issue-pr-sync
Skill0 starsChanged 6 months agoMITView on GitHub
Shared skill invoked by stage conductors (Stages 2–6) and /issue:breakdown as a non-fatal last step. Reads draft_pr + issue_number from workflow-state.md and updates both the draft PR body and the issue PRD sentinel block with the just-completed stage's artifact. No-op when draft_pr is absent. No slash command — invoked by other conductors only.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- plugin-v2/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- plugin-v2/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/agents.mdcCursor rule
- agentic-security-reviewSkill
- arc42-baselineSkill
- caveman-commitSkill
- caveman-helpSkill
- caveman-reviewSkill
- cavemanSkill
- create-goalSkill
- design-twiceSkill
- discovery-sprintSkill
- domain-contextSkill
- github-project-setupSkill
- grillSkill
- improve-codebase-architectureSkill
- issue-breakdownSkill
- issue-draftSkill
- new-adrSkill
- new-glossary-entrySkill
- orchestrateSkill
- portfolio-trackSkill
- product-pageSkill
- project-reviewSkill
- project-runSkill
- project-scaffoldingSkill
- quality-assuranceSkill
- quality-metricsSkill
- record-decisionSkill
- review-fixSkill
- roadmap-managementSkill
- sales-cycleSkill
- specorator-designSkill
- specorator-improvementSkill
- specorator-onboardSkill
- stock-takingSkill
- tackle-issueSkill
- tdd-cycleSkill
- token-budget-reviewSkill
- tracer-bulletSkill
- ubiquitous-languageSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
After each stage conductor (Stages 2–6: spec:research, spec:requirements, spec:design, spec:specify, spec:tasks) completes its primary work.
- Very specific: line 17
After /issue:breakdown Step 10.5 (housekeeping commit).
- Very specific: line 22
Read specs/<slug>/workflow-state.md.
- Very specific: line 44
If output is not OPEN, emit a warning: "draft PR #<n> is not open — skipping issue-pr-sync.
- Very specific: line 56
Update Current stage: to the just-completed stage name.
- Very specific: line 58
Update the matching - <Stage>: *(pending)* line in the Spec lineage section to:
- Very specific: line 64
If the stage is breakdown: add a human-readable note after the sentinel block (outside it):
- Distinctive: line 94
Update the section for the just-completed stage:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
issue-pr-sync
Shared sync primitive. No slash command. Conductors invoke this as their last step after stage work completes.
When to invoke
- After each stage conductor (Stages 2–6:
spec:research,spec:requirements,spec:design,spec:specify,spec:tasks) completes its primary work. - After
/issue:breakdownStep 10.5 (housekeeping commit). - Never invoked directly by the user. Never invoked by
/spec:idea(Stage 1).
Pre-condition check (no-op gate)
Read specs/<slug>/workflow-state.md. If draft_pr field is absent or empty, exit silently — this feature has not run /issue:draft. No warning, no side-effects.
Inputs
Calling conductor passes:
| Input | Source |
draft_pr | workflow-state.md — PR number (integer) |
issue_number | workflow-state.md — GitHub issue number (integer) |
slug | Feature slug (e.g. auth) |
stage | Stage just completed (e.g. research, requirements, design, specify, tasks, breakdown) |
artifact_path | Path to the new artifact (e.g. specs/<slug>/requirements.md) |
Steps
1 — Verify draft PR still open
gh pr view <draft_pr> --json state --jq '.state'If output is not OPEN, emit a warning: "draft PR #<n> is not open — skipping issue-pr-sync. Close the PR manually or update draft_pr in workflow-state.md." Return without further action.
2 — Fetch current PR body
gh pr view <draft_pr> --json body --jq '.body'3 — Render updated PR body
Locate the <!-- BEGIN issue-draft-pr:<slug> --> … <!-- END issue-draft-pr:<slug> --> sentinel block.
Update **Current stage:** to the just-completed stage name.
Update the matching - <Stage>: *(pending)* line in the Spec lineage section to:
- <Stage>: `<artifact_path>`If the stage is breakdown: add a human-readable note after the sentinel block (outside it):
*Implementation has moved to slice PRs. This draft PR is ready to close.*Also populate the Tasks line with the slice PR list provided by /issue:breakdown.
Sentinel block is always fully overwritten — this is the always-overwrite contract (idempotent on re-run).
Preserve everything outside the sentinel block unchanged, especially the ## Open questions / feedback welcome free-form section.
4 — Write updated PR body
# Render to staging file
mkdir -p .issue-draft-staging
# write rendered body to .issue-draft-staging/pr-<draft_pr>.md
gh pr edit <draft_pr> --body-file .issue-draft-staging/pr-<draft_pr>.md
rm .issue-draft-staging/pr-<draft_pr>.md5 — Fetch current issue body
gh issue view <issue_number> --json body --jq '.body'6 — Render updated issue PRD section
Locate the <!-- BEGIN issue-draft:<slug> --> … <!-- END issue-draft:<slug> --> sentinel block.
Update the section for the just-completed stage:
| Stage | Section updated |
research | ## Research — link to specs/<slug>/research.md |
requirements | ## Requirements — link to specs/<slug>/requirements.md with key REQ IDs if available |
design | ## Design — link to specs/<slug>/design.md |
specify | ## Spec — link to specs/<slug>/spec.md |
tasks | ## Tasks & work packages — link to specs/<slug>/tasks.md |
breakdown | ## Tasks & work packages — replace with *See ## Work packages below (managed by /issue:breakdown).* |
Sentinel block always overwritten — same always-overwrite contract.
Preserve everything outside the sentinel block.
7 — Write updated issue body
# write rendered body to .issue-draft-staging/issue-<issue_number>.md
gh issue edit <issue_number> --body-file .issue-draft-staging/issue-<issue_number>.md
rm .issue-draft-staging/issue-<issue_number>.mdAttempt rmdir .issue-draft-staging (will succeed silently if now empty, fail silently if not).
Failure handling
Any gh command failure (auth, rate limit, network): emit a warning prefixed with [issue-pr-sync] WARNING: and return without aborting the calling conductor. The stage completion is not rolled back. Sync can be recovered by re-running the stage conductor (idempotent always-overwrite).
Sentinel coexistence
Both /issue:draft (<!-- BEGIN issue-draft:<slug> -->) and /issue:breakdown (<!-- BEGIN issue-breakdown:<slug> -->) may place sentinel blocks in the same issue body. Their tags differ — they coexist without conflict. When invoked by /issue:breakdown, this skill updates the issue-draft sentinel's Tasks section to defer to the issue-breakdown block.
References
- Methodology:
docs/issue-draft-track.md. - Design spec:
docs/superpowers/specs/2026-05-04-issue-draft-track-design.md. - Templates:
templates/issue-prd-template.md,templates/issue-draft-pr-body-template.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

