@protonspy/csdd-mcp 0.1.10 → 0.2.0
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/README.md +232 -232
- package/dist/tools/spec.js +42 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,232 +1,232 @@
|
|
|
1
|
-
# @protonspy/csdd-mcp
|
|
2
|
-
|
|
3
|
-
**An [MCP](https://modelcontextprotocol.io) server that exposes the [`csdd`](https://github.com/protonspy/csdd) CLI as tools — one tool per subcommand.**
|
|
4
|
-
|
|
5
|
-
`csdd` governs the Claude Code Spec-Driven Development workflow (steering, specs,
|
|
6
|
-
skills, sub-agents, MCP servers) and validates the contract mechanically. This
|
|
7
|
-
server lets an MCP-capable agent drive `csdd` **directly as tools**, instead of
|
|
8
|
-
shelling out to a terminal — same operations, same phase gates, same exit codes.
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
agent ──(MCP/stdio)──▶ csdd-mcp ──(execFile)──▶ csdd binary ──▶ .claude/ · specs/
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Each tool builds a `csdd` argv, runs the binary headlessly (`NO_COLOR=1`, no TTY
|
|
15
|
-
so confirmations auto-decline), and returns its `stdout`/`stderr`. A non-zero
|
|
16
|
-
exit becomes an MCP error result; **exit `2` (validation failure) is surfaced
|
|
17
|
-
distinctly** so the agent can tell "your spec is invalid" from "the command
|
|
18
|
-
broke".
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Requirements
|
|
23
|
-
|
|
24
|
-
- **Node.js ≥ 18** (the published package ships compiled JS).
|
|
25
|
-
- **The `csdd` binary**, reachable by the server — see [Locating the csdd binary](#locating-the-csdd-binary).
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Install & configure
|
|
30
|
-
|
|
31
|
-
The server runs over **stdio**; point your MCP client at it.
|
|
32
|
-
|
|
33
|
-
### Claude Code
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
# project scope (writes .mcp.json) — or use --scope user for all projects
|
|
37
|
-
claude mcp add csdd -- npx -y @protonspy/csdd-mcp
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Or add it to `.mcp.json` by hand:
|
|
41
|
-
|
|
42
|
-
```json
|
|
43
|
-
{
|
|
44
|
-
"mcpServers": {
|
|
45
|
-
"csdd": {
|
|
46
|
-
"command": "npx",
|
|
47
|
-
"args": ["-y", "@protonspy/csdd-mcp"],
|
|
48
|
-
"env": { "CSDD_BIN": "/usr/local/bin/csdd" }
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
> `env.CSDD_BIN` is optional — drop it if `csdd` is on your `PATH`. See below.
|
|
55
|
-
|
|
56
|
-
### Any MCP client
|
|
57
|
-
|
|
58
|
-
Launch `npx -y @protonspy/csdd-mcp` (or `csdd-mcp` if installed globally) as a
|
|
59
|
-
stdio server. The process stays alive serving stdio until the client closes the
|
|
60
|
-
pipe.
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Locating the csdd binary
|
|
65
|
-
|
|
66
|
-
The server resolves `csdd` once, on first use, in this order (first hit wins):
|
|
67
|
-
|
|
68
|
-
| # | Source | When it applies |
|
|
69
|
-
|---|--------|-----------------|
|
|
70
|
-
| 1 | **`$CSDD_BIN`** | Explicit absolute path. Always wins — use this if in doubt. |
|
|
71
|
-
| 2 | **Platform package** `@protonspy/csdd-<os>-<arch>` | Declared as an `optionalDependency` of this package, so `npx`/`npm i` fetches the prebuilt binary for your OS/arch automatically — the zero-config path. |
|
|
72
|
-
| 3 | **Sibling repo binary** (`../csdd`, `../../csdd`) | When running from a checkout of the csdd repo. |
|
|
73
|
-
| 4 | **`csdd` on `$PATH`** | Last resort, resolved by the OS at spawn time. |
|
|
74
|
-
|
|
75
|
-
If none resolve, calls fail with **exit `127`** and a message telling you to set
|
|
76
|
-
`CSDD_BIN`, install `@protonspy/csdd`, or put `csdd` on your `PATH`.
|
|
77
|
-
|
|
78
|
-
> **Zero-config:** running via `npx -y @protonspy/csdd-mcp` pulls the matching
|
|
79
|
-
> binary through #2 automatically — nothing to install. Set `CSDD_BIN` only to
|
|
80
|
-
> pin a specific build (e.g. a local dev binary).
|
|
81
|
-
|
|
82
|
-
### Environment
|
|
83
|
-
|
|
84
|
-
| Variable | Effect |
|
|
85
|
-
|----------|--------|
|
|
86
|
-
| `CSDD_BIN` | Absolute path to the `csdd` binary. Highest-priority resolution. |
|
|
87
|
-
| `NO_COLOR` | Forced to `1` for every call so output is ANSI-free (you don't set this). |
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Result & error semantics
|
|
92
|
-
|
|
93
|
-
Every tool returns a text result. The mapping from the `csdd` exit code is:
|
|
94
|
-
|
|
95
|
-
| Exit | `isError` | Result text |
|
|
96
|
-
|------|-----------|-------------|
|
|
97
|
-
| `0` | `false` | `stdout` (and any `stderr` as an unlabelled warning); `(ok, no output)` if silent. |
|
|
98
|
-
| `2` | `true` | Prefixed `csdd validation failed (exit 2):` — a contract/validation problem. |
|
|
99
|
-
| other | `true` | Prefixed `csdd failed (exit <n>):`; `stderr` is labelled `[stderr]`. |
|
|
100
|
-
| `127` | `true` | Binary not found — includes guidance to set `CSDD_BIN` / install / fix `PATH`. |
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Tool reference
|
|
105
|
-
|
|
106
|
-
**27 tools** covering the csdd **development flow**, grouped by resource.
|
|
107
|
-
Conventions:
|
|
108
|
-
|
|
109
|
-
- Every tool accepts an optional **`root`** — the workspace root (the directory
|
|
110
|
-
containing `.claude/`). Omit it to walk up from the server's working directory.
|
|
111
|
-
- Destructive / gate-breaking tools take **`force`** (boolean). Without it,
|
|
112
|
-
deletes are refused and phase gates hold.
|
|
113
|
-
- `?` marks an optional parameter; everything else is required.
|
|
114
|
-
|
|
115
|
-
> **Scope:** this server exposes only the iterative development-flow resources
|
|
116
|
-
> (steering · spec · skill · agent). **Workspace setup and config management are
|
|
117
|
-
> deliberately not tools** — `csdd init`, `csdd update`, `csdd mcp …`, and `csdd export …` are
|
|
118
|
-
> one-time operations a human runs from the CLI, not part of the loop an agent
|
|
119
|
-
> drives. (In fact, `csdd init` is what registers *this* server.)
|
|
120
|
-
|
|
121
|
-
### Diagnostic
|
|
122
|
-
|
|
123
|
-
| Tool | Parameters | What it does |
|
|
124
|
-
|------|------------|--------------|
|
|
125
|
-
| `csdd_version` | — | Print the underlying `csdd` binary version (diagnostic / connectivity check). |
|
|
126
|
-
|
|
127
|
-
### 🧭 steering — project memory (`.claude/steering/*.md`)
|
|
128
|
-
|
|
129
|
-
| Tool | Parameters | What it does |
|
|
130
|
-
|------|------------|--------------|
|
|
131
|
-
| `csdd_steering_init` | `root?` | Create `.claude/steering/` and the 6 standard files (product, tech, structure, security, testing, api-conventions). |
|
|
132
|
-
| `csdd_steering_create` | `name`, `inclusion`, `pattern?[]`, `description?`, `title?`, `force?`, `root?` | Create a custom steering file. `inclusion` ∈ `always · fileMatch · manual · auto`. `fileMatch` requires ≥1 `pattern`; `auto` requires a `description`. |
|
|
133
|
-
| `csdd_steering_list` | `root?`, `inclusion?` | List steering files with inclusion mode; optionally filter by `inclusion`. |
|
|
134
|
-
| `csdd_steering_show` | `name`, `root?` | Print a steering file (frontmatter + body). |
|
|
135
|
-
| `csdd_steering_delete` | `name`, `force?`, `root?` | Delete a steering file (`force` required). Foundational files (product, tech, structure) are protected. |
|
|
136
|
-
| `csdd_steering_validate` | `name?`, `root?` | Validate frontmatter/structure. Omit `name` to validate all. Exit 2 on issues. |
|
|
137
|
-
|
|
138
|
-
`inclusion` controls *when* the steering loads: `always` (always-on), `fileMatch`
|
|
139
|
-
(when files match a `pattern`), `manual` (`#name`), `auto` (when its `description`
|
|
140
|
-
matches the context).
|
|
141
|
-
|
|
142
|
-
### 📐 spec — per-feature contract (`specs/<feature>/`)
|
|
143
|
-
|
|
144
|
-
| Tool | Parameters | What it does |
|
|
145
|
-
|------|------------|--------------|
|
|
146
|
-
| `csdd_spec_init` | `feature`, `language?`, `root?` | Create `specs/<feature>/spec.json` (phase = initial, no approvals). `language` defaults to `en`. |
|
|
147
|
-
| `csdd_spec_list` | `root?` | List specs with current phase, approved phases, and readiness. |
|
|
148
|
-
| `csdd_spec_show` | `feature`, `root?` | Show a spec's `spec.json` metadata and its artifacts. |
|
|
149
|
-
| `csdd_spec_status` | `feature`, `root?` | Combined `show` + `validate` for a spec. |
|
|
150
|
-
| `csdd_spec_generate` | `feature`, `artifact`, `force?`, `root?` | Generate an artifact. `artifact` ∈ `requirements · design · tasks · research · bugfix`. **Phase gates apply** (see below); `force` bypasses them. |
|
|
151
|
-
| `csdd_spec_approve` | `feature`, `phase`, `force?`, `root?` | Approve a phase. `phase` ∈ `requirements · design · tasks`. Validates first; `force` approves despite issues/missing prior approvals. |
|
|
152
|
-
| `csdd_spec_validate` | `feature`, `root?` | Validate EARS phrasing, traceability, task annotations, parallel safety. Exit 2 on issues. |
|
|
153
|
-
| `csdd_spec_delete` | `feature`, `force?`, `root?` | Delete `specs/<feature>/` recursively (`force` required). |
|
|
154
|
-
|
|
155
|
-
> **Phase gates (enforced, not advisory):** `design` needs `requirements`
|
|
156
|
-
> approved; `tasks` needs `design` approved. Generating out of order fails with
|
|
157
|
-
> **exit 2** unless `force` is passed. `ready_for_implementation` flips to `true`
|
|
158
|
-
> only when all three phases are approved. `research` and `bugfix` are ungated.
|
|
159
|
-
|
|
160
|
-
### 🛠️ skill — workflow bundles (`.claude/skills/<name>/`)
|
|
161
|
-
|
|
162
|
-
| Tool | Parameters | What it does |
|
|
163
|
-
|------|------------|--------------|
|
|
164
|
-
| `csdd_skill_create` | `name`, `description`, `title?`, `root?` | Create `.claude/skills/<name>/` with `SKILL.md` (+ `references/`, `assets/`, `scripts/`). `description` is the one-line activation trigger. The tool scaffolds the file — author the body by editing `SKILL.md` directly. |
|
|
165
|
-
| `csdd_skill_list` | `root?` | List skills with their descriptions. |
|
|
166
|
-
| `csdd_skill_show` | `name`, `root?` | List a skill's files and print `SKILL.md`. |
|
|
167
|
-
| `csdd_skill_add_reference` | `skill`, `file`, `root?` | Add a reference file under `references/`. Path traversal is rejected. |
|
|
168
|
-
| `csdd_skill_add_script` | `skill`, `file`, `root?` | Add a script file under `scripts/`. Path traversal is rejected. |
|
|
169
|
-
| `csdd_skill_add_asset` | `skill`, `file`, `root?` | Add an asset file under `assets/`. Path traversal is rejected. |
|
|
170
|
-
| `csdd_skill_validate` | `name`, `root?` | Validate structure + frontmatter; report line/token counts. Exit 2 on issues. |
|
|
171
|
-
| `csdd_skill_delete` | `name`, `force?`, `root?` | Delete `.claude/skills/<name>/` recursively (`force` required). |
|
|
172
|
-
|
|
173
|
-
### 🤖 agent — custom sub-agents (`.claude/agents/<name>.md`)
|
|
174
|
-
|
|
175
|
-
| Tool | Parameters | What it does |
|
|
176
|
-
|------|------------|--------------|
|
|
177
|
-
| `csdd_agent_create` | `name`, `description`, `tools?[]`, `model?`, `title?`, `force?`, `root?` | Create a least-privilege sub-agent (default tools: `Read`, `Grep`). `description` tells the orchestrator when to pick it. Scaffolds the file; fill in the body by editing the generated `.md`. `model` ∈ `sonnet · opus · haiku`. |
|
|
178
|
-
| `csdd_agent_list` | `root?` | List agents with their tools and descriptions. |
|
|
179
|
-
| `csdd_agent_show` | `name`, `root?` | Print an agent file. |
|
|
180
|
-
| `csdd_agent_delete` | `name`, `force?`, `root?` | Delete `.claude/agents/<name>.md` (`force` required). |
|
|
181
|
-
|
|
182
|
-
> **Not here:** managing the `.mcp.json` servers themselves (`csdd mcp add/list/
|
|
183
|
-
> remove/enable/disable/validate`) stays on the CLI — same for `csdd init`, `csdd update`, and
|
|
184
|
-
> `csdd export`. Keeping setup off the tool surface is intentional (see Scope).
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## A typical agent flow
|
|
189
|
-
|
|
190
|
-
Setup is a one-time CLI step (`npx @protonspy/csdd init --with-baseline`, which
|
|
191
|
-
also registers this server). From there the agent drives the feature with tools:
|
|
192
|
-
|
|
193
|
-
```jsonc
|
|
194
|
-
csdd_spec_init { "feature": "photo-albums" }
|
|
195
|
-
|
|
196
|
-
csdd_spec_generate { "feature": "photo-albums", "artifact": "requirements" }
|
|
197
|
-
csdd_spec_validate { "feature": "photo-albums" } // exit 2 → fix what it flags
|
|
198
|
-
csdd_spec_approve { "feature": "photo-albums", "phase": "requirements" }
|
|
199
|
-
|
|
200
|
-
csdd_spec_generate { "feature": "photo-albums", "artifact": "design" } // gated on the approval above
|
|
201
|
-
csdd_spec_approve { "feature": "photo-albums", "phase": "design" }
|
|
202
|
-
|
|
203
|
-
csdd_spec_generate { "feature": "photo-albums", "artifact": "tasks" }
|
|
204
|
-
csdd_spec_approve { "feature": "photo-albums", "phase": "tasks" }
|
|
205
|
-
// → spec.json: ready_for_implementation = true
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
`csdd_spec_status { "feature": "photo-albums" }` between steps shows phase,
|
|
209
|
-
approvals, and validation issues in one call.
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## Development
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
npm install
|
|
217
|
-
npm run build # tsc → dist/
|
|
218
|
-
npm test # build + Node's built-in test runner (node:test)
|
|
219
|
-
npm run test:run # tests only, against the current dist/ (no rebuild)
|
|
220
|
-
npm run dev # tsc --watch
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
Tests are TypeScript run through `node:test` with native **type stripping**, so
|
|
224
|
-
they need **Node ≥ 22.18** (dev-only — the published package still targets Node
|
|
225
|
-
≥ 18). They exercise the argv builders, result formatting, binary resolution,
|
|
226
|
-
`runCsdd` against a stub binary, and every tool's argv mapping. See `test/`.
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## License
|
|
231
|
-
|
|
232
|
-
MIT
|
|
1
|
+
# @protonspy/csdd-mcp
|
|
2
|
+
|
|
3
|
+
**An [MCP](https://modelcontextprotocol.io) server that exposes the [`csdd`](https://github.com/protonspy/csdd) CLI as tools — one tool per subcommand.**
|
|
4
|
+
|
|
5
|
+
`csdd` governs the Claude Code Spec-Driven Development workflow (steering, specs,
|
|
6
|
+
skills, sub-agents, MCP servers) and validates the contract mechanically. This
|
|
7
|
+
server lets an MCP-capable agent drive `csdd` **directly as tools**, instead of
|
|
8
|
+
shelling out to a terminal — same operations, same phase gates, same exit codes.
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
agent ──(MCP/stdio)──▶ csdd-mcp ──(execFile)──▶ csdd binary ──▶ .claude/ · specs/
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Each tool builds a `csdd` argv, runs the binary headlessly (`NO_COLOR=1`, no TTY
|
|
15
|
+
so confirmations auto-decline), and returns its `stdout`/`stderr`. A non-zero
|
|
16
|
+
exit becomes an MCP error result; **exit `2` (validation failure) is surfaced
|
|
17
|
+
distinctly** so the agent can tell "your spec is invalid" from "the command
|
|
18
|
+
broke".
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Requirements
|
|
23
|
+
|
|
24
|
+
- **Node.js ≥ 18** (the published package ships compiled JS).
|
|
25
|
+
- **The `csdd` binary**, reachable by the server — see [Locating the csdd binary](#locating-the-csdd-binary).
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Install & configure
|
|
30
|
+
|
|
31
|
+
The server runs over **stdio**; point your MCP client at it.
|
|
32
|
+
|
|
33
|
+
### Claude Code
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# project scope (writes .mcp.json) — or use --scope user for all projects
|
|
37
|
+
claude mcp add csdd -- npx -y @protonspy/csdd-mcp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or add it to `.mcp.json` by hand:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"csdd": {
|
|
46
|
+
"command": "npx",
|
|
47
|
+
"args": ["-y", "@protonspy/csdd-mcp"],
|
|
48
|
+
"env": { "CSDD_BIN": "/usr/local/bin/csdd" }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
> `env.CSDD_BIN` is optional — drop it if `csdd` is on your `PATH`. See below.
|
|
55
|
+
|
|
56
|
+
### Any MCP client
|
|
57
|
+
|
|
58
|
+
Launch `npx -y @protonspy/csdd-mcp` (or `csdd-mcp` if installed globally) as a
|
|
59
|
+
stdio server. The process stays alive serving stdio until the client closes the
|
|
60
|
+
pipe.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Locating the csdd binary
|
|
65
|
+
|
|
66
|
+
The server resolves `csdd` once, on first use, in this order (first hit wins):
|
|
67
|
+
|
|
68
|
+
| # | Source | When it applies |
|
|
69
|
+
|---|--------|-----------------|
|
|
70
|
+
| 1 | **`$CSDD_BIN`** | Explicit absolute path. Always wins — use this if in doubt. |
|
|
71
|
+
| 2 | **Platform package** `@protonspy/csdd-<os>-<arch>` | Declared as an `optionalDependency` of this package, so `npx`/`npm i` fetches the prebuilt binary for your OS/arch automatically — the zero-config path. |
|
|
72
|
+
| 3 | **Sibling repo binary** (`../csdd`, `../../csdd`) | When running from a checkout of the csdd repo. |
|
|
73
|
+
| 4 | **`csdd` on `$PATH`** | Last resort, resolved by the OS at spawn time. |
|
|
74
|
+
|
|
75
|
+
If none resolve, calls fail with **exit `127`** and a message telling you to set
|
|
76
|
+
`CSDD_BIN`, install `@protonspy/csdd`, or put `csdd` on your `PATH`.
|
|
77
|
+
|
|
78
|
+
> **Zero-config:** running via `npx -y @protonspy/csdd-mcp` pulls the matching
|
|
79
|
+
> binary through #2 automatically — nothing to install. Set `CSDD_BIN` only to
|
|
80
|
+
> pin a specific build (e.g. a local dev binary).
|
|
81
|
+
|
|
82
|
+
### Environment
|
|
83
|
+
|
|
84
|
+
| Variable | Effect |
|
|
85
|
+
|----------|--------|
|
|
86
|
+
| `CSDD_BIN` | Absolute path to the `csdd` binary. Highest-priority resolution. |
|
|
87
|
+
| `NO_COLOR` | Forced to `1` for every call so output is ANSI-free (you don't set this). |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Result & error semantics
|
|
92
|
+
|
|
93
|
+
Every tool returns a text result. The mapping from the `csdd` exit code is:
|
|
94
|
+
|
|
95
|
+
| Exit | `isError` | Result text |
|
|
96
|
+
|------|-----------|-------------|
|
|
97
|
+
| `0` | `false` | `stdout` (and any `stderr` as an unlabelled warning); `(ok, no output)` if silent. |
|
|
98
|
+
| `2` | `true` | Prefixed `csdd validation failed (exit 2):` — a contract/validation problem. |
|
|
99
|
+
| other | `true` | Prefixed `csdd failed (exit <n>):`; `stderr` is labelled `[stderr]`. |
|
|
100
|
+
| `127` | `true` | Binary not found — includes guidance to set `CSDD_BIN` / install / fix `PATH`. |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Tool reference
|
|
105
|
+
|
|
106
|
+
**27 tools** covering the csdd **development flow**, grouped by resource.
|
|
107
|
+
Conventions:
|
|
108
|
+
|
|
109
|
+
- Every tool accepts an optional **`root`** — the workspace root (the directory
|
|
110
|
+
containing `.claude/`). Omit it to walk up from the server's working directory.
|
|
111
|
+
- Destructive / gate-breaking tools take **`force`** (boolean). Without it,
|
|
112
|
+
deletes are refused and phase gates hold.
|
|
113
|
+
- `?` marks an optional parameter; everything else is required.
|
|
114
|
+
|
|
115
|
+
> **Scope:** this server exposes only the iterative development-flow resources
|
|
116
|
+
> (steering · spec · skill · agent). **Workspace setup and config management are
|
|
117
|
+
> deliberately not tools** — `csdd init`, `csdd update`, `csdd mcp …`, and `csdd export …` are
|
|
118
|
+
> one-time operations a human runs from the CLI, not part of the loop an agent
|
|
119
|
+
> drives. (In fact, `csdd init` is what registers *this* server.)
|
|
120
|
+
|
|
121
|
+
### Diagnostic
|
|
122
|
+
|
|
123
|
+
| Tool | Parameters | What it does |
|
|
124
|
+
|------|------------|--------------|
|
|
125
|
+
| `csdd_version` | — | Print the underlying `csdd` binary version (diagnostic / connectivity check). |
|
|
126
|
+
|
|
127
|
+
### 🧭 steering — project memory (`.claude/steering/*.md`)
|
|
128
|
+
|
|
129
|
+
| Tool | Parameters | What it does |
|
|
130
|
+
|------|------------|--------------|
|
|
131
|
+
| `csdd_steering_init` | `root?` | Create `.claude/steering/` and the 6 standard files (product, tech, structure, security, testing, api-conventions). |
|
|
132
|
+
| `csdd_steering_create` | `name`, `inclusion`, `pattern?[]`, `description?`, `title?`, `force?`, `root?` | Create a custom steering file. `inclusion` ∈ `always · fileMatch · manual · auto`. `fileMatch` requires ≥1 `pattern`; `auto` requires a `description`. |
|
|
133
|
+
| `csdd_steering_list` | `root?`, `inclusion?` | List steering files with inclusion mode; optionally filter by `inclusion`. |
|
|
134
|
+
| `csdd_steering_show` | `name`, `root?` | Print a steering file (frontmatter + body). |
|
|
135
|
+
| `csdd_steering_delete` | `name`, `force?`, `root?` | Delete a steering file (`force` required). Foundational files (product, tech, structure) are protected. |
|
|
136
|
+
| `csdd_steering_validate` | `name?`, `root?` | Validate frontmatter/structure. Omit `name` to validate all. Exit 2 on issues. |
|
|
137
|
+
|
|
138
|
+
`inclusion` controls *when* the steering loads: `always` (always-on), `fileMatch`
|
|
139
|
+
(when files match a `pattern`), `manual` (`#name`), `auto` (when its `description`
|
|
140
|
+
matches the context).
|
|
141
|
+
|
|
142
|
+
### 📐 spec — per-feature contract (`specs/<feature>/`)
|
|
143
|
+
|
|
144
|
+
| Tool | Parameters | What it does |
|
|
145
|
+
|------|------------|--------------|
|
|
146
|
+
| `csdd_spec_init` | `feature`, `language?`, `root?` | Create `specs/<feature>/spec.json` (phase = initial, no approvals). `language` defaults to `en`. |
|
|
147
|
+
| `csdd_spec_list` | `root?` | List specs with current phase, approved phases, and readiness. |
|
|
148
|
+
| `csdd_spec_show` | `feature`, `root?` | Show a spec's `spec.json` metadata and its artifacts. |
|
|
149
|
+
| `csdd_spec_status` | `feature`, `root?` | Combined `show` + `validate` for a spec. |
|
|
150
|
+
| `csdd_spec_generate` | `feature`, `artifact`, `force?`, `root?` | Generate an artifact. `artifact` ∈ `requirements · design · tasks · research · bugfix`. **Phase gates apply** (see below); `force` bypasses them. |
|
|
151
|
+
| `csdd_spec_approve` | `feature`, `phase`, `force?`, `root?` | Approve a phase. `phase` ∈ `requirements · design · tasks`. Validates first; `force` approves despite issues/missing prior approvals. |
|
|
152
|
+
| `csdd_spec_validate` | `feature`, `root?` | Validate EARS phrasing, traceability, task annotations, parallel safety. Exit 2 on issues. |
|
|
153
|
+
| `csdd_spec_delete` | `feature`, `force?`, `root?` | Delete `specs/<feature>/` recursively (`force` required). |
|
|
154
|
+
|
|
155
|
+
> **Phase gates (enforced, not advisory):** `design` needs `requirements`
|
|
156
|
+
> approved; `tasks` needs `design` approved. Generating out of order fails with
|
|
157
|
+
> **exit 2** unless `force` is passed. `ready_for_implementation` flips to `true`
|
|
158
|
+
> only when all three phases are approved. `research` and `bugfix` are ungated.
|
|
159
|
+
|
|
160
|
+
### 🛠️ skill — workflow bundles (`.claude/skills/<name>/`)
|
|
161
|
+
|
|
162
|
+
| Tool | Parameters | What it does |
|
|
163
|
+
|------|------------|--------------|
|
|
164
|
+
| `csdd_skill_create` | `name`, `description`, `title?`, `root?` | Create `.claude/skills/<name>/` with `SKILL.md` (+ `references/`, `assets/`, `scripts/`). `description` is the one-line activation trigger. The tool scaffolds the file — author the body by editing `SKILL.md` directly. |
|
|
165
|
+
| `csdd_skill_list` | `root?` | List skills with their descriptions. |
|
|
166
|
+
| `csdd_skill_show` | `name`, `root?` | List a skill's files and print `SKILL.md`. |
|
|
167
|
+
| `csdd_skill_add_reference` | `skill`, `file`, `root?` | Add a reference file under `references/`. Path traversal is rejected. |
|
|
168
|
+
| `csdd_skill_add_script` | `skill`, `file`, `root?` | Add a script file under `scripts/`. Path traversal is rejected. |
|
|
169
|
+
| `csdd_skill_add_asset` | `skill`, `file`, `root?` | Add an asset file under `assets/`. Path traversal is rejected. |
|
|
170
|
+
| `csdd_skill_validate` | `name`, `root?` | Validate structure + frontmatter; report line/token counts. Exit 2 on issues. |
|
|
171
|
+
| `csdd_skill_delete` | `name`, `force?`, `root?` | Delete `.claude/skills/<name>/` recursively (`force` required). |
|
|
172
|
+
|
|
173
|
+
### 🤖 agent — custom sub-agents (`.claude/agents/<name>.md`)
|
|
174
|
+
|
|
175
|
+
| Tool | Parameters | What it does |
|
|
176
|
+
|------|------------|--------------|
|
|
177
|
+
| `csdd_agent_create` | `name`, `description`, `tools?[]`, `model?`, `title?`, `force?`, `root?` | Create a least-privilege sub-agent (default tools: `Read`, `Grep`). `description` tells the orchestrator when to pick it. Scaffolds the file; fill in the body by editing the generated `.md`. `model` ∈ `sonnet · opus · haiku`. |
|
|
178
|
+
| `csdd_agent_list` | `root?` | List agents with their tools and descriptions. |
|
|
179
|
+
| `csdd_agent_show` | `name`, `root?` | Print an agent file. |
|
|
180
|
+
| `csdd_agent_delete` | `name`, `force?`, `root?` | Delete `.claude/agents/<name>.md` (`force` required). |
|
|
181
|
+
|
|
182
|
+
> **Not here:** managing the `.mcp.json` servers themselves (`csdd mcp add/list/
|
|
183
|
+
> remove/enable/disable/validate`) stays on the CLI — same for `csdd init`, `csdd update`, and
|
|
184
|
+
> `csdd export`. Keeping setup off the tool surface is intentional (see Scope).
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## A typical agent flow
|
|
189
|
+
|
|
190
|
+
Setup is a one-time CLI step (`npx @protonspy/csdd init --with-baseline`, which
|
|
191
|
+
also registers this server). From there the agent drives the feature with tools:
|
|
192
|
+
|
|
193
|
+
```jsonc
|
|
194
|
+
csdd_spec_init { "feature": "photo-albums" }
|
|
195
|
+
|
|
196
|
+
csdd_spec_generate { "feature": "photo-albums", "artifact": "requirements" }
|
|
197
|
+
csdd_spec_validate { "feature": "photo-albums" } // exit 2 → fix what it flags
|
|
198
|
+
csdd_spec_approve { "feature": "photo-albums", "phase": "requirements" }
|
|
199
|
+
|
|
200
|
+
csdd_spec_generate { "feature": "photo-albums", "artifact": "design" } // gated on the approval above
|
|
201
|
+
csdd_spec_approve { "feature": "photo-albums", "phase": "design" }
|
|
202
|
+
|
|
203
|
+
csdd_spec_generate { "feature": "photo-albums", "artifact": "tasks" }
|
|
204
|
+
csdd_spec_approve { "feature": "photo-albums", "phase": "tasks" }
|
|
205
|
+
// → spec.json: ready_for_implementation = true
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
`csdd_spec_status { "feature": "photo-albums" }` between steps shows phase,
|
|
209
|
+
approvals, and validation issues in one call.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Development
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
npm install
|
|
217
|
+
npm run build # tsc → dist/
|
|
218
|
+
npm test # build + Node's built-in test runner (node:test)
|
|
219
|
+
npm run test:run # tests only, against the current dist/ (no rebuild)
|
|
220
|
+
npm run dev # tsc --watch
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Tests are TypeScript run through `node:test` with native **type stripping**, so
|
|
224
|
+
they need **Node ≥ 22.18** (dev-only — the published package still targets Node
|
|
225
|
+
≥ 18). They exercise the argv builders, result formatting, binary resolution,
|
|
226
|
+
`runCsdd` against a stub binary, and every tool's argv mapping. See `test/`.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
MIT
|
package/dist/tools/spec.js
CHANGED
|
@@ -88,4 +88,46 @@ export const specTools = [
|
|
|
88
88
|
inputSchema: { feature, force: forceField, root: rootField },
|
|
89
89
|
toArgs: (p) => ["spec", "delete", p.feature, ...bool("--force", p.force), ...rootArg(p)],
|
|
90
90
|
},
|
|
91
|
+
{
|
|
92
|
+
name: "csdd_spec_test_report",
|
|
93
|
+
title: "Spec test report",
|
|
94
|
+
description: "Record per-spec unit-test evidence into specs/<feature>/test-report.json (surfaced by the dashboard). With run=true it executes the tests (the per-language default command, or cmd) and parses the JUnit + coverage reports they produce into the JSON contract; lang/path auto-discover reports (python|typescript|java|go|rust); or pass an explicit junit and/or coverage file. The run exits non-zero when tests fail, so it gates the task.",
|
|
95
|
+
inputSchema: {
|
|
96
|
+
feature,
|
|
97
|
+
run: z
|
|
98
|
+
.boolean()
|
|
99
|
+
.optional()
|
|
100
|
+
.describe("Execute the tests before parsing (per-language default command, or cmd)."),
|
|
101
|
+
cmd: z
|
|
102
|
+
.string()
|
|
103
|
+
.optional()
|
|
104
|
+
.describe("Test command to execute with run=true (overrides the per-language default; validated against the language's tooling)."),
|
|
105
|
+
lang: z
|
|
106
|
+
.enum(["python", "typescript", "java", "go", "rust"])
|
|
107
|
+
.optional()
|
|
108
|
+
.describe("Language: selects the run default command and the coverage format to auto-discover."),
|
|
109
|
+
path: z
|
|
110
|
+
.string()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe("Directory to run in / discover JUnit+coverage reports under (e.g. tests/). Defaults to the workspace root."),
|
|
113
|
+
junit: z.string().optional().describe("Explicit JUnit XML report to parse for test counts."),
|
|
114
|
+
coverage: z
|
|
115
|
+
.string()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe("Explicit coverage report to parse (lcov/Cobertura/JaCoCo/Go coverprofile)."),
|
|
118
|
+
root: rootField,
|
|
119
|
+
},
|
|
120
|
+
toArgs: (p) => [
|
|
121
|
+
"spec",
|
|
122
|
+
"test-report",
|
|
123
|
+
p.feature,
|
|
124
|
+
...bool("--run", p.run),
|
|
125
|
+
...flag("--cmd", p.cmd),
|
|
126
|
+
...flag("--lang", p.lang),
|
|
127
|
+
...flag("--path", p.path),
|
|
128
|
+
...flag("--junit", p.junit),
|
|
129
|
+
...flag("--coverage", p.coverage),
|
|
130
|
+
...rootArg(p),
|
|
131
|
+
],
|
|
132
|
+
},
|
|
91
133
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protonspy/csdd-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server exposing the csdd CLI over stdio (one tool per subcommand).",
|
|
5
5
|
"homepage": "https://github.com/protonspy/csdd/tree/main/mcp-server#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"zod": "^3.23.8"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@protonspy/csdd-linux-x64": "0.
|
|
40
|
-
"@protonspy/csdd-linux-arm64": "0.
|
|
41
|
-
"@protonspy/csdd-darwin-x64": "0.
|
|
42
|
-
"@protonspy/csdd-darwin-arm64": "0.
|
|
43
|
-
"@protonspy/csdd-win32-x64": "0.
|
|
39
|
+
"@protonspy/csdd-linux-x64": "0.2.0",
|
|
40
|
+
"@protonspy/csdd-linux-arm64": "0.2.0",
|
|
41
|
+
"@protonspy/csdd-darwin-x64": "0.2.0",
|
|
42
|
+
"@protonspy/csdd-darwin-arm64": "0.2.0",
|
|
43
|
+
"@protonspy/csdd-win32-x64": "0.2.0"
|
|
44
44
|
}
|
|
45
45
|
}
|