Implement a GitHub issue from an issue URL or number.
Implement Issue Skill
Implement a GitHub issue from start to finish: branch setup, codebase analysis, and implementation.
Prerequisites Check (MUST verify first)
Before proceeding, verify:
# 1. Check if in a git repository
git rev-parse --is-inside-work-tree
# 2. Check if gh CLI is available and authenticated
gh auth status
# 3. Check for uncommitted changes (warn user if any)
git status --porcelain
If checks fail, STOP and inform the user:
Not in git repo → "This skill requires a git repository. Please navigate to a git project."
gh not authenticated → "Please run gh auth login first."
Uncommitted changes → "You have uncommitted changes. Please commit or stash them first."
Input
The user provides an issue reference in one of these formats:
Full URL: https://github.com/owner/repo/issues/123
Short form (if in repo): #123 or 123
Workflow
Step 1: Extract Issue Information
# Get comprehensive issue metadata
gh issue view <ISSUE_NUMBER_OR_URL> --json number,title,body,state,author,labels,milestone,assignees,comments,createdAt,updatedAt
# Get repository info for branch naming
gh repo view --json owner,name,defaultBranchRef
# Create and checkout new branch
git checkout -b <BRANCH_NAME>
Step 4: Deep Codebase Analysis
Before implementing, thoroughly understand the codebase:
4.1 Project Structure Analysis
# Get project structure overviewls -la
find . -type f -name "*.json" -path "*/package.json" -o -name "*.toml" -path "*/Cargo.toml" -o -name "*.go" -path "*/go.mod" 2>/dev/null | head -20
# Check for configuration filesls -la *.json *.yaml *.yml *.toml .* 2>/dev/null | head -20
4.2 Understand Existing Patterns
Use explore agents to understand:
Architecture: How is the codebase organized? What are the main modules?
Patterns: What coding patterns are used? (error handling, logging, testing)
Related Code: What existing code is related to this issue?
Dependencies: What libraries/frameworks are used?
# Fire multiple explore agents in parallel
background_task(agent="explore", prompt="Find the main entry points and understand the overall architecture of this codebase")
background_task(agent="explore", prompt="Find code related to [ISSUE_TOPIC] and understand existing patterns")
background_task(agent="explore", prompt="Find test patterns and testing conventions in this codebase")
Match Existing Patterns: Follow the codebase's established conventions
Incremental Changes: Make small, focused changes
Test as You Go: Verify each change works before moving on
Document Complex Logic: Add comments where necessary
For each implementation task:
Mark todo as in_progress
Make the changes
Run lsp_diagnostics on changed files
Mark todo as completed
Step 7: Testing
# Run project tests (detect test command from package.json, Makefile, etc.)# Common patterns:
npm test
yarn test
go test ./...
cargo test
pytest
make test
Ensure:
All existing tests pass
New tests added for new functionality
Edge cases covered
Step 8: Final Verification
# Check for any linting issues# (detect lint command from project config)# Verify build succeeds# (detect build command from project config)# Review all changes
git diff --stat
git diff
Step 9: Commit Changes
# Stage all changes
git add -A
# Create commit with conventional commit message# Format: <type>(scope): <description>## Reference the issue number in the commit body
git commit -s -m "<type>: <short description>
<detailed description of changes>
Closes #<ISSUE_NUMBER>"