Repository navigation
Description
Overview
A spec-driven-development methodology recipe, following the same pattern established by the Linear-style (see Related Issues) and Jira-style recipes: a spec → plan → task (existing core task, unmodified) lineage chain connected by declared schema relationships (not has_child, not the mentions system — see Proposed Solution for why), gated at each transition by Invariant Plays requiring the prior stage's approval before the next can be created or completed.
Researched against the current real-world landscape rather than assumed: GitHub's own Spec Kit (specify → plan → tasks → implement → converge, ~111k stars), AWS Kiro's three-artifact spec-driven IDE workflow (requirements.md → design.md → tasks.md, gated human sign-off at each boundary), and a published agent-skill implementation of the pattern (addyosmani/agent-skills spec-driven-development). All three converge on the same invariants regardless of tool-specific vocabulary:
- Strict one-way lineage: spec → plan → tasks → code, each stage traceable to the one before it (the explicit failure mode all three tools exist to prevent — code/plan "drift from intent").
- An explicit gate between every stage: nothing advances until the current artifact is approved.
- The spec (and plan) stay "alive" — committed/referenced sources of truth, not one-time prose that decays after kickoff.
Problem Statement
NodeSpace has no spec-driven-development methodology recipe today. There is no schema representing a specification, a technical plan, or the lineage between them and an implementation task, and no enforcement that an implementation task actually traces back to an approved spec/plan rather than being created ad hoc.
Proposed Solution
Why declared relationships, not has_child or mentions
Two mechanisms were considered and rejected as the lineage backbone:
has_child: reserved for genuine outline/sub-task nesting (same reasoning as the Jira recipe's Epic-Link decision) — spec/plan/task lineage is a flat reference relationship, not hierarchical nesting.- The
mentionssystem (nodespace://{uuid}links, automatic on content edit,relationship_type = 'mentions'): deliberately NOT used for the lineage a gating Play depends on. Mentions remain available for arbitrary informal supporting context (a task mentioning an ADR, an unrelated doc, another task) with zero schema commitment — exactly what they're for. But the lineage a Play gates on needs to be a declaredSchemaRelationship, because:- It's visible in the schema itself (
EXISTING SCHEMASprompt injection,EntityTypeDescriptor,find_skills) without inspecting node content. - It's queryable through the existing, already-working
graph_resolver.rsresolve_path/fetch_related_nodespath (relationship_name-based lookup) — confirmed via direct code inspection that this machinery only walks schema-declared relationships (packages/core/src/playbook/graph_resolver.rs,fetch_related_nodes, ~line 188), not mention edges.trigger.node.mentionsis exposed to Play conditions as a flat ID array (packages/core/src/playbook/actions.rs:1603) but has no path-resolution support to fetch a mentioned node's fields (e.g. its status) — using mentions for gating would require extendinggraph_resolver.rsfirst. Declared relationships need no such extension; the presence/absence of a relationship is itself the durable, visible signal a Play checks.
- It's visible in the schema itself (
Schemas
spec (schema-only, no extends):
objective—field_type: "string". Purpose/why/who — matches Phase 1 "Objective" across all three researched tools.success_criteria—field_type: "string"(free text, not enum — testable conditions vary per spec; constraining to a fixed list would fight real usage, same reasoning as Jira'sstory_points).boundaries—field_type: "string", free text ("always do / ask first / never do," directly from the researched Osmani skill's Phase 1 structure).spec_status— enum (draft/approved/superseded). Namedspec_status, notstatus, for the same collision-avoidance reason established during the Jira recipe'ssprint_statusnaming (avoids colliding in meaning with coretask.status).
plan (schema-only, no extends):
approach—field_type: "string". Technical approach/component breakdown (the "how," as opposed to spec's "what/why").risks—field_type: "string", free text.plan_status— enum (draft/approved/superseded).- Relationship:
plan.spec/spec.plans— Many/One (a plan targets exactly one spec; a spec may accumulate multiple superseding plan revisions over time, usingsupersededstatus rather than deletion).
task (existing core type, unmodified by this issue) — same treatment as the Jira/Linear recipes: no wrapper schema.
- Relationship:
task.plan/plan.tasks— Many/One. - Relationship:
task.spec/spec.tasks— Many/Many, added directly (not only reachable viaplan) so a task's lineage to its governing spec is a single-hop query even when a plan also exists, and so the "task must reference a spec" Invariant Play (below) has a direct relationship to check. custom:verification_method— new field viaadd_field_values(ADR-076,Accepted) ontotask, namespacedcustom:per ADR-063 (extending a core type outside anextendsschema requires a namespace prefix) —field_type: "string". How completion will be verified (e.g. "test:bun run test:all", "manual: steps"), matching Phase 3/4's verification-method requirement across all three researched tools.
Plays (all RuleClass::Invariant, mirroring the Jira recipe's Sprint Plays exactly — synchronous, in-transaction, fail-closed)
- Plan requires approved spec — creating or approving a
planrequires itsplan.spectarget to havespec_status == approved. Rejected otherwise. - Task requires spec (the rule this issue was scoped around) — creating a
taskwithtask.planset requirestask.specto be non-empty, and requires the referencedplan.plan_status == approved. The absence of the relationship itself is the durable, visible signal this Play checks — no content-scanning, no dependency on mention-edge traversal. - Task-done requires verification method — transitioning
task.statustodonerequirescustom:verification_methodto be non-empty. Covers the researched tools' "converge"/verification step usingtask.statusdirectly rather than introducing a new state machine. - Spec/plan supersession lock — once
spec_status/plan_status == superseded, reject further edits to that node's core content fields (mirrors the Jira recipe's Sprint close-lock Play) — forces a new spec/plan node rather than silently rewriting history, keeping the artifact trustworthy as a stable source of truth for anything that references it.
Seeded skills for post-install usage guidance
Per the precedent established for both the Linear-style and Jira-style recipes (seeded narrow skills for system-wide/cross-schema usage narrative, not just schema-level field descriptions), this recipe requires seeded skills — and here they carry an additional responsibility beyond "how the mechanism works": actively eliciting real content for objective/success_criteria/boundaries/verification_method, not just a value that satisfies the Invariant Play's non-empty check. A Play can only enforce presence, not quality — an empty-but-technically-non-empty spec (e.g. objective: "n/a") would pass every Play in this issue while being useless to any plan, task, or unrelated entity that later references or mentions it. This mirrors the researched tools' own emphasis (Osmani skill: "surface assumptions immediately before drafting," "ask clarifying questions until requirements are concrete").
- "Writing a Spec" — the
objective/success_criteria/boundariesshape; instructs the agent to actively probe for missing detail (ask the user rather than invent unstated success criteria, and rather than leave a field thin/placeholder) before settingspec_status: approved. - "Writing a Plan from a Spec" — the
plan.specrelationship requirement; instructs the agent to fetch and actually use the parent spec'sobjective/success_criteriacontent when draftingplan.approach, not just create the link. - "Creating Implementation Tasks" — the
task.spec/task.planrelationship requirement; explains why the Invariant Play rejects a task with no spec link, and how to link to an existing spec/plan rather than creating a redundant one. - "Completing a Spec-Driven Task" — the
custom:verification_methodrequirement; instructs the agent to write a real, checkable method before transitioningtask.statustodone, not a placeholder string.
Full skill content
Written against the real seeded-skill pattern (packages/agent/src/skill_pipeline.rs's NodeTemplate shape — description for retrieval matching, tool_whitelist, max_iterations, markdown_content as the skill's actual body). Tool names verified against the real Tool enum (packages/agent/src/local_agent/tools.rs). Provided here as concrete starting content for spec_driven.rs's skills: Vec<NodeTemplate> entries — refine during implementation, but this is not placeholder/illustrative text the way the one-line summaries above are; it's meant to be usable close to as-is.
1. "Writing a Spec"
description: "Capture what's being built and why, before any plan or implementation exists — objective, testable success criteria, and boundaries (always do / ask first / never do). Use when the user wants to start new work under spec-driven development, says 'write a spec', 'let's spec this out', 'define requirements', or starts describing a feature/fix with no existing spec node to link to."
tool_whitelist: ["create_node", "update_node", "search_nodes", "get_node"]
max_iterations: 4
# Writing a Spec
A spec is the source of truth a plan and every task downstream will be judged against. A thin spec produces a thin plan and untraceable tasks — the Invariant Play on `plan` only checks that `spec_status == approved`, it cannot check whether the spec says anything real. That judgment is yours, now, before you set `spec_status: approved`.
CHECK FOR AN EXISTING SPEC FIRST: search_nodes(node_type="spec") before creating a new one — a second spec for the same objective fragments lineage instead of extending it.
DO NOT INVENT SUCCESS CRITERIA. If the user's request doesn't state how "done" will be verified, ASK them. A guessed success criterion is worse than an empty one — it becomes false confidence for every plan and task that inherits it.
REQUIRED FIELDS, all in field_values: `objective` (what/why/who, in the user's own terms — not a restatement of the task title), `success_criteria` (testable conditions — "runs `bun run test:all` with zero new failures," not "works correctly"), `boundaries` (what you will always do without asking, what needs the user's ok first, what you will never do unless explicitly told to). Leaving any of these thin or placeholder ("n/a", "TBD", "see title") defeats the reason this node exists — every field is a real question; ask it if you don't know the answer.
SET spec_status: draft first. Only set it to approved once the user has confirmed the objective and success criteria are correct — approval is what unblocks plan creation, so do not set it unprompted on the same turn you create the spec unless the user has already reviewed the content in this conversation.
SUCCESS: after create_node returns, tell the user what was captured (objective + success criteria, verbatim) and ask them to confirm before you approve it. Do not proceed to a plan in the same turn.2. "Writing a Plan from a Spec"
description: "Draft the technical approach for an approved spec — components, sequencing, risks — and link it back with a spec relationship. Use when the user wants to move from an approved spec to implementation planning, says 'let's plan this out', 'what's the approach', or asks for a plan for an existing spec."
tool_whitelist: ["create_node", "update_node", "create_relationship", "search_nodes", "get_node"]
max_iterations: 4
# Writing a Plan from a Spec
A plan without its spec's actual content behind it is just a guess wearing a plan's shape. Before drafting `approach`, fetch the linked spec's `objective` and `success_criteria` with get_node and read them — do not draft a plan from the spec's title alone.
THE PLAY WILL REJECT AN UNAPPROVED SPEC: creating a plan against a spec whose `spec_status` is not `approved` is rejected outright by an Invariant Play — this is not a soft warning, the write fails. If the linked spec is still `draft`, tell the user it needs approval first rather than attempting the plan anyway.
THE RELATIONSHIP IS REQUIRED, NOT OPTIONAL CONTEXT: use create_relationship to set `plan.spec` pointing at the spec node — this is a declared schema relationship, not a `nodespace://` mention in the content. A plan created without this relationship has no lineage and cannot be linked to by any task later.
REQUIRED FIELDS: `approach` (major components, dependencies, sequencing — reference the spec's actual success criteria by name, not by paraphrase), `risks` (what could go wrong, real risks specific to this approach — not a boilerplate list).
IF A SPEC ALREADY HAS AN APPROVED PLAN: check spec.plans via get_node before creating a second one. A new plan for an already-approved spec should usually mean the prior plan is being superseded — ask the user whether to set the old plan's `plan_status` to `superseded` rather than leaving two active plans against the same spec.
SUCCESS: after create_node and create_relationship both succeed, confirm the plan's approach and risks to the user and ask for approval before any task is created against it.3. "Creating Implementation Tasks"
description: "Create a task that implements part of an approved plan, with the required spec and plan relationships. Use when the user wants to break a plan into concrete work items, says 'create tasks for this plan', 'let's start implementing', or asks to turn a plan into actionable work."
tool_whitelist: ["create_node", "create_relationship", "search_nodes", "get_node"]
max_iterations: 4
# Creating Implementation Tasks
A task under spec-driven development is not a bare task — it must trace to the spec and plan that justify it. An Invariant Play rejects any task creation that sets `task.plan` without a non-empty `task.spec`, and separately requires the linked plan's `plan_status` to be `approved`. Both checks run on write; there is no way to create the task first and link it later to slip past them.
BEFORE CREATING: get_node on the plan to confirm `plan_status == approved`. If it isn't, tell the user the plan needs approval first — do not create the task anyway and expect the write to succeed.
SET BOTH RELATIONSHIPS: create_relationship for `task.plan` (the plan this task implements) AND `task.spec` (the governing spec — set this directly, even though the plan already links to the same spec, so the task's lineage to its spec is a one-hop query on its own). A task missing either relationship either fails the Invariant Play or has no real traceability.
DO NOT LINK TO A SPEC WITHOUT AN APPROVED PLAN just to satisfy the relationship count — the Play checks for an approved plan specifically, and a task that only points at a spec with no plan is not what this methodology is for. If there's no plan yet, use "Writing a Plan from a Spec" first.
DO NOT CREATE A REDUNDANT SPEC/PLAN: if the user is asking for "a task for X" and a spec/plan for X already exists, link to it — search_nodes(node_type="spec") / search_nodes(node_type="plan") first.
SUCCESS: after create_node and both create_relationship calls succeed, confirm to the user which spec and plan the task traces to.4. "Completing a Spec-Driven Task"
description: "Mark a spec-driven task done, with a real verification method recorded first. Use when the user says a task is finished, wants to close it out, or asks to mark a task done under spec-driven development."
tool_whitelist: ["update_node", "update_task_status", "get_node"]
max_iterations: 3
# Completing a Spec-Driven Task
A task cannot transition to `done` without `custom:verification_method` already set — an Invariant Play rejects the status change otherwise. Set the field before calling update_task_status, not after; a failed status transition does not roll back cleanly if the two calls are attempted in the wrong order.
WRITE A REAL VERIFICATION METHOD, NOT A PLACEHOLDER. "done" or "tested" is not a verification method and adds nothing for anyone tracing back through this task later. Say what was actually run or checked: "test: `bun run test:all`, 0 new failures" or "manual: reproduced steps 1-4 from the spec's success_criteria, confirmed expected output." If nothing was actually verified, say so honestly rather than writing something that reads as if it was — do not fabricate a check that didn't happen.
PREFER THE SPEC'S OWN SUCCESS CRITERIA: get_node on the task's linked spec and check whether `success_criteria` describes a specific check — if so, verification_method should say explicitly whether that exact criterion was met, not a generic substitute.
SET custom:verification_method via update_node's field_values first, THEN call update_task_status(status="done") — two separate calls, in this order.
SUCCESS: after update_task_status confirms the transition, tell the user what verification method was recorded.Implementation Approach
Corrected from this issue's original text, which described delivery as a TypeScript spec-driven.ts step array under packages/desktop-app/src/lib/methodology-recipes/, per #2596's original pre-implementation design. That design was superseded by the real, shipped Rust implementation (packages/core/src/methodology/, first exercised by the Linear-style Playbook, PR #2777) — this section now targets that real shape directly.
This recipe is delivered as a MethodologyPlaybook value in packages/core/src/methodology/spec_driven.rs, mirroring the shipped packages/core/src/methodology/linear.rs exactly: a schemas: Vec<SchemaStep>, field_value_extensions: Vec<FieldValueExtension>, plays: Vec<PlayStep>, skills: Vec<NodeTemplate> (markdown files under packages/core/src/methodology/skills/spec_driven/, matching skills/linear/*.md), and views: Vec<ViewStep> (per #3135). Concretely:
schemas—spec,planfield_value_extensions—custom:verification_methodontotask(anadd_field_valuespayload)plays— all four Invariant Plays listed aboveskills— all four seeded skills listed above, as markdown filesviews— see Seed default views (Kanban/list/table QueryNodes) as part of a Playbook install #3135; at minimum a Tasks-by-status board scoped to this recipe's lineage, decided during implementation
This issue does not implement install_playbook, the GUI onboarding/Settings wiring, or the generated packages/skill/references/*.md pipeline itself — those are shared infrastructure, already built and exercised by the shipped Linear Playbook. This issue is a consumer of that infrastructure, contributing spec_driven.rs's content and its onboarding wizard picker option ("Spec-driven").
How the four skills reach an agent at runtime
packages/skill/SKILL.md (the external-agent-facing file) is deliberately scoped to core NodeSpace operations only — it carries no methodology-specific content and stays near Anthropic's own ~5,000-token recommended ceiling for a skill body (confirmed: the real file is ~20k characters/317 lines, already at that ceiling). None of the four skills above are added to it. Instead, they become reachable through the two mechanisms already built for exactly this:
- External agent:
nodespace skill guidance "<task>"(packages/cli/src/commands/skill.rs,run_guidance) — reuses the existingSearchNodesRPC scoped tonode_type = "skill", with no hardcoded list of which skills it returns. Once this recipe is installed, its four seededskillnodes are automatically part of what this command can surface — no change to the command itself is required. Results carry a provenance banner/"provenance": "graph-fetched"marker (seepackages/skill/references/graph-authored-guidance.md) since this is live graph data, not shipped skill content. - Local/in-app agent:
search_skills→find_skills(packages/core/src/ops/skill_ops.rs), per ADR-038's similarity-threshold retrieval — same automatic discovery, no recipe-specific wiring needed.
This issue's create_skill steps only need to seed the four nodes correctly (per ADR-057's shape: description/tool_whitelist/max_iterations root properties, markdown children as the body) — discovery and fetch are already-built, generic infrastructure this recipe consumes, not something it needs to implement.
Architecture Impact
This recipe's schemas and Plays depend directly on ../nodespace-docs/decisions/078-schema-extends-relationship-for-field-composition.md (ADR-078, for scope-relative task.status resolution used by Play 3), ../nodespace-docs/decisions/076-schema-field-value-extension-and-task-status-enforcement.md (ADR-076, add_field_values, Accepted, for custom:verification_method), and ../nodespace-docs/decisions/063-namespace-prefixes-scope.md (ADR-063, namespace prefix requirement for the same field) — exactly as both prior recipes depend on these mechanisms; this issue is a consumer, not a reversal or extension of any of them. ../nodespace-docs/decisions/075-playbooknode-installable-bundle-record.md (ADR-075) governs this recipe's install/bundle-tracking shape, unchanged by this issue. No existing ADR documents a spec/plan/task lineage or approval-gating concept — confirmed via search of ../nodespace-docs/decisions/, ../nodespace-docs/architecture/, ../nodespace-docs/components/ for spec-driven/approval-adjacent terms; this issue introduces new methodology-recipe content, not a reversal of prior architecture.
Acceptance Criteria
-
spec,planschema-only types defined as specified -
plan.spec/spec.plans(Many/One) andtask.spec/spec.tasks(Many/Many),task.plan/plan.tasks(Many/One) relationship pairs declared -
custom:verification_methodfield added totaskviaadd_field_values - Invariant Play: plan creation/approval requires
spec_status == approvedon its linked spec - Invariant Play: task creation (with
task.planset) requires non-emptytask.specand an approved linked plan - Invariant Play:
task.statustransition todonerequires non-emptycustom:verification_method - Invariant Play:
spec_status/plan_status == supersededrejects further edits to that node's core content fields - Four seeded skills authored as specified, each instructing the agent to elicit substantive field content (not just relationship presence) before advancing a stage
- All of the above expressed as a
MethodologyPlaybookinpackages/core/src/methodology/spec_driven.rs, mirroring the shippedlinear.rs's real structure — not standalone implementation code - At least one default view seeded (
MethodologyPlaybook.views, per Seed default views (Kanban/list/table QueryNodes) as part of a Playbook install #3135), or an explicit documented decision that no default view suits this recipe's lineage-gate-heavy shape - "Spec-driven" onboarding wizard/Settings option installs this Playbook via the shared
install_playbookexecution path - After install, all four seeded skills are returned by
nodespace skill guidance "<relevant task>"(external agent) and bysearch_skills/find_skills(local agent) — no changes to either mechanism required, verifying this recipe's seeded skill nodes are correctly discoverable - Tests pass (
bun run test:all) - Code passes
bun run quality:fix
Technical Specifications
Reference Files
packages/core/src/models/core_schemas.rs—taskschema (unmodified base), pattern for Many/One and Many/Many relationship declarations (project.tasks,person.tasks)packages/nodespace-types/src/schema.rs—SchemaRelationship(target_type: Option<String>)packages/core/src/playbook/types.rs—RuleClass::Invariant(~line 137),GraphEventType::RelationshipAdded/RelationshipRemoved/PropertyChanged(~line 172)packages/core/src/playbook/graph_resolver.rs—resolve_path/fetch_related_nodes(~line 188), confirms schema-declared-relationship-only traversal (the reason lineage uses relationships, not mentions)packages/core/src/playbook/actions.rs—trigger.node.mentions(~line 1603), confirms mentions are exposed as a flat ID array only, no field-level path resolutionpackages/core/src/services/node_service/relationship.rs—get_mentions/get_mentioned_by(~lines 337, 369), the mentions system this recipe deliberately does not use for lineage../nodespace-docs/components/mentions-and-references.md— mentions system reference, confirmsrelationship_type = 'mentions', automatic content-edit-driven creation../nodespace-docs/decisions/078-schema-extends-relationship-for-field-composition.md— scope-relative status resolution../nodespace-docs/decisions/076-schema-field-value-extension-and-task-status-enforcement.md—add_field_values../nodespace-docs/decisions/063-namespace-prefixes-scope.md— namespace prefix requirement forcustom:verification_methodpackages/agent/src/skill_pipeline.rs— seeded skill pattern (seed_skill_nodes) to follow for the four skills specified abovepackages/cli/src/commands/skill.rs—run_guidance(~line 342), the external-agent fetch path that automatically surfaces this recipe's seeded skills once installed, no changes needed herepackages/skill/references/graph-authored-guidance.md— trust-boundary/provenance-marker doc governing how fetched skill content (including this recipe's) must be treated by an external agentpackages/core/src/ops/skill_ops.rs—find_skills(~line 299), the local-agent equivalent discovery pathpackages/core/src/methodology/mod.rs,packages/core/src/methodology/linear.rs,packages/core/src/methodology/install.rs— the real, shippedMethodologyPlaybook/install_playbookimplementation this issue'sspec_driven.rsmust match the shape of
Dependencies
- Add core blocks/blocked_by, relates_to/duplicates, and creator relationships on task #2637 (core
blocks/relates_to/creator relationships ontask) — same dependency both prior recipes share for core task-relationship support
(#2596, the original Playbook-mechanism design issue, is no longer listed as a dependency — it's closed, superseded by the real shipped implementation in packages/core/src/methodology/ this recipe targets directly.)
Related Issues
- The shipped Linear-style Playbook (
packages/core/src/methodology/linear.rs, PR Add the Linear-style methodology recipe, installable from onboarding or Settings (closes #2596) #2777) — direct implementation-pattern precedent - Add methodology recipe: Jira-style work tracking (Epic/Story/Bug hierarchy, Sprints) #2652 (Jira-style Playbook) — sibling recipe, same design pattern; this issue's declared-relationship-over-mentions reasoning and seeded-skill content-elicitation requirement apply equally in spirit to both siblings, though neither required it explicitly since neither has an approval-gated lineage chain
- Seed default views (Kanban/list/table QueryNodes) as part of a Playbook install #3135 (seed default Playbook views) — this recipe gains a view-seeding acceptance criterion from it
Non-Goals
- No
constitutionschema — one-time, rarely-changing project-wide principles belong in existing doc/skill content the agent reads, not a schema in the repeating spec→plan→task loop (Spec Kit's own/speckit-constitutionruns once per project, outside the per-feature cycle) - No
converge/re-verification loop state machine —custom:verification_methodplus existingtask.statuscovers the researched tools' convergence step; a dedicated convergence-tracking mechanism is unjustified scope beyond what any Play/query needs today - Extending the mentions system with field-level path resolution through
graph_resolver.rs— a real gap, confirmed during this issue's design, but explicitly out of scope since this recipe's lineage does not depend on it (mentions remain for informal supporting context only); left for a future issue if a real need for mention-based Play conditions surfaces elsewhere
Activity
malibio commentedon Sep 16, 2026
Set to Blocked: depends on #2637 (core
blocks/relates_to/creator relationships ontask), same as sibling recipes #2596 and #2652.malibio commentedon Sep 26, 2026
Unblocking: this recipe's named dependency, #2637 (core blocks/relates_to/creator relationships on task), is now closed. Note #2659 also depends on #2596 (the recipe mechanism itself) per its Implementation Approach section — #2596 is closed/implemented, so that dependency is clear too. Moving to Backlog — ready to implement.
malibio commentedon Sep 27, 2026
Frontend baseline: 281 files / 5444 tests passed
Add spec-driven methodology playbook (closes #2659)
Add spec-driven methodology playbook (closes #2659)
Add spec-driven methodology playbook (closes #2659)
Add spec-driven methodology playbook (closes #2659)
Add spec-driven methodology playbook (closes #2659)