Repository navigation
Description
Summary
Teach the SDD flow about inter-feature dependencies, and let the existing pr-stack skill turn those dependencies into stacked PRs automatically — no new stack tooling, just SDD-driven orchestration.
Declare that one feature depends on another — Spec Kit and stacked PRs do the rest.
The problem
Spec Kit walks users through one feature at a time. But real features often build on each other: Feature B needs code from Feature A. Today that means:
- Wait for Feature A to be reviewed and merged before starting Feature B (blocks parallel work).
- Start B anyway without visibility into A''s code, inventing placeholders that get thrown away.
- Combine both into one giant PR that reviewers can''t follow.
Real example — issues logged on github/spec-kit:
- #4210 — Add deterministic contribution IDs and stack lookup IDs for resolved artifacts
- #4212 — Add
specify artifactcommand exposing composition stacks as JSON
#4212 depends on #4210. Running each in its own Copilot session today, the #4212 session branched off main and had no visibility into #4210''s in-flight work.
What already exists
- Stacked pull requests — GitHub feature that lets PR B target PR A before A is merged; reviews happen in parallel; upstream changes auto-rebase; merging the top lands the whole stack.
pr-stackskill — already ships in the Copilot app; wrapsgh-stackfor creating/managing stacks.- Spec Kit +
spec-kit-copilot— handle intra-feature dependency ordering (phases,[P]markers,Dependencies & Execution Orderintasks.md) but have no first-class notion of feature-to-feature dependencies.
Gap
Spec Kit has no way to say "Feature #4212 depends on Feature #4210" such that any command acts on it. The spec.md "Assumptions" section is prose, not machine-readable, and assumes the dependency is already merged.
Proposal
Extend the existing spec-kit-copilot SDD skills (primarily speckit-workflow-step / speckit-workflow) to be stacks-aware. Delegate all Git/PR mechanics to the existing pr-stack skill. No new skill, no new user-visible commands in the MVP, no changes to core spec-kit.
Dependency declaration (any of these, unified internally)
Read whichever is available, in priority order:
- Explicit prompt at kickoff — "stack on #4210."
- GitHub sub-issue / tracked-by links on the issue.
Depends on: #NNNNline in the issue body.dependencies:frontmatter inspec.md(persists after issue is closed).
All resolve to {feature_id, upstream_prs, upstream_branches}.
Hooks into each SDD phase
| Phase | New behavior when a dependency exists |
|---|---|
| Session kickoff | Detect deps → if unmerged upstream PR exists, prompt to stack → call pr-stack to check out on top of upstream branch. |
/specify |
Load upstream spec.md as context. Write structured ## Dependencies into new spec. |
/plan |
Load upstream plan.md and contracts. Do not re-plan interfaces upstream owns. |
/tasks |
Skip tasks upstream delivers; tag consuming tasks with [upstream:#NNNN]. |
/analyze |
Cross-check assumptions against upstream contracts. Flag drift. |
/implement |
Runs against a working tree that already includes upstream code — real APIs, no stubs. |
| PR creation | Call pr-stack submit → PR targets upstream branch; stack map included in body. |
| Upstream changes | Auto-call pr-stack restack → rerun /analyze to flag invalidated assumptions. |
SDD canvas changes
- Stack lane — features in a stack render as connected columns in dependency order.
- Layer badge on each card: "Layer 2 of 3, base: #4210".
- Merge-readiness indicator per layer.
- Base preview — clicking the base opens the upstream feature''s canvas in a side panel.
Worked example — #4210 → #4212
- #4212 issue body says
Depends on: #4210. - Session opens on #4212. Plugin detects the dep, calls
pr-stackto base the branch on #4210''s branch. /specifyruns with #4210''s spec as context./planand/tasksreference #4210''sContributionIdAPI directly./implementwrites real code against real APIs.pr-stack submitopens PR #4212 targeting #4210''s branch.- #4210 reviewer renames
ContributionId→ArtifactRef; force-pushes. - Plugin auto-triggers
pr-stack restackon #4212 → reruns/analyze→ flags affected tasks →/implementpatches them. - #4210 merges. #4212 auto-retargets to
main. Merge queue lands it.
Delivery plan
MVP (small)
- Extend
speckit-workflow-stepto read deps from issue body +spec.mdfrontmatter. - Auto-call
pr-stack addat kickoff,pr-stack submitat end of/implement. - Write
dependencies:intospec.md.
Phase 2
- Upstream context injection into
/specify,/plan,/tasks,/analyze. - Auto
pr-stack restack+/analyzererun on upstream change.
Phase 3
- SDD canvas stack lane.
- Sub-issue / tracked-by detection.
- Content-based inference fallback in
/analyze. - Optional
/speckit.stackescape hatch command if users request explicit control.
Non-goals
- No changes to core
spec-kittemplates or commands. - No reimplementation of stack mechanics —
pr-stackowns that. - No new user-visible skill or command surface in the MVP.
- No non-GitHub host support (stacked PRs are GitHub-only).
Framing
Spec Kit already handles dependencies inside a feature. This makes it aware of dependencies between features — and lets stacked PRs carry that awareness all the way through review and merge.
Activity
mnriem commentedon Sep 1, 2026
@nicolehaugen Is there anything specific needed on the core Spec Kit side to make this easier? Note we can add presets in this repository too!