fix(subagent-dev): add post-commit verification for untracked files#661
fix(subagent-dev): add post-commit verification for untracked files#661
Conversation
The skill now prompts the agent to check for related GitHub issues and include closing keywords (Closes #NNN) in the PR body. This enables automatic issue closure on merge instead of requiring manual cleanup. Fixes obra#600 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… for Windows compatibility On Windows, cmd.exe doesn't recognize single quotes as path delimiters, causing the SessionStart hook to fail with "'C:' is not recognized". Double quotes are used instead to preserve space handling in paths like C:\Program Files\... Fixes obra#644 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Subagents sometimes commit without adding all new files, leaving the committed state broken while the working tree appears green. This adds a verification step after each commit to check for untracked files and a controller-side safety net. Fixes obra#633 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds post-commit verification and a controller-level git status check to the subagent workflow, updates implementer prompts, and fixes quoting of the SessionStart hook command in hooks/hooks.json; also adds conditional inclusion of GitHub-closing keywords in PR guidance. Changes
Sequence Diagram(s)sequenceDiagram
participant Controller
participant Implementer
participant Repo as Git/Repo
participant Reviewer as CodeQualityReviewer
Controller->>Implementer: Assign task
Implementer->>Repo: Commit changes
Implementer->>Reviewer: Request code-quality review
Reviewer-->>Controller: Approve?
Controller->>Repo: Run git status (post-review)
alt no untracked files
Controller->>Controller: Mark task complete
else untracked files found
Controller->>Implementer: Request stage/amend and re-commit
Implementer->>Repo: Stage/amend commit
Implementer->>Controller: Notify completion
Controller->>Repo: Re-run git status
Controller->>Controller: Mark task complete
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
skills/finishing-a-development-branch/SKILL.md (1)
109-110: Consider clarifying the placeholder syntax.The placeholder
<Closes#NNNif a related issue was found, otherwise omit this line>is an instruction to the agent, not literal text to include. While this is clear in context, you might consider using a more explicit instruction format to avoid any ambiguity:-<Closes `#NNN` if a related issue was found, otherwise omit this line> +<!-- If related issue found: Closes `#NNN` -->Or simply move the conditional note outside the heredoc as a comment.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@skills/finishing-a-development-branch/SKILL.md` around lines 109 - 110, The placeholder line "<Closes `#NNN` if a related issue was found, otherwise omit this line>" in SKILL.md is ambiguous; update the heredoc so the agent sees only the intended commit message template and move the conditional guidance out of the literal block (or rephrase it as an explicit directive). Specifically, replace the literal placeholder inside the heredoc with either a clear example like "<Closes `#123`>" or nothing, and relocate the sentence "If a related issue exists, include 'Closes `#NNN`' — otherwise omit" as a comment or explanatory line outside the heredoc so the template text and instructional note are not conflated.skills/subagent-driven-development/SKILL.md (1)
160-162: Consider adding re-verification after implementer fixes untracked files.The example shows dispatching the implementer to stage and amend, but doesn't show a subsequent git status re-check before marking complete. This could leave a gap if the implementer's fix introduces new issues.
[Controller: git status check - found untracked test fixture file] [Dispatch implementer to stage and amend] +[Controller: git status re-check - clean] [Mark Task 2 complete]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@skills/subagent-driven-development/SKILL.md` around lines 160 - 162, Add a re-verification step after dispatching the implementer to stage/amend: once the implementer reports completion, have the Controller re-run the git status check (the same "Controller: git status check - found untracked test fixture file" logic) and assert the working tree is clean (no untracked or unstaged files) before marking the task complete; if the re-check still shows issues, repeat the dispatch or surface an error so completion is not recorded.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@skills/subagent-driven-development/implementer-prompt.md`:
- Line 49: Update the sentence about staging so it accurately explains git
behavior: replace the claim "git add only stages tracked files by default" with
a clarification that "git add <file> stages both tracked and untracked files,
whereas git commit -a only commits changes to already-tracked files," and
explicitly advise implementers to run git add for any newly created files before
committing so subagents don't forget to include them; reference the terms "git
add", "git commit -a", and "newly created files" in the revised line.
---
Nitpick comments:
In `@skills/finishing-a-development-branch/SKILL.md`:
- Around line 109-110: The placeholder line "<Closes `#NNN` if a related issue was
found, otherwise omit this line>" in SKILL.md is ambiguous; update the heredoc
so the agent sees only the intended commit message template and move the
conditional guidance out of the literal block (or rephrase it as an explicit
directive). Specifically, replace the literal placeholder inside the heredoc
with either a clear example like "<Closes `#123`>" or nothing, and relocate the
sentence "If a related issue exists, include 'Closes `#NNN`' — otherwise omit" as
a comment or explanatory line outside the heredoc so the template text and
instructional note are not conflated.
In `@skills/subagent-driven-development/SKILL.md`:
- Around line 160-162: Add a re-verification step after dispatching the
implementer to stage/amend: once the implementer reports completion, have the
Controller re-run the git status check (the same "Controller: git status check -
found untracked test fixture file" logic) and assert the working tree is clean
(no untracked or unstaged files) before marking the task complete; if the
re-check still shows issues, repeat the dispatch or surface an error so
completion is not recorded.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2b2f4b51-e153-4ba4-89a1-e88742704202
📒 Files selected for processing (4)
hooks/hooks.jsonskills/finishing-a-development-branch/SKILL.mdskills/subagent-driven-development/SKILL.mdskills/subagent-driven-development/implementer-prompt.md
git add <file> stages both tracked and untracked files. The real issue is git commit -a only commits tracked files, so new files need explicit git add. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
git statusfor untracked files that should have been committedFixes #633
This contribution was developed with AI assistance (Claude Code).