@trieungoctam/speckit 0.2.2 → 0.3.1
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 +43 -6
- package/dist/adapters/antigravity-adapter.js +4 -4
- package/dist/adapters/claude-code-adapter.js +23 -5
- package/dist/adapters/codex-adapter.js +7 -3
- package/dist/adapters/cursor-adapter.js +30 -3
- package/dist/adapters/opencode-adapter.js +1 -1
- package/dist/cli.js +41 -0
- package/dist/commands/doctor.js +12 -4
- package/dist/commands/graph.d.ts +7 -0
- package/dist/commands/graph.js +51 -0
- package/dist/commands/init.js +3 -1
- package/dist/commands/memory.d.ts +6 -0
- package/dist/commands/memory.js +11 -0
- package/dist/commands/permissions.d.ts +8 -0
- package/dist/commands/permissions.js +18 -0
- package/dist/commands/session.d.ts +9 -0
- package/dist/commands/session.js +49 -0
- package/dist/commands/sprint.d.ts +7 -0
- package/dist/commands/sprint.js +54 -0
- package/dist/commands/start.js +4 -3
- package/dist/commands/sync.js +3 -0
- package/dist/commands/triage.js +2 -15
- package/dist/commands/validate.d.ts +6 -0
- package/dist/commands/validate.js +17 -0
- package/dist/core/agent-scaffold.d.ts +2 -0
- package/dist/core/agent-scaffold.js +57 -0
- package/dist/core/beads-mirror.d.ts +3 -0
- package/dist/core/beads-mirror.js +46 -0
- package/dist/core/memory.d.ts +1 -0
- package/dist/core/memory.js +47 -0
- package/dist/core/permission-auditor.d.ts +10 -0
- package/dist/core/permission-auditor.js +65 -0
- package/dist/core/permission-policy.d.ts +6 -0
- package/dist/core/permission-policy.js +93 -0
- package/dist/core/scaffold.js +35 -63
- package/dist/core/session-manager.d.ts +15 -0
- package/dist/core/session-manager.js +139 -0
- package/dist/core/skill-catalog.d.ts +3 -0
- package/dist/core/skill-catalog.js +180 -0
- package/dist/core/synced-stories.d.ts +8 -0
- package/dist/core/synced-stories.js +17 -0
- package/dist/core/templates.d.ts +2 -0
- package/dist/core/templates.js +54 -0
- package/dist/core/workflow-contract.d.ts +7 -0
- package/dist/core/workflow-contract.js +38 -0
- package/dist/core/workflow-validator.d.ts +6 -0
- package/dist/core/workflow-validator.js +133 -0
- package/docs/development-roadmap.md +9 -5
- package/docs/permission-rules-research.md +265 -0
- package/docs/product-contract.md +9 -4
- package/docs/project-changelog.md +46 -0
- package/docs/spec-enterprise-harness-plan.md +18 -1
- package/docs/use-cases.md +206 -0
- package/docs/workflow-model.md +23 -0
- package/package.json +1 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# Permission Rules Research
|
|
2
|
+
|
|
3
|
+
Date: 2026-05-10
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
Research goal: define a permission-rule model for Speckit that can compile safely across Claude Code, Codex, Cursor, OpenCode, and Antigravity.
|
|
8
|
+
|
|
9
|
+
This research focuses on:
|
|
10
|
+
|
|
11
|
+
- File read/write permissions
|
|
12
|
+
- Shell command permissions
|
|
13
|
+
- Network access
|
|
14
|
+
- Approval modes
|
|
15
|
+
- Phase-specific workflow permissions
|
|
16
|
+
- Enterprise guardrails for secrets, destructive commands, and production access
|
|
17
|
+
|
|
18
|
+
## Key Findings
|
|
19
|
+
|
|
20
|
+
### 1. Permission Rules Must Be Deny-First
|
|
21
|
+
|
|
22
|
+
Claude Code documents allow, ask, and deny rules, with evaluation order `deny -> ask -> allow`; deny rules always take precedence. Cursor CLI also documents deny rules taking precedence over allow rules.
|
|
23
|
+
|
|
24
|
+
Speckit should use the same mental model across all adapters:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
deny > ask > allow
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This should be a product invariant, even when a specific IDE has a different internal matching implementation.
|
|
31
|
+
|
|
32
|
+
Sources:
|
|
33
|
+
|
|
34
|
+
- [Claude Code permissions](https://code.claude.com/docs/en/permissions)
|
|
35
|
+
- [Cursor permissions](https://docs.cursor.com/cli/reference/permissions)
|
|
36
|
+
|
|
37
|
+
### 2. Permissions And Sandboxing Are Different Layers
|
|
38
|
+
|
|
39
|
+
Claude Code separates permissions from sandboxing: permissions control tool/file/domain access, while sandboxing enforces OS-level limits mainly around shell execution. OpenAI describes the same split for Codex: sandboxing defines execution boundaries, while approval policy decides when the agent must ask.
|
|
40
|
+
|
|
41
|
+
Speckit should model both layers:
|
|
42
|
+
|
|
43
|
+
- Permission policy: what the agent may attempt.
|
|
44
|
+
- Sandbox/approval policy: what the runtime may execute without approval.
|
|
45
|
+
|
|
46
|
+
Sources:
|
|
47
|
+
|
|
48
|
+
- [Claude Code permissions and sandboxing](https://code.claude.com/docs/en/permissions)
|
|
49
|
+
- [Running Codex safely at OpenAI](https://openai.com/index/running-codex-safely/)
|
|
50
|
+
- [Codex agent approvals and security](https://developers.openai.com/codex/agent-approvals-security)
|
|
51
|
+
|
|
52
|
+
### 3. Avoid Full Bypass Modes Except In Disposable Environments
|
|
53
|
+
|
|
54
|
+
Claude Code warns that bypass mode skips permission prompts and should only be used in isolated environments such as containers or VMs. Codex similarly labels no-sandbox/no-approval mode as dangerous and not recommended.
|
|
55
|
+
|
|
56
|
+
Speckit should never generate full-bypass configs by default.
|
|
57
|
+
|
|
58
|
+
Recommended default:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
approval: ask/on-request
|
|
62
|
+
sandbox: workspace-write
|
|
63
|
+
network: ask or denied by default
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Sources:
|
|
67
|
+
|
|
68
|
+
- [Claude Code permission modes](https://code.claude.com/docs/en/permissions)
|
|
69
|
+
- [Codex common sandbox and approval combinations](https://developers.openai.com/codex/agent-approvals-security)
|
|
70
|
+
|
|
71
|
+
### 4. Phase-Scoped Permissions Fit Speckit Best
|
|
72
|
+
|
|
73
|
+
Speckit already has phases: shape, research, plan, context, graph, session, TDD, test, debug, review, docs, ship.
|
|
74
|
+
|
|
75
|
+
Permission should follow phase, not only IDE:
|
|
76
|
+
|
|
77
|
+
| Phase | File Writes | Shell | Network | Notes |
|
|
78
|
+
| --- | --- | --- | --- | --- |
|
|
79
|
+
| shape | `.speckit/specs/**` only | ask | ask | No source edits |
|
|
80
|
+
| research | reports/docs only | ask | allow/ask | Sources required |
|
|
81
|
+
| plan | `.speckit/plans/**`, stories, evidence | ask | ask | No source edits |
|
|
82
|
+
| context | `.speckit/context/**` only | ask | deny/ask | Build handoff only |
|
|
83
|
+
| graph | `.speckit/sync/**`, `.beads/**` | allow Speckit wrappers | deny/ask | Robot-safe graph only |
|
|
84
|
+
| session | `.speckit/sessions/**`, memory | ask | deny | Durable state only |
|
|
85
|
+
| TDD | workspace source + tests | ask | ask | Requires ready gate |
|
|
86
|
+
| test | test artifacts only | allow test/build commands | deny/ask | No production |
|
|
87
|
+
| debug | source + tests after root cause | ask | ask | Capture failure first |
|
|
88
|
+
| review | no edits by default | allow `git diff`, `git log`, tests | deny | Read-only review |
|
|
89
|
+
| docs | docs + Speckit artifacts | ask | deny/ask | No source edits unless requested |
|
|
90
|
+
| ship | package/release files | ask | ask | Push/publish/deploy require explicit approval |
|
|
91
|
+
|
|
92
|
+
### 5. Adapter Mapping
|
|
93
|
+
|
|
94
|
+
#### Claude Code
|
|
95
|
+
|
|
96
|
+
Use `.claude/settings.json`:
|
|
97
|
+
|
|
98
|
+
- `permissions.defaultMode = "ask"` or conservative equivalent
|
|
99
|
+
- explicit deny rules for secrets and destructive commands
|
|
100
|
+
- ask rules for shell/network/publish/deploy
|
|
101
|
+
- optional hooks for runtime validation
|
|
102
|
+
- managed settings for enterprise to disable bypass/auto modes
|
|
103
|
+
|
|
104
|
+
Relevant details:
|
|
105
|
+
|
|
106
|
+
- Permission rule syntax supports `Tool` and `Tool(specifier)`.
|
|
107
|
+
- Bash rules support wildcards.
|
|
108
|
+
- Hooks can deny or force prompts before permission rules finish.
|
|
109
|
+
- Managed settings can prevent bypass mode and restrict user/project rules.
|
|
110
|
+
|
|
111
|
+
Source: [Claude Code permissions](https://code.claude.com/docs/en/permissions)
|
|
112
|
+
|
|
113
|
+
#### Codex
|
|
114
|
+
|
|
115
|
+
Use `.codex/config.toml`:
|
|
116
|
+
|
|
117
|
+
```toml
|
|
118
|
+
approval_policy = "on-request"
|
|
119
|
+
sandbox_mode = "workspace-write"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Enterprise hardening can use requirements:
|
|
123
|
+
|
|
124
|
+
```toml
|
|
125
|
+
allowed_approval_policies = ["untrusted", "on-request"]
|
|
126
|
+
allowed_sandbox_modes = ["read-only", "workspace-write"]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Avoid `danger-full-access` and no-approval modes for normal projects.
|
|
130
|
+
|
|
131
|
+
Sources:
|
|
132
|
+
|
|
133
|
+
- [Codex config reference](https://developers.openai.com/codex/config-reference)
|
|
134
|
+
- [Codex managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration)
|
|
135
|
+
- [Codex agent approvals and security](https://developers.openai.com/codex/agent-approvals-security)
|
|
136
|
+
|
|
137
|
+
#### Cursor
|
|
138
|
+
|
|
139
|
+
Use project-level `.cursor/cli.json` for CLI permissions:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"permissions": {
|
|
144
|
+
"allow": ["Shell(git)", "Shell(npm)", "Read(src/**/*.ts)"],
|
|
145
|
+
"deny": ["Shell(rm)", "Read(.env*)", "Write(**/*.key)", "Write(**/.env*)"]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Cursor permission tokens cover:
|
|
151
|
+
|
|
152
|
+
- `Shell(commandBase)`
|
|
153
|
+
- `Read(pathOrGlob)`
|
|
154
|
+
- `Write(pathOrGlob)`
|
|
155
|
+
|
|
156
|
+
Source: [Cursor permissions](https://docs.cursor.com/cli/reference/permissions)
|
|
157
|
+
|
|
158
|
+
#### OpenCode
|
|
159
|
+
|
|
160
|
+
Use `permission` in `opencode.json` and Markdown agents.
|
|
161
|
+
|
|
162
|
+
OpenCode supports:
|
|
163
|
+
|
|
164
|
+
- `ask`
|
|
165
|
+
- `allow`
|
|
166
|
+
- `deny`
|
|
167
|
+
- per-agent override
|
|
168
|
+
- specific bash command patterns
|
|
169
|
+
- task permission controls
|
|
170
|
+
|
|
171
|
+
For Speckit, keep planner/reviewer read-only, TDD developer ask-gated, and ship commands ask-gated.
|
|
172
|
+
|
|
173
|
+
Source: [OpenCode agents and permissions](https://opencode.ai/docs/agents/)
|
|
174
|
+
|
|
175
|
+
#### Antigravity
|
|
176
|
+
|
|
177
|
+
The accessible public docs emphasize configurable autonomy, artifact review, and approval for critical operations, but the browsable official pages did not expose a stable machine-readable permission schema during this research.
|
|
178
|
+
|
|
179
|
+
Speckit should treat Antigravity permissions as instruction-level until a stable official config format is confirmed:
|
|
180
|
+
|
|
181
|
+
- generate `.agents/rules/speckit-enterprise-safety.md`
|
|
182
|
+
- require human approval for destructive commands, production changes, secrets access, deployment
|
|
183
|
+
- require artifact review before close
|
|
184
|
+
- avoid claiming hard enforcement unless adapter support is verified
|
|
185
|
+
|
|
186
|
+
Source:
|
|
187
|
+
|
|
188
|
+
- [Antigravity agents overview](https://antigravity.im/agents) — independent guide, not official Google documentation
|
|
189
|
+
|
|
190
|
+
## Recommended Speckit Permission Model
|
|
191
|
+
|
|
192
|
+
Speckit should own a portable policy and compile it per IDE:
|
|
193
|
+
|
|
194
|
+
```yaml
|
|
195
|
+
version: 1
|
|
196
|
+
default:
|
|
197
|
+
file_read: allow_workspace
|
|
198
|
+
file_write: ask
|
|
199
|
+
shell: ask
|
|
200
|
+
network: ask
|
|
201
|
+
external_directory: deny
|
|
202
|
+
secrets: deny
|
|
203
|
+
destructive: deny
|
|
204
|
+
production: ask
|
|
205
|
+
phases:
|
|
206
|
+
review:
|
|
207
|
+
file_write: deny
|
|
208
|
+
shell_allow:
|
|
209
|
+
- git diff*
|
|
210
|
+
- git log*
|
|
211
|
+
- npm test*
|
|
212
|
+
ship:
|
|
213
|
+
shell_ask:
|
|
214
|
+
- git push*
|
|
215
|
+
- npm publish*
|
|
216
|
+
- "* deploy*"
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Commands To Add
|
|
220
|
+
|
|
221
|
+
Recommended CLI surface:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
speckit permissions init
|
|
225
|
+
speckit permissions audit --json
|
|
226
|
+
speckit permissions compile --ide all
|
|
227
|
+
speckit validate --permissions --json
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Minimum useful implementation:
|
|
231
|
+
|
|
232
|
+
1. Generate `.speckit/permissions.yaml`.
|
|
233
|
+
2. Add permission checks to `speckit validate`.
|
|
234
|
+
3. Compile:
|
|
235
|
+
- Claude Code: `.claude/settings.json`
|
|
236
|
+
- Codex: `.codex/config.toml`
|
|
237
|
+
- Cursor: `.cursor/cli.json`
|
|
238
|
+
- OpenCode: `opencode.json` and agent frontmatter
|
|
239
|
+
- Antigravity: `.agents/rules/speckit-enterprise-safety.md`
|
|
240
|
+
|
|
241
|
+
## High-Risk Defaults To Block
|
|
242
|
+
|
|
243
|
+
Always deny or ask:
|
|
244
|
+
|
|
245
|
+
- `rm -rf`, `rmdir`, destructive cleanup
|
|
246
|
+
- `git reset --hard`, `git clean -fd`, force push
|
|
247
|
+
- `sudo`, `chmod -R`, `chown -R`
|
|
248
|
+
- shell access to `.env*`, `*.pem`, `*.key`, SSH keys, cloud credentials
|
|
249
|
+
- production deploys
|
|
250
|
+
- package publish
|
|
251
|
+
- arbitrary outbound network from shell
|
|
252
|
+
- external directory writes
|
|
253
|
+
|
|
254
|
+
## Recommendation
|
|
255
|
+
|
|
256
|
+
Implement permission rules as the next Speckit enterprise layer.
|
|
257
|
+
|
|
258
|
+
Priority:
|
|
259
|
+
|
|
260
|
+
1. Add central `.speckit/permissions.yaml`.
|
|
261
|
+
2. Extend `validateWorkflowContract` with permission checks.
|
|
262
|
+
3. Compile concrete adapter permission files.
|
|
263
|
+
4. Add tests that tamper with dangerous permissions and ensure validation fails.
|
|
264
|
+
|
|
265
|
+
This keeps Speckit aligned with the strongest common pattern across current agent IDEs: deny-first, least-privilege, phase-scoped, with explicit approval for risky operations.
|
package/docs/product-contract.md
CHANGED
|
@@ -5,23 +5,28 @@ Speckit owns the workflow contract for enterprise Agile + TDD development with a
|
|
|
5
5
|
## Speckit Owns
|
|
6
6
|
|
|
7
7
|
- The `.speckit/` source of truth: config, rules, workflows, templates, generated artifacts.
|
|
8
|
-
- The command surface: `init`, `doctor`, `start`, `shape`, `plan`, `context`, `quick`, `sync`, `triage`, `next`, `ready`, `run`, `review`, `close`.
|
|
8
|
+
- The command surface: `init`, `doctor`, `validate`, `start`, `memory`, `permissions`, `session`, `shape`, `plan`, `context`, `quick`, `sync`, `triage`, `sprint`, `graph`, `next`, `ready`, `run`, `review`, `close`.
|
|
9
|
+
- The skill catalog and super-agent routing contract for phase-specific agent behavior.
|
|
10
|
+
- IDE-specific initialization that installs the shared Speckit runtime plus only the selected IDE adapter when `--ide <name>` is provided.
|
|
11
|
+
- The long-session contract: project memory, active session state, checkpoints, compaction summaries, and resume handoffs.
|
|
12
|
+
- The workflow validation contract: phase order, core skills, super-agent routing, run prompt terms, and installed adapter prompt parity.
|
|
9
13
|
- The TDD gate: code stories require red, green, and refactor evidence.
|
|
10
14
|
- The adapter compiler for Claude Code, Codex, Antigravity, OpenCode, and Cursor.
|
|
11
15
|
- The safety policy for destructive commands, secrets, production access, and review readiness.
|
|
16
|
+
- The permission policy for privacy-sensitive files, context-heavy paths, destructive commands, and release commands.
|
|
12
17
|
|
|
13
18
|
## Speckit Delegates
|
|
14
19
|
|
|
15
20
|
- Implementation to the selected IDE and agent runtime.
|
|
16
21
|
- Product lifecycle, story readiness, and quality gates to Speckit-native phases.
|
|
17
22
|
- Execution orchestration to Speckit-native plan/run/test/review flows.
|
|
18
|
-
- Task graph prioritization to beads and Beads Viewer robot commands.
|
|
23
|
+
- Task graph prioritization to beads and Beads Viewer robot commands, with local JSON fallback when `bv` is unavailable.
|
|
19
24
|
- Git, tests, CI, and deployment to project-local tooling.
|
|
20
25
|
|
|
21
26
|
## State Model
|
|
22
27
|
|
|
23
28
|
```text
|
|
24
|
-
intake -> session -> shaped -> planned -> context-ready -> synced -> triaged -> ready-for-dev -> tests-red -> running -> tests-green -> refactor -> review-ready -> closed
|
|
29
|
+
intake -> session -> memory-ready -> shaped -> planned -> sprint-ready -> context-ready -> synced -> graph-triaged -> ready-for-dev -> tests-red -> checkpointed -> running -> tests-green -> refactor -> compacted -> review-ready -> closed
|
|
25
30
|
```
|
|
26
31
|
|
|
27
|
-
Implementation starts only after `speckit ready <story>` passes. Review starts only after test evidence exists.
|
|
32
|
+
Implementation starts only after `speckit ready <story>` passes. Review starts only after test evidence exists and the active session has a current checkpoint.
|
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Project Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1 - 2026-05-11
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Prepared npm release for the workflow validation and permission policy package updates.
|
|
8
|
+
|
|
9
|
+
### Validation
|
|
10
|
+
|
|
11
|
+
- `npm test` passes with 36 tests.
|
|
12
|
+
|
|
13
|
+
## 0.3.0 - 2026-05-10
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- Added `speckit memory refresh` for durable project context, decisions, and lessons.
|
|
18
|
+
- Added `speckit session start`, `checkpoint`, `compact`, `resume`, and `status`.
|
|
19
|
+
- Added `speckit sprint plan` and `speckit sprint next` from synced stories.
|
|
20
|
+
- Added `speckit graph triage`, `graph plan`, and `graph insights` with Beads Viewer robot mode and local JSON fallback.
|
|
21
|
+
- Added `.speckit/agents/super-agent.md` as the portable orchestration router.
|
|
22
|
+
- Added `.speckit/skills/catalog.md` plus a curated Speckit skill set for shape, research, plan, context, graph, session, TDD, test, debug, review, docs, and ship phases.
|
|
23
|
+
- Added `.speckit/skills/schema.json` to define the portable skill contract and delegation statuses.
|
|
24
|
+
- Added `speckit validate` for workflow contract validation across phase order, skills, router, prompts, and installed adapters.
|
|
25
|
+
- Added `contractChecks` to `speckit doctor --deep --json`.
|
|
26
|
+
- Added `docs/use-cases.md` with command recipes and best practices for setup, migration, quick changes, full planning, long sessions, TDD, graph automation, review, CI, and troubleshooting.
|
|
27
|
+
- Added `.speckit/permissions.yaml` and `speckit permissions audit` for privacy, scout, destructive-command, and release-command checks.
|
|
28
|
+
- Added concrete permission output for Claude Code, Codex, and Cursor adapters.
|
|
29
|
+
- Added long-session prompt requirements for project memory, active session state, checkpoints, and compaction summaries.
|
|
30
|
+
- Added automatic `.beads/beads.jsonl` mirror generation so Beads Viewer robot commands can run without missing-project errors.
|
|
31
|
+
- Standard `speckit init --ide <name>` now installs the shared Speckit runtime, super-agent, and skill catalog for the selected IDE.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Enterprise flow now includes memory, sprint planning, graph triage, readiness, checkpoint, and compaction phases.
|
|
36
|
+
- Enterprise adapters now route through the Speckit super agent and smallest matching skill before execution.
|
|
37
|
+
- Super-agent routing now includes delegation status, task hydration, and sync-back contracts adapted from long-session orchestration patterns.
|
|
38
|
+
- IDE adapters now instruct agents to checkpoint red-green-refactor boundaries and compact before handoff.
|
|
39
|
+
- `speckit graph triage|plan|insights` now prepares the Beads Viewer mirror before invoking `bv --robot-*` from the project root.
|
|
40
|
+
- Selected-IDE init now avoids unrelated IDE adapters while still installing shared runtime files.
|
|
41
|
+
|
|
42
|
+
### Quality
|
|
43
|
+
|
|
44
|
+
- Added workflow tests for memory/session state, sprint planning, and graph fallback.
|
|
45
|
+
- Expanded prompt quality tests for project memory, active session, checkpoint, and compaction.
|
|
46
|
+
- Added init and flow contract coverage for the curated skill catalog.
|
|
47
|
+
- Added workflow validator tests for passing and tampered contract states.
|
|
48
|
+
|
|
3
49
|
## 0.2.2 - 2026-05-10
|
|
4
50
|
|
|
5
51
|
### Added
|
|
@@ -11,11 +11,15 @@ The product vocabulary is Spec-only. External tools may exist underneath, but ge
|
|
|
11
11
|
```text
|
|
12
12
|
idea
|
|
13
13
|
-> spec start
|
|
14
|
+
-> super-agent route
|
|
15
|
+
-> spec memory
|
|
14
16
|
-> spec shape
|
|
15
17
|
-> spec plan
|
|
18
|
+
-> spec sprint
|
|
16
19
|
-> spec context
|
|
17
20
|
-> graph triage
|
|
18
21
|
-> spec run
|
|
22
|
+
-> spec checkpoint
|
|
19
23
|
-> spec review
|
|
20
24
|
-> spec close
|
|
21
25
|
```
|
|
@@ -26,7 +30,10 @@ idea
|
|
|
26
30
|
| --- | --- | --- |
|
|
27
31
|
| Spec Flow | Phase order and state transitions | `.speckit/flows/*.md` |
|
|
28
32
|
| Spec Prompt | Phase-specific instructions | `.speckit/prompts/**/*.md` |
|
|
33
|
+
| Spec Super Agent | Phase routing and orchestration policy | `.speckit/agents/super-agent.md` |
|
|
34
|
+
| Spec Skills | Focused phase capabilities loaded on demand | `.speckit/skills/*.md` |
|
|
29
35
|
| Spec Session | Durable continuity across agents | `.speckit/sessions/<id>/*` |
|
|
36
|
+
| Spec Memory | Durable project rules and lessons | `.speckit/memory/*` |
|
|
30
37
|
| Spec Context | Bounded task context | `.speckit/context/current.md` |
|
|
31
38
|
| Spec Tool | Phase-aware allowed/denied actions | `.speckit/tool-policy.yaml` |
|
|
32
39
|
| Spec Graph | Work queue and priority bridge | `.speckit/graph/*` |
|
|
@@ -38,8 +45,14 @@ idea
|
|
|
38
45
|
speckit init --enterprise --ide all
|
|
39
46
|
speckit doctor --deep
|
|
40
47
|
speckit start "<idea>"
|
|
48
|
+
speckit memory refresh
|
|
49
|
+
speckit session checkpoint
|
|
50
|
+
speckit session compact
|
|
51
|
+
speckit session resume
|
|
41
52
|
speckit shape "<idea>"
|
|
42
53
|
speckit plan "<feature>"
|
|
54
|
+
speckit sprint plan
|
|
55
|
+
speckit graph triage
|
|
43
56
|
speckit context <story-or-bead>
|
|
44
57
|
speckit triage
|
|
45
58
|
speckit next
|
|
@@ -53,7 +66,10 @@ speckit sync
|
|
|
53
66
|
|
|
54
67
|
- Forbidden legacy vocabulary must not appear in publishable source, docs, tests, prompts, or generated adapter templates.
|
|
55
68
|
- Every implementation story must link to acceptance criteria and TDD evidence.
|
|
69
|
+
- Every agent run must route through the super-agent policy and the smallest matching Speckit skill.
|
|
56
70
|
- Every run must have a session handoff.
|
|
71
|
+
- Every long run must checkpoint after red, green, refactor, and review boundaries.
|
|
72
|
+
- Every handoff must have a compact session summary when context has grown noisy.
|
|
57
73
|
- Every graph task must trace back to a story or spec artifact.
|
|
58
74
|
- Every review must check AC coverage, TDD evidence, tool policy, and docs impact.
|
|
59
75
|
- All robot task graph commands must use non-interactive flags.
|
|
@@ -61,8 +77,9 @@ speckit sync
|
|
|
61
77
|
## Definition Of Enterprise Ready
|
|
62
78
|
|
|
63
79
|
- `speckit init --enterprise --ide all` creates a complete harness in a temp repo.
|
|
80
|
+
- The generated harness includes `.speckit/agents/super-agent.md` and `.speckit/skills/catalog.md`.
|
|
64
81
|
- `speckit doctor --deep --json` returns stable machine-readable status.
|
|
65
|
-
- `speckit start -> context -> run -> review -> close` preserves a single session id.
|
|
82
|
+
- `speckit start -> session checkpoint -> session compact -> context -> run -> review -> close` preserves a single session id.
|
|
66
83
|
- `speckit sync -> triage -> next` preserves story-to-graph traceability.
|
|
67
84
|
- All IDE adapters compile from the same Spec policies.
|
|
68
85
|
- Tests enforce vocabulary, flow links, adapter parity, and robot-safe graph commands.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Use Cases And Best Practices
|
|
2
|
+
|
|
3
|
+
This guide shows how to use Speckit for common product and engineering workflows.
|
|
4
|
+
|
|
5
|
+
## 1. New Project Setup
|
|
6
|
+
|
|
7
|
+
Use when a repository does not have Speckit runtime files yet.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @trieungoctam/speckit@latest init --enterprise --ide cursor
|
|
11
|
+
npx @trieungoctam/speckit@latest doctor --deep
|
|
12
|
+
npx @trieungoctam/speckit@latest validate
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Use `--ide all` only when the team actively uses multiple IDEs in the same repository.
|
|
16
|
+
|
|
17
|
+
Best practices:
|
|
18
|
+
|
|
19
|
+
- Prefer one IDE adapter per project at first. Add more adapters after the team agrees on the workflow.
|
|
20
|
+
- Run `speckit validate` after init so broken prompts or missing skills are caught immediately.
|
|
21
|
+
- Commit generated Speckit files so every teammate gets the same flow.
|
|
22
|
+
- Keep `.speckit/` local to the repository. Avoid relying on global agent state for enterprise work.
|
|
23
|
+
|
|
24
|
+
## 2. Existing Project Migration
|
|
25
|
+
|
|
26
|
+
Use when a project already has code, tests, and team conventions.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
speckit init --enterprise --ide all --force
|
|
30
|
+
speckit memory refresh
|
|
31
|
+
speckit doctor --deep --json
|
|
32
|
+
speckit validate --json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Best practices:
|
|
36
|
+
|
|
37
|
+
- Read generated files before pushing. Keep project-specific rules in `.speckit/memory/project-context.md`.
|
|
38
|
+
- Do not start implementation during migration. First make the generated flow pass validation.
|
|
39
|
+
- If an adapter prompt conflicts with local policy, update the adapter generator, not only the generated file.
|
|
40
|
+
- Run project tests after migration even if Speckit only changed documentation and prompt files.
|
|
41
|
+
|
|
42
|
+
## 3. One Small Change
|
|
43
|
+
|
|
44
|
+
Use when the request is bounded and can fit into one story.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
speckit memory refresh
|
|
48
|
+
speckit session start "Add invoice total validation"
|
|
49
|
+
speckit quick "Add invoice total validation"
|
|
50
|
+
speckit context .speckit/stories/<story>.md
|
|
51
|
+
speckit sync
|
|
52
|
+
speckit ready .speckit/stories/<story>.md
|
|
53
|
+
speckit run .speckit/stories/<story>.md
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Best practices:
|
|
57
|
+
|
|
58
|
+
- Use `quick` only for a single focused change.
|
|
59
|
+
- Do not skip `context`, `sync`, or `ready`. They prevent agents from implementing against stale assumptions.
|
|
60
|
+
- Keep acceptance criteria concrete enough to test.
|
|
61
|
+
- Checkpoint after the red test, green test, refactor, and review boundary.
|
|
62
|
+
|
|
63
|
+
## 4. Full Feature Planning
|
|
64
|
+
|
|
65
|
+
Use when the work includes multiple stories, architecture decisions, or team rollout.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
speckit session start "Add subscription lifecycle"
|
|
69
|
+
speckit memory refresh
|
|
70
|
+
speckit shape "Add subscription lifecycle"
|
|
71
|
+
speckit plan "Add subscription lifecycle"
|
|
72
|
+
speckit sync
|
|
73
|
+
speckit sprint plan
|
|
74
|
+
speckit graph triage --json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Best practices:
|
|
78
|
+
|
|
79
|
+
- Shape before planning. The shape artifact defines scope, non-goals, and risk.
|
|
80
|
+
- Keep stories small enough to pass through TDD evidence independently.
|
|
81
|
+
- Sync stories before graph commands so prioritization uses current metadata.
|
|
82
|
+
- Use `sprint next` or `graph triage` to select work instead of choosing only by recency.
|
|
83
|
+
|
|
84
|
+
## 5. Long Agent Session
|
|
85
|
+
|
|
86
|
+
Use when work will span many tool calls, handoffs, or context compaction.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
speckit memory refresh
|
|
90
|
+
speckit session start "Refactor report export flow"
|
|
91
|
+
speckit session status --json
|
|
92
|
+
speckit session checkpoint --note "red complete"
|
|
93
|
+
speckit session checkpoint --note "green complete"
|
|
94
|
+
speckit session compact
|
|
95
|
+
speckit session resume <session-id>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Best practices:
|
|
99
|
+
|
|
100
|
+
- Durable files are the source of truth, not chat history.
|
|
101
|
+
- Write decisions to memory when they apply beyond the current story.
|
|
102
|
+
- Compact before handing work to another agent or after noisy command output.
|
|
103
|
+
- Use `DONE`, `DONE_WITH_CONCERNS`, `BLOCKED`, or `NEEDS_CONTEXT` in handoffs.
|
|
104
|
+
- Never pass a full conversation as handoff context. Pass files, acceptance criteria, constraints, and current status.
|
|
105
|
+
|
|
106
|
+
## 6. TDD Implementation
|
|
107
|
+
|
|
108
|
+
Use for all code stories.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
speckit ready .speckit/stories/<story>.md
|
|
112
|
+
speckit run .speckit/stories/<story>.md
|
|
113
|
+
npm test
|
|
114
|
+
speckit session checkpoint --note "red evidence captured"
|
|
115
|
+
npm test
|
|
116
|
+
speckit session checkpoint --note "green evidence captured"
|
|
117
|
+
speckit session checkpoint --note "refactor validated"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Best practices:
|
|
121
|
+
|
|
122
|
+
- Record test intent before code changes.
|
|
123
|
+
- Capture the red result before implementation.
|
|
124
|
+
- Make the smallest change that turns the failing test green.
|
|
125
|
+
- Refactor only while tests stay green.
|
|
126
|
+
- Put command output summaries in the evidence file. Avoid pasting large logs unless they are necessary.
|
|
127
|
+
|
|
128
|
+
## 7. Graph And Sprint Automation
|
|
129
|
+
|
|
130
|
+
Use when multiple stories exist and the next task is not obvious.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
speckit sync
|
|
134
|
+
speckit sprint plan
|
|
135
|
+
speckit sprint next --json
|
|
136
|
+
speckit graph triage --json
|
|
137
|
+
speckit graph plan --json
|
|
138
|
+
speckit graph insights --json
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Best practices:
|
|
142
|
+
|
|
143
|
+
- Run `sync` before any graph command.
|
|
144
|
+
- Keep graph commands robot-safe. Use Speckit wrappers instead of interactive graph commands.
|
|
145
|
+
- Treat graph output as prioritization input, not automatic permission to implement.
|
|
146
|
+
- Re-run `sprint plan` when story status or dependencies change.
|
|
147
|
+
|
|
148
|
+
## 8. Review And Closure
|
|
149
|
+
|
|
150
|
+
Use after implementation and tests pass.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
speckit review
|
|
154
|
+
speckit session compact
|
|
155
|
+
speckit close .speckit/stories/<story>.md
|
|
156
|
+
speckit sync
|
|
157
|
+
speckit validate
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Best practices:
|
|
161
|
+
|
|
162
|
+
- Review acceptance coverage before style or preference issues.
|
|
163
|
+
- Check TDD evidence, session freshness, docs impact, and graph sync.
|
|
164
|
+
- Close only after the story has current evidence and a clean handoff.
|
|
165
|
+
- Sync after closing so downstream graph and sprint views are current.
|
|
166
|
+
|
|
167
|
+
## 9. CI And Enterprise Rollout
|
|
168
|
+
|
|
169
|
+
Use when Speckit becomes a shared team standard.
|
|
170
|
+
|
|
171
|
+
Recommended CI checks:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npm run build
|
|
175
|
+
npm test
|
|
176
|
+
npx @trieungoctam/speckit@latest doctor --deep --json
|
|
177
|
+
npx @trieungoctam/speckit@latest validate --json
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Best practices:
|
|
181
|
+
|
|
182
|
+
- Fail CI when `validate` returns `needs-attention`.
|
|
183
|
+
- Require `doctor --deep` before release branches are merged.
|
|
184
|
+
- Keep generated prompt files reviewed like source code.
|
|
185
|
+
- Add new workflow phases only through the central contract and tests.
|
|
186
|
+
- Do not allow IDE-specific prompts to drift from the shared Speckit contract.
|
|
187
|
+
|
|
188
|
+
## 10. Troubleshooting
|
|
189
|
+
|
|
190
|
+
Use these checks when the workflow feels inconsistent.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
speckit doctor --deep --json
|
|
194
|
+
speckit validate --json
|
|
195
|
+
speckit session status --json
|
|
196
|
+
speckit sync
|
|
197
|
+
speckit graph triage --json
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Common fixes:
|
|
201
|
+
|
|
202
|
+
- Missing skill file: run `speckit init --enterprise --ide <name> --force`.
|
|
203
|
+
- Adapter prompt mismatch: update the adapter generator, rebuild, then init again.
|
|
204
|
+
- Story is blocked: run `speckit context <story>` and `speckit sync`, then retry `speckit ready <story>`.
|
|
205
|
+
- Graph command fails: check that `.beads/beads.jsonl` exists after `speckit sync`.
|
|
206
|
+
- Session context is stale: run `speckit session checkpoint` and `speckit session compact`.
|
package/docs/workflow-model.md
CHANGED
|
@@ -8,7 +8,10 @@ Use for a bounded change.
|
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
speckit quick "Add invoice validation"
|
|
11
|
+
speckit memory refresh
|
|
12
|
+
speckit session start "Add invoice validation"
|
|
11
13
|
speckit run .speckit/stories/<story>.md
|
|
14
|
+
speckit session checkpoint --note "story implemented"
|
|
12
15
|
speckit review
|
|
13
16
|
```
|
|
14
17
|
|
|
@@ -16,6 +19,8 @@ Outputs:
|
|
|
16
19
|
|
|
17
20
|
- `.speckit/stories/<story>.md`
|
|
18
21
|
- `.speckit/evidence/<story>-tdd-evidence.md`
|
|
22
|
+
- `.speckit/sessions/<session>/summary.md`
|
|
23
|
+
- `.speckit/sessions/<session>/artifact-log.md`
|
|
19
24
|
|
|
20
25
|
## Full Lane
|
|
21
26
|
|
|
@@ -25,6 +30,8 @@ Use for product or enterprise rollout work.
|
|
|
25
30
|
speckit shape "Standardize Agile + TDD across teams"
|
|
26
31
|
speckit plan "Standardize Agile + TDD across teams"
|
|
27
32
|
speckit sync
|
|
33
|
+
speckit sprint plan
|
|
34
|
+
speckit graph triage --json
|
|
28
35
|
speckit next
|
|
29
36
|
```
|
|
30
37
|
|
|
@@ -36,6 +43,9 @@ Outputs:
|
|
|
36
43
|
- `.speckit/plans/<plan>/story.md`
|
|
37
44
|
- `.speckit/plans/<plan>/tdd-evidence.md`
|
|
38
45
|
- `.speckit/sync/beads-sync.jsonl`
|
|
46
|
+
- `.beads/beads.jsonl`
|
|
47
|
+
- `.speckit/sprint/status.yaml`
|
|
48
|
+
- `.speckit/sprint/plan.md`
|
|
39
49
|
|
|
40
50
|
## TDD Evidence Gate
|
|
41
51
|
|
|
@@ -47,3 +57,16 @@ Each code story must record:
|
|
|
47
57
|
- Refactor command and result
|
|
48
58
|
|
|
49
59
|
Missing evidence means the story is not review-ready.
|
|
60
|
+
|
|
61
|
+
## Long Session Gate
|
|
62
|
+
|
|
63
|
+
Long-running agent work must keep durable state outside chat history:
|
|
64
|
+
|
|
65
|
+
- `.speckit/memory/project-context.md` stores project-wide implementation rules.
|
|
66
|
+
- `.speckit/sessions/active.md` points to the active session.
|
|
67
|
+
- `.speckit/sessions/<id>/artifact-log.md` records checkpoints and files touched.
|
|
68
|
+
- `.speckit/sessions/<id>/summary.md` is the compacted handoff for resume.
|
|
69
|
+
|
|
70
|
+
## Beads Viewer Automation
|
|
71
|
+
|
|
72
|
+
`speckit sync` prepares both Speckit sync metadata and a Beads Viewer-compatible `.beads/beads.jsonl` mirror. `speckit graph triage|plan|insights` refreshes that mirror before invoking `bv --robot-*` from the project root, then falls back to local JSON if Beads Viewer is unavailable or still fails.
|