extend
Add more sub-issues to an existing tracking PR for a parent issue
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Add more sub-issues to an existing tracking PR for a parent issue
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Automatically implement all sub-issues of an epic in dependency order
Implement a GitHub issue with automated PR creation
End-of-session retrospective. Captures knowledge from any working session (debug, implementation, config, deployment) as reusable scripts, CLAUDE.md procedures, or skill proposals. Run before ending a session to prevent knowledge loss.
Decompose a large GitHub issue into sub-issues and create a tracking draft PR
OWASP-guided security code review for a specific domain or issue
Project kickoff checklist based on lessons learned from previous projects. Generates a tailored checklist and optionally creates GitHub issues.
| name | extend |
| description | Add more sub-issues to an existing tracking PR for a parent issue |
| argument-hint | <parent-issue> | add |
| user-invocable | true |
Add more sub-issues to an existing parent issue that already has a tracking PR.
Use this when you've implemented the first batch of sub-issues and want to decompose the next phase.
The user provides: $ARGUMENTS
Two modes of operation:
add #<issue> [#<issue>...] [to #<parent>]Examples:
/extend add #1042 # Add issue #1042, parent auto-detected from branch
/extend add #1042 to #723 # Add issue #1042 to epic #723
/extend add #1042 #1043 #1044 to #723 # Add multiple issues at once
<parent-issue> - The parent issue number (e.g., 723)Examples:
/extend 723 # Extend decomposition of #723
/extend # Detect parent from branch (issue-723-...)
Disambiguation: If $ARGUMENTS starts with add → Mode 1. Otherwise → Mode 2.
Use this when you have already-created issues that need to be linked to an epic's tracking PR.
Extract from $ARGUMENTS (after stripping the add keyword):
#<number> tokens before the to keyword (strip the # prefix)#<number> after to, or auto-detect from branch if no to keyword# Auto-detect parent from branch if needed
PARENT_ISSUE=$(~/.claude/bin/extract-issue-from-branch.sh)
If no parent found and no to #<parent> given: ask the user to provide one explicitly.
~/.claude/bin/find-tracking-pr.sh <repo> $PARENT_ISSUE
If no tracking PR exists: Inform the user and suggest using /decompose first.
Read the tracking PR body to understand the current Closes statements and tracking table.
Fetch details for all issues to be added:
~/.claude/bin/batch-issue-view.sh <repo> [issue-numbers...]
Use the Read tool to read the output. For each issue, extract: number, title, state, labels.
4a. Add Closes statements for each new issue (append after existing Closes lines):
Closes #[existing-issues]
Closes #1042 ← NEW
Closes #1043 ← NEW
4b. Add rows to tracking table for each new issue:
| # | Sub-Issue | Status | PR |
|---|-----------|--------|-----|
| ... existing entries ... |
| N | #1042 - [Issue title] | ⏳ Pending | - | ← NEW
| N+1 | #1043 - [Issue title] | ⏳ Pending | - | ← NEW
Map issue state to status: OPEN → ⏳ Pending, CLOSED → ✅ Complete.
4c. Update progress line to reflect the new total.
Link the added issues to the parent issue using the GitHub GraphQL API:
gh api graphql -f query='
{
repository(owner: "OWNER", name: "REPO") {
parent: issue(number: [parent-number]) { id }
sub1: issue(number: [sub-number-1]) { id }
sub2: issue(number: [sub-number-2]) { id }
...
}
}'
gh api graphql -f query='
mutation {
addSubIssue(input: {issueId: "[parent-node-id]", subIssueId: "[sub-node-id]"}) {
issue { number }
subIssue { number }
}
}'
Do this for ALL added issues. This enables GitHub's native sub-issue tracking in the UI.
## Issues Added to Epic
✅ Added #1042 - [title] to tracking PR #[pr-number]
✅ Added #1043 - [title] to tracking PR #[pr-number]
✅ Closes statements updated
✅ Progress: X of Y sub-issues complete (Z%)
### Quick Links
- Tracking PR: #[pr-number]
- Parent issue: #[parent-issue]
# If argument provided
PARENT_ISSUE=$ARGUMENTS
# Otherwise, detect from branch
PARENT_ISSUE=$(~/.claude/bin/extract-issue-from-branch.sh)
~/.claude/bin/gh-save.sh /tmp/issue-$PARENT_ISSUE.json issue view $PARENT_ISSUE --json number,title,body,labels
Use the Read tool to read /tmp/issue-$PARENT_ISSUE.json. Parse the issue body to identify:
- [ ] items~/.claude/bin/find-tracking-pr.sh <repo> $PARENT_ISSUE
If no tracking PR exists (script exits 1): Suggest using /decompose instead.
From tracking PR, extract existing sub-issue numbers, then fetch their current status in one batch:
~/.claude/bin/batch-issue-status.sh <repo> [sub-issue-numbers...]
From those results, determine:
From parent issue body, extract:
## Extend Decomposition - #[parent-issue]
### Current Progress
Tracking PR: #[pr-number]
Existing sub-issues: [N]
| # | Existing Sub-Issue | Status |
|---|-------------------|--------|
| 1 | #724 - Phase 1: Foundation | ✅ Complete |
| 2 | #725 - Phase 2: Core feature | ✅ Complete |
| 3 | #726 - Phase 3: Webhooks | 🔄 In Progress |
### Remaining Tasks (from parent issue)
These tasks don't have sub-issues yet:
- [ ] Phase 4: Frontend updates
- [ ] Phase 5: Testing & documentation
- [ ] Phase 6: Deployment
### Proposed New Sub-Issues
| # | New Sub-Issue Title | Scope |
|---|---------------------|-------|
| 4 | Phase 4: Frontend Stripe integration | Frontend |
| 5 | Phase 5: Test suite & documentation | Testing |
| 6 | Phase 6: Deployment & monitoring | DevOps |
Create these sub-issues?
- **A)** Create all proposed sub-issues
- **B)** Select which ones to create
- **C)** Modify the breakdown first
- **D)** Cancel
For each confirmed sub-issue, first write the body using the Write tool to /tmp/sub-issue-<n>.md:
## Parent Issue
Part of #[parent-issue] ([parent title])
## Scope
[What this sub-issue covers]
## Tasks
- [ ] Task 1
- [ ] Task 2
## Dependencies
- Requires: #[previous-sub-issues] to be complete
- Blocks: [next phases if any]
## Acceptance Criteria
- [ ] Criterion 1
- [ ] Criterion 2
Then create the issue:
gh issue create --title "[Parent #$PARENT_ISSUE] [Sub-issue title]" --body-file /tmp/sub-issue-<n>.md
After creating all sub-issues, link them to the parent issue using the GitHub GraphQL API:
gh api graphql -f query='
{
repository(owner: "OWNER", name: "REPO") {
parent: issue(number: [parent-number]) { id }
sub1: issue(number: [sub-number-1]) { id }
sub2: issue(number: [sub-number-2]) { id }
...
}
}'
gh api graphql -f query='
mutation {
addSubIssue(input: {issueId: "[parent-node-id]", subIssueId: "[sub-node-id]"}) {
issue { number }
subIssue { number }
}
}'
Do this for ALL created sub-issues. This enables GitHub's native sub-issue tracking in the UI.
7a. Add new Closes statements:
Closes #723
Closes #724
Closes #725
Closes #726
Closes #727 ← NEW
Closes #728 ← NEW
Closes #729 ← NEW
7b. Add to tracking table:
| # | Sub-Issue | Status | PR |
|---|-----------|--------|-----|
| 1 | #724 - Phase 1: Foundation | ✅ Complete | PR #730 |
| 2 | #725 - Phase 2: Core feature | ✅ Complete | PR #731 |
| 3 | #726 - Phase 3: Webhooks | 🔄 In Progress | PR #732 |
| 4 | #727 - Phase 4: Frontend | ⏳ Pending | - | ← NEW
| 5 | #728 - Phase 5: Testing | ⏳ Pending | - | ← NEW
| 6 | #729 - Phase 6: Deployment | ⏳ Pending | - | ← NEW
7c. Update progress:
**Progress:** 2 of 6 sub-issues complete (33%)
## Extension Complete
✅ Created 3 new sub-issues: #727, #728, #729
✅ Updated tracking PR #[pr-number]
✅ All 6 sub-issues will auto-close on merge
### Next Steps
- Continue working on #726
- When ready, start #727 with: `git checkout -b issue-727-frontend`
| Aspect | /decompose | /extend |
|---|---|---|
| When to use | Start of large issue | After first batch done |
| Creates PR | Yes (draft) | No (updates existing) |
| Analyzes | Full issue | Remaining tasks only |
| Sub-issues | Initial set | Additional set |