@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
@@ -0,0 +1,88 @@
1
+ <!-- speckit:managed -->
2
+ # Speckit Prompt Architecture
3
+
4
+ Speckit prompts are product contracts, not loose instructions. Each prompt must make the agent produce durable Agile + TDD artifacts that another agent can resume, validate, and review.
5
+
6
+ ## Design Goals
7
+
8
+ - Keep rough intent separate from implementation.
9
+ - Make acceptance criteria and TDD evidence first-class.
10
+ - Preserve long-session continuity through files.
11
+ - Keep IDE prompts aligned across all supported tools.
12
+ - Prefer machine-checkable output over conversational claims.
13
+
14
+ ## Prompt Layers
15
+
16
+ | Layer | Purpose | Example Artifact |
17
+ | --- | --- | --- |
18
+ | Router | Select the smallest matching skill | `.speckit/agents/super-agent.md` |
19
+ | Skill | Define phase-specific behavior | `.speckit/skills/spec-tdd.md` |
20
+ | Workflow | Define ordered phase execution | `.speckit/workflows/tdd-run.md` |
21
+ | Run prompt | Define implementation contract | `.speckit/prompts/spec-run.md` |
22
+ | IDE adapter | Project the same contract into each tool | `AGENTS.md`, `.claude/skills/*`, `.cursor/rules/*` |
23
+
24
+ ## Required Prompt Sections
25
+
26
+ Every core prompt should include:
27
+
28
+ - Goal
29
+ - Phase or role
30
+ - Required context
31
+ - Inputs and outputs
32
+ - Hard gates
33
+ - Common mistakes to prevent
34
+ - Stop conditions
35
+ - Output contract
36
+ - Validation command or evidence requirement
37
+
38
+ ## Implementation Prompt Contract
39
+
40
+ Code-producing prompts must require:
41
+
42
+ - Ready story with acceptance criteria.
43
+ - Fresh current context.
44
+ - Active session.
45
+ - Matching TDD evidence path.
46
+ - Red evidence before implementation.
47
+ - Green evidence after the target test passes.
48
+ - Refactor evidence after regression validation.
49
+ - Story Dev Agent Record, File List, and Change Log updates.
50
+ - Session checkpoint at red, green, refactor, and review boundaries.
51
+
52
+ ## Review Prompt Contract
53
+
54
+ Review prompts run in this order:
55
+
56
+ 1. Spec compliance: requested behavior, AC coverage, and no unrelated scope.
57
+ 2. Edge-case pathing: branch, boundary, error, state, and concurrency gaps.
58
+ 3. Production readiness: security, compatibility, performance, observability, rollback, docs.
59
+
60
+ Findings lead the report. Each finding needs severity, path, impact, and concrete fix.
61
+
62
+ ## Long Session Contract
63
+
64
+ - Keep durable decisions in `.speckit/**`, not chat.
65
+ - Load only the current phase and directly referenced files.
66
+ - Compact before handoff or after noisy tool output.
67
+ - Preserve session summary and artifact log.
68
+ - Rehydrate from project memory, active session, current context, story, and evidence.
69
+
70
+ ## Adapter Policy
71
+
72
+ All IDE adapters must preserve the same terms:
73
+
74
+ - project memory
75
+ - active session
76
+ - current context
77
+ - subagent handoff
78
+ - acceptance criteria
79
+ - red-green-refactor
80
+ - checkpoint and compact
81
+ - robot-safe graph commands
82
+ - ready-for-dev
83
+ - Dev Agent Record
84
+ - File List
85
+ - Change Log
86
+ - spec compliance
87
+ - edge-case review
88
+
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trieungoctam/speckit",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
4
4
  "description": "Enterprise Agile + TDD workflow compiler for agentic IDEs.",
5
5
  "type": "module",
6
6
  "files": [