From issue-management
Deepen an existing GitHub issue with codebase research — sharpen acceptance criteria, add implementation hints, and decompose into sub-tasks if needed. Triggers: /refine-issue, refine issue, sharpen issue
npx claudepluginhub benjamcalvin/bootstraps --plugin issue-managementThis skill uses the workspace's default tool permissions.
Refine GitHub issue: $ARGUMENTS
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Refine GitHub issue: $ARGUMENTS
gh issue view $0 --json number,title,body,labels,state,comments --jq '{number, title, body, labels: [.labels[].name], state, comment_count: (.comments | length)}'gh issue view $0 --comments 2>/dev/null || echo "NO_COMMENTS"git branch --show-currentYou refine existing GitHub issues by grounding them in codebase reality. Unlike /cleanup-issue (which fixes form), you improve substance — adding technical context, sharpening acceptance criteria with real code references, and decomposing large tasks.
The goal: after refinement, an AI agent can implement the issue without any codebase exploration of its own.
Extract the issue number from $ARGUMENTS. If no valid issue number is found, use AskUserQuestion to ask for one.
Read the issue body and comments from Context above. Identify:
This is the core value of refinement. Explore the codebase to fill knowledge gaps.
Locate affected code. Use Glob/Grep/Read to find the modules, files, and functions the issue touches. Record exact paths and line numbers.
Find existing patterns. Search for analogous implementations. If the issue asks for "add pagination to the users endpoint," find another endpoint that already has pagination and note the pattern.
Map the blast radius. What other code depends on the files being changed? What tests exercise them? Run:
Check related work. Search for related issues and PRs:
gh issue list --state all --search "<relevant keywords>" --limit 10
gh pr list --state all --search "<relevant keywords>" --limit 10
Note anything relevant (prior attempts, related features, known constraints).
Read referenced specs. If the task touches a domain with documentation in the repo, read it.
Apply refinements based on your research:
Replace vague criteria with specific, testable ones grounded in actual code:
GET /api/users?page=2&limit=10 is called, the response includes pagination.total_count, pagination.page, and pagination.per_page fields, matching the pattern in handlers/products.go:47-62"Each criterion should be independently verifiable and reference concrete types, functions, or paths where relevant.
Add or enhance the Technical Context section:
## Technical Context
- **Key files:**
- `path/to/main/file.go:L10-L45` — primary function to modify
- `path/to/test_file.go` — existing test coverage
- `path/to/related.go:L20` — analogous implementation to follow
- **Patterns to follow:** <describe the existing pattern with file references>
- **Dependencies:** <modules that import/use the affected code>
- **Constraints:** <discovered limitations — e.g., "this module has no external deps, keep it that way">
If the issue requires >400 lines of changes or touches multiple independent modules, add a "Proposed PRs" section:
## Proposed PRs
### PR 1: <imperative title>
**What:** <1-2 sentences>
**Files:**
| File | Change |
|------|--------|
| `path/to/file` | <what changes and why> |
**Acceptance criteria:**
- [ ] <criteria specific to this PR>
---
### PR 2: <imperative title>
**Depends on:** PR 1
<same structure>
### Dependency Order
<which PRs can be parallelized, which must be sequential>
If not already present, add or enhance the Verification section:
## Verification
- **Automated tests:** <which criteria map to tests, what test patterns to use>
- **Existing test suite:** <specific test commands or files that must continue to pass>
- **Manual checks:** <only if truly needed>
Before presenting, verify:
Show the user the refined issue with a summary of what changed. Use AskUserQuestion with options:
Update the issue:
gh issue edit <number> --body "$(cat <<'EOF'
<refined body>
EOF
)"
If the issue was decomposed into sub-issues, offer to create them:
gh issue create --title "<type>: <imperative summary>" --body "$(cat <<'EOF'
<sub-issue body>
Parent issue: #<parent-number>
EOF
)"
Report what was refined (e.g., "Sharpened 4 acceptance criteria with code references, added Technical Context section, decomposed into 2 PRs").