Work on Issue Command
Implement a ready-labeled GitHub issue: research, implement, review, commit, and open a PR.
Dynamic Context
Current git status:
!git status --short 2>/dev/null || echo "Not in a git repo"
Current branch:
!git branch --show-current 2>/dev/null || git rev-parse --short HEAD 2>/dev/null || echo "Unknown"
Recent commits:
!git log --oneline -20 2>/dev/null || echo "No git history found"
Prerequisites
Issues must have the ready label (groomed with clear description, acceptance criteria, out-of-scope section).
Arguments
Issue number: $ARGUMENTS
Instructions
Step 1: Select Issue
If an issue number was provided above, verify it has the ready label. If not, inform the user and suggest running /groom first.
If no issue number was provided:
- Fetch issues:
gh issue list --label ready --json number,title,labels,milestone --limit 20(exclude any within-progresslabel) - If none found, inform the user and exit
- Present the issues and ask the user to select one
After selection, mark it in-progress: gh issue edit <number> --add-label in-progress
Step 2: Understand the Issue
- Fetch full details:
gh issue view <number> --json number,title,body,labels,milestone - Parse: Description, Acceptance Criteria, Out of Scope
- Present a brief summary showing you understand the requirements
Step 3: Research Phase
Read conventions: Use Read tool on
docs/ai/conventions.mdExplore codebase using the
explore-issueagent:- Spawn a Task with
subagent_type: explore-issue - Find related files, existing patterns, similar implementations
- Identify files to create or modify
- Spawn a Task with
Identify approach: files to change, patterns to follow, technical decisions, change order
Step 4: Setup Branch
- Fetch latest:
git fetch origin main - Create feature branch from
origin/main:- Convention:
<type>/<issue-number>-<short-description>(types:feat/,fix/,refactor/,docs/,chore/) - Example:
git checkout -b feat/42-user-authentication origin/main
- Convention:
- If branch exists, see
templates/edge-cases.mdfor resolution
Step 5: Implementation
Make changes following the approach from research:
- Edit existing files with Edit tool, create new files with Write tool
- Keep changes focused on acceptance criteria — avoid scope creep
Core loop — repeat until green:
pnpm check # lint + build + test (REQUIRED before committing)
Fix any failures before proceeding. For UI changes, also run:
pnpm -F web test:e2e:smoke # REQUIRED for UI changes
For specialized scenarios (DB migrations, CSS tokens, visual-compare), see templates/implementation-guide.md.
If implementation reveals out-of-scope work, note it for follow-up issues — stay focused on acceptance criteria.
Step 6: Verify Acceptance Criteria
Go through each acceptance criterion from the issue:
- Confirm each item is satisfied by the implementation
- Run relevant tests to verify
- If any criterion is not met, ask the user whether to address now or note for follow-up
Step 7: Self-Review (REQUIRED)
You MUST spawn 3 parallel review agents before committing. DO NOT skip this step or proceed directly to commit.
Get the diff of all changes:
git diff --name-only git diffSpawn 3 review agents in parallel using Task tool:
subagent_type: conventions-review— check against project conventionssubagent_type: code-quality-review— check for over-engineering and unnecessary complexitysubagent_type: reuse-review— check for code duplication and reuse opportunities
Pass each agent the changed files list and diff content.
Collect findings from all 3 agents.
If issues found, present them grouped by category and ask the user how to proceed:
- Fix all: Auto-fix all identified issues
- Fix selected: Let user pick which to fix
- Skip: Proceed without fixes (add note to PR)
Apply any approved fixes, then re-run
pnpm checkto verify.If no issues found, proceed to Step 8.
Step 8: Commit Changes
GATE CHECK — Before proceeding, confirm Step 7 was completed:
- Did you spawn all 3 review agents (conventions, code-quality, reuse)?
- Did you collect and process their findings?
- Did you apply approved fixes or confirm no issues were found?
If ANY answer is NO, STOP and return to Step 7 now.
- Review changes:
git statusandgit diff - Stage relevant files (avoid staging unrelated changes)
- Commit with issue reference:
git commit -m "<type>: <description> (#<issue-number>)" - Push branch:
git push -u origin <branch-name>
Step 9: Create Pull Request
Create PR using the template from templates/pr-body.md:
gh pr create --title "<title>" --body "$(cat <<'EOF'
<fill in from templates/pr-body.md>
EOF
)"
Include Closes #<issue-number> in the body. Then remove the in-progress label:
gh issue edit <number> --remove-label in-progress
Step 10: Summary
Provide a summary including:
- Issue worked on (number and title)
- Branch name and PR link
- Key changes made and files modified
- Any follow-up items identified
Notes
- ALWAYS read the issue thoroughly before starting
- ALWAYS research the codebase to understand existing patterns
- NEVER skip self-review — always spawn review agents before committing
- Follow conventions in
docs/ai/conventions.md - Keep commits focused and atomic; reference the issue number in commits and PR
- For edge cases (issue not ready, lint errors, branch conflicts, etc.), see
templates/edge-cases.md
Source: thomasreichmann/nexus — distributed by TomeVault.