specdx 0.4.0-alpha.17 → 0.4.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +435 -0
- package/dist/{check-Q3QKTN2D.js → check-PQQGR4KP.js} +3 -3
- package/dist/{chunk-TJPPBM24.js → chunk-33FELECG.js} +9 -9
- package/dist/{chunk-4HPWTWBL.js → chunk-AXCGMUU7.js} +11 -6
- package/dist/chunk-AXCGMUU7.js.map +1 -0
- package/dist/{chunk-V7JOVK6D.js → chunk-FX4NRQHE.js} +139 -32
- package/dist/chunk-FX4NRQHE.js.map +1 -0
- package/dist/{chunk-PEC5LAVE.js → chunk-RI2SFGMR.js} +13 -5
- package/dist/chunk-RI2SFGMR.js.map +1 -0
- package/dist/{diff-IEN6W4OG.js → diff-IOBAJMKU.js} +2 -2
- package/dist/{dist-DVROIZAO.js → dist-HRY2V5MO.js} +11 -5
- package/dist/dist-HRY2V5MO.js.map +1 -0
- package/dist/{dist-SWJSMLIP.js → dist-WXT4UJ55.js} +2 -2
- package/dist/{generate-GQPOLFP7.js → generate-NSTYQOAV.js} +4 -4
- package/dist/{generate-story-UJS37FHA.js → generate-story-RFAPULQY.js} +31 -6
- package/dist/generate-story-RFAPULQY.js.map +1 -0
- package/dist/{generate-test-plan-RQTSGQLR.js → generate-test-plan-M22PCW73.js} +11 -1
- package/dist/generate-test-plan-M22PCW73.js.map +1 -0
- package/dist/index.js +131 -21
- package/dist/index.js.map +1 -1
- package/dist/{lint-VB5PV32N.js → lint-ADR7L6AP.js} +2 -2
- package/dist/main.js +16 -3
- package/dist/main.js.map +1 -1
- package/dist/{mcp-DADOVCEV.js → mcp-A6CCWSS2.js} +2 -2
- package/dist/{ready-C6YXJ47W.js → ready-GH4YKVOX.js} +13 -4
- package/dist/ready-GH4YKVOX.js.map +1 -0
- package/dist/{status-BRLCD7NY.js → status-PQKPTDP5.js} +3 -3
- package/dist/{update-P6TQUI6H.js → update-VAC6XV5E.js} +2 -2
- package/hooks/hooks.json +1 -1
- package/package.json +19 -6
- package/dist/chunk-4HPWTWBL.js.map +0 -1
- package/dist/chunk-PEC5LAVE.js.map +0 -1
- package/dist/chunk-V7JOVK6D.js.map +0 -1
- package/dist/dist-DVROIZAO.js.map +0 -1
- package/dist/generate-story-UJS37FHA.js.map +0 -1
- package/dist/generate-test-plan-RQTSGQLR.js.map +0 -1
- package/dist/ready-C6YXJ47W.js.map +0 -1
- /package/dist/{check-Q3QKTN2D.js.map → check-PQQGR4KP.js.map} +0 -0
- /package/dist/{chunk-TJPPBM24.js.map → chunk-33FELECG.js.map} +0 -0
- /package/dist/{diff-IEN6W4OG.js.map → diff-IOBAJMKU.js.map} +0 -0
- /package/dist/{dist-SWJSMLIP.js.map → dist-WXT4UJ55.js.map} +0 -0
- /package/dist/{generate-GQPOLFP7.js.map → generate-NSTYQOAV.js.map} +0 -0
- /package/dist/{lint-VB5PV32N.js.map → lint-ADR7L6AP.js.map} +0 -0
- /package/dist/{mcp-DADOVCEV.js.map → mcp-A6CCWSS2.js.map} +0 -0
- /package/dist/{status-BRLCD7NY.js.map → status-PQKPTDP5.js.map} +0 -0
- /package/dist/{update-P6TQUI6H.js.map → update-VAC6XV5E.js.map} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
# specdx
|
|
2
|
+
|
|
3
|
+
> The context engine for spec-driven development — keeps AI coding sessions grounded in validated, token-budgeted spec context.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/specdx)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com/umxr/specdx/actions/workflows/ci.yml)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What is specdx?
|
|
12
|
+
|
|
13
|
+
specdx does a few things really well: it gives your project specs (PRDs, technical designs, user stories, test plans, ADRs, API contracts) a formal schema, **validates and lints** them, **packs** them into token-optimised context for LLM sessions, and **tracks freshness** so drift between specs gets caught before it compounds.
|
|
14
|
+
|
|
15
|
+
No LLM calls in the core pipeline. No API keys required. Deterministic validation you can run in CI.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g specdx
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## The Real-World Workflow
|
|
24
|
+
|
|
25
|
+
specdx fits into how developers actually work with AI coding tools. Here's what day-to-day usage looks like.
|
|
26
|
+
|
|
27
|
+
### Setting Up a New Project
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
cd your-project
|
|
31
|
+
specdx init --name "my-app" --template lightweight
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This creates `spec.config.yaml` and starter specs in `specs/`. Five templates available:
|
|
35
|
+
|
|
36
|
+
| Template | What you get | Best for |
|
|
37
|
+
|----------|-------------|----------|
|
|
38
|
+
| `lightweight` | PRD + Technical Design | Small projects, solo devs |
|
|
39
|
+
| `bmad` | PRD + Technical Design + Test Plan + stories/ + adr/ | Full methodology |
|
|
40
|
+
| `api-first` | Technical Design + API Contract + Test Plan | Backend/API projects |
|
|
41
|
+
| `quick` | Single Quick Spec | Rapid prototyping |
|
|
42
|
+
| `context` | Project Context only | Adding to existing projects |
|
|
43
|
+
|
|
44
|
+
### Adding specdx to an Existing Project
|
|
45
|
+
|
|
46
|
+
If you already have a codebase and want to introduce specs:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd existing-project
|
|
50
|
+
specdx init --name "my-app" --template context
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Start with `context` to create a project-context spec describing your stack, conventions, and constraints. Then add specs incrementally as you plan new work:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Add a PRD when you're planning a feature
|
|
57
|
+
# Add a technical design when you're making architecture decisions
|
|
58
|
+
# Add user stories when you're breaking work into tasks
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Edit `spec.config.yaml` to register each new spec with its type and dependencies.
|
|
62
|
+
|
|
63
|
+
### Daily Development Loop
|
|
64
|
+
|
|
65
|
+
This is the core loop. Every coding session follows the same pattern:
|
|
66
|
+
|
|
67
|
+
**1. Load context before you code**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
specdx pack --task "implement user authentication" --copy
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This scores every spec in your suite for relevance to your task, allocates a token budget, compresses boilerplate, and copies the result to your clipboard. Paste it into your LLM session or let the Claude Code skill handle it automatically.
|
|
74
|
+
|
|
75
|
+
**2. Write code informed by specs**
|
|
76
|
+
|
|
77
|
+
Your LLM session now has the right context — the PRD features you're implementing, the technical constraints, the acceptance criteria, the API contract. No manual copy-pasting, no guessing which specs matter.
|
|
78
|
+
|
|
79
|
+
**3. Lint before committing**
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
specdx lint
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Validates frontmatter, checks required sections, verifies cross-references, detects circular dependencies, flags vague language, and catches hardcoded secrets in specs. Three presets: `minimal`, `recommended`, `strict`.
|
|
86
|
+
|
|
87
|
+
**4. Keep specs fresh**
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
specdx diff # what changed, and which downstream specs it affects
|
|
91
|
+
specdx ready # is the suite fit to implement from?
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
If you updated the PRD but not the test plan that depends on it, `diff` flags it before the staleness compounds.
|
|
95
|
+
|
|
96
|
+
### Planning New Work
|
|
97
|
+
|
|
98
|
+
When you're starting a new feature or project phase:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Check what state the spec suite is in
|
|
102
|
+
specdx status
|
|
103
|
+
|
|
104
|
+
# See the dependency graph
|
|
105
|
+
specdx graph
|
|
106
|
+
|
|
107
|
+
# Check if specs are ready for implementation
|
|
108
|
+
specdx ready
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`ready` validates that all required specs exist, lint is clean, no references are broken, no specs are stale, and PRD features have corresponding user stories. It's the gate between "planning" and "building."
|
|
112
|
+
|
|
113
|
+
### Reviewing Changes
|
|
114
|
+
|
|
115
|
+
When specs change (or should have changed):
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# What specs changed since main?
|
|
119
|
+
specdx diff
|
|
120
|
+
|
|
121
|
+
# What's the downstream impact?
|
|
122
|
+
specdx diff --base main --head HEAD
|
|
123
|
+
|
|
124
|
+
# Generate a changelog for sprint review
|
|
125
|
+
specdx diff --base v1.0 --head HEAD --format changelog
|
|
126
|
+
|
|
127
|
+
# Include specs you haven't committed yet
|
|
128
|
+
specdx diff --working
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
`diff` walks the dependency graph to find downstream specs affected by upstream changes. If you updated the PRD but forgot to update the test plan that depends on it, `diff` flags it.
|
|
132
|
+
|
|
133
|
+
### Onboarding New Team Members
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
specdx status
|
|
137
|
+
specdx graph
|
|
138
|
+
specdx pack --full
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
`status` reports what specs exist and how healthy they are, `graph` shows how they relate, and `pack --full` loads the content itself. A new developer can understand the project's intent without opening a spec file. The `specdx-onboard` skill drives this sequence as a guided tour.
|
|
142
|
+
|
|
143
|
+
### CI Integration
|
|
144
|
+
|
|
145
|
+
Add spec health checks to your CI pipeline with the GitHub Action:
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
# .github/workflows/specs.yml
|
|
149
|
+
- uses: umxr/specdx/packages/github-action@v0.4.0
|
|
150
|
+
with:
|
|
151
|
+
working-directory: .
|
|
152
|
+
preset: recommended
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The action runs lint + diff on every PR, posts a formatted comment with results, and can block merges on spec health failures. Configure severity thresholds in `spec.config.yaml`:
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
ci:
|
|
159
|
+
block_on: ["error"]
|
|
160
|
+
post_comment: true
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Experimental Features
|
|
166
|
+
|
|
167
|
+
These ship with specdx but are **not part of the stable surface** — they lean on static code analysis, which is inherently fuzzy, and their output and interfaces may change or produce noise. They are flagged `[experimental]` in CLI help.
|
|
168
|
+
|
|
169
|
+
| Command | What it does |
|
|
170
|
+
|---------|-------------|
|
|
171
|
+
| `specdx check` | Spec-to-implementation drift analysis: extracts routes (Express, Hono, Next.js), types (TS, Zod, Prisma), and tests from your code and compares them against specs |
|
|
172
|
+
| Declared artifacts | Framework-agnostic checkable surfaces for `check`: a spec's optional `artifacts:` frontmatter lists files that must exist and names they must export, so any project — static sites, CLIs, libraries — gets drift checking. See below. |
|
|
173
|
+
| `specdx check --ai` | Sends check findings to Claude for assessment (requires `ANTHROPIC_API_KEY`) |
|
|
174
|
+
| `specdx update --from-code` | Suggests spec updates from check findings |
|
|
175
|
+
| `specdx generate test-plan` | Generates test-plan stubs from story acceptance criteria |
|
|
176
|
+
| `specdx migrate` | Schema-version migration for spec suites |
|
|
177
|
+
|
|
178
|
+
Feedback on these is especially welcome — accuracy improvements (confidence scoring, better matching) are what graduates them to stable.
|
|
179
|
+
|
|
180
|
+
### Declared artifacts
|
|
181
|
+
|
|
182
|
+
When no framework extractor applies (Astro, static sites, CLIs, libraries), declare what "implemented" means directly in a spec's frontmatter:
|
|
183
|
+
|
|
184
|
+
```yaml
|
|
185
|
+
artifacts:
|
|
186
|
+
- path: "middleware.ts"
|
|
187
|
+
- path: "scripts/export-crawler-log.mjs"
|
|
188
|
+
- path: "src/lib/bots.ts"
|
|
189
|
+
exports: ["BOT_SIGNATURES"]
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
`specdx check` verifies each `path` exists and each name in `exports` is exported from it (export checks use ts-morph and are skipped with a note — never silently passed — when it isn't installed). Declared artifacts count toward the implementation score as their own category and make a spec checkable on any stack.
|
|
193
|
+
|
|
194
|
+
**Enforcement follows the spec's `status`**, so you can declare artifacts in a spec written before the code exists:
|
|
195
|
+
|
|
196
|
+
| Spec status | Declared file or export missing | Exit code |
|
|
197
|
+
|---|---|---|
|
|
198
|
+
| `draft`, `review`, `superseded` | reported as **pending** — planned, not yet built. Excluded from the score. | 0 |
|
|
199
|
+
| `approved` | reported as a **missing** error — the spec says this should exist | 1 |
|
|
200
|
+
|
|
201
|
+
The rule applies identically to a planned `path` and a planned entry in `exports`, so a spec can declare that an existing file will gain a new export. Files and exports that *do* exist are always verified, whatever the status. Flipping a spec to `approved` is what makes its contract enforceable, so `check` can tell "this is a plan for unbuilt work" apart from "this was approved but three of its five artifacts are missing".
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Claude Code Integration
|
|
206
|
+
|
|
207
|
+
specdx ships as a Claude Code plugin with 9 skills that automate the workflow above.
|
|
208
|
+
|
|
209
|
+
### Automatic Setup
|
|
210
|
+
|
|
211
|
+
Install specdx as a dev dependency and the plugin is discovered automatically:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npm install -D specdx
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Or install skills manually:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
specdx skills install
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Skills install to `.claude/skills/<name>/SKILL.md` and follow the
|
|
224
|
+
[Agent Skills specification](https://agentskills.io/specification).
|
|
225
|
+
|
|
226
|
+
### Skills
|
|
227
|
+
|
|
228
|
+
| Skill | What it does |
|
|
229
|
+
|-------|-------------|
|
|
230
|
+
| `specdx-start-task` | Loads spec context before coding — runs `pack --task` and injects the result |
|
|
231
|
+
| `specdx-author-spec` | Guides spec creation with iterative linting gates between sections |
|
|
232
|
+
| `specdx-plan-from-spec` | Generates implementation plans grounded in the spec suite |
|
|
233
|
+
| `specdx-verify` | *(experimental)* Verifies implementation against specs using `check` |
|
|
234
|
+
| `specdx-check-drift` | *(experimental)* Cross-references code changes vs spec definitions |
|
|
235
|
+
| `specdx-pre-commit` | Runs lint + diff before commits to catch drift early |
|
|
236
|
+
| `specdx-review-spec` | Multi-layer quality review (completeness, consistency, adversarial) |
|
|
237
|
+
| `specdx-onboard` | Guided overview for new developers |
|
|
238
|
+
| `specdx-sprint-review` | Generates shareable spec health summary for standups |
|
|
239
|
+
|
|
240
|
+
### MCP Server
|
|
241
|
+
|
|
242
|
+
specdx also exposes all tools over MCP (Model Context Protocol) for programmatic access:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
specdx mcp
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
7 tools available: `sdx_validate`, `sdx_lint`, `sdx_pack`, `sdx_status`, `sdx_check`, `sdx_diff`, `sdx_graph`.
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Spec File Format
|
|
253
|
+
|
|
254
|
+
Every spec is a Markdown file with YAML frontmatter:
|
|
255
|
+
|
|
256
|
+
```markdown
|
|
257
|
+
---
|
|
258
|
+
id: "prd-001"
|
|
259
|
+
type: "prd"
|
|
260
|
+
title: "User Authentication System"
|
|
261
|
+
status: "approved"
|
|
262
|
+
version: "1.0"
|
|
263
|
+
created: "2026-03-01"
|
|
264
|
+
authors: ["alice"]
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Problem Statement
|
|
268
|
+
|
|
269
|
+
Our application has no authentication...
|
|
270
|
+
|
|
271
|
+
## Goals
|
|
272
|
+
|
|
273
|
+
1. Support email/password login
|
|
274
|
+
2. ...
|
|
275
|
+
|
|
276
|
+
## Non-Goals
|
|
277
|
+
|
|
278
|
+
- Social login (Phase 2)
|
|
279
|
+
- ...
|
|
280
|
+
|
|
281
|
+
## Features
|
|
282
|
+
|
|
283
|
+
- **F1 Login Flow**: Email and password with rate limiting...
|
|
284
|
+
- **F2 Session Management**: JWT tokens with refresh...
|
|
285
|
+
|
|
286
|
+
## Success Criteria
|
|
287
|
+
|
|
288
|
+
- 99.9% auth uptime
|
|
289
|
+
- < 200ms login response time
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Spec Types
|
|
293
|
+
|
|
294
|
+
| Type | Required Sections | Extra Fields |
|
|
295
|
+
|------|------------------|--------------|
|
|
296
|
+
| `prd` | Problem Statement, Goals, Non-Goals, Features, Success Criteria | — |
|
|
297
|
+
| `technical-design` | Overview, Architecture, Data Model, API Design, Dependencies, Risks, Open Questions | — |
|
|
298
|
+
| `user-story` | Description, Acceptance Criteria, Dependencies, Notes | `story_id`, `priority`, `estimate` |
|
|
299
|
+
| `test-plan` | Scope, Test Cases, Coverage Matrix, Edge Cases | — |
|
|
300
|
+
| `adr` | Context, Decision, Status, Consequences | — |
|
|
301
|
+
| `api-contract` | Endpoints, Request/Response Schemas, Auth, Error Codes | — |
|
|
302
|
+
| `epic` | Overview, Stories, Acceptance Criteria, Dependencies | `epic_id`, `priority` |
|
|
303
|
+
| `quick-spec` | Intent, Boundaries, Tasks | — |
|
|
304
|
+
| `project-context` | Technology Stack, Critical Implementation Rules, Coding Patterns | — |
|
|
305
|
+
|
|
306
|
+
### Required Frontmatter
|
|
307
|
+
|
|
308
|
+
| Field | Type | Description |
|
|
309
|
+
|-------|------|-------------|
|
|
310
|
+
| `id` | string | Unique identifier within the spec suite |
|
|
311
|
+
| `type` | enum | One of the 9 spec types above |
|
|
312
|
+
| `title` | string | Human-readable title |
|
|
313
|
+
| `status` | enum | `draft`, `review`, `approved`, `superseded` |
|
|
314
|
+
| `version` | string | Version string (e.g. `"1.0"`) |
|
|
315
|
+
| `created` | string | ISO 8601 date — must be quoted in YAML |
|
|
316
|
+
| `authors` | string[] | At least one author |
|
|
317
|
+
|
|
318
|
+
### Cross-References
|
|
319
|
+
|
|
320
|
+
Specs can reference each other in frontmatter:
|
|
321
|
+
|
|
322
|
+
```yaml
|
|
323
|
+
references:
|
|
324
|
+
- id: "tech-001"
|
|
325
|
+
relationship: "depends-on"
|
|
326
|
+
- id: "story-auth-001"
|
|
327
|
+
relationship: "decomposed-into"
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Relationships: `implemented-by`, `decomposed-into`, `depends-on`, `supersedes`, `related-to`.
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Configuration
|
|
335
|
+
|
|
336
|
+
`spec.config.yaml` at the project root:
|
|
337
|
+
|
|
338
|
+
```yaml
|
|
339
|
+
version: "1.0"
|
|
340
|
+
|
|
341
|
+
project:
|
|
342
|
+
name: "my-project"
|
|
343
|
+
|
|
344
|
+
specs:
|
|
345
|
+
prd:
|
|
346
|
+
path: specs/prd.md
|
|
347
|
+
type: prd
|
|
348
|
+
required: true
|
|
349
|
+
|
|
350
|
+
technical:
|
|
351
|
+
path: specs/technical-design.md
|
|
352
|
+
type: technical-design
|
|
353
|
+
requires: ["prd"]
|
|
354
|
+
|
|
355
|
+
stories:
|
|
356
|
+
path: "specs/stories/*.md"
|
|
357
|
+
type: user-story
|
|
358
|
+
requires: ["prd"]
|
|
359
|
+
|
|
360
|
+
test-plan:
|
|
361
|
+
path: specs/test-plan.md
|
|
362
|
+
type: test-plan
|
|
363
|
+
requires: ["technical"]
|
|
364
|
+
|
|
365
|
+
lint:
|
|
366
|
+
extends: "recommended"
|
|
367
|
+
rules:
|
|
368
|
+
consistency/naming-conventions: off
|
|
369
|
+
|
|
370
|
+
pack:
|
|
371
|
+
max_tokens: 12000
|
|
372
|
+
format: xml
|
|
373
|
+
compression:
|
|
374
|
+
strip_boilerplate: true
|
|
375
|
+
stable_days: 30
|
|
376
|
+
|
|
377
|
+
diff:
|
|
378
|
+
baseline_ref: main
|
|
379
|
+
staleness_threshold_days: 14
|
|
380
|
+
|
|
381
|
+
check:
|
|
382
|
+
framework: auto # auto | express | hono | nextjs
|
|
383
|
+
|
|
384
|
+
ci:
|
|
385
|
+
block_on: ["error"]
|
|
386
|
+
post_comment: true
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## CLI Reference
|
|
392
|
+
|
|
393
|
+
| Command | Description |
|
|
394
|
+
|---------|-------------|
|
|
395
|
+
| `specdx init --name <name>` | Scaffold a new spec suite |
|
|
396
|
+
| `specdx lint` | Lint all specs against configured rules |
|
|
397
|
+
| `specdx validate` | Validate `spec.config.yaml` |
|
|
398
|
+
| `specdx pack --task <task>` | Pack specs into token-optimised context |
|
|
399
|
+
| `specdx status` | Show spec suite health overview |
|
|
400
|
+
| `specdx check` | *(experimental)* Analyse spec-to-implementation drift |
|
|
401
|
+
| `specdx diff` | Show spec changes and downstream impact (`--working`, `--format changelog`) |
|
|
402
|
+
| `specdx graph` | Print the dependency graph |
|
|
403
|
+
| `specdx ready` | Check if specs are ready for implementation |
|
|
404
|
+
| `specdx generate story --from <id>` | Generate user story stubs from a PRD |
|
|
405
|
+
| `specdx generate test-plan` | *(experimental)* Generate test plan stub from stories |
|
|
406
|
+
| `specdx update` | *(experimental)* Suggest spec updates based on code drift |
|
|
407
|
+
| `specdx migrate` | *(experimental)* Check and validate spec schema version |
|
|
408
|
+
| `specdx skills install` | Install Claude Code skills (`--experimental` also installs the unpromoted ones) |
|
|
409
|
+
| `specdx mcp` | Start the MCP server |
|
|
410
|
+
|
|
411
|
+
Global flags: `--format pretty|json|github`, `--quiet`, `--verbose`.
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Why specdx?
|
|
416
|
+
|
|
417
|
+
**vs. Markdown linters** (markdownlint, remark-lint) — They check formatting. specdx checks semantics: required sections by spec type, cross-reference validity, dependency chain cycles, downstream staleness.
|
|
418
|
+
|
|
419
|
+
**vs. YAML validators** (JSON Schema + AJV) — They check structure. specdx combines schema validation with document-level semantic rules that understand spec relationships.
|
|
420
|
+
|
|
421
|
+
**What makes it different:**
|
|
422
|
+
|
|
423
|
+
1. **Dependency chains.** `requires` declarations build a DAG. Rules catch staleness and broken references across the entire suite.
|
|
424
|
+
2. **Context packing.** `specdx pack` assembles token-optimised payloads with relevance filtering, budget allocation, and boilerplate stripping.
|
|
425
|
+
3. **Drift detection.** `specdx diff` walks the dependency graph to find specs affected by upstream changes, and `specdx ready` gates implementation on suite health. (Experimental: `specdx check` compares specs against your actual implementation.)
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## Contributing
|
|
430
|
+
|
|
431
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, how to write custom lint rules, and the PR process.
|
|
432
|
+
|
|
433
|
+
## License
|
|
434
|
+
|
|
435
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runCheck
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RI2SFGMR.js";
|
|
4
4
|
import {
|
|
5
5
|
sharedArgs
|
|
6
6
|
} from "./chunk-GAM4MXPC.js";
|
|
@@ -50,7 +50,7 @@ var check_default = defineCommand({
|
|
|
50
50
|
logger.debug(`Checking ${specs.length} specs...`);
|
|
51
51
|
const result = await runCheck(specs, configDir, checkConfig);
|
|
52
52
|
if (args.ai) {
|
|
53
|
-
const { analyzeWithAi } = await import("./dist-
|
|
53
|
+
const { analyzeWithAi } = await import("./dist-WXT4UJ55.js");
|
|
54
54
|
const aiResult = await analyzeWithAi(result.findings, args.spec ?? "full suite check");
|
|
55
55
|
if (args.format === "json") {
|
|
56
56
|
console.log(JSON.stringify({ ...result, ai: aiResult }, null, 2));
|
|
@@ -134,4 +134,4 @@ var check_default = defineCommand({
|
|
|
134
134
|
export {
|
|
135
135
|
check_default as default
|
|
136
136
|
};
|
|
137
|
-
//# sourceMappingURL=check-
|
|
137
|
+
//# sourceMappingURL=check-PQQGR4KP.js.map
|
|
@@ -157,23 +157,23 @@ function bucketed(name, load) {
|
|
|
157
157
|
}
|
|
158
158
|
var subCommands = {
|
|
159
159
|
init: init_default,
|
|
160
|
-
lint: bucketed("lint", () => import("./lint-
|
|
160
|
+
lint: bucketed("lint", () => import("./lint-ADR7L6AP.js").then((m) => m.default)),
|
|
161
161
|
validate: bucketed("validate", () => import("./validate-WIB246IE.js").then((m) => m.default)),
|
|
162
162
|
graph: bucketed("graph", () => import("./graph-OKUMHR3Q.js").then((m) => m.default)),
|
|
163
163
|
skills: bucketed("skills", () => import("./skills-LHFTTEJ7.js").then((m) => m.default)),
|
|
164
164
|
pack: bucketed("pack", () => import("./pack-B3KYRKUR.js").then((m) => m.default)),
|
|
165
|
-
diff: bucketed("diff", () => import("./diff-
|
|
166
|
-
status: bucketed("status", () => import("./status-
|
|
167
|
-
check: bucketed("check", () => import("./check-
|
|
168
|
-
ready: bucketed("ready", () => import("./ready-
|
|
169
|
-
update: bucketed("update", () => import("./update-
|
|
170
|
-
generate: bucketed("generate", () => import("./generate-
|
|
165
|
+
diff: bucketed("diff", () => import("./diff-IOBAJMKU.js").then((m) => m.default)),
|
|
166
|
+
status: bucketed("status", () => import("./status-PQKPTDP5.js").then((m) => m.default)),
|
|
167
|
+
check: bucketed("check", () => import("./check-PQQGR4KP.js").then((m) => m.default)),
|
|
168
|
+
ready: bucketed("ready", () => import("./ready-GH4YKVOX.js").then((m) => m.default)),
|
|
169
|
+
update: bucketed("update", () => import("./update-VAC6XV5E.js").then((m) => m.default)),
|
|
170
|
+
generate: bucketed("generate", () => import("./generate-NSTYQOAV.js").then((m) => m.default)),
|
|
171
171
|
migrate: bucketed("migrate", () => import("./migrate-LAMRDT3V.js").then((m) => m.default)),
|
|
172
|
-
mcp: bucketed("mcp", () => import("./mcp-
|
|
172
|
+
mcp: bucketed("mcp", () => import("./mcp-A6CCWSS2.js").then((m) => m.default))
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
export {
|
|
176
176
|
labelled,
|
|
177
177
|
subCommands
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-33FELECG.js.map
|
|
@@ -2534,11 +2534,16 @@ function checkCrossReferences(allSpecs, removedIds) {
|
|
|
2534
2534
|
|
|
2535
2535
|
// ../diff/dist/git.js
|
|
2536
2536
|
function getRepoRoot(cwd) {
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2537
|
+
let root;
|
|
2538
|
+
try {
|
|
2539
|
+
root = execSync("git rev-parse --show-toplevel", {
|
|
2540
|
+
cwd,
|
|
2541
|
+
encoding: "utf-8",
|
|
2542
|
+
stdio: "pipe"
|
|
2543
|
+
}).trim();
|
|
2544
|
+
} catch {
|
|
2545
|
+
throw new DiffError("diff compares specs across git history, and this directory is not inside a git repository. Run `git init` first, or run diff from a checked-out project.");
|
|
2546
|
+
}
|
|
2542
2547
|
return realpathSync(root);
|
|
2543
2548
|
}
|
|
2544
2549
|
function validateRef(ref, cwd) {
|
|
@@ -2838,4 +2843,4 @@ export {
|
|
|
2838
2843
|
DiffError,
|
|
2839
2844
|
diffBetweenRefs
|
|
2840
2845
|
};
|
|
2841
|
-
//# sourceMappingURL=chunk-
|
|
2846
|
+
//# sourceMappingURL=chunk-AXCGMUU7.js.map
|