tmux-agent 0.1.0

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 (161) hide show
  1. package/.codex/skills/speckit/SKILL.md +173 -0
  2. package/.codex/skills/speckit/assets/templates/checklist-template.md +49 -0
  3. package/.codex/skills/speckit/assets/templates/notes-entrypoints-template.md +11 -0
  4. package/.codex/skills/speckit/assets/templates/notes-questions-template.md +7 -0
  5. package/.codex/skills/speckit/assets/templates/notes-readme-template.md +36 -0
  6. package/.codex/skills/speckit/assets/templates/notes-session-template.md +21 -0
  7. package/.codex/skills/speckit/assets/templates/plan-template.md +126 -0
  8. package/.codex/skills/speckit/assets/templates/spec-template.md +135 -0
  9. package/.codex/skills/speckit/assets/templates/tasks-template.md +269 -0
  10. package/.codex/skills/speckit/references/acceptance.md +183 -0
  11. package/.codex/skills/speckit/references/analyze.md +186 -0
  12. package/.codex/skills/speckit/references/checklist.md +302 -0
  13. package/.codex/skills/speckit/references/clarify-auto.md +69 -0
  14. package/.codex/skills/speckit/references/clarify-detailed.md +78 -0
  15. package/.codex/skills/speckit/references/clarify.md +189 -0
  16. package/.codex/skills/speckit/references/constitution.md +90 -0
  17. package/.codex/skills/speckit/references/group.md +89 -0
  18. package/.codex/skills/speckit/references/implement-task.md +115 -0
  19. package/.codex/skills/speckit/references/implement.md +129 -0
  20. package/.codex/skills/speckit/references/notes.md +82 -0
  21. package/.codex/skills/speckit/references/plan-deep.md +87 -0
  22. package/.codex/skills/speckit/references/plan-from-questions.md +115 -0
  23. package/.codex/skills/speckit/references/plan-from-review.md +89 -0
  24. package/.codex/skills/speckit/references/plan.md +97 -0
  25. package/.codex/skills/speckit/references/review-plan.md +156 -0
  26. package/.codex/skills/speckit/references/specify.md +246 -0
  27. package/.codex/skills/speckit/references/tasks.md +155 -0
  28. package/.codex/skills/speckit/references/taskstoissues.md +33 -0
  29. package/.codex/skills/speckit/scripts/bash/check-prerequisites.sh +206 -0
  30. package/.codex/skills/speckit/scripts/bash/common.sh +191 -0
  31. package/.codex/skills/speckit/scripts/bash/create-new-feature.sh +259 -0
  32. package/.codex/skills/speckit/scripts/bash/extract-coded-points.sh +322 -0
  33. package/.codex/skills/speckit/scripts/bash/extract-spec-ids.sh +238 -0
  34. package/.codex/skills/speckit/scripts/bash/extract-tasks.sh +295 -0
  35. package/.codex/skills/speckit/scripts/bash/extract-user-stories.sh +312 -0
  36. package/.codex/skills/speckit/scripts/bash/setup-notes.sh +182 -0
  37. package/.codex/skills/speckit/scripts/bash/setup-plan.sh +110 -0
  38. package/.codex/skills/speckit/scripts/bash/show-todo-tasks.sh +257 -0
  39. package/.codex/skills/speckit/scripts/bash/spec-group-checklist.sh +402 -0
  40. package/.codex/skills/speckit/scripts/bash/spec-group-members.sh +215 -0
  41. package/.codex/skills/speckit/scripts/bash/spec-registry-graph.sh +399 -0
  42. package/.specify/memory/constitution.md +67 -0
  43. package/.specify/templates/agent-file-template.md +28 -0
  44. package/.specify/templates/checklist-template.md +49 -0
  45. package/.specify/templates/plan-template.md +126 -0
  46. package/.specify/templates/spec-template.md +135 -0
  47. package/.specify/templates/tasks-template.md +269 -0
  48. package/README.md +128 -0
  49. package/README.zh-CN.md +127 -0
  50. package/bun.lock +269 -0
  51. package/dist/cli/commands/codex/forkHome.js +88 -0
  52. package/dist/cli/commands/codex/send.js +55 -0
  53. package/dist/cli/commands/codex/sessionInfo.js +42 -0
  54. package/dist/cli/commands/codex/spawn.js +68 -0
  55. package/dist/cli/commands/find.js +26 -0
  56. package/dist/cli/commands/paneKill.js +33 -0
  57. package/dist/cli/commands/paneSpawn.js +40 -0
  58. package/dist/cli/commands/paneTitle.js +33 -0
  59. package/dist/cli/commands/read.js +34 -0
  60. package/dist/cli/commands/send.js +51 -0
  61. package/dist/cli/commands/snapshot.js +19 -0
  62. package/dist/cli/commands/ui/select.js +41 -0
  63. package/dist/cli/commands/windowKill.js +25 -0
  64. package/dist/cli/commands/windowLs.js +15 -0
  65. package/dist/cli/commands/windowNew.js +28 -0
  66. package/dist/cli/commands/windowRename.js +25 -0
  67. package/dist/cli/index.js +365 -0
  68. package/dist/cli/parse.js +39 -0
  69. package/dist/lib/codex/forkHome.js +101 -0
  70. package/dist/lib/codex/isCodexPane.js +55 -0
  71. package/dist/lib/codex/send.js +58 -0
  72. package/dist/lib/codex/sessionInfo.js +449 -0
  73. package/dist/lib/codex/spawn.js +246 -0
  74. package/dist/lib/contracts/types.js +2 -0
  75. package/dist/lib/fs/safeRm.js +32 -0
  76. package/dist/lib/io/readStdin.js +14 -0
  77. package/dist/lib/os/process.js +55 -0
  78. package/dist/lib/output/format.js +95 -0
  79. package/dist/lib/proc/lsof.js +42 -0
  80. package/dist/lib/proc/ps.js +60 -0
  81. package/dist/lib/targeting/errors.js +13 -0
  82. package/dist/lib/targeting/resolvePaneTarget.js +91 -0
  83. package/dist/lib/targeting/resolveWindowTarget.js +40 -0
  84. package/dist/lib/targeting/scope.js +58 -0
  85. package/dist/lib/tmux/capturePane.js +20 -0
  86. package/dist/lib/tmux/exec.js +66 -0
  87. package/dist/lib/tmux/paneOps.js +29 -0
  88. package/dist/lib/tmux/paste.js +23 -0
  89. package/dist/lib/tmux/sendKeys.js +47 -0
  90. package/dist/lib/tmux/session.js +29 -0
  91. package/dist/lib/tmux/snapshotPanes.js +46 -0
  92. package/dist/lib/tmux/snapshotWindows.js +24 -0
  93. package/dist/lib/tmux/windowOps.js +32 -0
  94. package/dist/lib/ui/popupSelect.js +432 -0
  95. package/dist/lib/ui/popupSupport.js +76 -0
  96. package/package.json +23 -0
  97. package/src/cli/commands/codex/forkHome.ts +141 -0
  98. package/src/cli/commands/codex/send.ts +83 -0
  99. package/src/cli/commands/codex/sessionInfo.ts +59 -0
  100. package/src/cli/commands/codex/spawn.ts +90 -0
  101. package/src/cli/commands/find.ts +40 -0
  102. package/src/cli/commands/paneKill.ts +49 -0
  103. package/src/cli/commands/paneSpawn.ts +53 -0
  104. package/src/cli/commands/paneTitle.ts +50 -0
  105. package/src/cli/commands/read.ts +48 -0
  106. package/src/cli/commands/send.ts +71 -0
  107. package/src/cli/commands/snapshot.ts +28 -0
  108. package/src/cli/commands/ui/select.ts +49 -0
  109. package/src/cli/commands/windowKill.ts +35 -0
  110. package/src/cli/commands/windowLs.ts +20 -0
  111. package/src/cli/commands/windowNew.ts +40 -0
  112. package/src/cli/commands/windowRename.ts +36 -0
  113. package/src/cli/index.ts +430 -0
  114. package/src/lib/codex/forkHome.ts +148 -0
  115. package/src/lib/codex/isCodexPane.ts +56 -0
  116. package/src/lib/codex/send.ts +84 -0
  117. package/src/lib/codex/sessionInfo.ts +521 -0
  118. package/src/lib/codex/spawn.ts +305 -0
  119. package/src/lib/contracts/types.ts +30 -0
  120. package/src/lib/fs/safeRm.ts +32 -0
  121. package/src/lib/io/readStdin.ts +11 -0
  122. package/src/lib/output/format.ts +105 -0
  123. package/src/lib/proc/lsof.ts +44 -0
  124. package/src/lib/proc/ps.ts +70 -0
  125. package/src/lib/targeting/errors.ts +25 -0
  126. package/src/lib/targeting/resolvePaneTarget.ts +106 -0
  127. package/src/lib/targeting/resolveWindowTarget.ts +45 -0
  128. package/src/lib/targeting/scope.ts +76 -0
  129. package/src/lib/tmux/capturePane.ts +21 -0
  130. package/src/lib/tmux/exec.ts +90 -0
  131. package/src/lib/tmux/paneOps.ts +35 -0
  132. package/src/lib/tmux/paste.ts +20 -0
  133. package/src/lib/tmux/sendKeys.ts +72 -0
  134. package/src/lib/tmux/session.ts +27 -0
  135. package/src/lib/tmux/snapshotPanes.ts +52 -0
  136. package/src/lib/tmux/snapshotWindows.ts +23 -0
  137. package/src/lib/tmux/windowOps.ts +43 -0
  138. package/src/lib/ui/popupSelect.ts +561 -0
  139. package/src/lib/ui/popupSupport.ts +84 -0
  140. package/tests/e2e/codexForkHome.test.ts +146 -0
  141. package/tests/e2e/codexSessionInfo.test.ts +112 -0
  142. package/tests/e2e/codexTuiSend.test.ts +68 -0
  143. package/tests/integration/codexSpawn.test.ts +113 -0
  144. package/tests/integration/paneOps.test.ts +60 -0
  145. package/tests/integration/sendRead.test.ts +52 -0
  146. package/tests/integration/snapshot.test.ts +39 -0
  147. package/tests/integration/tmuxHarness.ts +39 -0
  148. package/tests/integration/windowOps.test.ts +60 -0
  149. package/tests/unit/codexSend.test.ts +105 -0
  150. package/tests/unit/codexSessionInfo.test.ts +88 -0
  151. package/tests/unit/codexSpawn.test.ts +34 -0
  152. package/tests/unit/keys.test.ts +30 -0
  153. package/tests/unit/outputFormat.test.ts +52 -0
  154. package/tests/unit/popupSelect.test.ts +77 -0
  155. package/tests/unit/popupSupport.test.ts +109 -0
  156. package/tests/unit/resolvePaneTarget.test.ts +43 -0
  157. package/tests/unit/resolveWindowTarget.test.ts +36 -0
  158. package/tests/unit/safeRm.test.ts +41 -0
  159. package/tests/unit/scope.test.ts +57 -0
  160. package/tsconfig.json +14 -0
  161. package/vitest.config.ts +16 -0
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: speckit
3
+ description: In repositories that use `.specify/` + `specs/` (Spec Kit / Spec-Driven Development), use `$speckit <stage>` as a single stage router to write back key decisions into spec-kit artifacts (`spec.md`, `plan.md`, `tasks.md`, `checklists/*`, `.specify/memory/constitution.md`). Trigger only when the user makes an explicit decision/change; stay silent for casual chat/brainstorming.
4
+ ---
5
+
6
+ # speckit (Stage Router)
7
+
8
+ Goal: Drive a Spec-Driven workflow with one skill, treat spec artifacts as an executable single source of truth (spec → plan → tasks → implement), and write back key decisions promptly to avoid drift between code and specs.
9
+
10
+ ## When to trigger / when to stay silent
11
+
12
+ Trigger (the user made an explicit decision/change that impacts artifacts):
13
+
14
+ - Tech stack / architecture changes → usually run `clarify` first, then `plan`
15
+ - Feature requirements added/removed/changed → `specify`
16
+ - Principles / governance / quality gates changed → `constitution`
17
+ - Ambiguity blocks implementation → `clarify` (write back to spec)
18
+ - An external review produced `review.md` (plan review) → `review-plan`
19
+ - Ingest an external review report into `plan.md` / `tasks.md` → `plan-from-review`
20
+ - Ingest a question list (without `review.md`) into planning/tasks → `plan-from-questions`
21
+ - Task decomposition/order/parallelization needs reshaping → `tasks`
22
+ - Multi-spec coordination (Spec Group: one spec dispatches multiple specs) → `group`
23
+ - Pre-implementation consistency check (read-only) → `analyze`
24
+ - Generate a domain checklist (security/ux/api/performance/...) → `checklist`
25
+ - Enter implementation and check tasks off → `implement`
26
+ - Long exploration / context may be compacted: flush handoff notes → `notes`
27
+ - Post-implementation acceptance & drift assessment (FR/NFR/SC) → `acceptance`
28
+ - Implement only a specific TaskID / next task (task-driven, minimal context) → `implement-task`
29
+ - Sync tasks to an issue tracker → `taskstoissues`
30
+
31
+ Stay silent (do not auto-trigger):
32
+
33
+ - Casual chat / brainstorming without a decision
34
+ - Explaining concepts / answering questions without asking to update spec-kit artifacts
35
+
36
+ ## How it works (router + bundled resources)
37
+
38
+ - Router: `$speckit <stage> ...` selects and executes the stage reference prompt.
39
+ - Bundled resources: stage prompts, scripts, and templates live in this skill to keep the workflow stable and reusable.
40
+
41
+ ## Usage
42
+
43
+ - Invocation: `$speckit <stage> <text...>`
44
+ - `<stage>` must be one of:
45
+ - `constitution`
46
+ - `specify`
47
+ - `clarify`
48
+ - `clarify-auto`
49
+ - `clarify-detailed`
50
+ - `plan`
51
+ - `plan-deep`
52
+ - `review-plan`
53
+ - `plan-from-review`
54
+ - `plan-from-questions`
55
+ - `group`
56
+ - `tasks`
57
+ - `analyze`
58
+ - `checklist`
59
+ - `notes`
60
+ - `implement`
61
+ - `acceptance`
62
+ - `implement-task`
63
+ - `taskstoissues`
64
+
65
+ If `<stage>` is missing or invalid: stop and ask the user to pick one from the list.
66
+
67
+ ## Optional: Specs Kanban
68
+
69
+ An optional local Kanban to browse and drive `specs/*`:
70
+
71
+ - Recommended: run as a standalone tool: `npx speckit-kit kanban`
72
+ - Set repo root: `npx speckit-kit kanban --repo-root /path/to/repo`
73
+ - Or env var: `SPECKIT_KIT_REPO_ROOT=/path/to/repo npx speckit-kit kanban`
74
+
75
+ Note: the Kanban is shipped as an npm CLI package: `speckit-kit`.
76
+
77
+ ## Feature selection (recommended)
78
+
79
+ Avoid accidentally targeting the “latest” spec; pick a feature explicitly:
80
+
81
+ - Recommended: place the feature id as the first token after `<stage>`: `$speckit plan 025 ...`
82
+ - Explicit env override: include `SPECIFY_FEATURE=025` (or `SPECIFY_FEATURE=025-my-feature`)
83
+ - Alias forms: `feature=025` / `spec=025` / `feat=025` / `id=025` (normalized to `SPECIFY_FEATURE=...`)
84
+ - Multi-spec acceptance: `acceptance` supports multiple ids: `$speckit acceptance 026 027`
85
+
86
+ ## Core workflow and artifact boundaries
87
+
88
+ - Trigger form: users trigger by calling `$speckit <stage>` (slash commands are treated as aliases).
89
+ - Recommended main flow: `constitution` → `specify` → `clarify` → `plan` → `tasks` → `implement`
90
+ - You can insert `notes` anywhere for a manual flush.
91
+ - You can insert `checklist` / `analyze` before implementation for convergence.
92
+ - Recommended closure: run `acceptance` after `implement` to evaluate drift against coded points in `spec.md`.
93
+ - Artifact boundaries:
94
+ - `constitution`: project principles and governance (global constraints)
95
+ - `specify`: requirements and success criteria (WHAT/WHY, not HOW)
96
+ - `clarify`: remove ambiguity and fill gaps (eliminate `[NEEDS CLARIFICATION]`)
97
+ - `plan`: technical/architecture plan (HOW at the macro level; details can live in sub-docs)
98
+ - `tasks`: executable task breakdown (order/dependencies/parallel markers/checkpoints)
99
+ - `implement`: implement from `tasks.md` and keep checking progress; write back to specs if needed
100
+ - Feature context: feature id is `001-xxx`, mapping to `specs/<feature-id>/...`; scripts read `SPECIFY_FEATURE`, then infer from CWD, then fall back to the highest number under `specs/`.
101
+
102
+ ## Routing rules (avoid semantic drift)
103
+
104
+ 0. Derive `SKILL_DIR`: from the injected `SKILL.md` absolute path: `SKILL_DIR = dirname(path)`.
105
+ - Important: `SKILL_DIR/...` is a placeholder in docs; shell commands must use the actual absolute path.
106
+ 1. Parse from the user message:
107
+ - `stage`: the first token after `$speckit`
108
+ - `stage_args`: the remaining text (may be empty)
109
+ - If `stage_args` contains `SPECIFY_FEATURE=<id>`: treat it as the feature override; strip it from `stage_args`.
110
+ - If the first token of `stage_args` matches `026` or `026-xxx`: treat it as feature id and normalize to `SPECIFY_FEATURE=<token>`.
111
+ - If `stage_args` contains `feature=<id>` / `spec=<id>` / `feat=<id>` / `id=<id>`: treat it as feature id and normalize.
112
+ - If multiple forms are present, prefer explicit `SPECIFY_FEATURE=`.
113
+ 2. Before doing any action, read and follow `SKILL_DIR/references/<stage>.md` as authoritative.
114
+ 3. Execute strictly per `references/<stage>.md`; do not re-implement a “similar” flow in this file.
115
+ 4. In stage references, `$ARGUMENTS` means `stage_args`.
116
+
117
+ ## Stage reference mapping (authoritative)
118
+
119
+ - `constitution` → `SKILL_DIR/references/constitution.md`
120
+ - `specify` → `SKILL_DIR/references/specify.md`
121
+ - `clarify` → `SKILL_DIR/references/clarify.md`
122
+ - `clarify-auto` → `SKILL_DIR/references/clarify-auto.md`
123
+ - `clarify-detailed` → `SKILL_DIR/references/clarify-detailed.md`
124
+ - `plan` → `SKILL_DIR/references/plan.md`
125
+ - `plan-deep` → `SKILL_DIR/references/plan-deep.md`
126
+ - `review-plan` → `SKILL_DIR/references/review-plan.md`
127
+ - `plan-from-review` → `SKILL_DIR/references/plan-from-review.md`
128
+ - `plan-from-questions` → `SKILL_DIR/references/plan-from-questions.md`
129
+ - `group` → `SKILL_DIR/references/group.md`
130
+ - `tasks` → `SKILL_DIR/references/tasks.md`
131
+ - `analyze` → `SKILL_DIR/references/analyze.md`
132
+ - `checklist` → `SKILL_DIR/references/checklist.md`
133
+ - `notes` → `SKILL_DIR/references/notes.md`
134
+ - `implement` → `SKILL_DIR/references/implement.md`
135
+ - `acceptance` → `SKILL_DIR/references/acceptance.md`
136
+ - `implement-task` → `SKILL_DIR/references/implement-task.md`
137
+ - `taskstoissues` → `SKILL_DIR/references/taskstoissues.md`
138
+
139
+ Treat `references/<stage>.md` as the stage’s authoritative prompt:
140
+
141
+ - Do not write a second “equivalent” flow in this file.
142
+ - If a reference instruction does not match the real repo (missing scripts/paths), make the smallest fix and document the delta for prompt debugging.
143
+
144
+ ## Bundled resources
145
+
146
+ - Stage prompts: `references/*.md`
147
+ - Scripts: `scripts/bash/*.sh`
148
+ - Templates: `assets/templates/*.md`
149
+
150
+ Notes:
151
+
152
+ - Repo root inference: scripts walk up from CWD to find `.specify/` or `specs/`, then fall back to git root/current directory; by default they operate on the repo you are currently in.
153
+ - Templates: scripts prefer this skill’s templates (`assets/templates/*`); they do not depend on repo-local `.specify/templates/*`.
154
+ - Feature inference: scripts do not depend on Git branches; prefer `SPECIFY_FEATURE`, then infer from CWD, then fall back to the highest number under `specs/`.
155
+ - No VCS operations: scripts do not run `git checkout` / `git commit` or any history operation.
156
+ - Script reading convention: do not read script source just to “see what it does”; treat scripts as controlled assets and run them with `--json`. Read source only when you need to modify or debug behavior.
157
+ - Shell command conventions:
158
+ - Recommended: run scripts via absolute paths and quote them: `"<SKILL_DIR>/scripts/bash/check-prerequisites.sh" ...`
159
+ - If you need an env var in the same command: assign first, then use it: `SKILL_DIR="..."; "$SKILL_DIR/scripts/bash/check-prerequisites.sh" ...`
160
+ - Avoid: `SKILL_DIR="..." $SKILL_DIR/scripts/...` (shell expands `$SKILL_DIR` before assignment).
161
+
162
+ ## Script capabilities (no need to read source)
163
+
164
+ - `scripts/bash/create-new-feature.sh`: create `specs/<NNN-*>/spec.md` (copy template or create empty), output JSON with `BRANCH_NAME` and `SPEC_FILE`; no VCS operations.
165
+ - `scripts/bash/setup-plan.sh`: ensure `specs/<feature>/plan.md` exists (no overwrite unless `--force`), output JSON with `FEATURE_SPEC` and `IMPL_PLAN`.
166
+ - `scripts/bash/setup-notes.sh`: ensure `specs/<feature>/notes/` skeleton exists (no overwrite unless `--force`), output JSON with `NOTES_DIR` / `NOTES_README` / `SESSIONS_DIR`; supports `--dry-run`.
167
+ - `scripts/bash/check-prerequisites.sh`: check required files for the current feature and output JSON (optionally require `tasks.md`); read-only.
168
+ - `scripts/bash/extract-user-stories.sh`: extract `User Story N` list from `spec.md` (with Priority + file+line evidence); supports `--json`; read-only.
169
+ - `scripts/bash/extract-coded-points.sh`: extract coded points (FR/NFR/SC) from one or more `spec.md` files (with file+line evidence); supports `--json`; read-only.
170
+ - `scripts/bash/extract-tasks.sh`: extract task list and completion status from one or more `tasks.md` files (with file+line evidence); supports `--json`; read-only.
171
+ - `scripts/bash/extract-spec-ids.sh`: aggregate id registries (`us/codes/tasks`), supports `--kind/--kinds` + `--json`; read-only.
172
+ - `scripts/bash/show-todo-tasks.sh`: summarize remaining tasks across `specs/*` (or expand by `--feature` / multiple ids), supports `--json`; read-only.
173
+ - All scripts support `--feature 029` to target a spec; `setup-plan.sh` and `check-prerequisites.sh` also accept positional `029` / `029-xxx`.
@@ -0,0 +1,49 @@
1
+ # [CHECKLIST TYPE] Checklist: [FEATURE NAME]
2
+
3
+ **Purpose**: [Brief description of what this checklist covers]
4
+ **Created**: [DATE]
5
+ **Feature**: [Link to spec.md or relevant documentation]
6
+
7
+ **Note**: This checklist is generated by the `$speckit checklist` stage based on feature context and requirements.
8
+
9
+ <!--
10
+ ============================================================================
11
+ IMPORTANT: The checklist items below are SAMPLE ITEMS for illustration only.
12
+
13
+ The $speckit checklist stage MUST replace these with actual items based on:
14
+ - User's specific checklist request
15
+ - Feature requirements from spec.md
16
+ - Technical context from plan.md
17
+ - Implementation details from tasks.md
18
+
19
+ DO NOT keep these sample items in the generated checklist file.
20
+ ============================================================================
21
+ -->
22
+
23
+ ## [Category 1]
24
+
25
+ - [ ] CHK001 First checklist item with clear action
26
+ - [ ] CHK002 Second checklist item
27
+ - [ ] CHK003 Third checklist item
28
+
29
+ ## [Category 2]
30
+
31
+ - [ ] CHK004 Another category item
32
+ - [ ] CHK005 Item with specific criteria
33
+ - [ ] CHK006 Final item in this category
34
+
35
+ ## Performance & Observability _(if applicable)_
36
+
37
+ - [ ] CHK0XX Performance budget + baseline measurement recorded (env/tool documented)
38
+ - [ ] CHK0XX No critical regression (or justified in Complexity Tracking)
39
+ - [ ] CHK0XX Logs/metrics/traces updated for key flows; PII/overhead reviewed
40
+ - [ ] CHK0XX Diagnostics include stable identifiers to correlate requests/sessions/entities
41
+ - [ ] CHK0XX Data consistency boundaries documented (transaction/atomicity/ordering as applicable)
42
+ - [ ] CHK0XX Breaking change declared and migration note linked (per project policy)
43
+
44
+ ## Notes
45
+
46
+ - Check items off as completed: `[x]`
47
+ - Add comments or findings inline
48
+ - Link to relevant resources or documentation
49
+ - Items are numbered sequentially for easy reference
@@ -0,0 +1,11 @@
1
+ # Entry Points
2
+
3
+ ## Specs (SSoT)
4
+
5
+ - `../spec.md`
6
+ - `../plan.md`
7
+ - `../tasks.md` (if present)
8
+
9
+ ## Code Entry Points (Files / Symbols)
10
+
11
+ - `<path>:<line>` — <why it matters / how to enter>
@@ -0,0 +1,7 @@
1
+ # Questions
2
+
3
+ ## Q1
4
+
5
+ - Question:
6
+ - Impact:
7
+ - Decision needed:
@@ -0,0 +1,36 @@
1
+ # Notes (Working Memory)
2
+
3
+ ## Scope
4
+
5
+ - <What this notes folder covers / does not cover>
6
+
7
+ ## Entry Points
8
+
9
+ - `entrypoints.md`
10
+
11
+ ## Current Status
12
+
13
+ - Focus: <one line>
14
+ - Phase:
15
+ - [ ] Rehydrate / Align
16
+ - [ ] Explore / Locate
17
+ - [ ] Decide / Sync SSoT
18
+ - [ ] Implement / Verify
19
+
20
+ ## Current Hypothesis
21
+
22
+ - <1–5 items>
23
+
24
+ ## Errors Encountered
25
+
26
+ - <time> — <symptom> → <fix/mitigation> (link the session if any)
27
+
28
+ ## Next Actions
29
+
30
+ - <concrete next changes + how to validate>
31
+
32
+ ## Last Flush
33
+
34
+ - At: <YYYY-MM-DD HH:mm>
35
+ - Intent: <this run's $ARGUMENTS>
36
+ - Session: `sessions/<YYYY-MM-DD>.md` (if any)
@@ -0,0 +1,21 @@
1
+ # Session: <YYYY-MM-DD>
2
+
3
+ ## Intent
4
+
5
+ - <this run's $ARGUMENTS>
6
+
7
+ ## What Changed
8
+
9
+ - <files/symbols/changes (index only)>
10
+
11
+ ## Findings
12
+
13
+ - <conclusions / evidence / counterexamples>
14
+
15
+ ## Errors (Failure Traces)
16
+
17
+ - <time> — <error/symptom> → <fix/mitigation> → <synced back to SSoT?>
18
+
19
+ ## Next Actions
20
+
21
+ - <concrete next changes + how to validate>
@@ -0,0 +1,126 @@
1
+ # Implementation Plan: [FEATURE]
2
+
3
+ **Branch**: `[###-feature-name]` | **Date**: [DATE] | **Spec**: [link]
4
+ **Input**: Feature specification from `/specs/[###-feature-name]/spec.md`
5
+
6
+ **Note**: This template is copied into `specs/[###-feature-name]/plan.md` by the
7
+ Speckit plan workflow (`setup-plan.sh`).
8
+
9
+ ## Summary
10
+
11
+ [Extract from feature spec: primary requirement + technical approach from research]
12
+
13
+ ## Technical Context
14
+
15
+ <!--
16
+ ACTION REQUIRED: Replace the content in this section with the technical details
17
+ for the project. The structure here is presented in advisory capacity to guide
18
+ the iteration process.
19
+ -->
20
+
21
+ **Language/Version**: [e.g., Python 3.11, Swift 5.9, Rust 1.75 or NEEDS CLARIFICATION]
22
+ **Primary Dependencies**: [e.g., React, Next.js, FastAPI, Postgres, Redis or NEEDS CLARIFICATION]
23
+ **Storage**: [if applicable, e.g., files / N/A]
24
+ **Testing**: [e.g., Vitest, Jest, Pytest, Go test or NEEDS CLARIFICATION]
25
+ **Target Platform**: [e.g., Node.js 20+, browsers, iOS/Android]
26
+ **Project Type**: [single repo / monorepo / packages + apps]
27
+ **Performance Goals**: [budgets + measurement method (benchmark/profile) or NEEDS CLARIFICATION]
28
+ **Constraints**: [include diagnostics overhead budgets if applicable]
29
+ **Scale/Scope**: [domain-specific, e.g., 10k users, 1M LOC, 50 screens or NEEDS CLARIFICATION]
30
+
31
+ ## Constitution Check
32
+
33
+ _GATE: Must pass before implementation. Re-check after Phase 1 design._
34
+
35
+ - Answer the following BEFORE starting implementation, and re-check after Phase 1:
36
+ - What user value is delivered, and how is it validated (acceptance scenarios / SC-*)?
37
+ - What public/external surfaces change (API/CLI/UI/config), and what is the compatibility policy?
38
+ - What docs/specs must be updated first (docs-first where applicable) to avoid drift?
39
+ - What are the key risks (security, data loss, privacy, performance) and mitigations?
40
+ - If performance-sensitive: what budgets/baselines exist, and how are regressions prevented?
41
+ - What diagnostics/observability signals are required for triage (logs/metrics/traces)?
42
+ - What quality gates will be run before merge (typecheck / lint / test / build), and what counts as “pass”?
43
+
44
+ ## Perf Evidence Plan (IF APPLICABLE)
45
+
46
+ > If this feature touches performance-sensitive paths or external performance boundaries: this section must be filled. Otherwise mark it as `N/A`.
47
+
48
+ - Baseline semantics: before/after code change OR A/B strategy (choose one)
49
+ - envId: <os-arch.cpu.runtime-version>
50
+ - tool: <benchmark/profile tool name>
51
+ - collect (before): `specs/<id>/perf/before.<envId>.<tag>.<ext>`
52
+ - collect (after): `specs/<id>/perf/after.<envId>.<tag>.<ext>`
53
+ - diff: `specs/<id>/perf/diff.before__after.<ext>` (if applicable)
54
+ - Failure policy: if results are not comparable (env/tool changes, insufficient sample size, high variance) → re-run or narrow the scope; do not draw hard conclusions when not comparable.
55
+
56
+ ## Project Structure
57
+
58
+ ### Documentation (this feature)
59
+
60
+ ```text
61
+ specs/[###-feature]/
62
+ ├── plan.md # This file ($speckit plan output)
63
+ ├── research.md # Phase 0 output ($speckit plan)
64
+ ├── data-model.md # Phase 1 output ($speckit plan)
65
+ ├── quickstart.md # Phase 1 output ($speckit plan)
66
+ ├── contracts/ # Phase 1 output ($speckit plan)
67
+ ├── notes/ # Optional: handoff notes / entry points ($speckit notes)
68
+ └── tasks.md # Phase 2 output ($speckit tasks - NOT created by $speckit plan)
69
+ ```
70
+
71
+ ### Source Code (repository root)
72
+
73
+ <!--
74
+ ACTION REQUIRED: Replace the placeholder tree below with the concrete layout
75
+ for this feature. Delete unused options and expand the chosen structure with
76
+ real paths (e.g., apps/admin, packages/something). The delivered plan must
77
+ not include Option labels.
78
+ -->
79
+
80
+ ```text
81
+ # [REMOVE IF UNUSED] Option 1: Single project (DEFAULT)
82
+ src/
83
+ ├── models/
84
+ ├── services/
85
+ ├── cli/
86
+ └── lib/
87
+
88
+ tests/
89
+ ├── contract/
90
+ ├── integration/
91
+ └── unit/
92
+
93
+ # [REMOVE IF UNUSED] Option 2: Web application (when "frontend" + "backend" detected)
94
+ backend/
95
+ ├── src/
96
+ │ ├── models/
97
+ │ ├── services/
98
+ │ └── api/
99
+ └── tests/
100
+
101
+ frontend/
102
+ ├── src/
103
+ │ ├── components/
104
+ │ ├── pages/
105
+ │ └── services/
106
+ └── tests/
107
+
108
+ # [REMOVE IF UNUSED] Option 3: Mobile + API (when "iOS/Android" detected)
109
+ api/
110
+ └── [same as backend above]
111
+
112
+ ios/ or android/
113
+ └── [platform-specific structure: feature modules, UI flows, platform tests]
114
+ ```
115
+
116
+ **Structure Decision**: [Document the selected structure and reference the real
117
+ directories captured above]
118
+
119
+ ## Complexity Tracking
120
+
121
+ > **Fill ONLY if Constitution Check has violations that must be justified**
122
+
123
+ | Violation | Why Needed | Simpler Alternative Rejected Because |
124
+ | -------------------------- | ------------------ | ------------------------------------ |
125
+ | [e.g., 4th project] | [current need] | [why 3 projects insufficient] |
126
+ | [e.g., Repository pattern] | [specific problem] | [why direct DB access insufficient] |
@@ -0,0 +1,135 @@
1
+ # Feature Specification: [FEATURE NAME]
2
+
3
+ **Feature Branch**: `[###-feature-name]`
4
+ **Created**: [DATE]
5
+ **Status**: Draft
6
+ **Input**: User description: "$ARGUMENTS"
7
+
8
+ ## User Scenarios & Testing _(mandatory)_
9
+
10
+ <!--
11
+ IMPORTANT: User stories should be PRIORITIZED as user journeys ordered by importance.
12
+ Each user story/journey must be INDEPENDENTLY TESTABLE - meaning if you implement just ONE of them,
13
+ you should still have a viable MVP (Minimum Viable Product) that delivers value.
14
+
15
+ Assign priorities (P1, P2, P3, etc.) to each story, where P1 is the most critical.
16
+ Think of each story as a standalone slice of functionality that can be:
17
+ - Developed independently
18
+ - Tested independently
19
+ - Deployed independently
20
+ - Demonstrated to users independently
21
+ -->
22
+
23
+ ### User Story 1 - [Brief Title] (Priority: P1)
24
+
25
+ [Describe this user journey in plain language]
26
+
27
+ **Why this priority**: [Explain the value and why it has this priority level]
28
+
29
+ **Independent Test**: [Describe how this can be tested independently - e.g., "Can be fully tested by [specific action] and delivers [specific value]"]
30
+
31
+ **Acceptance Scenarios**:
32
+
33
+ 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
34
+ 2. **Given** [initial state], **When** [action], **Then** [expected outcome]
35
+
36
+ ---
37
+
38
+ ### User Story 2 - [Brief Title] (Priority: P2)
39
+
40
+ [Describe this user journey in plain language]
41
+
42
+ **Why this priority**: [Explain the value and why it has this priority level]
43
+
44
+ **Independent Test**: [Describe how this can be tested independently]
45
+
46
+ **Acceptance Scenarios**:
47
+
48
+ 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
49
+
50
+ ---
51
+
52
+ ### User Story 3 - [Brief Title] (Priority: P3)
53
+
54
+ [Describe this user journey in plain language]
55
+
56
+ **Why this priority**: [Explain the value and why it has this priority level]
57
+
58
+ **Independent Test**: [Describe how this can be tested independently]
59
+
60
+ **Acceptance Scenarios**:
61
+
62
+ 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
63
+
64
+ ---
65
+
66
+ [Add more user stories as needed, each with an assigned priority]
67
+
68
+ ### Edge Cases
69
+
70
+ <!--
71
+ ACTION REQUIRED: The content in this section represents placeholders.
72
+ Fill them out with the right edge cases.
73
+ -->
74
+
75
+ - What happens when [boundary condition]?
76
+ - How does system handle [error scenario]?
77
+
78
+ ## Requirements _(mandatory)_
79
+
80
+ <!--
81
+ ACTION REQUIRED: The content in this section represents placeholders.
82
+ Fill them out with the right functional requirements.
83
+ -->
84
+
85
+ ### Functional Requirements
86
+
87
+ - **FR-001**: System MUST [specific capability, e.g., "allow users to create accounts"]
88
+ - **FR-002**: System MUST [specific capability, e.g., "validate email addresses"]
89
+ - **FR-003**: Users MUST be able to [key interaction, e.g., "reset their password"]
90
+ - **FR-004**: System MUST [data requirement, e.g., "persist user preferences"]
91
+ - **FR-005**: System MUST [behavior, e.g., "log all security events"]
92
+
93
+ _Example of marking unclear requirements:_
94
+
95
+ - **FR-006**: System MUST authenticate users via [NEEDS CLARIFICATION: auth method not specified - email/password, SSO, OAuth?]
96
+ - **FR-007**: System MUST retain user data for [NEEDS CLARIFICATION: retention period not specified]
97
+
98
+ ### Non-Functional Requirements (Quality)
99
+
100
+ <!--
101
+ If this feature is performance/scale sensitive:
102
+ - Define budgets (latency/throughput/memory/alloc) and how they are measured
103
+ - Define observability: logs/metrics/traces + failure triage signals
104
+ -->
105
+
106
+ - **NFR-001**: If performance-sensitive, system MUST define budgets for critical paths
107
+ and record a measurable baseline before implementation.
108
+ - **NFR-002**: System MUST provide structured diagnostic signals (logs/metrics/traces)
109
+ for key flows, with a documented enable/disable cost model.
110
+ - **NFR-003**: Identifiers used in diagnostics SHOULD be stable and searchable.
111
+ - **NFR-004**: Error handling MUST be explicit for user-facing failures, and MUST include
112
+ a clear triage path (where to look, what to collect).
113
+ - **NFR-005**: If this feature introduces breaking changes, the project MUST document
114
+ the change and migration steps (where applicable).
115
+
116
+ ### Key Entities _(include if feature involves data)_
117
+
118
+ - **[Entity 1]**: [What it represents, key attributes without implementation]
119
+ - **[Entity 2]**: [What it represents, relationships to other entities]
120
+
121
+ ## Success Criteria _(mandatory)_
122
+
123
+ <!--
124
+ ACTION REQUIRED: Define measurable success criteria.
125
+ These must be technology-agnostic and measurable.
126
+ -->
127
+
128
+ ### Measurable Outcomes
129
+
130
+ - **SC-001**: [Measurable metric, e.g., "Users can complete account creation in under 2 minutes"]
131
+ - **SC-002**: [Measurable metric, e.g., "System handles 1000 concurrent users without degradation"]
132
+ - **SC-003**: [User satisfaction metric, e.g., "90% of users successfully complete primary task on first attempt"]
133
+ - **SC-004**: [Business metric, e.g., "Reduce support tickets related to [X] by 50%"]
134
+ - **SC-005**: [Performance metric, e.g., "No regression in p95 latency / allocations for [hot path]"]
135
+ - **SC-006**: [Diagnosability metric, e.g., "Devtools can explain 'why' for [event] with causal chain"]