/plan-feature
Turn a PRD into a researched, reviewable Design Doc โ the bridge from product hand-off to "R&D can start building". It does the deterministic mapping the PRD makes possible, then hands to the architect to do the real design work (code archaeology, the existing landscape, the actual API / schema / sequencing) and fill the doc completely. The output is meant to be read and approved by a reviewer, and built from by an implementation session โ not refined from a stub.
What it producesโ
A Design Doc at docs/designs/<slug>-<cu-id>.md (Design Doc template, status: draft, related_prd โ the PRD) that is:
- Concise and reviewer-first. It opens with a TL;DR a reviewer reads in a minute โ the key design decisions and why, the design-system deltas, the risks / open calls. No restating the PRD, no filler.
- Complete enough to build from. Every section the implementer needs is filled by real research, not left "TBD" / "DRAFT โ R&D refines": the existing landscape, API / contracts (ยง5), data model (ยง4), frontend & components (ยง6), observability (ยง7), and a ยง13 Task Breakdown with
Effort(XSโXL),Risk,Depends on, and the design-system prerequisites listed first.
Plus a short summary (reused components, DS delta tasks by type, open questions raised + owners, the doc path).
Argumentsโ
$ARGUMENTS โ optional. A PRD path, a slug, or a free-language description ("the spotlight palette", "the command-palette PRD"). You never need to type a path: with no argument, the command lists the PRDs โ read from origin/master, never your local branch โ and lets you pick (step 1).
How it runsโ
-
Resolve which PRD against
origin/masterโ never make the author type a path, and never trust the local branch. PRDs live onmaster(a promoted PRD is merged there); the local checkout is usually on an unrelated feature branch, so reading the working tree silently hides freshly-merged PRDs and can lock onto the wrong one. Always resolve fromorigin/master:- Fetch, then enumerate from the merged tree. Run
git fetch origin master(quiet), thengit ls-tree -r --name-only origin/master docs/prds/(dropindex.md); read each one's frontmatter withgit show origin/master:<path>for itsstatus/title/id. - No argument โ list those PRDs, surfacing
status: ready-for-rdones first (the ready-to-plan set) and showing the rest with their status, then ask the author to pick one. - A slug or free-language description โ fuzzy-match it against the
origin/masterPRD titles / slugs / ids. One clear match โ confirm it in a line ("Spotlight (โK command palette) โ that one?") and proceed on yes; several โ list them to pick from; none โ list all and ask. (A path to a real file is also accepted, but the canonical body is read fromorigin/master.) - Warn on a stale checkout. If
git rev-list --count HEAD..origin/masteris non-zero, note it in one line ("your checkout is N commits behind master โ planning against the merged PRD") and continue; do not block, since resolution already usesorigin/master. - Once resolved, read the PRD body from
origin/master:<path>and requirestatus: ready-for-rdโ if it's stilldraft, say so and stop ("the PRD isn't hand-off ready โ Gatekeeper hasn't approved it"). (An intake-promoted PRD is flipped toready-for-rdby the hand-off / gatekeeper before this runs.)
- Fetch, then enumerate from the merged tree. Run
-
Deterministic pre-pass โ the scaffold the architect builds on:
-
Fetch the design reference. Figma Dev Mode via the Figma MCP if connected; a Claude Design code branch or a served HTML prototype otherwise; if unreachable, note the gap and use PRD ยง7.2.
-
Resolve ยง7.2 against the catalog (
@bewith-dev/design-systemCOMPONENTS.md/src). Every component named in ยง7.2 must exist in the catalog or appear in ยง7.2.a. If one does neither, stop and send the PRD back toprd-writerโ it names a component nobody is building. -
Turn ยง7.2.a deltas into design-system tasks โ one per non-
reuserow, using the row'sDS taskcommand verbatim. Flag any delta-type โ command inconsistency rather than guessing (that's aprd-writer/gatekeepermiss). These tasks run in@bewith-dev/design-systemand are prerequisites that ship before the feature is wired into the consuming app.Delta type Design-system task reusenone โ reference the catalog import path variant/add-variant <Component> <desc>element/add-component <Name> elementcomponent/add-component <Name> componentcomposite/add-composite <Name> <desc>
-
-
Hand to the
architectfor the real design pass. Invoke the architect on the PRD + the scaffold. The architect does what the deterministic pass cannot:- Code archaeology across the repos PRD ยง2 names โ the existing model / service / controller patterns, persistence, transport, auth, and the current shape of what this feature touches. Design against the landscape as it actually is, never greenfield.
- Pulls in the relevant specialists per its architectural-surfaces checklist โ
auth-security(mandatory on any permission / RBAC touch),contracts-schema(FEโBE / inter-service contracts),database(schema / migration),design-system(the new components from ยง7.2.a),frontend-developer,observability, and others a surface fires. - Observability is mandatory when PRD ยง8.1 lists analytics events. Run
observabilityfor real, not as a footnote: for each ยง8.1 event, the payload schema, where it fires (FE / BE), the privacy constraints it must honour (e.g. a raw search query is never in the payload โ only non-identifying metadata), and the metric / dashboard it maps to. A ยง8.1 with events that gets only "where it fires" is an incomplete ยง7 โ do not let it pass as done. - Fills every section with concrete decisions: real endpoints + DTOs + error codes (ยง5), schema with indexes (ยง4), a sequence diagram for any flow crossing โฅ2 services, rollback / feature-flag, and explicit backward-compatibility โ then runs the Design Review Checklist.
- Completes ยง13 Task Breakdown โ the DS prerequisite tasks first (no upstream dependency), then the consuming-repo tasks, each with a conservative
Effort(XSโXL),Risk, and the dependency edge that makes "design-system ships first" deterministic. - Flags candidate platform artifacts โ proactively, the way a teammate would. If the design introduces a recurring operation the team will repeat by hand (e.g. registering a new entry into a code-defined registry, a repeated migration / backfill shape, a check that should run every time), name it as a candidate
/new-artifactโ a skill, command, or hook โ and say what it would automate. Record it as a ยง13 task or a ยง15 open question. Propose; never build it here.
-
Iterate with the human on genuine open questions โ do not fill with assumptions. When research surfaces a decision only the author / R&D can make (or that needs a colleague), stop and ask it, concisely, one at a time (the architect's rule: designing against an unclear ask is the most expensive mistake). Resolve what archaeology can answer; escalate what it cannot. Record resolutions in the doc; leave non-blocking ones in its open-questions section with an owner. Never bury a decision silently.
-
Write the Design Doc to
docs/designs/<slug>-<cu-id>.mdon a fresh branch offorigin/master(e.g.docs/<slug>-design), not whatever branch the checkout happens to sit on โ the symmetric trap to reading the PRD off a stale branch. Template shape,status: draft,related_prdโ the input; lead with the TL;DR. In ยง6, areusecomponent maps to its catalog import; a non-reuseone references its ยง7.2.a design-system task as a prerequisite. -
Summarize to the developer. Reused components count; DS delta tasks by type (all flagged prerequisites); any ยง7.2 โ ยง7.2.a inconsistency (and that it was sent back to
prd-writer); any candidate platform artifacts proposed (filed as ยง13 tasks / ยง15 questions, not built); the open questions raised + their owners; the path to the Design Doc.
What this skill does NOT doโ
- It does NOT write feature code โ only the Design Doc.
- It does NOT create the GitHub Issues โ that's
/breakdown, after the Task Breakdown is reviewed. - It does NOT create the ClickUp parent task โ that comes from the PRD hand-off, before this runs.
- It does NOT approve the Design Doc โ human R&D +
gatekeeper(Mode B) move it pastdraft.
Cross-referencesโ
architectโ the design authority this command drives; the codebase research and the Design Doc authorship live there.- Product โ R&D Handoff methodology โ the pipeline this command sits in.
- PRD template โ the input shape; ยง7.2.a is the design-system delta list this command parses.
- Design Doc template โ the output shape (TL;DR + ยง13 Task Breakdown with effort).
@bewith-dev/design-systemโ the SoT the deltas anchor to; the/add-variant,/add-component,/add-compositecommands live there./breakdownโ the next step (after the Task Breakdown is reviewed).