@trieungoctam/speckit 0.3.0 → 0.3.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.
Files changed (40) hide show
  1. package/README.md +12 -1
  2. package/dist/adapters/antigravity-adapter.js +5 -5
  3. package/dist/adapters/claude-code-adapter.js +30 -17
  4. package/dist/adapters/codex-adapter.js +5 -3
  5. package/dist/adapters/cursor-adapter.js +33 -12
  6. package/dist/adapters/opencode-adapter.js +13 -16
  7. package/dist/cli.js +13 -0
  8. package/dist/commands/context.js +3 -7
  9. package/dist/commands/doctor.js +10 -3
  10. package/dist/commands/permissions.d.ts +8 -0
  11. package/dist/commands/permissions.js +18 -0
  12. package/dist/commands/plan.js +5 -13
  13. package/dist/commands/quick.js +5 -13
  14. package/dist/commands/validate.d.ts +6 -0
  15. package/dist/commands/validate.js +17 -0
  16. package/dist/core/agent-scaffold.js +22 -1
  17. package/dist/core/managed-files.d.ts +5 -0
  18. package/dist/core/managed-files.js +33 -1
  19. package/dist/core/permission-auditor.d.ts +10 -0
  20. package/dist/core/permission-auditor.js +65 -0
  21. package/dist/core/permission-policy.d.ts +6 -0
  22. package/dist/core/permission-policy.js +93 -0
  23. package/dist/core/policy.d.ts +5 -5
  24. package/dist/core/policy.js +53 -1
  25. package/dist/core/scaffold.js +67 -1
  26. package/dist/core/skill-catalog.d.ts +1 -0
  27. package/dist/core/skill-catalog.js +76 -3
  28. package/dist/core/templates.d.ts +2 -2
  29. package/dist/core/templates.js +49 -3
  30. package/dist/core/workflow-contract.d.ts +7 -0
  31. package/dist/core/workflow-contract.js +43 -0
  32. package/dist/core/workflow-validator.d.ts +6 -0
  33. package/dist/core/workflow-validator.js +133 -0
  34. package/docs/development-roadmap.md +5 -2
  35. package/docs/permission-rules-research.md +265 -0
  36. package/docs/product-contract.md +3 -1
  37. package/docs/project-changelog.md +45 -0
  38. package/docs/prompt-architecture.md +88 -0
  39. package/docs/use-cases.md +206 -0
  40. package/package.json +1 -1
@@ -2,6 +2,8 @@ export const storyTemplate = `---
2
2
  status: draft
3
3
  evidence: .speckit/evidence/{{slug}}-tdd-evidence.md
4
4
  context: pending
5
+ story_key: {{slug}}
6
+ ac_count: 0
5
7
  ---
6
8
 
7
9
  # Story: {{title}}
@@ -10,9 +12,28 @@ context: pending
10
12
  {{intent}}
11
13
 
12
14
  ## Acceptance Criteria
13
- - Given ...
14
- - When ...
15
- - Then ...
15
+ - AC1: Given ...
16
+ When ...
17
+ Then ...
18
+
19
+ ## Implementation Scope
20
+ - In scope:
21
+ - Out of scope:
22
+ - Files likely to read:
23
+ - Files likely to modify:
24
+
25
+ ## Dev Notes
26
+ - Existing patterns to reuse:
27
+ - Architecture constraints:
28
+ - Edge cases:
29
+ - Previous-story learnings:
30
+
31
+ ## Tasks / Subtasks
32
+ - [ ] Map acceptance criteria to tests.
33
+ - [ ] RED: create or identify failing test.
34
+ - [ ] GREEN: implement minimum passing change.
35
+ - [ ] REFACTOR: improve design while tests stay green.
36
+ - [ ] Update evidence, file list, and change log.
16
37
 
17
38
  ## TDD Checklist
18
39
  - [ ] Test targets identified
@@ -24,31 +45,56 @@ context: pending
24
45
  - Risks:
25
46
  - Dependencies:
26
47
 
48
+ ## Dev Agent Record
49
+ ### Test Intent
50
+
51
+ ### Debug Log
52
+
53
+ ### Completion Notes
54
+
55
+ ### File List
56
+
57
+ ## Change Log
58
+ - {{date}}: Story drafted.
59
+
27
60
  ## Spec Anti-Mistake Checklist
28
61
  - Reuse existing project patterns before adding new files.
29
62
  - Verify file locations before editing.
30
63
  - Do not introduce new libraries without explicit need.
31
64
  - Preserve existing behavior unless an acceptance criterion requires change.
32
65
  - Capture previous-story learnings if this continues prior work.
66
+ - Do not mark any task complete without test or validation evidence.
33
67
  `;
