ENH: Add commit and simplify-staged Claude Code skills#36
Conversation
Provides /commit (auto-drafts message, fixes pre-commit hook failures, guards against committing to main) and /simplify-staged (reviews staged files for open-source clarity, reuse, and type-annotation standards before committing).
WalkthroughAdds two new skill docs for scripted commits and staged-file simplification, and updates utils/claude_github_reviews.py: replaces dry-run with prompt-only, tightens since-last-push gating (blocks on detached/main), adds Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as CLI
participant Git as Git (local)
participant Remote as Remote (origin/upstream)
participant Claude as Claude API
CLI->>Git: parse args (--prompt-only?, --since-last-push?)
alt since-last-push set and head_ref exists & not main
CLI->>Git: git_fetch(repo_root, remote, head_ref)
Git->>Remote: git fetch <remote> <branch>
Remote-->>Git: fetch result
Git-->>CLI: fetched refs
CLI->>Git: compute reflog cutoff using fetched ref
else if head_ref missing or main
CLI-->>CLI: exit(1) with error
end
CLI->>Git: gather PR/data/diffs
CLI->>Claude: build prompt (allowedTools includes Read,Write,Edit,Glob,Grep)
alt prompt-only
Claude-->>CLI: (not invoked) print prompt and exit
else
CLI->>Claude: invoke_claude(prompt)
Claude-->>CLI: advisory / patches
CLI->>Git: optionally apply patches or print instructions
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds two new Claude Code “skills” intended to standardize and automate common pre-commit workflows in the PhysioMotion4D repo.
Changes:
- Introduces a
/commitskill to draft commit messages, enforce “no commits to main”, and iterate on pre-commit failures until a commit succeeds. - Introduces a
/simplify-stagedskill to review tracked, would-be-committed changes for clarity/reuse/typing/docstring standards before committing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .claude/skills/commit/SKILL.md | New commit automation skill (branch guard, message drafting, pre-commit remediation loop). |
| .claude/skills/simplify-staged/SKILL.md | New pre-commit review/simplification checklist skill for tracked modified files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| description: Stage all changes, draft a commit message from the diff, fix any pre-commit hook failures, and repeat until the commit succeeds. | ||
| --- | ||
|
|
||
| Commit all pending changes in the PhysioMotion4D repository. |
There was a problem hiding this comment.
The frontmatter/intro says this skill will "Stage all changes" / "Commit all pending changes", but later the instructions explicitly prohibit adding untracked files and require behavior equivalent to git commit -a (tracked changes only). Please reword the description and/or the intro sentence to reflect that this only commits tracked modifications/deletions, not new files.
| description: Stage all changes, draft a commit message from the diff, fix any pre-commit hook failures, and repeat until the commit succeeds. | |
| --- | |
| Commit all pending changes in the PhysioMotion4D repository. | |
| description: Stage all tracked modifications and deletions, draft a commit message from the diff, fix any pre-commit hook failures, and repeat until the commit succeeds. | |
| --- | |
| Commit all tracked pending changes in the PhysioMotion4D repository (equivalent to `git commit -a`, not including new untracked files). |
| - Optional body: 1–3 sentences explaining *why*, not *what*. | ||
|
|
||
| 3. Attempt the commit: | ||
| ``` | ||
| git commit -a -m "<subject>" -m "<body with co-author line>" | ||
| ``` |
There was a problem hiding this comment.
Step 2 says the commit body is optional, but step 3 always includes a second -m and mentions "body with co-author line". This is contradictory and will push a body even when none is needed, and the co-author requirement seems out of scope. Consider making the second -m conditional (only when a body is warranted) and removing the co-author reference unless the project has a documented co-author convention.
| - Optional body: 1–3 sentences explaining *why*, not *what*. | |
| 3. Attempt the commit: | |
| ``` | |
| git commit -a -m "<subject>" -m "<body with co-author line>" | |
| ``` | |
| - Optional body: 1–3 sentences explaining *why*, not *what*; omit if not needed. | |
| 3. Attempt the commit: | |
| - If you only need a subject line: | |
| ``` | |
| git commit -a -m "<subject>" | |
| ``` | |
| - If you also wrote a body: | |
| ``` | |
| git commit -a -m "<subject>" -m "<body>" | |
| ``` |
| ## Instructions | ||
|
|
||
| 1. Run `git diff HEAD` to get the full diff of tracked modified files. | ||
| Also run `git diff HEAD --name-only` to list just the changed files. |
There was a problem hiding this comment.
git diff HEAD --name-only is likely to be parsed as a pathspec (--name-only) after the revision, rather than an option, so it may not list changed files as intended. Use git diff --name-only HEAD (option before revision, optionally with -- before paths) to reliably produce the file list.
| Also run `git diff HEAD --name-only` to list just the changed files. | |
| Also run `git diff --name-only HEAD` to list just the changed files. |
| - [ ] Is there dead code (unreachable branches, unused imports, stale comments)? | ||
| Remove it. | ||
|
|
||
| 4. After editing, run `ruff check . --fix && ruff format .` to enforce code style. |
There was a problem hiding this comment.
Running ruff check . --fix && ruff format . can modify files outside the current change set, which conflicts with the earlier instruction to avoid refactoring code that was not changed. To keep the skill's behavior aligned with its own constraints, consider running Ruff only on the modified Python files (or explicitly instruct to revert any unrelated Ruff-only changes before proceeding).
| 4. After editing, run `ruff check . --fix && ruff format .` to enforce code style. | |
| 4. After editing, run Ruff only on the modified Python files to enforce code style, for example: | |
| - `git diff --name-only HEAD | grep -E '\.py$' | xargs -r ruff check --fix` | |
| - `git diff --name-only HEAD | grep -E '\.py$' | xargs -r ruff format` | |
| If your workflow runs Ruff project-wide, revert any Ruff-only changes in files outside the current diff before committing. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/skills/commit/SKILL.md:
- Around line 22-31: The commit template in SKILL.md is ambiguous about
co-author attribution; update step 2 to state when to include a co-author (e.g.,
when others made substantive contributions) and specify the required format
"Co-authored-by: Name <email>" (optional unless required by repo policy), or
alternatively change step 3's example command to use just "-m \"<body>\"" if
co-authors are not standard; ensure references in the document to "body with
co-author line" and the example commit command are updated to match the chosen
behavior so readers see consistent guidance.
- Around line 29-31: The fenced code block showing the git commit command is
missing a language identifier, causing MD040 markdownlint warnings; update the
block in SKILL.md by adding a language tag (e.g., "bash") to the opening fence
so the block becomes ```bash and retains the same content ("git commit -a -m
\"<subject>\" -m \"<body with co-author line>\""), ensuring syntax highlighting
and satisfying the linter.
- Around line 16-20: The instructions conflict by forbidding committing
secrets/untracked files while requiring "ONLY perform the equivalent to a `git
commit -a`"; change to selective staging: replace the `git commit -a`
requirement with an explicit "ONLY stage files you have explicitly reviewed and
approved" workflow, update the commit example to remove the `-a` flag and
instruct contributors to run `git add` only the files they've inspected (and not
to add untracked files), and remove/replace any line that mandates `git commit
-a` so the steps for inspection (lines mentioning secrets/large
binaries/untracked files) are consistent with the commit command.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3292bcb5-6b3c-4379-a803-bdedc9b18c34
📒 Files selected for processing (2)
.claude/skills/commit/SKILL.md.claude/skills/simplify-staged/SKILL.md
| 1. Run `git diff HEAD` and `git status` to understand what has changed. | ||
| - Read any modified source files that are not self-explanatory from the diff alone. | ||
| - Do NOT commit files that look like secrets, large binaries, or generated artefacts that belong in .gitignore. | ||
| - Do NOT add any untracked files to the commit | ||
| - ONLY perform the equivalent to a `git commit -a` |
There was a problem hiding this comment.
Logic conflict between selective exclusion and git commit -a behavior.
Lines 18-19 instruct to "Do NOT commit files that look like secrets, large binaries, or generated artefacts" and "Do NOT add any untracked files to the commit," but line 20 mandates using "the equivalent to a git commit -a".
The git commit -a command automatically stages all tracked modified files—you cannot selectively exclude specific files with this flag. If a tracked file contains secrets or unwanted artifacts, git commit -a will stage and commit it.
To reconcile this conflict, the workflow should either:
-
Option A (Recommended): Modify step 1 to use selective staging instead of
-a:- After inspection in step 1, explicitly
git addonly the files that should be committed - Remove the
-aflag from thegit commitcommand in step 3 - Update line 20 to: "ONLY stage files you have explicitly reviewed and approved"
- After inspection in step 1, explicitly
-
Option B: Add an intermediate unstaging step:
- Keep
git commit -abut add explicit instructions between steps 1 and 2 to rungit restore --staged <file>for any files that should be excluded - This is more error-prone and harder to automate
- Keep
Without this fix, contributors following these instructions could accidentally commit sensitive data.
🔒 Proposed fix (Option A - selective staging)
1. Run `git diff HEAD` and `git status` to understand what has changed.
- Read any modified source files that are not self-explanatory from the diff alone.
- Do NOT commit files that look like secrets, large binaries, or generated artefacts that belong in .gitignore.
- Do NOT add any untracked files to the commit
- - ONLY perform the equivalent to a `git commit -a`
+ - After inspection, stage only the approved files with `git add <file>...`
2. Draft a commit message following the project convention (match style of recent `git log --oneline -10`):
- Subject line: `<TAG>: <imperative summary>` (≤72 chars), where TAG is one of:
`ENH` (new feature / enhancement), `FIX` (bug fix), `REF` (refactor),
`TST` (tests only), `DOC` (docs/comments only), `MNT` (maintenance / config).
- Optional body: 1–3 sentences explaining *why*, not *what*.
3. Attempt the commit:
```bash
- git commit -a -m "<subject>" -m "<body with co-author line>"
+ git commit -m "<subject>" -m "<body>"
```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/skills/commit/SKILL.md around lines 16 - 20, The instructions
conflict by forbidding committing secrets/untracked files while requiring "ONLY
perform the equivalent to a `git commit -a`"; change to selective staging:
replace the `git commit -a` requirement with an explicit "ONLY stage files you
have explicitly reviewed and approved" workflow, update the commit example to
remove the `-a` flag and instruct contributors to run `git add` only the files
they've inspected (and not to add untracked files), and remove/replace any line
that mandates `git commit -a` so the steps for inspection (lines mentioning
secrets/large binaries/untracked files) are consistent with the commit command.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
=======================================
Coverage ? 13.67%
=======================================
Files ? 49
Lines ? 6596
Branches ? 0
=======================================
Hits ? 902
Misses ? 5694
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Apply PR Project-MONAI#36 review fixes: bash code fences, scope ruff to modified files, git restore escape hatch, git push reminder. Add --prompt_only flag to claude_github_reviews.py for interactive use, Write to allowedTools, and default remote to upstream with origin fallback.
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.claude/skills/commit/SKILL.md (1)
17-21: Consider documenting the escape hatch for aborting the commit workflow.The PR objectives mention providing "a git restore escape hatch," but this section doesn't explicitly tell users how to abort and unstage if they change their mind after inspection. Consider adding a note that users can run
git restore --staged .to unstage everything if they decide not to proceed.📝 Proposed addition
1. Run `git diff HEAD` and `git status` to understand what has changed. - Read any modified source files that are not self-explanatory from the diff alone. - If any tracked file contains secrets, large binaries, or generated artefacts that should not be committed, display an error, stop processing, and abort - Do NOT add any untracked files to the commit. + - If you need to abort and unstage all changes, run: `git restore --staged .`🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/skills/commit/SKILL.md around lines 17 - 21, Add a short escape-hatch note to the checklist step that begins "Run `git diff HEAD` and `git status`" explaining how to abort/unstage if the user changes their mind: instruct them to run `git restore --staged .` (or `git restore --staged <path>` for a specific file) to unstage files and cancel the commit preparation, and remind them not to add untracked files back. Place this sentence immediately after that checklist bullet so users see the restore command during inspection.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/skills/commit/SKILL.md:
- Around line 38-45: Replace the global ruff invocation "ruff check . --fix &&
ruff format ." with a scoped invocation that runs ruff only on staged/modified
files: update the instruction text in the step that mentions `ruff check . --fix
&& ruff format .` to instruct collecting modified/staged filenames (e.g., via
`git diff --name-only --cached` or `git ls-files -m`) and then run `ruff check
--fix` and `ruff format` against that file list; ensure the updated guidance
explicitly says to run ruff only on staged/modified files and not the whole
repo.
In `@utils/claude_github_reviews.py`:
- Around line 511-513: The --remote default "upstream" can fail on repos that
only have "origin"; update the handling so that when the '--since-last-push'
flow reads the parsed remote variable (remote) it first checks whether that
remote actually exists (e.g., via `git remote` or `git remote get-url`) and if
not falls back to "origin" (and only errors if neither exists). Change the code
path that uses the remote variable in the --since-last-push logic to perform
this existence check and substitution before calling the reflog/last-push logic
so users with only "origin" won't need to override the flag.
- Around line 582-596: The output text still says "dry run" while the flag has
been renamed to prompt_only; update the print statement that emits the prompt
header so it uses consistent prompt_only wording (e.g., replace "PROMPT (dry run
— not sent to Claude)" with something like "PROMPT (prompt_only — not sent to
Claude)" or "PROMPT (prompt-only — not sent to Claude)"). Locate the block
guarded by args.prompt_only and adjust the string printed for the prompt header
(the print that currently prints the title before printing the variable prompt);
ensure other messages in that block (which reference args.prompt_only, prompt,
and summary_filename) remain unchanged and consistent.
- Around line 495-498: Add a backward-compatible alias so scripts using the old
flag still work: when you call parser.add_argument for "--prompt_only" in
utils/claude_github_reviews.py, also register "--dry-run" (or pass both as
argument names) wired to the same store_true action and same destination, and
update the help text to mention both names; ensure the code uses the single dest
(e.g., prompt_only) so both flags map to the same boolean variable.
---
Nitpick comments:
In @.claude/skills/commit/SKILL.md:
- Around line 17-21: Add a short escape-hatch note to the checklist step that
begins "Run `git diff HEAD` and `git status`" explaining how to abort/unstage if
the user changes their mind: instruct them to run `git restore --staged .` (or
`git restore --staged <path>` for a specific file) to unstage files and cancel
the commit preparation, and remind them not to add untracked files back. Place
this sentence immediately after that checklist bullet so users see the restore
command during inspection.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3477befa-7359-444e-bfc0-1a623345a44e
📒 Files selected for processing (4)
.claude/skills/commit/SKILL.md.claude/skills/simplify-staged/SKILL.mddocs/API_MAP.mdutils/claude_github_reviews.py
✅ Files skipped from review due to trivial changes (2)
- docs/API_MAP.md
- .claude/skills/simplify-staged/SKILL.md
| default="upstream", | ||
| help="Git remote name for reflog (default: upstream; used with --since-last-push)", | ||
| ) |
There was a problem hiding this comment.
--since-last-push default can fail on repos without upstream.
Line 511 defaults --remote to upstream, but Line 552 uses it directly with no fallback. In clones that only have origin, this breaks --since-last-push unless users override manually.
Suggested fallback patch
- parser.add_argument(
- "--remote",
- metavar="NAME",
- default="upstream",
- help="Git remote name for reflog (default: upstream; used with --since-last-push)",
- )
+ parser.add_argument(
+ "--remote",
+ metavar="NAME",
+ default=None,
+ help="Git remote name for reflog (default: upstream, falling back to origin; used with --since-last-push)",
+ )- if args.since_last_push:
+ if args.since_last_push:
+ remote_name = args.remote
+ if remote_name is None:
+ for candidate in ("upstream", "origin"):
+ probe = subprocess.run(
+ ["git", "remote", "get-url", candidate],
+ text=True,
+ capture_output=True,
+ cwd=repo_root,
+ )
+ if probe.returncode == 0:
+ remote_name = candidate
+ break
+ if remote_name is None:
+ print("[ERROR] Could not read git remote URL from 'upstream' or 'origin'.")
+ sys.exit(1)
head_ref = pr_data.get("head", {}).get("ref")
if not head_ref:
print("[ERROR] PR has no head branch ref; cannot use --since-last-push.")
sys.exit(1)
- remote_ref = f"refs/remotes/{args.remote}/{head_ref}"
- cutoff = get_remote_reflog_cutoff(repo_root, args.remote, head_ref)
+ remote_ref = f"refs/remotes/{remote_name}/{head_ref}"
+ cutoff = get_remote_reflog_cutoff(repo_root, remote_name, head_ref)Also applies to: 546-553
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@utils/claude_github_reviews.py` around lines 511 - 513, The --remote default
"upstream" can fail on repos that only have "origin"; update the handling so
that when the '--since-last-push' flow reads the parsed remote variable (remote)
it first checks whether that remote actually exists (e.g., via `git remote` or
`git remote get-url`) and if not falls back to "origin" (and only errors if
neither exists). Change the code path that uses the remote variable in the
--since-last-push logic to perform this existence check and substitution before
calling the reflog/last-push logic so users with only "origin" won't need to
override the flag.
…b review script Scope ruff to modified files in commit skill. Add --dry-run alias for --prompt_only, fix --remote default to origin, auto-fetch before reflog lookup, and fix stale dry-run wording in prompt_only output.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
Comments suppressed due to low confidence (1)
utils/claude_github_reviews.py:536
- The new CLI flag
--since_last_pushbreaks the existing hyphenated option style used elsewhere in this repo and is a backward-incompatible rename from--since-last-push. Consider accepting--since-last-pushas the primary/alias option (keepingdest="since_last_push") to preserve compatibility and match established argparse conventions in this codebase.
parser.add_argument(
"--since_last_push",
action="store_true",
help=(
"Only include inline comments and reviews after the latest reflog time "
"for refs/remotes/<remote>/<PR_head_branch> (this clone)"
),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def get_current_branch(repo_root: Path) -> str: | ||
| """Return the name of the currently checked-out branch.""" | ||
| try: | ||
| out = subprocess.run( | ||
| ["git", "rev-parse", "--show-toplevel"], | ||
| ["git", "branch", "--show-current"], | ||
| check=True, | ||
| text=True, | ||
| capture_output=True, | ||
| cwd=repo_root, | ||
| ) | ||
| return Path(out.stdout.strip()) | ||
| return out.stdout.strip() | ||
| except subprocess.CalledProcessError: | ||
| print("[ERROR] Not inside a Git repository.") | ||
| sys.exit(1) | ||
| return "" |
There was a problem hiding this comment.
get_current_branch() is currently unused in this script. Consider removing it to avoid dead code, or use it to enforce a concrete behavior (e.g., refuse to run on certain branches) so it stays covered by the script’s logic.
| parser.add_argument( | ||
| "--prompt_only", | ||
| "--dry-run", | ||
| dest="prompt_only", | ||
| action="store_true", | ||
| help="Print the prompt that would be sent to Claude and exit without changes", | ||
| ) |
There was a problem hiding this comment.
Similarly, --prompt_only is an underscore-style long option, which is inconsistent with the repo’s other scripts (typically --kebab-case). Consider adding a --prompt-only alias (and possibly deprecating --dry-run more explicitly) to keep CLI UX consistent.
| @@ -488,14 +521,15 @@ def parse_args() -> argparse.Namespace: | |||
| help="GitHub repo slug (default: inferred from git remote origin)", | |||
There was a problem hiding this comment.
The --repo help text says the slug is inferred from the origin remote, but get_repo_slug() now prefers upstream (falling back to origin). Update the help text to reflect the actual inference behavior so users know which remote is consulted.
| help="GitHub repo slug (default: inferred from git remote origin)", | |
| help=( | |
| "GitHub repo slug (default: inferred from git remote upstream, " | |
| "falling back to origin)" | |
| ), |
|
|
||
| 2. For each modified Python file, read the **entire file** — not just the diff. | ||
| Understanding the unchanged context is necessary to judge whether the new code | ||
| fits naturally. |
There was a problem hiding this comment.
Step 2 says to read the entire file for each modified Python file, but git diff HEAD --name-only / git diff HEAD can include deleted/renamed files. Add guidance to skip deleted files (or read the prior version via git show HEAD:<path>) so the workflow doesn’t fail when a changed file no longer exists on disk.
| fits naturally. | |
| fits naturally. If a path from `git diff HEAD --name-only` no longer exists on | |
| disk (for example, the file was deleted or renamed), skip it, or, if you need to | |
| inspect its previous contents, read it via `git show HEAD:<path>` instead. |
| 4. After editing, run ruff only on the Python files that appear in the diff | ||
| (`git diff HEAD --name-only`). Pass only those `.py` files to | ||
| `ruff check --fix` and `ruff format`. Do not run ruff project-wide — it | ||
| may reformat files outside the current change set. |
There was a problem hiding this comment.
Step 4 suggests running ruff on Python files from git diff HEAD --name-only, but that list can include deleted paths, which will cause ruff to error. Filter to existing .py files (and/or exclude D status) before invoking ruff check / ruff format.
| 4. After editing, run ruff only on the Python files that appear in the diff | |
| (`git diff HEAD --name-only`). Pass only those `.py` files to | |
| `ruff check --fix` and `ruff format`. Do not run ruff project-wide — it | |
| may reformat files outside the current change set. | |
| 4. After editing, run ruff only on Python files that both appear in the diff | |
| and still exist on disk. For example, use | |
| `git diff --diff-filter=d --name-only HEAD -- '*.py'` to list changed, | |
| non-deleted `.py` files, and pass only that list to `ruff check --fix` | |
| and `ruff format`. Do not run ruff project-wide — it may reformat files | |
| outside the current change set. |
| If the branch is `main`, stop immediately and report: | ||
| "ERROR: Refusing to commit directly to main. Please switch to a feature branch first." |
There was a problem hiding this comment.
Step 0 only guards against committing on main, but git branch --show-current returns an empty string in a detached HEAD state. Consider treating an empty branch name as an error as well (refuse to commit) to avoid creating commits on detached HEAD unexpectedly.
| If the branch is `main`, stop immediately and report: | |
| "ERROR: Refusing to commit directly to main. Please switch to a feature branch first." | |
| If the command returns no branch name (empty output / detached HEAD) or the branch is `main`, | |
| stop immediately and report an appropriate error, e.g.: | |
| "ERROR: Refusing to commit in detached HEAD or directly to main. Please switch to a named feature branch first." |
| - For `ruff` formatting/lint: run ruff only on the modified Python files | ||
| (`git diff HEAD --name-only`), not the whole repo. Pass only those `.py` | ||
| files to `ruff check --fix` and `ruff format`. |
There was a problem hiding this comment.
The ruff guidance uses git diff HEAD --name-only to select files, but that list can include deleted paths; running ruff on missing files will fail. Filter to existing .py files (and/or use git diff --name-status to exclude deletions) before invoking ruff.
| - For `ruff` formatting/lint: run ruff only on the modified Python files | |
| (`git diff HEAD --name-only`), not the whole repo. Pass only those `.py` | |
| files to `ruff check --fix` and `ruff format`. | |
| - For `ruff` formatting/lint: run ruff only on the modified Python files, | |
| using `git diff --name-status HEAD` (or `git diff HEAD --name-only`) to list | |
| changed paths, filtering out deleted entries and non-`.py` files, and passing | |
| only existing `.py` files to `ruff check --fix` and `ruff format`. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
utils/claude_github_reviews.py (1)
531-537:⚠️ Potential issue | 🟠 MajorAdd
--since-last-pushas a backward-compatible alias.The CLI only registers
--since_last_push(underscore, line 531), but README.md (line 693) documents--since-last-push(hyphen). Users following the README will encounter an unrecognized argument error.Suggested fix
parser.add_argument( "--since_last_push", + "--since-last-push", + dest="since_last_push", action="store_true", help=( "Only include inline comments and reviews after the latest reflog time " "for refs/remotes/<remote>/<PR_head_branch> (this clone)" ), )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@utils/claude_github_reviews.py` around lines 531 - 537, The CLI currently registers the flag "--since_last_push" in the parser.add_argument call but README documents the hyphenated "--since-last-push", causing an unrecognized argument error; update the parser.add_argument invocation that defines "--since_last_push" (the add_argument call in utils/claude_github_reviews.py) to also accept a backward-compatible alias "--since-last-push" (e.g., add the hyphenated string to the same add_argument call and ensure both map to the same dest/since_last_push with action="store_true") so both forms are supported without changing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@utils/claude_github_reviews.py`:
- Around line 94-96: Update the user-facing help text for the CLI flag that
documents repository resolution to match get_repo_slug's behavior of checking
"upstream" then "origin" (not origin-only); find the help string used for the
--repo/--repository argument and change its wording to indicate it will look for
upstream first and fall back to origin so it aligns with get_repo_slug's remote
resolution logic.
---
Outside diff comments:
In `@utils/claude_github_reviews.py`:
- Around line 531-537: The CLI currently registers the flag "--since_last_push"
in the parser.add_argument call but README documents the hyphenated
"--since-last-push", causing an unrecognized argument error; update the
parser.add_argument invocation that defines "--since_last_push" (the
add_argument call in utils/claude_github_reviews.py) to also accept a
backward-compatible alias "--since-last-push" (e.g., add the hyphenated string
to the same add_argument call and ensure both map to the same
dest/since_last_push with action="store_true") so both forms are supported
without changing behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9ceb1cbe-f894-4f75-90c3-9f47bade1dfc
📒 Files selected for processing (3)
.claude/skills/commit/SKILL.mddocs/API_MAP.mdutils/claude_github_reviews.py
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/API_MAP.md
…ew script Guard detached HEAD in commit skill. Use --diff-filter=d for ruff in both skills. Skip deleted files in simplify-staged. Remove unused get_current_branch(). Fix --repo help text and rename CLI args to kebab-case.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/skills/commit/SKILL.md:
- Around line 41-43: Update the instruction for running Ruff so it explicitly
handles the case of no modified Python files: after running git diff
--diff-filter=d --name-only HEAD -- '*.py' check whether the result is empty
and, if so, skip running ruff check --fix and ruff format; otherwise pass only
the listed files to those commands. Mention the git diff command and the ruff
commands (ruff check --fix, ruff format) by name so readers know to
conditionally skip Ruff when no files are returned.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5e76246c-7db1-4c53-bf19-4a09a8734dc7
📒 Files selected for processing (4)
.claude/skills/commit/SKILL.md.claude/skills/simplify-staged/SKILL.mddocs/API_MAP.mdutils/claude_github_reviews.py
🚧 Files skipped from review as they are similar to previous changes (2)
- .claude/skills/simplify-staged/SKILL.md
- utils/claude_github_reviews.py
Provides /commit (auto-drafts message, fixes pre-commit hook failures, guards against committing to main) and /simplify-staged (reviews staged files for open-source clarity, reuse, and type-annotation standards before committing).
Summary by CodeRabbit