empirical-sdd 0.20.1 → 0.20.2
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 +182 -150
- package/dist/cli.js +740 -279
- package/dist/core.d.ts +2 -0
- package/dist/discovery.d.ts +26 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +664 -94
- package/dist/integrations.d.ts +24 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Empirical SDD
|
|
2
2
|
|
|
3
|
-
Empirical is an agent-neutral spec-driven development engine for Codex, Claude
|
|
3
|
+
Empirical is an agent-neutral, spec-driven development engine for Codex, Claude
|
|
4
4
|
Code, Cursor, Gemini CLI, Windsurf, and MCP clients. It turns a coding request
|
|
5
|
-
into
|
|
6
|
-
|
|
5
|
+
into a durable contract, exact workflow revisions, verification evidence,
|
|
6
|
+
review, and living capability specifications.
|
|
7
7
|
|
|
8
|
-
Empirical `0.20.
|
|
9
|
-
and real Git worktrees for parallel work.
|
|
8
|
+
Empirical `0.20.2` is an alpha release. It supports one active feature per
|
|
9
|
+
checkout and uses real Git worktrees for isolated parallel work.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -15,17 +15,26 @@ npm install -g empirical-sdd
|
|
|
15
15
|
empirical install
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
`empirical install` opens a multi-select list of
|
|
19
|
-
Detected agents and existing
|
|
20
|
-
|
|
21
|
-
Enter to install.
|
|
18
|
+
`empirical install` opens a multi-select list of supported coding agents.
|
|
19
|
+
Detected agents and existing managed installations are selected by default.
|
|
20
|
+
Use Up/Down, Space, `a`, and Enter to submit the exact selection.
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
selected agent and removes only Empirical-managed entrypoints from agents you
|
|
25
|
-
deselect. Unmanaged files are never overwritten or deleted. The installer works
|
|
26
|
-
from any directory and neither creates repository state nor launches an agent.
|
|
22
|
+
Every selected agent receives five global skills:
|
|
27
23
|
|
|
28
|
-
|
|
24
|
+
| Intent | Skill |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| Automatic setup, routing, and execution | `empirical` |
|
|
27
|
+
| Initialize or repair this repository only | `empirical-init` |
|
|
28
|
+
| Draft a concrete specification and stop | `empirical-spec` |
|
|
29
|
+
| Run the five-pass interview, draft, and stop | `empirical-socratic` |
|
|
30
|
+
| Resume the approved specification to completion | `empirical-loop` |
|
|
31
|
+
|
|
32
|
+
The installer removes only marker-owned Empirical skills from agents you
|
|
33
|
+
deselect. It preserves unmanaged files, directories, symbolic links, and
|
|
34
|
+
unrelated settings. It works from any directory and does not create repository
|
|
35
|
+
state or launch an agent.
|
|
36
|
+
|
|
37
|
+
For unattended installation:
|
|
29
38
|
|
|
30
39
|
```bash
|
|
31
40
|
# Exact selection; repeat -a/--agent
|
|
@@ -38,66 +47,75 @@ empirical install --all
|
|
|
38
47
|
empirical install --yes
|
|
39
48
|
```
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
Restart or reload the selected agent after installation. Native invocations are:
|
|
42
51
|
|
|
43
|
-
| Agent |
|
|
44
|
-
| --- | --- |
|
|
45
|
-
| Codex | `$empirical` |
|
|
46
|
-
| Claude Code | `/empirical` |
|
|
47
|
-
| Cursor Agent
|
|
48
|
-
| Gemini CLI | `empirical` |
|
|
49
|
-
| Windsurf Cascade | `@empirical` |
|
|
52
|
+
| Agent | Automatic | Init | Spec | Socratic | Loop |
|
|
53
|
+
| --- | --- | --- | --- | --- | --- |
|
|
54
|
+
| Codex | `$empirical` | `$empirical-init` | `$empirical-spec` | `$empirical-socratic` | `$empirical-loop` |
|
|
55
|
+
| Claude Code | `/empirical` | `/empirical-init` | `/empirical-spec` | `/empirical-socratic` | `/empirical-loop` |
|
|
56
|
+
| Cursor Agent | `empirical` | `empirical-init` | `empirical-spec` | `empirical-socratic` | `empirical-loop` |
|
|
57
|
+
| Gemini CLI | `empirical` | `empirical-init` | `empirical-spec` | `empirical-socratic` | `empirical-loop` |
|
|
58
|
+
| Windsurf Cascade | `@empirical` | `@empirical-init` | `@empirical-spec` | `@empirical-socratic` | `@empirical-loop` |
|
|
50
59
|
|
|
51
|
-
To upgrade
|
|
60
|
+
To upgrade the package and refresh every selected skill:
|
|
52
61
|
|
|
53
62
|
```bash
|
|
54
63
|
empirical update
|
|
55
64
|
```
|
|
56
65
|
|
|
57
66
|
`empirical install` and `empirical update` are the entire public terminal CLI.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## One entrypoint owns the workflow
|
|
67
|
+
Init, Spec, Socratic, and Loop are coding-agent skills, not shell commands.
|
|
68
|
+
Internal workflow operations remain available to installed skills through MCP
|
|
69
|
+
and a private compatibility transport.
|
|
63
70
|
|
|
64
|
-
|
|
65
|
-
It deterministically:
|
|
71
|
+
## Choose automatic or deliberate mode
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
3. resumes non-terminal work already owned by this checkout;
|
|
70
|
-
4. uses the original five-pass Socratic interview only when the request is
|
|
71
|
-
genuinely vague;
|
|
72
|
-
5. routes an approved, concrete request internally to Fast or Complex;
|
|
73
|
-
6. executes exact revisions through evidence, review, and living-spec archive;
|
|
74
|
-
7. offers an explicit agent handoff only after a Complex specification exists.
|
|
73
|
+
Both modes use the same state machine, artifacts, evidence gates, and safety
|
|
74
|
+
rules.
|
|
75
75
|
|
|
76
76
|
```text
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
│
|
|
87
|
-
Continue here | Save | Continue in agent
|
|
77
|
+
Automatic
|
|
78
|
+
empirical request
|
|
79
|
+
└─ setup/repair → resume or discover/route → execute → verify → review → done
|
|
80
|
+
|
|
81
|
+
Deliberate SDD
|
|
82
|
+
empirical-init
|
|
83
|
+
└─ empirical-spec request ──────────────┐
|
|
84
|
+
└─ empirical-socratic idea → interview ├─ review contract → empirical-loop → done
|
|
85
|
+
┘
|
|
88
86
|
```
|
|
89
87
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
and
|
|
88
|
+
Use `empirical` when you want the agent to choose the right path and keep going.
|
|
89
|
+
Use the explicit skills when you want to inspect the specification before any
|
|
90
|
+
implementation begins. Fast and Complex are internal profiles; users do not
|
|
91
|
+
need separate skills for them.
|
|
92
|
+
|
|
93
|
+
## Initialize a repository
|
|
94
|
+
|
|
95
|
+
Inside the repository, invoke the Init skill in your coding agent. For Codex:
|
|
96
|
+
|
|
97
|
+
> `$empirical-init`
|
|
98
|
+
|
|
99
|
+
Init inspects manifests, documentation, source, tests, Git state, existing
|
|
100
|
+
Empirical configuration, and living capabilities. It asks one focused question
|
|
101
|
+
at a time only when the answer changes:
|
|
93
102
|
|
|
94
|
-
|
|
103
|
+
- whether unrelated active work should use a sibling Git worktree;
|
|
104
|
+
- the base branch, worktree path, and branch pattern;
|
|
105
|
+
- whether Complex decisions require reviewable decision records.
|
|
95
106
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
It then creates or repairs `.empirical/`, installs repository MCP bridges,
|
|
108
|
+
refreshes compact context, confirms `setupComplete: true`, and stops. It does not
|
|
109
|
+
create a feature or specification.
|
|
99
110
|
|
|
100
|
-
|
|
111
|
+
You can skip explicit Init and invoke `$empirical` directly; the automatic skill
|
|
112
|
+
performs the same preflight first. A partial schema-4 repository—such as one with
|
|
113
|
+
`setupComplete: false` or missing `.empirical/context/`—is repaired rather than
|
|
114
|
+
mistaken for a complete setup. Marker-owned old project-local skills are removed
|
|
115
|
+
so they cannot shadow global updates; unmanaged collisions are preserved and
|
|
116
|
+
reported.
|
|
117
|
+
|
|
118
|
+
Initialization creates:
|
|
101
119
|
|
|
102
120
|
```text
|
|
103
121
|
.empirical/context/
|
|
@@ -109,119 +127,135 @@ Initialization also creates a compact, committed context set:
|
|
|
109
127
|
└── conventions.md
|
|
110
128
|
```
|
|
111
129
|
|
|
112
|
-
The deterministic manifest contains bounded path, size, and
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
130
|
+
The deterministic manifest contains bounded path, size, and digest metadata,
|
|
131
|
+
not source contents. Dependencies, build output, ignored files, secret-like
|
|
132
|
+
paths, credentials, binaries, and large files are excluded. There are no
|
|
133
|
+
embeddings, hosted RAG services, or vector databases.
|
|
134
|
+
|
|
135
|
+
## Explicit Spec: a small concrete feature
|
|
136
|
+
|
|
137
|
+
In Codex:
|
|
138
|
+
|
|
139
|
+
> `$empirical-spec` Add a keyboard shortcut that opens the existing command
|
|
140
|
+
> palette with Cmd/Ctrl+K. Do not change the palette design.
|
|
141
|
+
|
|
142
|
+
Spec ensures the repository is initialized, starts internal Complex Specify,
|
|
143
|
+
inspects the relevant code and living capabilities, and writes observable
|
|
144
|
+
acceptance criteria, scope, non-goals, risks, verification, and capability
|
|
145
|
+
deltas. It then stops. No implementation code is written and the pending
|
|
146
|
+
Specify revision is not completed.
|
|
147
|
+
|
|
148
|
+
Review the files under `.empirical/specs/<feature>/`. When the contract is right:
|
|
149
|
+
|
|
150
|
+
> `$empirical-loop`
|
|
151
|
+
|
|
152
|
+
That invocation is explicit approval to complete Specify and continue through
|
|
153
|
+
Design, Plan, Implement, Verify, Review, and Archive.
|
|
117
154
|
|
|
118
|
-
## Socratic
|
|
155
|
+
## Explicit Socratic: a complex or vague feature
|
|
119
156
|
|
|
120
|
-
|
|
121
|
-
|
|
157
|
+
In Codex:
|
|
158
|
+
|
|
159
|
+
> `$empirical-socratic` Build a team notification center that works well across
|
|
160
|
+
> desktop and mobile.
|
|
161
|
+
|
|
162
|
+
Socratic asks one question at a time across the original five passes:
|
|
122
163
|
|
|
123
164
|
1. primary user and observed problem;
|
|
124
165
|
2. smallest observable outcome;
|
|
125
166
|
3. boundaries, constraints, and explicit non-goals;
|
|
126
|
-
4.
|
|
167
|
+
4. failure behavior and solution-changing risks;
|
|
127
168
|
5. concrete verification.
|
|
128
169
|
|
|
129
|
-
It
|
|
130
|
-
|
|
131
|
-
state.
|
|
170
|
+
It reflects each answer, asks only a material follow-up, and saves progress after
|
|
171
|
+
every pass. After all five, it displays one exact refined request. Rejecting or
|
|
172
|
+
saving creates no workflow state. Approving binds that exact request to Complex
|
|
173
|
+
Specify, drafts the specification and capability deltas, and stops again for
|
|
174
|
+
contract review.
|
|
132
175
|
|
|
133
|
-
|
|
176
|
+
After reviewing the draft:
|
|
134
177
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
> `$empirical` Add a health command that prints `ok`.
|
|
178
|
+
> `$empirical-loop`
|
|
138
179
|
|
|
139
|
-
|
|
140
|
-
it internally to Fast. The agent inspects only relevant files, implements the
|
|
141
|
-
generated observable criterion, runs one focused test, reviews the diff, and
|
|
142
|
-
completes the exact revision. The durable result is:
|
|
180
|
+
## Automatic demos
|
|
143
181
|
|
|
144
|
-
|
|
145
|
-
.empirical/specs/add-a-health-command-that-prints-ok/
|
|
146
|
-
├── spec.md
|
|
147
|
-
├── state.json
|
|
148
|
-
├── events/
|
|
149
|
-
└── evidence.json
|
|
150
|
-
```
|
|
182
|
+
For a tiny, localized, reversible, low-risk, non-UI change:
|
|
151
183
|
|
|
152
|
-
|
|
184
|
+
> `$empirical` Add a health command that prints `ok`.
|
|
153
185
|
|
|
154
|
-
|
|
186
|
+
Empirical routes internally to Fast, implements the criterion, runs focused
|
|
187
|
+
tests, reviews the diff, and completes the exact revision.
|
|
155
188
|
|
|
156
|
-
|
|
189
|
+
For a substantial feature:
|
|
157
190
|
|
|
158
191
|
> `$empirical` Add team invitations with expiration, revocation, and audit
|
|
159
192
|
> history. Existing members must keep access during rollout.
|
|
160
193
|
|
|
161
|
-
Empirical routes
|
|
194
|
+
Empirical routes to Complex and drives seven gates:
|
|
162
195
|
|
|
163
|
-
1. Specify observable
|
|
164
|
-
|
|
165
|
-
2. Design the architecture and record accepted evidence-backed decisions.
|
|
196
|
+
1. Specify observable behavior and capability deltas.
|
|
197
|
+
2. Design the solution and record accepted evidence-backed decisions.
|
|
166
198
|
3. Plan an executable implementation sequence.
|
|
167
199
|
4. Implement the approved contract.
|
|
168
|
-
5. Verify every criterion; UI work requires real-browser evidence.
|
|
169
|
-
6. Review the diff against criteria and
|
|
200
|
+
5. Verify every criterion; UI work requires real-browser and screenshot evidence.
|
|
201
|
+
6. Review the diff against criteria and decisions.
|
|
170
202
|
7. Archive reviewed deltas into living capability specifications.
|
|
171
203
|
|
|
172
|
-
|
|
204
|
+
For a genuinely vague automatic request, Empirical uses the same durable
|
|
205
|
+
five-pass Socratic operation before routing. A concrete request does not pay that
|
|
206
|
+
discovery cost.
|
|
173
207
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
-
|
|
208
|
+
## Resume safely with Loop
|
|
209
|
+
|
|
210
|
+
`empirical-loop` takes no new feature request. It asks Empirical for the selected
|
|
211
|
+
action, completes its exact revision with required artifacts and evidence, and
|
|
212
|
+
continues until Done, Blocked, or Awaiting Human.
|
|
213
|
+
|
|
214
|
+
If no feature is selected, Loop creates nothing and points to Automatic, Spec,
|
|
215
|
+
or Socratic. Attached text never replaces active work. If another feature is
|
|
216
|
+
already active, starting unrelated work returns a read-only worktree proposal
|
|
217
|
+
instead of overwriting state.
|
|
177
218
|
|
|
178
|
-
|
|
179
|
-
prompt or only a workspace, the exact working directory, and exact argument
|
|
180
|
-
array. Detection and Save launch nothing. The command is revalidated and
|
|
181
|
-
authorized only after you explicitly approve that exact option.
|
|
219
|
+
## Worktrees and agent handoff
|
|
182
220
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
221
|
+
An isolation proposal shows its base and immutable base commit, branch, sibling
|
|
222
|
+
path, exact Git argument array, and approval token. Empirical waits for explicit
|
|
223
|
+
approval, requires a clean source checkout, revalidates every field, rejects
|
|
224
|
+
collisions, and creates the linked checkout without force. It never stashes,
|
|
225
|
+
commits, moves local changes, deletes worktrees, or deletes branches.
|
|
186
226
|
|
|
187
|
-
|
|
227
|
+
After a Complex specification passes, Automatic or Loop offers:
|
|
188
228
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
229
|
+
- Continue here.
|
|
230
|
+
- Save for later.
|
|
231
|
+
- Continue in a detected agent.
|
|
192
232
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
deletes worktrees, or deletes branches.
|
|
233
|
+
Detection and Save launch nothing. Before external handoff, Empirical displays
|
|
234
|
+
the agent, its prompt/workspace capability, cwd, and exact argv; it authorizes
|
|
235
|
+
only the unchanged option after explicit approval.
|
|
197
236
|
|
|
198
|
-
Active selection lives in checkout-local Git metadata
|
|
199
|
-
contracts remain
|
|
200
|
-
|
|
237
|
+
Active selection lives in checkout-local Git metadata. Portable feature
|
|
238
|
+
contracts remain under `.empirical/specs/`, so a linked checkout does not inherit
|
|
239
|
+
a blocked feature owned by another checkout.
|
|
201
240
|
|
|
202
241
|
## Internal automation API
|
|
203
242
|
|
|
204
|
-
The TypeScript API and MCP
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
`empirical_complete`, `empirical_retry`, `empirical_verify`,
|
|
217
|
-
`empirical_archive`;
|
|
218
|
-
- handoff/isolation: `empirical_handoff`, `empirical_worktree_propose`,
|
|
219
|
-
`empirical_worktree_create`;
|
|
220
|
-
- understanding: `empirical_explain`, `empirical_status`,
|
|
243
|
+
The TypeScript API and MCP server expose the primitives used by installed
|
|
244
|
+
skills. They are not additional public terminal commands.
|
|
245
|
+
|
|
246
|
+
- Setup/context: `empirical_init`, `empirical_adopt`, `empirical_configure`,
|
|
247
|
+
`empirical_context`.
|
|
248
|
+
- Discovery/routing: `empirical_explore`, `empirical_discovery`,
|
|
249
|
+
`empirical_fast`, `empirical_complex`.
|
|
250
|
+
- Workflow: `empirical_loop`, `empirical_next`, `empirical_complete`,
|
|
251
|
+
`empirical_retry`, `empirical_verify`, `empirical_archive`.
|
|
252
|
+
- Handoff/isolation: `empirical_handoff`, `empirical_worktree_propose`,
|
|
253
|
+
`empirical_worktree_create`.
|
|
254
|
+
- Understanding: `empirical_explain`, `empirical_status`,
|
|
221
255
|
`empirical_capabilities`, `empirical_policy`, `empirical_doctor`.
|
|
222
256
|
|
|
223
|
-
|
|
224
|
-
|
|
257
|
+
Generated skills use MCP first and `empirical __internal` only as a private
|
|
258
|
+
fallback when MCP is unavailable. Humans should not invoke that namespace.
|
|
225
259
|
|
|
226
260
|
## Committed layout
|
|
227
261
|
|
|
@@ -246,28 +280,26 @@ approval-bound command but never launches it itself.
|
|
|
246
280
|
└── evidence.json
|
|
247
281
|
```
|
|
248
282
|
|
|
249
|
-
|
|
250
|
-
policy are
|
|
251
|
-
|
|
283
|
+
Specifications, decisions, journals, context, capabilities, configuration, and
|
|
284
|
+
policy are durable, reviewable state. Decision records contain evidence,
|
|
285
|
+
options, the chosen approach, trade-offs, risks, and verification—not private
|
|
286
|
+
chain-of-thought, prompts, tokens, credentials, or scratchpads.
|
|
252
287
|
|
|
253
|
-
## Migration and
|
|
288
|
+
## Migration and development
|
|
254
289
|
|
|
255
|
-
Running
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
readable.
|
|
290
|
+
Running `empirical install` again migrates global integrations. Repository Init
|
|
291
|
+
removes only marker-owned old local skills and repairs partial setup. Both
|
|
292
|
+
operations converge, preserve unmanaged content, and keep schema-4 projects and
|
|
293
|
+
discovery records readable.
|
|
260
294
|
|
|
261
|
-
Schema-1
|
|
262
|
-
|
|
263
|
-
left untouched and unsupported.
|
|
295
|
+
Schema-1 through schema-3 root state migrates idempotently into feature-local
|
|
296
|
+
state. Empirical v1 `ai/` adoption remains available through agent automation.
|
|
264
297
|
|
|
265
|
-
See [migration details](docs/migration-v1.md), the
|
|
266
|
-
|
|
298
|
+
See [migration details](docs/migration-v1.md), the
|
|
299
|
+
[architecture](docs/architecture.md), [MCP guide](docs/mcp.md),
|
|
300
|
+
[security model](docs/security.md), [demos](docs/demo.md), and
|
|
267
301
|
[OpenSpec comparison](docs/openspec-comparison.md).
|
|
268
302
|
|
|
269
|
-
## Development
|
|
270
|
-
|
|
271
303
|
```bash
|
|
272
304
|
bun install
|
|
273
305
|
bun run ci
|