sync-closes
Synchronize all sub-issues to Closes statements in tracking PR
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Synchronize all sub-issues to Closes statements in tracking PR
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | sync-closes |
| description | Synchronize all sub-issues to Closes statements in tracking PR |
| argument-hint | <pr-number> |
| user-invocable | true |
Ensure all sub-issues referenced in a tracking PR are included in the "Closes #XXX" statements, so they auto-close when the PR merges.
The user provides a PR number: $ARGUMENTS
~/.claude/bin/gh-save.sh /tmp/pr-$ARGUMENTS.json pr view $ARGUMENTS --json number,title,body,baseRefName
Use the Read tool to read /tmp/pr-$ARGUMENTS.json.
Parse the PR body for existing closes:
Closes #689
Closes #690
Closes #691
Regex pattern: [Cc]loses?\s+#(\d+)
Also catch variations:
Closes #XXXcloses #XXXClose #XXXFixes #XXXfixes #XXXResolves #XXXFind all issue references in the tracking table:
| # | Sub-Issue | Status | PR |
|---|-----------|--------|-----|
| 1 | #690 - Foundation | ✅ | PR #701 |
| 2 | #691 - Home Page | ✅ | PR #702 |
| 3 | #724 - 🐛 Bug fix | ⏳ | - |
Extract: #690, #691, #724
Also scan for:
Current Closes: [689, 690, 691]
Found in Table: [689, 690, 691, 724]
Missing: [724]
## Sync Closes - PR #[number]
### Current Closes Statements
- Closes #689 (parent)
- Closes #690
- Closes #691
### Found in Tracking Table (not in Closes)
- ❌ #724 - 🐛 Bug: Webhook fails (MISSING)
- ❌ #725 - 🐛 Bug: Amount calc error (MISSING)
### Recommended Action
Add these to PR body:
Closes #724 Closes #725
Apply changes? (y/n)
After confirmation, prepend missing Closes statements:
Before:
Closes #689
Closes #690
Closes #691
This PR tracks...
After:
Closes #689
Closes #690
Closes #691
Closes #724
Closes #725
This PR tracks...
Write the updated body to a temp file first, then use --body-file:
# Write updated body to temp file using the Write tool
# Then apply it:
gh pr edit $ARGUMENTS --body-file /tmp/pr_body.md
If you need to check whether any referenced issues are already closed, fetch their status in one batch:
~/.claude/bin/batch-issue-status.sh <repo> [issue-numbers...]
~/.claude/bin/gh-save.sh /tmp/pr-$ARGUMENTS-verify.json pr view $ARGUMENTS --json body
Use the Read tool to read /tmp/pr-$ARGUMENTS-verify.json and extract all Closes #\d+ statements.
Show confirmation:
## Sync Complete
✅ PR #[number] now closes [N] issues:
- #689 (parent)
- #690, #691, #692 (original sub-issues)
- #724, #725 (bugs added during development)
When this PR merges to [base-branch], all [N] issues will auto-close.
Don't add if already present (case-insensitive):
Closes #724
closes #724 ← Don't add duplicate
Warn about already-closed issues:
⚠️ Warning: #691 is already closed (was it merged separately?)
Only add issues, not PR references:
Skip: PR #701 (this is a PR, not an issue)
Add: #724 (this is an issue)
/sync-closes 696
Output:
## Sync Closes - PR #696
Found 3 issues not in Closes statements:
- #724 - 🐛 Bug: Settings display
- #725 - 🐛 Bug: Feature flags
- #726 - 🐛 Bug: System config
Add "Closes #724, #725, #726" to PR? (y/n)
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.