34
68
  export const tddEvidenceTemplate = `---
35
69
  status: missing
36
70
  story: {{story}}
71
+ phase: not-started
37
72
  ---
38
73
 
39
74
  # TDD Evidence: {{story}}
40
75
 
41
76
  ## Test Intent
77
+ - Acceptance criteria covered:
78
+ - Test files:
79
+ - Command:
42
80
 
43
81
  ## Red
44
82
  - Command:
45
83
  - Result:
84
+ - Failing reason:
46
85
 
47
86
  ## Green
48
87
  - Command:
49
88
  - Result:
89
+ - Passing evidence:
50
90
 
51
91
  ## Refactor
52
92
  - Command:
53
93
  - Result:
94
+ - Regression evidence:
95
+
96
+ ## Review Evidence
97
+ - Reviewer:
98
+ - Outcome:
99
+ - Follow-ups:
54
100
  `;
@@ -0,0 +1,7 @@
1
+ export declare const workflowContract: {
2
+ readonly phases: readonly ["start", "memory", "sprint", "context", "sync", "triage", "ready", "run", "checkpoint", "review", "close"];
3
+ readonly skills: string[];
4
+ readonly statuses: readonly ["DONE", "DONE_WITH_CONCERNS", "BLOCKED", "NEEDS_CONTEXT"];
5
+ readonly requiredPromptTerms: readonly [readonly ["project memory", ".speckit/memory/project-context.md"], readonly ["active session", ".speckit/sessions/active.md"], readonly ["current context", ".speckit/context/current.md"], readonly ["subagent handoff", ".speckit/context/subagent-handoff.md"], readonly ["acceptance criteria", "AC coverage", "ACs"], readonly ["red-green-refactor", "red/green/refactor"], readonly ["checkpoint", "speckit session checkpoint"], readonly ["compact", "compaction", "speckit session compact"], readonly ["robot-safe", "bv --robot", "robot commands"], readonly ["ready-for-dev", "speckit ready"], readonly ["Dev Agent Record", "implementation notes"], readonly ["File List", "files changed"], readonly ["Change Log", "changelog"], readonly ["spec compliance", "AC coverage"], readonly ["edge-case", "edge case"]];
6
+ readonly requiredRouterTerms: readonly ["smallest matching Speckit skill", "Work context path", "Reports path", "Plans path", "Hydrate runtime tasks", "Sync completed runtime tasks"];
7
+ };
@@ -0,0 +1,43 @@
1
+ import { specSkillNames } from "./skill-catalog.js";
2
+ export const workflowContract = {
3
+ phases: [
4
+ "start",
5
+ "memory",
6
+ "sprint",
7
+ "context",
8
+ "sync",
9
+ "triage",
10
+ "ready",
11
+ "run",
12
+ "checkpoint",
13
+ "review",
14
+ "close",
15
+ ],
16
+ skills: specSkillNames(),
17
+ statuses: ["DONE", "DONE_WITH_CONCERNS", "BLOCKED", "NEEDS_CONTEXT"],
18
+ requiredPromptTerms: [
19
+ ["project memory", ".speckit/memory/project-context.md"],
20
+ ["active session", ".speckit/sessions/active.md"],
21
+ ["current context", ".speckit/context/current.md"],
22
+ ["subagent handoff", ".speckit/context/subagent-handoff.md"],
23
+ ["acceptance criteria", "AC coverage", "ACs"],
24
+ ["red-green-refactor", "red/green/refactor"],
25
+ ["checkpoint", "speckit session checkpoint"],
26
+ ["compact", "compaction", "speckit session compact"],
27
+ ["robot-safe", "bv --robot", "robot commands"],
28
+ ["ready-for-dev", "speckit ready"],
29
+ ["Dev Agent Record", "implementation notes"],
30
+ ["File List", "files changed"],
31
+ ["Change Log", "changelog"],
32
+ ["spec compliance", "AC coverage"],
33
+ ["edge-case", "edge case"],
34
+ ],
35
+ requiredRouterTerms: [
36
+ "smallest matching Speckit skill",
37
+ "Work context path",
38
+ "Reports path",
39
+ "Plans path",
40
+ "Hydrate runtime tasks",
41
+ "Sync completed runtime tasks",
42
+ ],
43
+ };
@@ -0,0 +1,6 @@
1
+ export type ContractCheck = {
2
+ name: string;
3
+ ok: boolean;
4
+ detail: string;
5
+ };
6
+ export declare function validateWorkflowContract(root: string): Promise<ContractCheck[]>;
@@ -0,0 +1,133 @@
1
+ import { access, readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { getAdapters } from "../config/adapter-registry.js";
4
+ import { validatePermissionPolicy } from "./permission-auditor.js";
5
+ import { workflowContract } from "./workflow-contract.js";
6
+ export async function validateWorkflowContract(root) {
7
+ const checks = [];
8
+ const catalog = await read(root, ".speckit/skills/catalog.md");
9
+ const router = await read(root, ".speckit/agents/super-agent.md");
10
+ const flow = await read(root, ".speckit/flows/spec-flow.md");
11
+ const runPrompt = await read(root, ".speckit/prompts/spec-run.md");
12
+ checks.push(requiredFile(".speckit/skills/catalog.md", catalog));
13
+ checks.push(requiredFile(".speckit/agents/super-agent.md", router));
14
+ checks.push(requiredFile(".speckit/flows/spec-flow.md", flow));
15
+ checks.push(requiredFile(".speckit/prompts/spec-run.md", runPrompt));
16
+ checks.push(await skillsCheck(root, catalog));
17
+ checks.push(containsAll("super-agent router", router, workflowContract.requiredRouterTerms));
18
+ checks.push(orderedFlowCheck(flow));
19
+ checks.push(containsAll("enterprise run prompt", runPrompt, workflowContract.requiredPromptTerms));
20
+ checks.push(await permissionPolicyCheck(root));
21
+ checks.push(await adapterPromptCheck(root));
22
+ return checks;
23
+ }
24
+ async function permissionPolicyCheck(root) {
25
+ const missing = await validatePermissionPolicy(root);
26
+ return {
27
+ name: "permission policy",
28
+ ok: missing.length === 0,
29
+ detail: missing.length === 0 ? "aligned" : `missing: ${missing.join(", ")}`,
30
+ };
31
+ }
32
+ function requiredFile(path, content) {
33
+ return {
34
+ name: path,
35
+ ok: content !== undefined,
36
+ detail: content === undefined ? "missing" : "present",
37
+ };
38
+ }
39
+ async function skillsCheck(root, catalog) {
40
+ const missing = [];
41
+ for (const skill of workflowContract.skills) {
42
+ if (!(await exists(root, `.speckit/skills/${skill}.md`)) || !catalog?.includes(skill)) {
43
+ missing.push(skill);
44
+ }
45
+ }
46
+ return {
47
+ name: "core skills",
48
+ ok: missing.length === 0,
49
+ detail: missing.length === 0 ? `${workflowContract.skills.length} skills aligned` : `missing: ${missing.join(", ")}`,
50
+ };
51
+ }
52
+ function orderedFlowCheck(flow) {
53
+ if (!flow)
54
+ return { name: "workflow phase order", ok: false, detail: "flow file missing" };
55
+ let cursor = -1;
56
+ const missing = [];
57
+ for (const phase of workflowContract.phases) {
58
+ const next = flow.indexOf(phase, cursor + 1);
59
+ if (next === -1) {
60
+ missing.push(phase);
61
+ continue;
62
+ }
63
+ cursor = next;
64
+ }
65
+ return {
66
+ name: "workflow phase order",
67
+ ok: missing.length === 0,
68
+ detail: missing.length === 0 ? workflowContract.phases.join(" -> ") : `missing or out of order: ${missing.join(", ")}`,
69
+ };
70
+ }
71
+ function containsAll(name, content, terms) {
72
+ const haystack = content?.toLowerCase() ?? "";
73
+ const missing = terms.filter((term) => !matchesTerm(haystack, term)).map(termLabel);
74
+ return {
75
+ name,
76
+ ok: missing.length === 0,
77
+ detail: missing.length === 0 ? "aligned" : `missing: ${missing.join(", ")}`,
78
+ };
79
+ }
80
+ function matchesTerm(haystack, term) {
81
+ const alternatives = Array.isArray(term) ? term : [term];
82
+ return alternatives.some((alternative) => haystack.includes(alternative.toLowerCase()));
83
+ }
84
+ function termLabel(term) {
85
+ return typeof term === "string" ? term : term[0];
86
+ }
87
+ async function adapterPromptCheck(root) {
88
+ const missing = [];
89
+ const checked = [];
90
+ for (const adapter of getAdapters("all")) {
91
+ const content = await readExisting(root, adapter.outputPaths);
92
+ if (!content)
93
+ continue;
94
+ checked.push(adapter.name);
95
+ const check = containsAll(adapter.name, content, workflowContract.requiredPromptTerms);
96
+ if (!check.ok)
97
+ missing.push(`${adapter.name} (${check.detail})`);
98
+ }
99
+ if (checked.length === 0) {
100
+ return { name: "adapter prompt contracts", ok: false, detail: "no adapter files found" };
101
+ }
102
+ return {
103
+ name: "adapter prompt contracts",
104
+ ok: missing.length === 0,
105
+ detail: missing.length === 0 ? `aligned: ${checked.join(", ")}` : missing.join("; "),
106
+ };
107
+ }
108
+ async function readExisting(root, paths) {
109
+ const chunks = [];
110
+ for (const path of paths) {
111
+ const content = await read(root, path);
112
+ if (content)
113
+ chunks.push(content);
114
+ }
115
+ return chunks.length > 0 ? chunks.join("\n") : undefined;
116
+ }
117
+ async function read(root, path) {
118
+ try {
119
+ return await readFile(join(root, path), "utf8");
120
+ }
121
+ catch {
122
+ return undefined;
123
+ }
124
+ }
125
+ async function exists(root, path) {
126
+ try {
127
+ await access(join(root, path));
128
+ return true;
129
+ }
130
+ catch {
131
+ return false;
132
+ }
133
+ }
@@ -4,7 +4,7 @@
4
4
 
5
5
  Speckit MVP is implemented and pushed to `git@github.com:trieungoctam/speckit.git` on `main`.
6
6
 
7
- Current package target: `@trieungoctam/speckit@0.3.0`.
7
+ Current package target: `@trieungoctam/speckit@0.3.3`.
8
8
 
9
9
  The CLI is npx-ready, generates Agile + TDD rules, creates workflow artifacts, supports five IDE adapters, wraps Beads Viewer safely, includes an enterprise harness, and has automated prompt/readiness/session tests plus CI.
10
10
 
@@ -21,13 +21,16 @@ The CLI is npx-ready, generates Agile + TDD rules, creates workflow artifacts, s
21
21
  | Sprint automation | MVP Complete | `sprint plan` and `sprint next` select work from synced stories. |
22
22
  | Enterprise harness | MVP Complete | `init --enterprise` creates flow, tool-policy, and prompt harness files; `doctor --deep` verifies them. |
23
23
  | Curated skill catalog | Complete | Speckit now generates focused phase skills, a schema, delegation statuses, and task hydration/sync-back guidance. |
24
+ | Workflow contract validator | Complete | `speckit validate` and `doctor --deep` check phase order, core skills, router terms, run prompt terms, and adapter parity. |
25
+ | Prompt architecture | Complete | Generated prompts now enforce artifact contracts, hard gates, common mistake prevention, TDD evidence, and review layers across adapters. |
26
+ | Permission policy | MVP Complete | `.speckit/permissions.yaml` and `permissions audit` cover privacy files, heavy paths, destructive commands, and release commands. |
24
27
  | Validation | Complete | Build and `node:test` suite pass locally with flow contract gates. |
25
28
  | GitHub publish | Complete | Initial code pushed to `trieungoctam/speckit` at commit `7e5c582`; status docs follow-up in progress. |
26
29
  | npm package readiness | Ready | Package scoped as `@trieungoctam/speckit`; `npm pack --dry-run` passes. |
27
30
 
28
31
  ## Next Roadmap
29
32
 
30
- - Add `review --deep` with blind, edge-case, and acceptance audit prompts.
33
+ - Add `review --deep` with multi-layer acceptance, edge-case, and production-readiness prompts.
31
34
  - Add graph drift and history correlation commands.
32
35
  - Add GitHub trusted publishing for npm releases.
33
36
  - Add snapshot tests for full adapter file contents.
@@ -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.
@@ -5,13 +5,15 @@ 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`, `memory`, `session`, `shape`, `plan`, `context`, `quick`, `sync`, `triage`, `sprint`, `graph`, `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
9
  - The skill catalog and super-agent routing contract for phase-specific agent behavior.
10
10
  - IDE-specific initialization that installs the shared Speckit runtime plus only the selected IDE adapter when `--ide <name>` is provided.
11
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.
12
13
  - The TDD gate: code stories require red, green, and refactor evidence.
13
14
  - The adapter compiler for Claude Code, Codex, Antigravity, OpenCode, and Cursor.
14
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.
15
17
 
16
18
  ## Speckit Delegates
17
19
 
@@ -1,5 +1,44 @@
1
1
  # Project Changelog
2
2
 
3
+ ## 0.3.3 - 2026-05-11
4
+
5
+ ### Added
6
+
7
+ - Added `docs/prompt-architecture.md` to define Speckit prompt layers, required sections, implementation contract, review contract, long-session contract, and adapter parity policy.
8
+
9
+ ### Changed
10
+
11
+ - Strengthened generated story and TDD evidence templates with AC IDs, implementation scope, Dev Notes, Dev Agent Record, File List, Change Log, and review evidence.
12
+ - Strengthened generated skill files with inputs, outputs, common mistakes, hard gates, validation guidance, and durable artifact requirements.
13
+ - Strengthened the super-agent, enterprise run prompt, and IDE adapter prompts with workflow state, just-in-time context loading, spec compliance, edge-case review, and production readiness expectations.
14
+
15
+ ### Quality
16
+
17
+ - Expanded workflow contract terms so `speckit validate` checks Dev Agent Record, File List, Change Log, spec compliance, and edge-case prompt coverage across installed adapters.
18
+
19
+ ## 0.3.2 - 2026-05-11
20
+
21
+ ### Fixed
22
+
23
+ - Fixed OpenCode, Cursor, and Claude Code JSON generation so schema-strict config files no longer include the internal `x-speckit-managed` marker.
24
+ - Fixed generated YAML-frontmatter files so IDE agents, Cursor rules, stories, evidence, and current context start with `---` and keep the Speckit marker after frontmatter.
25
+ - Preserved idempotent `speckit init` behavior for strict JSON files by matching generated JSON fingerprints and legacy marker-based files.
26
+
27
+ ### Quality
28
+
29
+ - Added regression tests for strict JSON compatibility, frontmatter placement, legacy config upgrades, and adapter output quality.
30
+ - `npm test` passes with 42 tests.
31
+
32
+ ## 0.3.1 - 2026-05-11
33
+
34
+ ### Changed
35
+
36
+ - Prepared npm release for the workflow validation and permission policy package updates.
37
+
38
+ ### Validation
39
+
40
+ - `npm test` passes with 36 tests.
41
+
3
42
  ## 0.3.0 - 2026-05-10
4
43
 
5
44
  ### Added
@@ -11,6 +50,11 @@
11
50
  - Added `.speckit/agents/super-agent.md` as the portable orchestration router.
12
51
  - 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.
13
52
  - Added `.speckit/skills/schema.json` to define the portable skill contract and delegation statuses.
53
+ - Added `speckit validate` for workflow contract validation across phase order, skills, router, prompts, and installed adapters.
54
+ - Added `contractChecks` to `speckit doctor --deep --json`.
55
+ - 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.
56
+ - Added `.speckit/permissions.yaml` and `speckit permissions audit` for privacy, scout, destructive-command, and release-command checks.
57
+ - Added concrete permission output for Claude Code, Codex, and Cursor adapters.
14
58
  - Added long-session prompt requirements for project memory, active session state, checkpoints, and compaction summaries.
15
59
  - Added automatic `.beads/beads.jsonl` mirror generation so Beads Viewer robot commands can run without missing-project errors.
16
60
  - Standard `speckit init --ide <name>` now installs the shared Speckit runtime, super-agent, and skill catalog for the selected IDE.
@@ -29,6 +73,7 @@
29
73
  - Added workflow tests for memory/session state, sprint planning, and graph fallback.
30
74
  - Expanded prompt quality tests for project memory, active session, checkpoint, and compaction.
31
75
  - Added init and flow contract coverage for the curated skill catalog.
76
+ - Added workflow validator tests for passing and tampered contract states.
32
77
 
33
78
  ## 0.2.2 - 2026-05-10
34
79