|
1 | 1 | --- |
2 | | -name: "speckit-plan" |
3 | | -description: "Execute the implementation planning workflow using the plan template to generate design artifacts." |
4 | | -compatibility: "Requires spec-kit project structure with .specify/ directory" |
| 2 | +name: speckit-plan |
| 3 | +description: Generate technical implementation plans from feature specifications. |
| 4 | +compatibility: Requires spec-kit project structure with .specify/ directory |
5 | 5 | metadata: |
6 | | - author: "github-spec-kit" |
7 | | - source: "templates/commands/plan.md" |
| 6 | + author: github-spec-kit |
| 7 | + source: preset:security-governance |
8 | 8 | --- |
9 | 9 |
|
| 10 | +# Speckit Plan Skill |
10 | 11 |
|
11 | | -## User Input |
12 | | - |
13 | | -```text |
14 | | -$ARGUMENTS |
15 | | -``` |
16 | | - |
17 | | -You **MUST** consider the user input before proceeding (if not empty). |
18 | | - |
19 | | -## Pre-Execution Checks |
20 | | - |
21 | | -**Check for extension hooks (before planning)**: |
22 | | -- Check if `.specify/extensions.yml` exists in the project root. |
23 | | -- If it exists, read it and look for entries under the `hooks.before_plan` key |
24 | | -- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally |
25 | | -- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default. |
26 | | -- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions: |
27 | | - - If the hook has no `condition` field, or it is null/empty, treat the hook as executable |
28 | | - - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation |
29 | | -- For each executable hook, output the following based on its `optional` flag: |
30 | | - - **Optional hook** (`optional: true`): |
31 | | - ``` |
32 | | - ## Extension Hooks |
33 | | -
|
34 | | - **Optional Pre-Hook**: {extension} |
35 | | - Command: `/{command}` |
36 | | - Description: {description} |
37 | | -
|
38 | | - Prompt: {prompt} |
39 | | - To execute: `/{command}` |
40 | | - ``` |
41 | | - - **Mandatory hook** (`optional: false`): |
42 | | - ``` |
43 | | - ## Extension Hooks |
44 | | -
|
45 | | - **Automatic Pre-Hook**: {extension} |
46 | | - Executing: `/{command}` |
47 | | - EXECUTE_COMMAND: {command} |
| 12 | +Before continuing, apply the Security Governance preset: |
48 | 13 |
|
49 | | - Wait for the result of the hook command before proceeding to the Outline. |
50 | | - ``` |
51 | | -- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently |
| 14 | +- plan explicit MSL applicability or non-MSL justification work when relevant |
| 15 | +- plan explicit secure-development verification work |
| 16 | +- plan dependency and supply-chain evidence updates where relevant |
| 17 | +- surface security review checkpoints instead of leaving them implicit |
52 | 18 |
|
53 | | -## Outline |
| 19 | +Before continuing, apply the Architecture Governance preset: |
54 | 20 |
|
55 | | -1. **Setup**: Run `.specify/scripts/bash/setup-plan.sh --json` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot"). |
| 21 | +- plan explicit architecture evidence work |
| 22 | +- plan threat-model and ADR updates when boundaries, integrations, or flows |
| 23 | + change |
| 24 | +- surface Zero Trust and SAMM work explicitly when relevant |
56 | 25 |
|
57 | | -2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied). |
| 26 | +Before continuing, apply the iSAQB Architecture Governance preset: |
58 | 27 |
|
59 | | -3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to: |
60 | | - - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION") |
61 | | - - Fill Constitution Check section from constitution |
62 | | - - Evaluate gates (ERROR if violations unjustified) |
63 | | - - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION) |
64 | | - - Phase 1: Generate data-model.md, contracts/, quickstart.md |
65 | | - - Phase 1: Update agent context by running the agent script |
66 | | - - Re-evaluate Constitution Check post-design |
| 28 | +- plan explicit architecture work products where the feature changes |
| 29 | + structure, interfaces, quality attributes, runtime behavior, or |
| 30 | + deployment |
| 31 | +- plan updates to architecture views under `docs/architecture/` |
| 32 | +- plan ADRs for architecturally significant decisions |
| 33 | +- plan risk and technical-debt review for trade-offs or unresolved |
| 34 | + constraints |
| 35 | +- if security-relevant architecture is affected, also plan the |
| 36 | + secure-architecture evidence from `architecture-governance` |
67 | 37 |
|
68 | | -4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts. |
| 38 | +Before continuing, apply the A11Y Governance preset: |
69 | 39 |
|
70 | | -5. **Check for extension hooks**: After reporting, check if `.specify/extensions.yml` exists in the project root. |
71 | | - - If it exists, read it and look for entries under the `hooks.after_plan` key |
72 | | - - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally |
73 | | - - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default. |
74 | | - - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions: |
75 | | - - If the hook has no `condition` field, or it is null/empty, treat the hook as executable |
76 | | - - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation |
77 | | - - For each executable hook, output the following based on its `optional` flag: |
78 | | - - **Optional hook** (`optional: true`): |
79 | | - ``` |
80 | | - ## Extension Hooks |
| 40 | +- plan accessibility review work explicitly |
| 41 | +- plan bilingual content work explicitly |
| 42 | +- include CLI accessibility checks where user-facing terminal output is changed |
81 | 43 |
|
82 | | - **Optional Hook**: {extension} |
83 | | - Command: `/{command}` |
84 | | - Description: {description} |
| 44 | +Before continuing, apply the Cross-Platform Governance preset: |
85 | 45 |
|
86 | | - Prompt: {prompt} |
87 | | - To execute: `/{command}` |
88 | | - ``` |
89 | | - - **Mandatory hook** (`optional: false`): |
90 | | - ``` |
91 | | - ## Extension Hooks |
| 46 | +- plan paired Bash + PowerShell script work as a single unit |
| 47 | +- plan the man-page, the bilingual PowerShell help block, and the |
| 48 | + `Verb-Noun` Cmdlet alongside the script |
| 49 | +- plan manual verification on at least one target OS per variant |
| 50 | +- plan implementation discipline checks (Bash quoting, `set -euo |
| 51 | + pipefail`, `Set-StrictMode -Version Latest`, `-NoProfile`) and the |
| 52 | + parity-checklist artefact |
92 | 53 |
|
93 | | - **Automatic Hook**: {extension} |
94 | | - Executing: `/{command}` |
95 | | - EXECUTE_COMMAND: {command} |
96 | | - ``` |
97 | | - - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently |
| 54 | +Before continuing, apply the Agent Parity Governance preset: |
98 | 55 |
|
99 | | -## Phases |
| 56 | +- plan an atomic update across all maintained agent surfaces |
| 57 | +- plan synchronised updates to project templates and the local |
| 58 | + `.specify/memory/constitution.md` |
| 59 | +- plan a parity-verification artefact for the change |
| 60 | + |
| 61 | +# Command Template: `/speckit.plan` |
| 62 | + |
| 63 | +Use this command to produce an implementation plan from an approved specification. |
| 64 | + |
| 65 | +## Required Actions |
| 66 | + |
| 67 | +1. Populate technical context with real stack details. |
| 68 | +2. Execute the Constitution Check gates explicitly: |
| 69 | + - branching and PR flow |
| 70 | + - .NET 10 + C# 14.0 toolchain alignment |
| 71 | + - architecture/layer boundaries |
| 72 | + - bilingual CEFR B2 documentation scope |
| 73 | + - XML documentation + DocFX regeneration scope |
| 74 | + - Red-Green-Refactor testing scope |
| 75 | + - coverage gate (`>=70%` minimum, `>=80%` target) |
| 76 | + - NuGet dependency currency and pinning exceptions |
| 77 | + - serialization/data conventions |
| 78 | +3. Document concrete project structure for this feature. |
| 79 | +4. Record justified exceptions in Complexity Tracking. |
| 80 | + |
| 81 | +## Validation Checklist |
| 82 | + |
| 83 | +- No gate is left unresolved without rationale. |
| 84 | +- Test, coverage, dependency, and documentation impacts are planned before implementation. |
100 | 85 |
|
101 | | -### Phase 0: Outline & Research |
102 | 86 |
|
103 | | -1. **Extract unknowns from Technical Context** above: |
104 | | - - For each NEEDS CLARIFICATION → research task |
105 | | - - For each dependency → best practices task |
106 | | - - For each integration → patterns task |
107 | 87 |
|
108 | | -2. **Generate and dispatch research agents**: |
109 | 88 |
|
110 | | - ```text |
111 | | - For each unknown in Technical Context: |
112 | | - Task: "Research {unknown} for {feature context}" |
113 | | - For each technology choice: |
114 | | - Task: "Find best practices for {tech} in {domain}" |
115 | | - ``` |
116 | | - |
117 | | -3. **Consolidate findings** in `research.md` using format: |
118 | | - - Decision: [what was chosen] |
119 | | - - Rationale: [why chosen] |
120 | | - - Alternatives considered: [what else evaluated] |
121 | | - |
122 | | -**Output**: research.md with all NEEDS CLARIFICATION resolved |
123 | | - |
124 | | -### Phase 1: Design & Contracts |
125 | | - |
126 | | -**Prerequisites:** `research.md` complete |
127 | | - |
128 | | -1. **Extract entities from feature spec** → `data-model.md`: |
129 | | - - Entity name, fields, relationships |
130 | | - - Validation rules from requirements |
131 | | - - State transitions if applicable |
132 | | - |
133 | | -2. **Define interface contracts** (if project has external interfaces) → `/contracts/`: |
134 | | - - Identify what interfaces the project exposes to users or other systems |
135 | | - - Document the contract format appropriate for the project type |
136 | | - - Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications |
137 | | - - Skip if project is purely internal (build scripts, one-off tools, etc.) |
138 | | - |
139 | | -3. **Agent context update**: |
140 | | - - Update the plan reference between the `<!-- SPECKIT START -->` and `<!-- SPECKIT END -->` markers in `AGENTS.md` to point to the plan file created in step 1 (the IMPL_PLAN path) |
141 | 89 |
|
142 | | -**Output**: data-model.md, /contracts/*, quickstart.md, updated agent context file |
143 | 90 |
|
144 | | -## Key rules |
145 | 91 |
|
146 | | -- Use absolute paths for filesystem operations; use project-relative paths for references in documentation and agent context files |
147 | | -- ERROR on gate failures or unresolved clarifications |
0 commit comments