/soong:developfrom soong
Take a Notion roadmap item and build its whole task stack as stacked pull requests, one pull request per task, asking any questions the task cards leave open before writing code. Use when the user runs /develop, or asks to implement a roadmap item, build out a stack of tasks, or start development from prepared task cards. Requires the repo to be configured via soong-setup first.
Ships in soong. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Take a Notion roadmap item, walk every task on it in stack order, and land each one as its own reviewable pull request based on the previous task's branch.
The user answers questions once, up front. Then the stack builds unattended.
superpowers plugin (writing-plans, subagent-driven-development).manage-pr skill, with --base, --notion-card, and --draft.soong-setup./develop <roadmap-item-notion-link> [--skip <task-title>]... [--draft]
<roadmap-item-notion-link> — required, first positional. A Notion URL or
page id for the roadmap item. This is the ledger key, so the same link resumes
the same stack.--skip <task-title> — repeatable. The task's title, matched against
the task pages resolved in first-run step 2, case-insensitively and ignoring
surrounding whitespace. A title that matches no task, or more than one, stops
before anything is created. Titles are resolved to page ids at that point, and
the ledger stores ids only.--draft — open every pull request in the stack as a draft. Off by
default, and the only thing that turns it on.Derive a task slug from its title: lowercase it, replace each run of
non-alphanumeric characters with one hyphen, and remove edge hyphens.
Branches use the claude/<slug> prefix. The worktree lives at
.claude/worktrees/develop-<roadmap-item-id> under the main checkout.
Record every derived branch name in the ledger before creating branches. Record the worktree path. A resume reads both from the ledger. A retitled card must not rename an existing branch.
A run is a first run when the ledger has no entry for this roadmap item, and a resume when it does. The two paths differ, so they are specified separately. Resume is below.
On a first run, nothing is created and nothing is written until step 6. Every earlier step can stop for free.
Check configuration. Run:
bash "${CLAUDE_PLUGIN_ROOT}/skills/soong-setup/scripts/soong-setup.sh" check notion
bash "${CLAUDE_PLUGIN_ROOT}/skills/soong-setup/scripts/soong-setup.sh" get
check notion exit 0 continues to get, which reads the ids. Exit 3 means
this repo is not configured for Notion: invoke soong-setup, then run
check notion again and stop on anything non-zero. Exit 1 is a corrupt
config, exit 2 is not a git repository. Both stop. A non-zero get after a
clean check is a bug: report it and stop.
Read useNotion from get before the ids. False means this repo does not
use Notion at all, and it satisfies the capability, so exit 0 alone does not
rule it out. Say this repo is not tracked on Notion, so /develop does not
apply, and stop. Do not invoke setup: the user answered this already, and
changing the answer is theirs to ask for.
Confirm the Notion MCP is reachable in this step, rather than finding out at task 4 that the stack has nowhere to report.
Resolve the stack. Two sources, cross-checked:
taskDb for tasks linked to the roadmap
item. A prose list cannot give a page id.Check two things, in this order:
On a stop, show the two lists side by side, say which entries could not be mapped, and ask. Do not guess an order. Building a stack in the wrong order is expensive to undo, because every later branch sits on the wrong base.
Resolve and validate skips. For each --skip title, match it to a task
per the Arguments rules. Then, for each matched task, walk the "stacks on"
statement on every unskipped task. Any unskipped task that depends on a
skipped one, directly or transitively, blocks the skip: refuse, name every
blocking dependent, and offer the two fixes, which are to skip those too or to
not skip at all.
For a linear stack, a skip is accepted only for a contiguous tail. Refuse a skip with work above it because that task would be built on a base that was never created. Say so plainly in the refusal.
This step reads the "stacks on" prose that is not trusted for ordering. Trusting it for dependency is deliberate: ordering has a better source in the roadmap list, and dependency has none. A "stacks on" statement that names no task, on any task, stops this step rather than being read as "depends on nothing".
Skips are validated before any branch exists, so a refused skip costs one message.
The gap pass. Read every task card, skipped ones excluded. Per task, list what implementing it needs and the card does not answer.
Read the cards in subagents, not on the main thread. Every card body lands in
context otherwise, and the only thing the rest of this run needs from a card is
its gaps and the answers to them. Dispatch one read-only exploration agent per unskipped
task with the Explore agent (subagent_type: Explore, model: sonnet).
Dispatch the independent agents together. The cards do not depend on each other, so reading them
in sequence buys nothing.
Give each agent one task's page id and the roadmap item id. The gaps are in the card, so an agent needs nothing from the repository, and the stack's worktree does not exist until step 5. Tell it to return, for that one card:
An agent that finds no gaps returns the title and "no gaps".
Any agent that fails, read that one card on the main thread. A failed gap pass on one card is not a reason to stop the stack, and it is not a reason to treat that card as gap-free.
Show the whole list, including the tasks with no gaps, so the user can add a question the pass missed. A missed gap becomes a subagent's guess.
Then ask the questions inline, one at a time, on the main thread. Do not
invoke brainstorming, whose checklist ends in a written design document, its
own review loop, and an approval gate, none of which belongs here. Do not
batch the questions into one message, and do not write a design document. The
cards are the source of truth for this workflow.
Hold the answers in the conversation for now. They are written to the ledger in step 6, because this step must stay free to stop.
Create the worktree. One worktree for the whole stack, off main.
Use git worktree add with the path from the Names section.
Inspect attached worktrees and git worktree list before creating one.
Reuse a matching stack worktree from an interrupted run and report the reuse.
For a managed worktree, record the returned path rather than inventing one.
For a Git fallback, derive the directory from the roadmap item id.
If a crash left no ledger entry, explain that the earlier gap answers were lost. Re-run the gap pass before continuing.
Verify project-local worktree directories are ignored before creating files
inside them. Add the selected directory to .gitignore if necessary.
Host-managed worktrees outside the repository do not require this change.
Never run in the worktree the user is sitting in: branches advance in place here, and swapping a branch under an open editor is the failure this avoids.
Write the ledger entry. Create the entry for this roadmap item: the
resolved order, the resolved skip ids, the answers from step 4, the worktree
path from step 5, and every unskipped task at pending, with its derived
branch name recorded and its pull request null.
Record the branch name now, at the one point where every task title is in
hand, rather than leaving it to be re-derived later. A resume reads order
from the ledger and re-queries Notion only to confirm the tasks still exist,
so it never has the titles; and a card retitled between runs would derive a
different name and orphan the branch the earlier run created. The name is
recorded before any branch exists, so it is a plan, not a claim that the
branch is there.
This is the first write of the run, and it is what makes the run resumable.
For each unskipped task in stack order, in that one worktree:
Check for interrupted work, before branching. Read this task's branch name from the ledger, where first-run step 6 recorded it. Every task has one from the moment the entry exists, whether or not the branch itself does.
Go to "A task that was interrupted" and resolve it there first if any of these holds:
in-progress.stopped. The ledger promises no automatic retry, so a stopped
task is never resumed by falling through to the next step.pending and its recorded branch already exists in the
repository. That combination means a previous run created the branch and
died before marking it.None of those, continue. This check owns the collision, and step 3's re-check and everything after it assume a branch this run created.
Branch. Create the recorded branch off the previous unskipped task's
branch. The first task built is based on main.
Mark the task in-progress before any work happens on it. The branch name is
already recorded, so this writes the status only.
Re-check the answers. Read the diff the stack has built so far,
git diff main...HEAD, and check this task's recorded answers against it.
An answer is contradicted when the built code makes it false or impossible, not when it merely went unused. Two worked examples:
--verbose. Nothing
built so far names any flag. The answer is untouched, so the loop continues
without asking.A contradiction stops the loop: record stopped in the ledger with which
answer and what contradicts it, and leave every later task pending.
This check is a no-op on the first task built, where the diff is empty. That is expected, since an answer cannot be contradicted by nothing.
Plan. Invoke superpowers:writing-plans from the card plus its recorded
answers.
The plan file it writes is a working artifact, not a deliverable. Write it
outside the repository, under the session scratchpad, so it never appears in
any pull request's diff. writing-plans runs its own per-chunk review loop;
let it, and do not skip it.
Implement. Invoke superpowers:subagent-driven-development on that plan.
Its own two stages, spec compliance then code quality, are the quality gate.
This skill adds no review of its own at this step and skips neither of those.
Loop step 7 adds one more, by way of compose.
That skill normally ends by invoking finishing-a-development-branch. Do not
follow that transition. Steps 6 through 8 here are the finish for one task, and
the stack continues.
It also dispatches a final reviewer over the whole implementation before that transition. Let that run: per task it reviews the stack as built so far, which is the state the next task will build on. It is a third review this skill inherits rather than adds, and it is not one of the two per-task stages, so the rule against skipping those does not cover it.
Push the branch. git push -u origin <branch>. gh pr create cannot open
a pull request for a branch the remote does not have.
This is its own step because a run can die between it and the next one, and the interrupted-work path has to tell those two states apart.
Open the pull request. Invoke soong:manage-pr in compose mode with:
--non-interactive, because the stack is meant to run unattended.--base <previous unskipped task's branch>, or main for the first task
built. This is the same base step 2 branched from, read from the ledger, not
recomputed. Without it the pull request would target the repository default
branch and the stack would not be a stack.--notion-card <this task's page url>, so compose writes the card into the
pull request record itself rather than this skill overwriting the record
afterward.--draft only if the user passed --draft.Compose leaves the remote tip matching HEAD, so this step does not re-push.
The next task branches off this branch's local tip, so any commit compose
added carries into the stack.
If compose reports a failing check, stop the stack there. Record the task
stopped with stoppedBecause naming the check, and report it. Not
in-progress: that routes the resume back into step 7, which fails the same
way. Do not open the pull request, and do not start the next task on a branch
that fails its own check.
Record it. Mark the task done in the ledger with its branch and pull
request url.
Then set the card's status. Read the card's own status options through the Notion MCP and pick the matching one. Nothing matches, skip the status write and say so. Never guess a Notion value: these writes do not reverse.
A run is a resume when the ledger already has an entry for this roadmap item. Report what is already built, then continue. The differences from a first run:
order wins. Re-query Notion only
to confirm every task in order still exists. A task that vanished stops the
resume. A task that Notion has and the ledger does not is reported, not
added: the stack in progress was planned around the order it started with,
and appending to it mid-flight would build the new task on an arbitrary base.
Say it was found and skipped, and that re-running from a fresh ledger entry
would include it.skipped wins. A --skip on a resume that
does not match the recorded set stops rather than silently re-deciding: say
which set is recorded and let the user choose.--draft on a resume: the ledger's draft wins, so the stack stays
consistent with the pull requests already opened. A --draft that disagrees
with the recorded value is reported and ignored, not applied to the remaining
tasks: half a stack of drafts is worse than either whole. Say which value is
recorded, so the user can act on it themselves.main, record the new path, and say so, since the branches themselves
survive in the repository.Then enter the loop at the first task that is not done, and rebuild nothing
below it.
This section covers two dispositions that loop step 1 routes here: a task a
previous run died inside, and a task that stopped deliberately. The second is
settled at the end and never resumed. For the first, the ledger cannot say how
far the run got, because it died before writing that down, so establish the state
from git and gh rather than from the ledger.
Establish two facts, in this order. Check the branch out first, so both commands read the right branch.
gh pr list --head <branch> --state all --json number,url,state # any pull request?
git rev-parse --abbrev-ref '@{u}' >/dev/null 2>&1 \
&& git log --oneline '@{u}'..HEAD # unpushed commits?
Query --state all, not --state open: a pull request closed or merged between
runs is not the same as no pull request, and treating it as one would open a
second pull request for the same task.
Unpushed commits means either that git rev-parse failed, so the branch has
no upstream and nothing is pushed, or that git log printed something. Push
before doing anything else in the first two cases below, because a stale remote
makes the next task branch off a tip that was never published.
That gives three states, each resumed at a different step:
An open pull request exists. The run died between opening it and recording
it. Do not re-run the earlier steps and do not call gh pr create again, which
fails on a branch that already has an open pull request. Push if there are
unpushed commits, then do loop step 8 alone: record the found url and set the
card status. Then continue to the next task.
Pushed, no open pull request. The run died between the push and the pull request. The work is safe on the remote, so re-planning and re-implementing it would duplicate it. Push anything outstanding, then resume at loop step 7 and open the pull request.
A pull request that --state all reports as closed or merged is not this
state. Report it and stop: something outside this run acted on the branch, and
opening a second pull request for the same task is not a decision to make
unattended.
Nothing pushed. The only genuinely ambiguous state: the commits are local and partial, and nothing outside this machine knows about them. Report what the branch contains and ask whether to continue on it or reset it.
Never delete the branch, force-push it, or start a second one. Only the last case asks the user, because only there can guessing destroy work that is not recoverable. The first two are recoverable precisely because the remote can still see them.
A stopped task reaches this section too, and it is not an interruption: the
ledger records why it stopped, and the user has to resolve that before it can be
built. Report stoppedBecause and stop. Do not resume it at any step.
A stop at task 4 must not mean rebuilding tasks 1 through 3.
File: ${XDG_STATE_HOME:-$HOME/.local/state}/soong/develop-ledger.json.
Regenerable state, so it shares a home with the pull request records rather
than user configuration, and it is never committed.
Keyed by project, then roadmap item id. The project name comes from the
common git dir, never --show-toplevel, so every linked worktree of one
repo shares one entry:
common="$(git rev-parse --path-format=absolute --git-common-dir)"
top="${common%/.git}"; top="${top%/}"; project="${top##*/}"
Shape:
{
"<project>": {
"<roadmap-item-id>": {
"order": ["<task-id>", "..."],
"skipped": ["<task-id>"],
"answers": { "<task-id>": [{ "question": "...", "answer": "..." }] },
"tasks": {
"<task-id>": {
"status": "pending | in-progress | done | stopped",
"branch": "<derived-at-entry-creation>",
"pr": "<url-or-null>",
"stoppedBecause": "<reason-or-null>"
}
},
"worktree": "<path>",
"draft": false,
"updatedAt": "<iso8601>"
}
}
}
Every field is written by a named step and read by a named step:
| Field | Written | Read |
|---|---|---|
order | First run step 6 | Resume step 2, the loop |
skipped | First run step 6 | Resume step 3, the loop |
answers | First run step 6 | Loop steps 3 and 4 |
tasks[].status | First run step 6 at pending, then loop steps 2, 3, 8 | Resume, to find the first task not done; loop step 1 and the interrupted-work path |
tasks[].branch | First run step 6, from the task title | Loop step 1 to detect an existing branch, step 2 to create it, steps 6 and 7 to push and to set --base, and the interrupted-work path |
tasks[].pr | Loop step 8 | Reported on resume |
tasks[].stoppedBecause | Loop step 3 | Reported on resume, by the interrupted-work path |
worktree | First run step 6, and resume step 5 if recreated | Resume step 5, and every loop step, which all run inside it |
draft | First run step 6 | Loop step 7 |
updatedAt | Every ledger write | Reported on resume, to say when the stack last advanced |
Merge into the file idempotently, the same way manage-pr writes the pull
request record, so a concurrent run on another repository cannot lose an entry.
Two things the ledger deliberately does not do:
finishing-a-development-branch keeps a worktree on the pull request
path.| Failure | Behavior |
|---|---|
| Repo unconfigured, exit 3 | Invoke soong-setup, re-check, stop on non-zero |
| Notion MCP unreachable | Stop at startup. No worktree, no branch, no ledger |
| Roadmap list and task query disagree on count or mapping | Stop, show both, ask. Nothing created |
A --skip title matching no task or several | Stop. Nothing created |
| A skip later tasks depend on | Refuse, name the dependents, explain the tail-only ceiling. Nothing created |
| A "stacks on" statement naming no task | Stop at skip validation. Never read as "depends on nothing" |
| A gap answer the built code contradicts | Stop at that task, ledger records why. Later tasks stay pending |
subagent-driven-development reports BLOCKED | Stop at that task. Never re-dispatch it unchanged, and never hand-fix it on the main thread |
| A branch that already exists at loop step 1 | Resolve it in the interrupted-task path. Never force-push and never start a second branch |
| An open pull request on an interrupted task's branch | Do loop step 8 alone. Never re-run gh pr create on it |
| An interrupted task pushed with no pull request | Resume at loop step 7. Never re-implement it |
| An interrupted task with unpushed commits and no pull request | Ask the user. The only state where guessing loses work |
| An interrupted task whose pull request was closed or merged elsewhere | Report it and stop. Never open a second one for the same task |
A worktree path that is ignored only via .git/info/exclude | Add it to .gitignore and commit that first |
A stopped task reached on resume | Report stoppedBecause and stop. Never retry it automatically |
| A worktree on disk with no ledger entry | Reuse it, say the earlier answers were lost |
A --draft on a resume that disagrees with the ledger | Report it, keep the recorded value |
| A recorded worktree that is gone on resume | Create a new one off main, record it, say so |
| A task in Notion that the ledger's order lacks | Report it, do not add it to the running stack |
| No matching card status option | Skip the status write, say so, continue |
The pull request guard hook denies gh | Fix the title or body per its reason and retry. Never bypass it |
main.--draft.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub konvoulgaris/soong --plugin soong9 skills in this plugin
/manage-prUse for any work on a pull request — writing or rewriting its title and description when creating or editing a PR, and responding to reviewers on your own open PR. Enforces the Conventional-Commits-with-scope title format, an optional Notion ticket id suffix, and a simple-prose description style. Walks unresolved review threads one-by-one with the user, then posts all replies in one batch after approval. Forbids generated-by footers and Claude attribution tags on both. Also persists a project/branch -> notion card + last commit record outside the repo for later querying. Triggers on "open a PR", "create a pull request", "write the PR title/description", "address the PR feedback", "reply to the reviewers", "go through the review comments", "respond to the PR comments", or any `gh pr create` / `gh pr edit` / `gh pr comment`./mergeMerge a base branch into the current feature branch and push the result, resolving conflicts file-by-file. Use when the user asks to "merge", "merge back", catch a feature branch up with its base, or pull base-branch changes into the current branch. "Base" most likely means the branch the feature was cut from or the PR's base branch, not necessarily a branch literally named "development"./polishRun a code review with autofix, then a simplification pass, then commit the result. Use when the user runs /polish, or asks to review and clean up the current changes in one shot, autofix the review findings, or "review and simplify and commit". Runs unattended - it applies fixes and commits without asking./rebaseRebase the current feature branch onto a new base branch, keeping only the changes made on the feature branch and dropping any commits inherited from the old base. Use when the user asks to "rebase", change a feature branch's base, move a branch onto a different base, or re-point a branch at a new base branch without carrying over the previous base's history./soong-setupRecord what this repo needs for soong's skills to run - whether it uses Notion at all and which roadmap and task databases it maps to, and whether its commits carry a Conventional Commits scope. Use when the user runs /soong-setup, when another skill reports the repo is not configured, or when the user wants to change what a repo is configured for. A repo can record that it does not use Notion, which settles that capability for good. Stops without writing anything if the user says the repo uses Notion but does not supply valid databases./sync-pr-to-notionUse when asked to sync a branch's changes into its linked Notion card, or to update the Notion ticket for a PR. Looks up the card from the PR record written by manage-pr (keyed by project and branch), asks the user for the card if none is recorded, then writes a high-level architecture-style description of the branch's changes to the card via the write-notion-content skill. Never edits code, tests, or verification steps. Triggers on "sync the PR to notion", "update the notion card for this branch", "describe these changes on notion".