empirical-sdd 0.20.1 → 0.20.3
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 +56 -259
- package/dist/agent-catalog.d.ts +441 -0
- package/dist/cli.js +1795 -549
- package/dist/core.d.ts +2 -0
- package/dist/discovery.d.ts +26 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +1309 -222
- package/dist/integrations.d.ts +29 -4
- package/dist/selector.d.ts +26 -7
- package/dist/setup.d.ts +11 -0
- package/dist/types.d.ts +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,279 +1,76 @@
|
|
|
1
1
|
# Empirical SDD
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
living capability specifications, and safe Git worktree isolation.
|
|
3
|
+
Agent-neutral, resumable spec-driven development for 73 global agent-skill
|
|
4
|
+
targets, with verified runtime guidance for Codex, Claude Code, Cursor, Gemini
|
|
5
|
+
CLI, Windsurf, and MCP clients.
|
|
7
6
|
|
|
8
|
-
Empirical
|
|
9
|
-
|
|
7
|
+
> Empirical is alpha software. It supports one active feature per checkout and
|
|
8
|
+
> uses Git worktrees for isolated parallel work.
|
|
10
9
|
|
|
11
10
|
## Install
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
npm install -g empirical-sdd
|
|
15
|
-
empirical install
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
`empirical install` opens a multi-select list of every supported coding agent.
|
|
19
|
-
Detected agents and existing Empirical installations are labeled and selected
|
|
20
|
-
by default. Use the arrow keys to move, Space to select, `a` to toggle all, and
|
|
21
|
-
Enter to install.
|
|
22
|
-
|
|
23
|
-
The selection is exact: Empirical installs one global entrypoint in every
|
|
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.
|
|
27
|
-
|
|
28
|
-
For scripts and unattended setup, choose agents explicitly:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
# Exact selection; repeat -a/--agent
|
|
32
|
-
empirical install --agent codex --agent cursor
|
|
33
|
-
|
|
34
|
-
# Every supported agent
|
|
35
|
-
empirical install --all
|
|
36
|
-
|
|
37
|
-
# Detected agents plus existing managed installations
|
|
38
|
-
empirical install --yes
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Then open your repository in a coding agent and use its one Empirical entrypoint:
|
|
42
|
-
|
|
43
|
-
| Agent | Invocation |
|
|
12
|
+
| Command | Purpose |
|
|
44
13
|
| --- | --- |
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
| Gemini CLI | `empirical` |
|
|
49
|
-
| Windsurf Cascade | `@empirical` |
|
|
50
|
-
|
|
51
|
-
To upgrade both the package and installed entrypoints:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
empirical update
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
`empirical install` and `empirical update` are the entire public terminal CLI.
|
|
58
|
-
Repository setup and feature work happen inside the current coding agent; old
|
|
59
|
-
terminal verbs such as `init`, `config`, `explore`, `fast`, `complex`, and
|
|
60
|
-
`loop` are rejected.
|
|
61
|
-
|
|
62
|
-
## One entrypoint owns the workflow
|
|
63
|
-
|
|
64
|
-
Ask the installed Empirical entrypoint for repository work in ordinary language.
|
|
65
|
-
It deterministically:
|
|
66
|
-
|
|
67
|
-
1. initializes an uninitialized repository in the current runtime;
|
|
68
|
-
2. builds or refreshes compact repository knowledge;
|
|
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.
|
|
75
|
-
|
|
76
|
-
```text
|
|
77
|
-
one Empirical invocation
|
|
78
|
-
│
|
|
79
|
-
├─ repository uninitialized ──> first-run setup + compact context
|
|
80
|
-
├─ active feature found ──────> resume exact revision
|
|
81
|
-
└─ new request
|
|
82
|
-
├─ genuinely vague ────> five Socratic passes ──> approval
|
|
83
|
-
└─ concrete ───────────> internal Fast / Complex routing
|
|
84
|
-
│
|
|
85
|
-
approved Complex spec exists?
|
|
86
|
-
│
|
|
87
|
-
Continue here | Save | Continue in agent
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Fast is only for explicit, tiny, localized, reversible, low-risk, non-UI work.
|
|
91
|
-
Everything else—including UI, architecture, public APIs, security, migrations,
|
|
92
|
-
and cross-cutting changes—uses Complex.
|
|
93
|
-
|
|
94
|
-
## First use and repository knowledge
|
|
95
|
-
|
|
96
|
-
On first use, the agent initializes `.empirical/`. It applies safe defaults or
|
|
97
|
-
asks only questions that materially change Git isolation or Complex decision
|
|
98
|
-
policy. It does not install project-local workflow skills.
|
|
99
|
-
|
|
100
|
-
Initialization also creates a compact, committed context set:
|
|
101
|
-
|
|
102
|
-
```text
|
|
103
|
-
.empirical/context/
|
|
104
|
-
├── manifest.json
|
|
105
|
-
├── index.md
|
|
106
|
-
├── overview.md
|
|
107
|
-
├── architecture.md
|
|
108
|
-
├── commands.md
|
|
109
|
-
└── conventions.md
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
The deterministic manifest contains bounded path, size, and content-digest
|
|
113
|
-
metadata—not source contents. Dependency trees, build output, ignored files,
|
|
114
|
-
secret-like paths, credentials, binary files, and large files are excluded.
|
|
115
|
-
Topic pages are maintained from repository evidence and are not overwritten by
|
|
116
|
-
a routine refresh. There are no embeddings, hosted services, or vector database.
|
|
117
|
-
|
|
118
|
-
## Socratic discovery
|
|
119
|
-
|
|
120
|
-
For a vague idea such as “make onboarding better,” Empirical asks one question
|
|
121
|
-
at a time across five passes:
|
|
122
|
-
|
|
123
|
-
1. primary user and observed problem;
|
|
124
|
-
2. smallest observable outcome;
|
|
125
|
-
3. boundaries, constraints, and explicit non-goals;
|
|
126
|
-
4. failures and solution-changing risks;
|
|
127
|
-
5. concrete verification.
|
|
128
|
-
|
|
129
|
-
It adds only material follow-ups, saves the answers, presents the complete
|
|
130
|
-
refined contract, and waits for explicit approval before creating workflow
|
|
131
|
-
state. A concrete request does not pay this discovery cost.
|
|
132
|
-
|
|
133
|
-
## Small feature demo
|
|
14
|
+
| `npm install -g empirical-sdd` | Install the Empirical CLI globally. |
|
|
15
|
+
| `empirical install` | Choose coding agents and install their five Empirical skills. |
|
|
16
|
+
| `empirical update` | Upgrade Empirical and refresh the installed skills. |
|
|
134
17
|
|
|
135
|
-
|
|
18
|
+
Restart or reload each selected agent after installation.
|
|
136
19
|
|
|
137
|
-
|
|
20
|
+
`empirical install` uses a searchable, scrollable local catalog pinned to a
|
|
21
|
+
reviewed `vercel-labs/skills` release. It remembers the exact selected ids,
|
|
22
|
+
deduplicates shared skill roots, and never runs `npx` or uses the network. Type
|
|
23
|
+
to search by agent name, id, or destination; use arrows, Space, Enter, Escape,
|
|
24
|
+
or Ctrl-C. Automation can use repeatable `--agent`/`-a`, `--all`, `--yes`, and
|
|
25
|
+
`--json`; the legacy ids `claude` and `gemini` remain aliases.
|
|
138
26
|
|
|
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:
|
|
27
|
+
## Use
|
|
143
28
|
|
|
144
|
-
|
|
145
|
-
.empirical/specs/add-a-health-command-that-prints-ok/
|
|
146
|
-
├── spec.md
|
|
147
|
-
├── state.json
|
|
148
|
-
├── events/
|
|
149
|
-
└── evidence.json
|
|
150
|
-
```
|
|
29
|
+
These are coding-agent skills, not shell commands:
|
|
151
30
|
|
|
152
|
-
|
|
31
|
+
| Agent | Automatic | Init | Spec | Socratic | Loop |
|
|
32
|
+
| --- | --- | --- | --- | --- | --- |
|
|
33
|
+
| Codex | `$empirical` | `$empirical-init` | `$empirical-spec` | `$empirical-socratic` | `$empirical-loop` |
|
|
34
|
+
| Claude Code | `/empirical` | `/empirical-init` | `/empirical-spec` | `/empirical-socratic` | `/empirical-loop` |
|
|
35
|
+
| Cursor | `empirical` | `empirical-init` | `empirical-spec` | `empirical-socratic` | `empirical-loop` |
|
|
36
|
+
| Gemini CLI | `empirical` | `empirical-init` | `empirical-spec` | `empirical-socratic` | `empirical-loop` |
|
|
37
|
+
| Windsurf | `@empirical` | `@empirical-init` | `@empirical-spec` | `@empirical-socratic` | `@empirical-loop` |
|
|
153
38
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
- Continue here.
|
|
175
|
-
- Save for later.
|
|
176
|
-
- Continue in a detected agent.
|
|
177
|
-
|
|
178
|
-
For an external handoff, Empirical displays the target, whether it accepts a
|
|
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.
|
|
182
|
-
|
|
183
|
-
Decision records store reviewable evidence, options, the selected approach,
|
|
184
|
-
trade-offs, risks, and verification—not private chain-of-thought, prompts,
|
|
185
|
-
scratchpads, tokens, or credentials.
|
|
186
|
-
|
|
187
|
-
## Parallel work uses Git worktrees
|
|
188
|
-
|
|
189
|
-
If a different feature is active, the single entrypoint returns a read-only
|
|
190
|
-
worktree proposal instead of overwriting state. It shows the base and immutable
|
|
191
|
-
base commit, branch, sibling path, exact Git argument array, and approval token.
|
|
192
|
-
|
|
193
|
-
After explicit approval Empirical requires a clean source checkout, revalidates
|
|
194
|
-
every field, rejects collisions, creates the linked checkout without force, and
|
|
195
|
-
starts the exact request there. It never stashes, commits, moves local changes,
|
|
196
|
-
deletes worktrees, or deletes branches.
|
|
197
|
-
|
|
198
|
-
Active selection lives in checkout-local Git metadata while portable feature
|
|
199
|
-
contracts remain committed under `.empirical/specs/`. A linked checkout therefore
|
|
200
|
-
does not accidentally inherit a blocked feature owned by another checkout.
|
|
201
|
-
|
|
202
|
-
## Internal automation API
|
|
203
|
-
|
|
204
|
-
The TypeScript API and MCP tools remain available for agent runtimes and
|
|
205
|
-
programmatic integrations. They include setup, context refresh, discovery,
|
|
206
|
-
Fast/Complex routing, resume, exact completion, verification, review, archive,
|
|
207
|
-
status/explain, handoff, capability projection, and worktree proposal/creation.
|
|
208
|
-
They are automation primitives, not additional user-facing terminal commands.
|
|
209
|
-
|
|
210
|
-
The stdio MCP server exposes these groups:
|
|
211
|
-
|
|
212
|
-
- setup/context: `empirical_init`, `empirical_adopt`, `empirical_configure`,
|
|
213
|
-
`empirical_context`;
|
|
214
|
-
- routing/workflow: `empirical_explore`, `empirical_fast`,
|
|
215
|
-
`empirical_complex`, `empirical_loop`, `empirical_next`,
|
|
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`,
|
|
221
|
-
`empirical_capabilities`, `empirical_policy`, `empirical_doctor`.
|
|
222
|
-
|
|
223
|
-
Only explicitly approved worktree creation mutates Git. Agent handoff returns an
|
|
224
|
-
approval-bound command but never launches it itself.
|
|
225
|
-
|
|
226
|
-
## Committed layout
|
|
227
|
-
|
|
228
|
-
```text
|
|
229
|
-
.empirical/
|
|
230
|
-
├── config.json
|
|
231
|
-
├── policy.json
|
|
232
|
-
├── context/
|
|
233
|
-
├── capabilities/<capability>/spec.md
|
|
234
|
-
├── discoveries/<discovery>/
|
|
235
|
-
│ ├── interview.json
|
|
236
|
-
│ └── brief.md
|
|
237
|
-
└── specs/<feature>/
|
|
238
|
-
├── spec.md
|
|
239
|
-
├── design.md # Complex
|
|
240
|
-
├── decisions.md # Complex when required
|
|
241
|
-
├── plan.md # Complex
|
|
242
|
-
├── deltas/*.md # Complex behavior changes
|
|
243
|
-
├── state.json
|
|
244
|
-
├── state.lock # ephemeral
|
|
245
|
-
├── events/*.json
|
|
246
|
-
└── evidence.json
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
Feature contracts, journals, context, capability specs, configuration, and
|
|
250
|
-
policy are committed. The checkout's selected feature is stored in its own Git
|
|
251
|
-
metadata and is not shared across linked worktrees.
|
|
252
|
-
|
|
253
|
-
## Migration and the 0.20 alpha
|
|
39
|
+
| Skill | Purpose |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `empirical <request>` | Initialize if needed, select the workflow, and run the request through review. |
|
|
42
|
+
| `empirical-init` | Initialize or repair repository setup without starting work. |
|
|
43
|
+
| `empirical-spec <request>` | Draft a concrete specification and stop for approval. |
|
|
44
|
+
| `empirical-socratic <idea>` | Refine an idea through a five-pass interview, then draft a specification. |
|
|
45
|
+
| `empirical-loop` | Resume the active approved specification and drive it to completion. |
|
|
46
|
+
|
|
47
|
+
On first `empirical-init`, the agent shows the complete recommended setup before
|
|
48
|
+
writing anything. Apply the defaults, customize Verification, Parallel work,
|
|
49
|
+
and Decisions one section at a time, or cancel. Repair shows current values and
|
|
50
|
+
keeps them unless edited. Verification independently stores acceptance-test,
|
|
51
|
+
UI-browser, UI-screenshot, and code-review gates; all default on. Turning off
|
|
52
|
+
criterion evidence makes its UI sub-policies inactive without erasing them, and
|
|
53
|
+
does not turn off code review.
|
|
54
|
+
|
|
55
|
+
Broad catalog membership means an agent can read global `SKILL.md` files. MCP
|
|
56
|
+
bridging and executable handoff remain separately verified capabilities; the
|
|
57
|
+
installer does not infer either one.
|
|
254
58
|
|
|
255
|
-
|
|
256
|
-
global and project-local Empirical workflow artifacts, preserves unmanaged
|
|
257
|
-
content and existing runtime configuration, and converges without unnecessary
|
|
258
|
-
second-run changes. Existing schema-4 projects and discovery records remain
|
|
259
|
-
readable.
|
|
59
|
+
## Development
|
|
260
60
|
|
|
261
|
-
|
|
262
|
-
the matching feature directory. Historical alternate parallel-state data is
|
|
263
|
-
left untouched and unsupported.
|
|
61
|
+
Requires Node.js 20+ and Bun.
|
|
264
62
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
63
|
+
| Command | Purpose |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `bun install` | Install development dependencies. |
|
|
66
|
+
| `bun run ci` | Run type checking, tests, build smoke tests, and package tests. |
|
|
268
67
|
|
|
269
|
-
##
|
|
68
|
+
## Documentation
|
|
270
69
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
```
|
|
70
|
+
[Architecture](docs/architecture.md) · [Demos](docs/demo.md) ·
|
|
71
|
+
[MCP](docs/mcp.md) · [Security](docs/security.md) ·
|
|
72
|
+
[Migration](docs/migration-v1.md)
|
|
275
73
|
|
|
276
|
-
|
|
277
|
-
and building the published JavaScript package.
|
|
74
|
+
## License
|
|
278
75
|
|
|
279
|
-
|
|
76
|
+
[MIT](LICENSE)
|