* feat: add review and fix-issue project commands Add 4 Claude Code project commands adapted from global skills, tailored to IronClaw's build/test/lint workflow and conventions: - review-pr: Paranoid architect PR review across 6 lenses - review-crate: Deep Rust crate audit (vulnerabilities, bugs, unfinished work) - respond-pr: Triage and address PR review comments - fix-issue: End-to-end GitHub issue resolution with branch/plan/implement flow Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: address PR review feedback on project commands - Add headRefOid to gh pr view and resolve {owner}/{repo} in review-pr.md so Step 6 line comments actually work (Gemini + Copilot) - Add --paginate to gh api calls in respond-pr.md for large PRs (Gemini + Copilot) - Use gh repo view --json defaultBranchRef instead of hardcoded main/master fallback in fix-issue.md (Gemini) - Narrow allowed-tools in all four commands to match repo convention of specific subcommands (Bash(cargo fmt:*) style) instead of broad wildcards (Copilot) - Clarify >20 files guidance in review-pr.md: read all, process in priority order (Copilot) - Make cargo audit mandatory with install hint in review-crate.md (Gemini) Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
4.3 KiB
description, disable-model-invocation, allowed-tools, argument-hint
| description | disable-model-invocation | allowed-tools | argument-hint |
|---|---|---|---|
| Fetch a GitHub issue, create a branch, research the codebase, plan the fix, implement with tests, and commit | true | Bash(gh issue view:*), Bash(gh repo view:*), Bash(git fetch:*), Bash(git checkout:*), Bash(git status:*), Bash(git branch:*), Bash(git add:*), Bash(git commit:*), Bash(cargo fmt:*), Bash(cargo clippy:*), Bash(cargo test:*), Read, Edit, Write, Grep, Glob | <issue-number or github-issue-url> |
Fix GitHub Issue
Step 1: Resolve the issue
Parse $ARGUMENTS to extract the issue number:
- If it's a URL like
https://github.com/owner/repo/issues/42, extract42. - If it's a bare number, use it directly.
- If empty, stop and ask the user for an issue number.
Fetch the issue:
gh issue view {number} --json title,body,labels,assignees,comments,state
If the issue is closed, warn the user and ask if they still want to proceed.
Step 2: Create a branch
Create a fresh branch off the latest main:
- Fetch latest:
git fetch origin - Detect default branch:
gh repo view --json defaultBranchRef --jq .defaultBranchRef.name - Create and switch to a new branch:
git checkout -b fix/{number}-{short-slug} origin/{default-branch}{short-slug}is 3-5 words from the issue title, lowercase, hyphenated (e.g.fix/42-idor-workspace-check)
If the working tree has uncommitted changes, warn the user and stop. Do not stash or discard their work.
Step 3: Understand the issue
Summarize the issue in 2-3 sentences. Identify:
- What's broken or missing (the symptom or feature request)
- Acceptance criteria (what "done" looks like, from the issue body or comments)
- Constraints (mentioned technologies, backward compatibility, performance requirements)
If the issue is unclear or ambiguous, list the open questions. These will be addressed during planning.
Step 4: Research the codebase
Before planning, gather context:
- Find relevant code - Search for files, functions, types, and patterns mentioned in the issue. Read them in full.
- Trace the flow - If the issue is about a specific behavior, trace the code path from the entry point (route handler, CLI command, etc.) through to the relevant logic.
- Check existing tests - Find tests related to the affected code. Understand what's already covered.
- Check for prior art - Look for similar patterns in the codebase that solve analogous problems. Prefer consistency with existing patterns.
Step 5: Enter planning mode
Enter planning mode to design the implementation. The plan MUST cover:
- Root cause (for bugs) or design approach (for features)
- Files to modify with specific descriptions of what changes in each
- New files (if any) with justification for why they're needed
- Tests to add - every code path introduced or changed needs a test:
- Happy path (expected input produces expected output)
- Error paths (invalid input, missing data, permission denied)
- Edge cases (empty collections, boundary values, concurrent access)
- IronClaw-specific concerns:
- If the change touches persistence, both database backends must be updated (
postgres.rsandlibsql_backend.rs) - New
Databasetrait methods need implementations in both backends - No
.unwrap()or.expect()in production code - Use
crate::imports, notsuper:: - Error types via
thiserrorinerror.rs
- If the change touches persistence, both database backends must be updated (
- Migration or compatibility concerns (if any)
Follow the project's CLAUDE.md guidance for architecture decisions.
Wait for user approval before implementing.
Step 6: Implement
After the plan is approved:
- Implement each change from the plan.
- Write all planned tests.
- Run IronClaw's full quality gate:
cargo fmtcargo clippy --all --benches --tests --examples --all-features(zero warnings)cargo test --lib(all tests pass)
- If any check fails, fix it before proceeding.
Note: Integration tests (--test workspace_integration) require PostgreSQL and are expected to fail locally. Only --lib test failures are blocking.
Step 7: Commit and summarize
- Commit with a descriptive message referencing the issue (e.g.
fix: prevent IDOR in function call outputs (#42)). - Summarize what was done:
- Files changed with line references
- Tests added and what they cover
- Any follow-up work or open questions