Prompt file imported from fotoetienne/gru (
.claude/commands/do.md). Fill in{{arguments}}before use. Copyright stays with the author.
Work on a GitHub issue.
Issue: {{arguments}}
When Running Under Gru
This command is being orchestrated by Gru. GitHub operations (claiming issue, creating PR, posting updates) are handled automatically. Focus on:
- understanding the issue (details provided by Gru)
- planning the implementation
- writing clean code
- testing thoroughly
- committing your changes
Gru will handle:
- Fetching issue details
- Creating pull requests
- Posting status updates
- Merging and cleanup
Workflow:
1. Check if Decomposition is Needed
-
Assess the issue's complexity:
- Does it involve multiple distinct components or systems?
- Does it have multiple acceptance criteria?
- Would it take more than a few hours to complete?
- Does it mix different types of work (backend + frontend + docs)?
-
If the issue is complex and should be broken down:
- Recommend to the user: "This issue seems complex. Run
/decompose {{arguments}}to break it into smaller sub-issues first." - Stop the fix workflow here - wait for user to decompose
- Recommend to the user: "This issue seems complex. Run
-
If the issue is focused and ready to fix:
- Proceed to the next step
2. Verify Worktree Setup
- Confirm current directory is a git worktree with
git rev-parse --git-dir - Check current branch matches expected pattern
minion/issue-<number>-<minion-id> - If not in correct worktree, remind user to run
/setup-worktreefirst
3. Plan the Fix
- Explore the codebase to understand the relevant code
- Create a detailed plan using TodoWrite with specific steps to fix the issue
- Consider tests that need to be added or updated
4. Implement the Fix
- Work through each todo item
- Write clean, minimal code changes
- Add or update tests as needed
- Check CLAUDE.md for project-specific build/test commands
- Run tests to verify the fix
5. Code Review
- Make a commit with the changes, prefixing the commit message with your Minion ID (from the branch name), e.g.
[M042] Fix null pointer in parser - Use the Agent tool with
subagent_type='code-reviewer'to perform an autonomous code review - Wait for the review agent to complete and read its full output before proceeding
- The code-reviewer agent will analyze the changes for:
- Code correctness and logic errors
- Security vulnerabilities
- Error handling gaps
- Edge cases
- Adherence to project conventions (check CLAUDE.md)
- Test coverage
- Address any issues raised by the code-reviewer before proceeding
- If the review identifies significant problems, iterate on the implementation
- Do NOT push your branch or write PR_DESCRIPTION.md until you have read and addressed all review findings
6. Finish Your Work
When your implementation is complete and ready for human review:
- Commit your implementation changes with a descriptive commit message prefixed with your Minion ID (from the branch name), e.g.
[M042] Fix null pointer in parser - Push the branch to the remote repository
- Write
PR_DESCRIPTION.mdin the root of the repository with this format:## Summary - Key change 1 - Key change 2 ## Test plan - How you tested this - Commands run: cargo test, just check, etc. ## Notes - Context reviewers should know - Follow-up work if any
DO NOT commit PR_DESCRIPTION.md - Gru will read this file locally from your worktree, use it to create the PR description, mark the PR ready, and then delete it automatically.
IMPORTANT: Only write PR_DESCRIPTION.md when work is truly complete and ready for human review. If work is still in progress, don't create this file - Gru will create a draft PR instead.
7. Iterate on Feedback
- Look at CI check results
- Address any issues raised by the CI checks
- Read review comments
- Determine which comments require changes. Sometimes reviewers are wrong!
- Make the necessary changes
- For any comments that you've determined don't require changes, acknowledge them
- Make a reply that addresses each comment and includes a summary of the changes made
- Repeat until the PR is ready to merge