Skip to content

Commit 6a348cb

Browse files
dgarrosclaude
andcommitted
chore: upgrade Spec Kit
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7f37905 commit 6a348cb

32 files changed

Lines changed: 3794 additions & 379 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
description: Refresh the managed Spec Kit section in coding agent context file(s)
3+
---
4+
5+
6+
<!-- Extension: agent-context -->
7+
<!-- Config: .specify/extensions/agent-context/ -->
8+
# Update Coding Agent Context
9+
10+
Refresh the managed Spec Kit section inside the active coding agent's context/instruction file (e.g. `CLAUDE.md`, `.github/copilot-instructions.md`, `AGENTS.md`).
11+
12+
## Behavior
13+
14+
The script reads the agent-context extension config at
15+
`.specify/extensions/agent-context/agent-context-config.yml` to discover:
16+
17+
- `context_file` — the path of the coding agent context file to manage.
18+
- `context_files` — optional project-relative paths for multiple coding agent context files. When non-empty, the script updates each listed file and the list takes precedence over `context_file`.
19+
- `context_markers.start` / `.end` — the delimiters surrounding the managed section. Defaults to `<!-- SPECKIT START -->` and `<!-- SPECKIT END -->` when the field is missing.
20+
21+
It then creates, replaces, or appends the managed block so that the section points at the most recent plan path when one can be discovered (`specs/<feature>/plan.md`).
22+
23+
If `context_files` and `context_file` are empty, the command reports nothing to do and exits successfully. Context file paths must stay project-relative; absolute paths, Windows drive paths, backslash separators, and `..` path segments are rejected.
24+
25+
## Execution
26+
27+
- **Bash**: `.specify/extensions/agent-context/scripts/bash/update-agent-context.sh [plan_path]`
28+
- **PowerShell**: `.specify/extensions/agent-context/scripts/powershell/update-agent-context.ps1 [plan_path]`
29+
30+
When `plan_path` is omitted, the script auto-detects the most recently modified `specs/*/plan.md`.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: speckit-agent-context-update
3+
description: Refresh the managed Spec Kit section in coding agent context file(s)
4+
compatibility: Requires spec-kit project structure with .specify/ directory
5+
metadata:
6+
author: github-spec-kit
7+
source: agent-context:commands/speckit.agent-context.update.md
8+
---
9+
10+
# Update Coding Agent Context
11+
12+
Refresh the managed Spec Kit section inside the active coding agent's context/instruction file (e.g. `CLAUDE.md`, `.github/copilot-instructions.md`, `AGENTS.md`).
13+
14+
## Behavior
15+
16+
The script reads the agent-context extension config at
17+
`.specify/extensions/agent-context/agent-context-config.yml` to discover:
18+
19+
- `context_file` — the path of the coding agent context file to manage.
20+
- `context_files` — optional project-relative paths for multiple coding agent context files. When non-empty, the script updates each listed file and the list takes precedence over `context_file`.
21+
- `context_markers.start` / `.end` — the delimiters surrounding the managed section. Defaults to `<!-- SPECKIT START -->` and `<!-- SPECKIT END -->` when the field is missing.
22+
23+
It then creates, replaces, or appends the managed block so that the section points at the most recent plan path when one can be discovered (`specs/<feature>/plan.md`).
24+
25+
If `context_files` and `context_file` are empty, the command reports nothing to do and exits successfully. Context file paths must stay project-relative; absolute paths, Windows drive paths, backslash separators, and `..` path segments are rejected.
26+
27+
## Execution
28+
29+
- **Bash**: `.specify/extensions/agent-context/scripts/bash/update-agent-context.sh [plan_path]`
30+
- **PowerShell**: `.specify/extensions/agent-context/scripts/powershell/update-agent-context.ps1 [plan_path]`
31+
32+
When `plan_path` is omitted, the script auto-detects the most recently modified `specs/*/plan.md`.
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
---
2+
name: "speckit-analyze"
3+
description: "Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation."
4+
argument-hint: "Optional focus areas for analysis"
5+
compatibility: "Requires spec-kit project structure with .specify/ directory"
6+
metadata:
7+
author: "github-spec-kit"
8+
source: "templates/commands/analyze.md"
9+
user-invocable: true
10+
disable-model-invocation: false
11+
---
12+
13+
14+
## User Input
15+
16+
```text
17+
$ARGUMENTS
18+
```
19+
20+
You **MUST** consider the user input before proceeding (if not empty).
21+
22+
## Pre-Execution Checks
23+
24+
**Check for extension hooks (before analysis)**:
25+
- Check if `.specify/extensions.yml` exists in the project root.
26+
- If it exists, read it and look for entries under the `hooks.before_analyze` key
27+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
28+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
29+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
30+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
31+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
32+
- When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit``/speckit-git-commit`.
33+
- For each executable hook, output the following based on its `optional` flag:
34+
- **Optional hook** (`optional: true`):
35+
```
36+
## Extension Hooks
37+
38+
**Optional Pre-Hook**: {extension}
39+
Command: `/{command}`
40+
Description: {description}
41+
42+
Prompt: {prompt}
43+
To execute: `/{command}`
44+
```
45+
- **Mandatory hook** (`optional: false`):
46+
```
47+
## Extension Hooks
48+
49+
**Automatic Pre-Hook**: {extension}
50+
Executing: `/{command}`
51+
EXECUTE_COMMAND: {command}
52+
53+
Wait for the result of the hook command before proceeding to the Goal.
54+
```
55+
After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:speckit-...` or `$speckit-...`). Emitting the block alone does not run the hook.
56+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
57+
58+
## Goal
59+
60+
Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/speckit-tasks` has successfully produced a complete `tasks.md`.
61+
62+
## Operating Constraints
63+
64+
**STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
65+
66+
**Constitution Authority**: The project constitution (`.specify/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/speckit-analyze`.
67+
68+
## Execution Steps
69+
70+
### 1. Initialize Analysis Context
71+
72+
Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
73+
74+
- SPEC = FEATURE_DIR/spec.md
75+
- PLAN = FEATURE_DIR/plan.md
76+
- TASKS = FEATURE_DIR/tasks.md
77+
78+
Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
79+
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").
80+
81+
### 2. Load Artifacts (Progressive Disclosure)
82+
83+
Load only the minimal necessary context from each artifact:
84+
85+
**From spec.md:**
86+
87+
- Overview/Context
88+
- Functional Requirements
89+
- Success Criteria (measurable outcomes — e.g., performance, security, availability, user success, business impact)
90+
- User Stories
91+
- Edge Cases (if present)
92+
93+
**From plan.md:**
94+
95+
- Architecture/stack choices
96+
- Data Model references
97+
- Phases
98+
- Technical constraints
99+
100+
**From tasks.md:**
101+
102+
- Task IDs
103+
- Descriptions
104+
- Phase grouping
105+
- Parallel markers [P]
106+
- Referenced file paths
107+
108+
**From constitution:**
109+
110+
- Load `.specify/memory/constitution.md` for principle validation
111+
112+
### 3. Build Semantic Models
113+
114+
Create internal representations (do not include raw artifacts in output):
115+
116+
- **Requirements inventory**: For each Functional Requirement (FR-###) and Success Criterion (SC-###), record a stable key. Use the explicit FR-/SC- identifier as the primary key when present, and optionally also derive an imperative-phrase slug for readability (e.g., "User can upload file" → `user-can-upload-file`). Include only Success Criteria items that require buildable work (e.g., load-testing infrastructure, security audit tooling), and exclude post-launch outcome metrics and business KPIs (e.g., "Reduce support tickets by 50%").
117+
- **User story/action inventory**: Discrete user actions with acceptance criteria
118+
- **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
119+
- **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
120+
121+
### 4. Detection Passes (Token-Efficient Analysis)
122+
123+
Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
124+
125+
#### A. Duplication Detection
126+
127+
- Identify near-duplicate requirements
128+
- Mark lower-quality phrasing for consolidation
129+
130+
#### B. Ambiguity Detection
131+
132+
- Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
133+
- Flag unresolved placeholders (TODO, TKTK, ???, `<placeholder>`, etc.)
134+
135+
#### C. Underspecification
136+
137+
- Requirements with verbs but missing object or measurable outcome
138+
- User stories missing acceptance criteria alignment
139+
- Tasks referencing files or components not defined in spec/plan
140+
141+
#### D. Constitution Alignment
142+
143+
- Any requirement or plan element conflicting with a MUST principle
144+
- Missing mandated sections or quality gates from constitution
145+
146+
#### E. Coverage Gaps
147+
148+
- Requirements with zero associated tasks
149+
- Tasks with no mapped requirement/story
150+
- Success Criteria requiring buildable work (performance, security, availability) not reflected in tasks
151+
152+
#### F. Inconsistency
153+
154+
- Terminology drift (same concept named differently across files)
155+
- Data entities referenced in plan but absent in spec (or vice versa)
156+
- Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
157+
- Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
158+
159+
### 5. Severity Assignment
160+
161+
Use this heuristic to prioritize findings:
162+
163+
- **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
164+
- **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
165+
- **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
166+
- **LOW**: Style/wording improvements, minor redundancy not affecting execution order
167+
168+
### 6. Produce Compact Analysis Report
169+
170+
Output a Markdown report (no file writes) with the following structure:
171+
172+
## Specification Analysis Report
173+
174+
| ID | Category | Severity | Location(s) | Summary | Recommendation |
175+
|----|----------|----------|-------------|---------|----------------|
176+
| A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
177+
178+
(Add one row per finding; generate stable IDs prefixed by category initial.)
179+
180+
**Coverage Summary Table:**
181+
182+
| Requirement Key | Has Task? | Task IDs | Notes |
183+
|-----------------|-----------|----------|-------|
184+
185+
**Constitution Alignment Issues:** (if any)
186+
187+
**Unmapped Tasks:** (if any)
188+
189+
**Metrics:**
190+
191+
- Total Requirements
192+
- Total Tasks
193+
- Coverage % (requirements with >=1 task)
194+
- Ambiguity Count
195+
- Duplication Count
196+
- Critical Issues Count
197+
198+
### 7. Provide Next Actions
199+
200+
At end of report, output a concise Next Actions block:
201+
202+
- If CRITICAL issues exist: Recommend resolving before `/speckit-implement`
203+
- If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
204+
- Provide explicit command suggestions: e.g., "Run /speckit-specify with refinement", "Run /speckit-plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
205+
206+
### 8. Offer Remediation
207+
208+
Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
209+
210+
### 9. Check for extension hooks
211+
212+
After reporting, check if `.specify/extensions.yml` exists in the project root.
213+
- If it exists, read it and look for entries under the `hooks.after_analyze` key
214+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
215+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
216+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
217+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
218+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
219+
- When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
220+
- For each executable hook, output the following based on its `optional` flag:
221+
- **Optional hook** (`optional: true`):
222+
```
223+
## Extension Hooks
224+
225+
**Optional Hook**: {extension}
226+
Command: `/{command}`
227+
Description: {description}
228+
229+
Prompt: {prompt}
230+
To execute: `/{command}`
231+
```
232+
- **Mandatory hook** (`optional: false`):
233+
```
234+
## Extension Hooks
235+
236+
**Automatic Hook**: {extension}
237+
Executing: `/{command}`
238+
EXECUTE_COMMAND: {command}
239+
```
240+
After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:speckit-...` or `$speckit-...`). Emitting the block alone does not run the hook.
241+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
242+
243+
## Operating Principles
244+
245+
### Context Efficiency
246+
247+
- **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
248+
- **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
249+
- **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
250+
- **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
251+
252+
### Analysis Guidelines
253+
254+
- **NEVER modify files** (this is read-only analysis)
255+
- **NEVER hallucinate missing sections** (if absent, report them accurately)
256+
- **Prioritize constitution violations** (these are always CRITICAL)
257+
- **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
258+
- **Report zero issues gracefully** (emit success report with coverage statistics)
259+
260+
## Context
261+
262+
$ARGUMENTS

0 commit comments

Comments
 (0)