packages/qfai/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md
Create and update layered SDD artifacts ( policies + spec-XXXX) in one workflow.
npx skillsauth add aganesy/qfai qfai-sddInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
[DRIFT-PROTOCOL:MANDATORY]
"Create new spec-XXXX (${subject}) in category ${category}. Approve?"
Choices: ["Approve", "Reject"]"Delete spec-XXXX (${subject}). Reason: ${rationale}. Approve?"
Choices: ["Approve", "Reject"]delta.md..qfai/** artifact, read and follow:
.qfai/require/README.md.qfai/specs/README.md.qfai/contracts/**/README.md.qfai/evidence/README.md.qfai/assistant/steering/agent-catalog.yml.qfai/assistant/steering/agent-routing.yml.qfai/assistant/steering/review-profiles.yml.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md.qfai/assistant/skills/qfai-sdd/templates/report/preflight_summary.mdDetermine preflight input in this order:
.qfai/discussion/discussion-*/ pack (lexicographically largest)01_Context.md .. 99_delta.md), minimum contents, and no blocking OQ./qfai-sdd and guide to:
/qfai-discussion for discussion-pack generation/fixThen read inputs in this order:
.qfai/assistant/instructions/*.qfai/assistant/steering/*.qfai/specs/<spec-id>/** (if updating).qfai/discussion/**, .qfai/require/**, .qfai/contracts/**This section is mandatory and overrides any conflicting fallback text in this file.
Simulation mode allowed.Subagents: simulated (reason: <why unavailable>)User approval: <quote or reference>Every major artifact in this stage MUST include a ## Work Orders Summary section with this fixed table schema:
| Step | Role (sub-agent) | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE) | | ---- | ---------------- | ---------- | ------------ | ------------- | -------------------- | | 1 | <role> | <task> | <refs> | <refs> | PASS/REVISE |
Output (refs) must point to in-file anchors or relative evidence file paths.requirements-analyst drafts requirement-aligned spec content and open-question handling.solution-architect drafts structural, contract, and architecture-sensitive sections.test-design-analyst drafts traceability, examples, and test-design structure.product-experience-architect only when the target is UI-bearing.orchestrator consolidates delegated outputs and presents them to the user for confirmation.completion-reviewer is delegated independently and returns only PASS or REVISE./qfai-sdd is invoked without <spec-id-or-name>, treat the run as an all-capability batch..qfai/specs/_policies/03_Capabilities.md and keep spec-0001..N mapping stable by Capability order.qfai-sdd in .qfai/assistant/steering/agent-routing.yml..qfai/evidence/sdd-spec-XXXX.md..qfai/evidence/sdd-batch-<timestamp>.md.## Work Orders Summary.completion-reviewer.qfai validate --fail-on error --format github completed with error=0..qfai/report/validate.log and .qfai/report/specs-coverage/spec-*.md are present.QFAI-COV-201/202/203/204/205/206 are 0.QFAI-ATDD-101/102/103/111/112/113/121/122 are 0.QFAI-COV-207 warnings are reviewed as density-smell signals.steering/test-layers.md and the project plan.tests/e2e/** -> QFAI:SPEC-XXXX:US-YYYYtests/integration/** -> QFAI:SPEC-XXXX:TC-YYYYtests/api/** -> QFAI:CON-API-XXXX (and no TC annotations).qfai/assistant/steering/agent-routing.yml and .qfai/assistant/steering/review-profiles.yml.completion-reviewerarchitecture-reviewer for structural / contract / CLI changesproduct-surface-reviewer for UI-bearing specsqa-gatekeeper when validate, coverage, runtime, or prototyping evidence is affectedPASS.FAIL.Task title: <short>
Role: <sub-agent role>
Goal: <what to decide/produce>
Inputs (refs):
- <file/section>
Constraints:
- must: enforce Drift Protocol (no upstream edits without user approval + CR)
- must: verify plan/test-layer adherence (`steering/test-layers.md` + plan)
- must: check `qfai validate --fail-on error` passes with evidence (`error=0`)
- must: enforce `.qfai/assistant/steering/test-layers.md` hard gates
- must_not: accept test-volume ratios/floors as a hard gate
- must_not: accept upstream edits made directly by downstream phase
Output format:
- <headings / bullet schema>
Quality bar:
- PASS if ...
- REVISE if ...
Result: PASS | REVISE
Findings:
- <issue>
Required fixes:
- <action>
Evidence checked:
- <refs>
.qfai/assistant/steering/agent-routing.yml..qfai/assistant/steering/review-profiles.yml..qfai/assistant/skills/qfai-sdd/references/rcp_footer.md.PASS, FAIL.FAIL triggers targeted rerun for the failed reviewer and reviewers affected by the changed scope.fixed is forbidden until all routed blocking reviewers are PASS.Before moving forward in this stage, refresh these files:
.qfai/assistant/steering/manifest.md.qfai/assistant/steering/product.md.qfai/assistant/steering/structure.md.qfai/assistant/steering/tech.mdRules:
<...>, TBD, stale facts).09_delta.md (or *_delta.md).[RE-OPEN] decision record with explicit approval evidence.US->AC->BR->EX->TC).08_Open-questions.md (spec scope) or _policies/09_Open-questions.md (shared scope).Before any spec creation, update, or deletion, the agent MUST:
_policies/11_Slice-Policy.md as the SSOT for spec slicing decisions._policies/11_Slice-Policy.md is missing, stale, or no longer matches the repository structure, create or update it before continuing._policies/11_Slice-Policy.md to decide whether each detected change is CREATE, UPDATE, or DELETE._policies/11_Slice-Policy.md exists and reflects the current slicing model./qfai-sdd <spec-id-or-name> [--auto]): update only the matched single spec target./qfai-sdd): target all capabilities listed in _policies/03_Capabilities.md._policies/03_Capabilities.md or _policies/11_Slice-Policy.md does not exist, bootstrap shared templates first, then enumerate capabilities._policies/03_Capabilities.md is SSOT for spec-0001..N assignment and ID stability..qfai/assistant/skills/qfai-sdd/templates/specs/.qfai/assistant/skills/qfai-sdd/templates/contracts/.qfai/report/preflight_summary.md before generating shared/spec artifacts..qfai/contracts/(api|db|ui)/** before shared/spec slices_policies/05_Contracts.md must include a Contract Index with short IDs (DB-001, API-001, UI-001)QFAI-CONTRACT-ID:
DB-001 -> CON-DB-0001 -> db-0001-<slug>.sqlAPI-001 -> CON-API-0001 -> api-0001-<slug>.yamlUI-001 -> CON-UI-0001 -> ui-0001-<slug>.yaml<slug> comes from entity/router/screen and must be sanitized to kebab-case/qfai-sdd must stop when discussion-pack is missing/incomplete or has blocking OQ (guide to /qfai-discussion first)..qfai/assistant/steering/agent-routing.yml and .qfai/assistant/steering/review-profiles.yml..qfai/assistant/skills/qfai-sdd/references/rcp_footer.md._policies/04_Business-Flow.md must be Markdown and include at least one Mermaid flowchart or sequenceDiagram.*Business-flow*.feature is deprecated).```mermaid fences only.05_Examples.md must include EX-ID and BR-Ref mappings.06_Test-Cases.md must include TC-ID, EX-Ref, AC-Refs, and Type (normal/error/boundary/edge).06_Test-Cases.md quality depth: each AC must have at minimum one normal-path and one error/boundary test case. Normal-path-only coverage is incomplete.qfai validate --fail-on error --format github | tee .qfai/report/validate.log exits successfully..qfai/report/specs-coverage/spec-*.md has been read for density review..qfai/specs/README.md must be enforced:
specs/ definition-only and keep operational status as execution logs under .qfai/report/run-*.Create/update:
.qfai/contracts/api/**.qfai/contracts/db/**.qfai/contracts/ui/**_policies/05_Contracts.md Contract Index table (DB/API/UI short IDs)Rules:
_policies/05_Contracts.md lists an ID, the corresponding declared contract file MUST exist.QFAI-CONTRACT-ID.none is allowed only when there is no contract impact and rationale is written.Create/update:
_policies/01_Objective.md_policies/02_Initiative.md_policies/03_Capabilities.md_policies/04_Business-Flow.md_policies/05_Contracts.md_policies/06_Glossary.md_policies/07_Constraints.md_policies/08_Decisions.md_policies/09_Open-questions.md_policies/10_delta.md_policies/11_Slice-Policy.mdRules:
TBD is allowed, but each TBD must be mirrored into _policies/09_Open-questions.md._policies/04_Business-Flow.md must include Mermaid and keep diagram syntax inside ```mermaid fences._policies/08_Decisions.md and _policies/10_delta.md must exist even when empty, and must explicitly state 0 items._policies/11_Slice-Policy.md must be created or refreshed in this phase and must explain:
_policies/11_Slice-Policy.md disagree, update the policy file first and record the decision in delta.Create/update:
spec-XXXX/01_Spec.mdspec-XXXX/02_User-stories.mdspec-XXXX/03_Acceptance-Criteria.mdspec-XXXX/04_Business-Rules.mdspec-XXXX/05_Examples.mdspec-XXXX/06_Test-Cases.mdspec-XXXX/07_Decisions.mdspec-XXXX/08_Open-questions.mdSlice gate (must pass before Phase 3):
SC tags must align with the target spec-XXXX namespace.07_Decisions.md and 08_Open-questions.md must exist even when empty and include explicit 0 items statements.01_Spec.md is the execution Primary SSOT and MUST copy down applicable NFR, policy, evidence summary, relevant requirements, and an Escalation Hook to _policies.Create/update:
spec-XXXX/10_Plan.mdRules:
spec-XXXX/10_Plan.md is the single source of truth for How.specs/plan.md.Create/update:
spec-XXXX/09_delta.md (or spec-XXXX/*_delta.md)Rules:
DO NOT and Temptation.Before declaring completion, you MUST:
TBD, TODO, ???, OPEN QUESTION, etc.) unless explicitly deferred.qfai validate --fail-on error --format github | tee .qfai/report/validate.log.qfai/report/specs-coverage/spec-*.mderror=0.Create or update layered SDD artifacts in one run so downstream execution phases can start without command switching.
.qfai/specs/_policies/01_Objective.md.qfai/specs/_policies/02_Initiative.md.qfai/specs/_policies/03_Capabilities.md.qfai/specs/_policies/04_Business-Flow.md.qfai/specs/_policies/05_Contracts.md.qfai/specs/_policies/06_Glossary.md.qfai/specs/_policies/07_Constraints.md.qfai/specs/_policies/08_Decisions.md.qfai/specs/_policies/09_Open-questions.md.qfai/specs/_policies/10_delta.md.qfai/specs/_policies/11_Slice-Policy.md.qfai/specs/spec-XXXX/01_Spec.md.qfai/specs/spec-XXXX/02_User-stories.md.qfai/specs/spec-XXXX/03_Acceptance-Criteria.md.qfai/specs/spec-XXXX/04_Business-Rules.md.qfai/specs/spec-XXXX/05_Examples.md.qfai/specs/spec-XXXX/06_Test-Cases.md.qfai/specs/spec-XXXX/07_Decisions.md.qfai/specs/spec-XXXX/08_Open-questions.md.qfai/specs/spec-XXXX/10_Plan.md.qfai/specs/spec-XXXX/09_delta.md (or *_delta.md).qfai/contracts/** (mandatory in this workflow).qfai/report/preflight_summary.md.qfai/evidence/sdd-spec-XXXX.md.qfai/discussion/discussion-*, lexicographically largest) and run readiness checks./qfai-discussion..qfai/report/preflight_summary.md from templates/report/preflight_summary.md._policies/05_Contracts.md index and .qfai/contracts/** are aligned._policies/11_Slice-Policy.md exists and matches the current repository slicing model before any CREATE / UPDATE / DELETE spec decision.10_Plan.md actionable as How-only.qfai validate --fail-on error --format github | tee .qfai/report/validate.log..qfai/report/specs-coverage/spec-*.md and QFAI-COV-207 warnings.error=0.Run static checks:
_policies and spec-XXXX layered files exist._policies/11_Slice-Policy.md exists and matches the repository's current slice model._policies/04_Business-Flow.md includes Mermaid and at least one flowchart or sequenceDiagram.01_Spec.md includes copy-down context and Escalation Hook to _policies.```text or language-less fences.05_Examples.md provides EX-ID + BR-Ref mappings.06_Test-Cases.md provides TC-ID + EX-Ref + AC-Refs + Type.06_Test-Cases.md includes error/boundary/edge test cases, not only normal paths.US -> AC -> BR -> EX -> TC.QFAI-COV-201/202/203/204/205/206 are zero.QFAI-ATDD-101/102/103/111/112/113/121/122 are zero when test assets are in review scope..qfai/report/specs-coverage/spec-*.md was reviewed and QFAI-COV-207 warnings were triaged.10_Plan.md exists and contains implementation/test strategy as How-only.specs/plan.md does not exist.09_delta.md (or *_delta.md) includes rejected guardrails (DO NOT, Temptation) when rejections exist.Create and update: .qfai/evidence/sdd-<spec-id>.md
Required sections:
.qfai/report/preflight_summary.md).qfai/report/validate.log, .qfai/report/specs-coverage/spec-*.md)When declaring DONE, include:
09_delta.md (or *_delta.md).qfai/report/preflight_summary.md was generated before spec authoring._policies/05_Contracts.md index and .qfai/contracts/** declared files are aligned._policies + spec-XXXX outputs exist and are internally consistent._policies/11_Slice-Policy.md exists and was created or refreshed before spec slice decisions._policies/04_Business-Flow.md is Markdown + Mermaid (flowchart or sequenceDiagram).```text or language-less fences.10_Plan.md is finalized with implementation/test strategy (How-only).specs/plan.md was not created.09_delta.md (or *_delta.md) contains adoption/rejection rationale.qfai validate --fail-on error --format github ran and produced error=0.QFAI-COV-201/202/203/204/205/206 are all zero.QFAI-ATDD-101/102/103/111/112/113/121/122 are all zero when test assets are in scope..qfai/report/specs-coverage/spec-*.md was reviewed for density-smell signals (QFAI-COV-207).When this skill is complete, provide a final user-facing completion message and enumerate all actionable next steps.
/qfai-prototyping.
Action: build contract-aligned skeleton implementation before deeper coding./qfai-atdd.
Action: implement acceptance tests from the finalized spec pack..qfai/contracts/** and referenced by _policies/05_Contracts.md./qfai-sdd.
Action: fix layered _policies + spec-XXXX consistency and decision records, then regenerate evidence.testing
# /qfai-prototyping-full-harness [DRIFT-PROTOCOL:MANDATORY] Premium prototyping skill with planner/generator/evaluator iteration loop. Full-harness mode is an **explicit, non-default** path activated only via `qfai prototyping --mode full-harness` or discussion artifact recommendation. > This skill defines a real execution workflow — it is NOT a routing-only redirect. ## When to Use - Projects requiring L3–L5 fidelity evidence (production-ready prototypes). - Evaluation needs: weighted mult
testing
# /qfai-prototyping-full-harness [DRIFT-PROTOCOL:MANDATORY] Premium prototyping skill with planner/generator/evaluator iteration loop. Full-harness mode is an **explicit, non-default** path activated only via `qfai prototyping --mode full-harness` or discussion artifact recommendation. > This skill defines a real execution workflow — it is NOT a routing-only redirect. ## When to Use - Projects requiring L3–L5 fidelity evidence (production-ready prototypes). - Evaluation needs: weighted mult
testing
Run and document quality gates (repo + qfai validate/report), fix until PASS.
testing
Implement a minimum runnable skeleton for ALL specs and block DONE until evidence + validate gate pass.