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,115 @@
1
+ ---
2
+ description: Digest an external review question list (no review.md) and update plan.md (and tasks.md/spec.md if needed) to close the loop.
3
+ handoffs:
4
+ - label: Refresh Tasks
5
+ agent: speckit.tasks
6
+ prompt: Update tasks based on the updated plan.md.
7
+ send: true
8
+ ---
9
+
10
+ ## User Input
11
+
12
+ ```text
13
+ $ARGUMENTS
14
+ ```
15
+
16
+ You **MUST** consider the user input before proceeding. This stage expects a *question list* pasted inline (no `review.md`).
17
+
18
+ ## Parallel Development Safety (Non-Negotiable)
19
+
20
+ - Assume the working tree may contain unrelated, uncommitted changes from other parallel tasks.
21
+ - NEVER try to "leave only this task's files" by reverting or cleaning other changes.
22
+ - ABSOLUTELY PROHIBITED: any form of `git restore`, `git checkout -- <path>`, `git reset`, `git clean`, `git stash`.
23
+ - Avoid staging/committing/history rewriting unless explicitly requested by the user: `git add`, `git commit`, `git rebase`, `git merge`, `git cherry-pick`, `git push`.
24
+ - Read-only git commands are allowed (e.g., `git status`, `git diff`).
25
+
26
+ ## Outline
27
+
28
+ Goal: Take an external reviewer’s *questions* (asked from the “questioner” perspective) and merge the resulting decisions back into the feature artifacts so the spec-kit SSoT stays consistent.
29
+
30
+ - Primary target: `plan.md`
31
+ - Secondary targets (only when required by the questions/answers): `tasks.md`, `spec.md`, `data-model.md`, `contracts/*`
32
+
33
+ ## Execution Steps
34
+
35
+ ### 1) Resolve feature + file paths
36
+
37
+ 1. Run `SKILL_DIR/scripts/bash/setup-plan.sh --json` from repo root **once** and parse JSON:
38
+ - `FEATURE_SPEC` (spec.md path)
39
+ - `IMPL_PLAN` (plan.md path)
40
+ 2. Derive `FEATURE_DIR = dirname(FEATURE_SPEC)`.
41
+ 3. Determine candidate optional files (only load when needed):
42
+ - `TASKS_FILE = FEATURE_DIR/tasks.md`
43
+ - `DATA_MODEL = FEATURE_DIR/data-model.md`
44
+ - `RESEARCH = FEATURE_DIR/research.md`
45
+ - `CONTRACTS_DIR = FEATURE_DIR/contracts/`
46
+
47
+ If `IMPL_PLAN` does not exist, stop and instruct the user to run `$speckit plan <feature>` first.
48
+
49
+ ### 2) Validate question input (no review.md in this flow)
50
+
51
+ - If `$ARGUMENTS` is empty:
52
+ - Stop and ask the user to paste the question list (preferred format: one question per line; IDs like `Q001` are optional).
53
+ - Otherwise:
54
+ - Normalize the questions into an internal list:
55
+ - If IDs are present, keep them (`Q001`, `Q002`, ...).
56
+ - If not, assign stable IDs in appearance order.
57
+
58
+ ### 3) Load context
59
+
60
+ Read:
61
+ - `FEATURE_SPEC`
62
+ - `IMPL_PLAN`
63
+ - `.specify/memory/constitution.md`
64
+
65
+ If present and relevant to specific questions, also read:
66
+ - `TASKS_FILE`
67
+ - `DATA_MODEL`
68
+ - `RESEARCH`
69
+ - `CONTRACTS_DIR/*` (only the files actually referenced by questions or by planned changes)
70
+
71
+ ### 4) Answer questions → merge decisions into artifacts (do not append-only)
72
+
73
+ For each question:
74
+
75
+ 1. Produce a direct answer (concise, decision-oriented).
76
+ 2. Decide which artifact(s) the answer impacts:
77
+ - Spec ambiguity / missing acceptance criteria → update `spec.md`
78
+ - Architecture / constraints / quality gates / performance & diagnostics plan → update `plan.md`
79
+ - Implied work items / sequencing / validation steps → update `tasks.md` (if it exists)
80
+ - Data / contracts correctness → update `data-model.md` / `contracts/*`
81
+ 3. Apply edits by **merging into the correct section(s)** (replace/adjust contradictory text; avoid duplicating near-identical bullets).
82
+
83
+ If a question cannot be answered without product/business choice, do **NOT** guess:
84
+ - Ask the user for a decision (offer 2–5 options).
85
+ - After the user decides, continue and encode the answer back into the artifacts.
86
+
87
+ ### 5) Record a compact “Questions Digest” in plan.md
88
+
89
+ In `plan.md`, add a small note near the top (or under `## Summary`) that:
90
+ - States the source as “external questions pasted into `$speckit plan-from-questions`”.
91
+ - Lists the key accepted changes, referencing question IDs (e.g., `Q003`, `Q007`).
92
+ - If you changed `spec.md` or `tasks.md`, include a 1-line pointer to those updates.
93
+
94
+ Keep it compact (a digest, not a transcript).
95
+
96
+ ### 6) Tasks handling (keep tasks.md as the task list)
97
+
98
+ - If `tasks.md` exists:
99
+ - Add/adjust tasks to reflect accepted changes.
100
+ - Ensure tasks have concrete file paths and validation steps.
101
+ - If `tasks.md` does not exist:
102
+ - Do **NOT** invent a full tasks list here.
103
+ - Recommend running `$speckit tasks <feature>` after `plan.md` is updated.
104
+
105
+ ### 7) Final validation
106
+
107
+ - No contradictory statements left in `spec.md`/`plan.md`.
108
+ - “Questions Digest” exists and references the right IDs.
109
+ - Any new perf/diagnostics gates mentioned are actionable (what to measure, where, how to validate).
110
+
111
+ ## Report
112
+
113
+ In your final response, include:
114
+ - Which files were updated.
115
+ - The recommended next command(s): typically `$speckit tasks <feature-id>` (if tasks are missing/outdated), or proceed to `$speckit implement <feature-id>`.
@@ -0,0 +1,89 @@
1
+ ---
2
+ description: Digest an external review report (review.md) and update plan.md (and tasks.md/spec.md if needed) to close the loop.
3
+ handoffs:
4
+ - label: Refresh Tasks
5
+ agent: speckit.tasks
6
+ prompt: Update tasks based on the updated plan.md and review.md.
7
+ send: true
8
+ ---
9
+
10
+ ## User Input
11
+
12
+ ```text
13
+ $ARGUMENTS
14
+ ```
15
+
16
+ You **MUST** consider the user input before proceeding (if not empty).
17
+
18
+ ## Parallel Development Safety (Non-Negotiable)
19
+
20
+ - Assume the working tree may contain unrelated, uncommitted changes from other parallel tasks.
21
+ - NEVER try to "leave only this task's files" by reverting or cleaning other changes.
22
+ - ABSOLUTELY PROHIBITED: any form of `git restore`, `git checkout -- <path>`, `git reset`, `git clean`, `git stash`.
23
+ - Avoid staging/committing/history rewriting unless explicitly requested by the user: `git add`, `git commit`, `git rebase`, `git merge`, `git cherry-pick`, `git push`.
24
+ - Read-only git commands are allowed (e.g., `git status`, `git diff`).
25
+ - Do **NOT** delete `review.md`. Preserve it as evidence (you may add a small status note if needed).
26
+
27
+ ## Outline
28
+
29
+ Goal: Take a review report (typically created by another LLM) and merge the actionable decisions back into the feature artifacts so the spec-kit SSoT stays consistent:
30
+
31
+ - Primary target: `plan.md`
32
+ - Secondary targets (only when required by the review): `tasks.md`, `spec.md`, `data-model.md`, `contracts/*`
33
+
34
+ Execution steps:
35
+
36
+ 1. **Resolve feature + file paths**
37
+ - Run `SKILL_DIR/scripts/bash/setup-plan.sh --json` from repo root **once** and parse JSON:
38
+ - `FEATURE_SPEC` (spec.md path)
39
+ - `IMPL_PLAN` (plan.md path)
40
+ - Derive `FEATURE_DIR = dirname(FEATURE_SPEC)`.
41
+ - Determine candidate inputs:
42
+ - `REVIEW_FILE = FEATURE_DIR/review.md` (default)
43
+ - `TASKS_FILE = FEATURE_DIR/tasks.md` (optional)
44
+ - `DATA_MODEL = FEATURE_DIR/data-model.md` (optional)
45
+ - If `REVIEW_FILE` does not exist:
46
+ - Ask the user to provide the review content (paste) or to create `review.md` first, then stop.
47
+
48
+ 2. **Load context**
49
+ - Read:
50
+ - `FEATURE_SPEC`
51
+ - `IMPL_PLAN`
52
+ - `REVIEW_FILE`
53
+ - `.specify/memory/constitution.md`
54
+ - If present and relevant to review items, also load:
55
+ - `TASKS_FILE`
56
+ - `DATA_MODEL`
57
+ - `FEATURE_DIR/research.md`
58
+ - `FEATURE_DIR/contracts/*` (only the files mentioned by review)
59
+
60
+ 3. **Digest the review (item-by-item)**
61
+ - Highest priority: **Risks & Recommendations**
62
+ - For each risk: ensure `plan.md` includes a concrete mitigation plan (what to do, where, how to validate).
63
+ - If mitigation implies work: add/update concrete tasks in `tasks.md` (or flag that tasks are missing).
64
+ - Then: **Technical Analysis** and **Constitution Check / Quality Gates**
65
+ - If the review points out a violation or missing gate: either (a) change the plan to comply, or (b) explicitly justify the violation in `plan.md` (Complexity Tracking).
66
+ - If the review mentions performance/diagnostics, ensure the plan includes a reproducible baseline/measurement and the intended diagnostic surfaces/cost.
67
+ - Clarifications:
68
+ - If review identifies ambiguous requirements or missing edge cases, update `spec.md` (and keep `FR-/NFR-/SC-` points consistent).
69
+ - Data/contract correctness:
70
+ - If the review points out missing/incorrect domain modeling, update `data-model.md`.
71
+ - If the review changes external contracts, update `contracts/*` and ensure the plan/tasks reflect the change.
72
+
73
+ 4. **Apply edits (merge into the right sections, not append-only)**
74
+ - `plan.md`:
75
+ - Edit the relevant sections (Summary / Technical Context / Constitution Check / Project Structure / Complexity Tracking).
76
+ - Add a small “Review Digest” note near the top (or under Summary) containing:
77
+ - The review source file (`review.md`)
78
+ - A concise list of the key accepted changes (prefer referencing review item IDs like `R001`, `R101`, ...)
79
+ - `tasks.md` (if it exists):
80
+ - Add new tasks or adjust existing tasks to reflect accepted review changes.
81
+ - Ensure tasks have concrete file paths and validation steps.
82
+ - If `tasks.md` does not exist:
83
+ - Do **NOT** invent a full tasks list here.
84
+ - Mention that `$speckit tasks` should be run next after the plan is updated.
85
+
86
+ 5. **Close the loop (without deleting evidence)**
87
+ - Keep `review.md` in place.
88
+ - If `review.md` contains a `**Digest**: PENDING` line, update it to something like `**Digest**: DONE (YYYY-MM-DD)`; otherwise optionally add a short status line at the top of `review.md` (e.g., “Digested into plan.md/tasks.md on YYYY-MM-DD”).
89
+ - Output a brief summary: which files changed and what major review points were accepted/rejected (with 1-line rationale for rejections).
@@ -0,0 +1,97 @@
1
+ ---
2
+ description: Execute the implementation planning workflow using the plan template to generate design artifacts.
3
+ handoffs:
4
+ - label: Create Tasks
5
+ agent: speckit.tasks
6
+ prompt: Break the plan into tasks
7
+ send: true
8
+ - label: Create Checklist
9
+ agent: speckit.checklist
10
+ prompt: Create a checklist for the following domain...
11
+ ---
12
+
13
+ ## User Input
14
+
15
+ ```text
16
+ $ARGUMENTS
17
+ ```
18
+
19
+ You **MUST** consider the user input before proceeding (if not empty).
20
+
21
+ ## Parallel Development Safety (Non-Negotiable)
22
+
23
+ - Assume the working tree may contain unrelated, uncommitted changes from other parallel tasks.
24
+ - NEVER try to "leave only this task's files" by reverting or cleaning other changes.
25
+ - ABSOLUTELY PROHIBITED: any form of `git restore`, `git checkout -- <path>`, `git reset`, `git clean`, `git stash`.
26
+ - Avoid staging/committing/history rewriting unless explicitly requested by the user: `git add`, `git commit`, `git rebase`, `git merge`, `git cherry-pick`, `git push`.
27
+ - Read-only git commands are allowed (e.g., `git status`, `git diff`).
28
+
29
+ ## Outline
30
+
31
+ ## Spec Group (dispatcher spec) note
32
+
33
+ If the target feature is a **Spec Group** (its directory contains `spec-registry.json`, fallback: `spec-registry.md`, e.g. `specs/046-core-ng-roadmap/`), then this stage should produce a plan that is **dispatch / gates / evidence write-back** oriented:
34
+
35
+ - The plan is mostly documentation deliverables (roadmap/registry/checklists/quickstart). Do not generate business-side `contracts/` or `data-model.md` (you can mark them as N/A).
36
+ - The plan MUST clarify: member spec dependency order, milestone “done” criteria, and where evidence is written + how it is written back (avoid parallel truth sources).
37
+ - To generate/refresh the group execution index checklist, use `$speckit group <group>` (derive members from registry).
38
+
39
+ 1. **Setup**: Run `SKILL_DIR/scripts/bash/setup-plan.sh --json` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. If you need to target a specific spec by number/id, add `--feature 025` (or `--feature 025-my-feature`). For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
40
+
41
+ 2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied).
42
+
43
+ 3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
44
+ - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
45
+ - Fill Constitution Check section from constitution
46
+ - Evaluate gates (ERROR if violations unjustified)
47
+ - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
48
+ - Phase 1: Generate data-model.md, contracts/, quickstart.md
49
+ - Re-evaluate Constitution Check post-design
50
+
51
+ 4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
52
+
53
+ ## Phases
54
+
55
+ ### Phase 0: Outline & Research
56
+
57
+ 1. **Extract unknowns from Technical Context** above:
58
+ - For each NEEDS CLARIFICATION → research task
59
+ - For each dependency → best practices task
60
+ - For each integration → patterns task
61
+
62
+ 2. **Generate and dispatch research agents**:
63
+
64
+ ```text
65
+ For each unknown in Technical Context:
66
+ Task: "Research {unknown} for {feature context}"
67
+ For each technology choice:
68
+ Task: "Find best practices for {tech} in {domain}"
69
+ ```
70
+
71
+ 3. **Consolidate findings** in `research.md` using format:
72
+ - Decision: [what was chosen]
73
+ - Rationale: [why chosen]
74
+ - Alternatives considered: [what else evaluated]
75
+
76
+ **Output**: research.md with all NEEDS CLARIFICATION resolved
77
+
78
+ ### Phase 1: Design & Contracts
79
+
80
+ **Prerequisites:** `research.md` complete
81
+
82
+ 1. **Extract entities from feature spec** → `data-model.md`:
83
+ - Entity name, fields, relationships
84
+ - Validation rules from requirements
85
+ - State transitions if applicable
86
+
87
+ 2. **Generate API contracts** from functional requirements:
88
+ - For each user action → endpoint
89
+ - Use standard REST/GraphQL patterns
90
+ - Output OpenAPI/GraphQL schema to `/contracts/`
91
+
92
+ **Output**: data-model.md, /contracts/\*, quickstart.md
93
+
94
+ ## Key rules
95
+
96
+ - Use absolute paths
97
+ - ERROR on gate failures or unresolved clarifications
@@ -0,0 +1,156 @@
1
+ ---
2
+ description: Review a speckit feature plan (spec.md + plan.md) and produce a structured review.md for later digestion via $speckit plan-from-review.
3
+ ---
4
+
5
+ ## User Input
6
+
7
+ ```text
8
+ $ARGUMENTS
9
+ ```
10
+
11
+ You **MUST** consider the user input before proceeding (if not empty).
12
+
13
+ ## Parallel Development Safety (Non-Negotiable)
14
+
15
+ - Assume the working tree may contain unrelated, uncommitted changes from other parallel tasks.
16
+ - NEVER try to "leave only this task's files" by reverting or cleaning other changes.
17
+ - ABSOLUTELY PROHIBITED: any form of `git restore`, `git checkout -- <path>`, `git reset`, `git clean`, `git stash`.
18
+ - Avoid staging/committing/history rewriting unless explicitly requested by the user: `git add`, `git commit`, `git rebase`, `git merge`, `git cherry-pick`, `git push`.
19
+ - Read-only git commands are allowed (e.g., `git status`, `git diff`).
20
+ - This is a **review-plan** stage: do not implement code changes. Only produce `review.md` under the feature directory.
21
+
22
+ ## Goal
23
+
24
+ Generate a `review.md` report inside `specs/<feature>/review.md` that:
25
+
26
+ - Is written in **English** by default (unless the user explicitly requests otherwise).
27
+ - Contains actionable, structured review items with IDs (`R001`, `R101`, ...).
28
+ - Clearly maps each recommendation to the correct artifact target:
29
+ - `spec.md` / `plan.md` / `tasks.md` / `data-model.md` / `contracts/*`
30
+ - Includes explicit acceptance criteria / validation method for each item.
31
+ - Can be later digested and closed-looped by `$speckit plan-from-review <feature>`.
32
+
33
+ ## Execution Steps
34
+
35
+ ### 1) Resolve feature directory (supports direct numeric IDs)
36
+
37
+ 1. Run `SKILL_DIR/scripts/bash/check-prerequisites.sh --json --paths-only` from repo root **once**.
38
+ - If you need to target a specific spec by number/id, add `--feature 042` (or `--feature 042-my-feature`).
39
+ - Parse minimal JSON payload fields:
40
+ - `FEATURE_DIR`
41
+ - `FEATURE_SPEC`
42
+ - (Optionally capture `IMPL_PLAN`, `TASKS` if present.)
43
+ - If JSON parsing fails, stop and instruct the user to re-run `$speckit specify` / `$speckit plan` or verify the feature selection.
44
+
45
+ 2. Derive paths:
46
+ - `SPEC_FILE = FEATURE_SPEC` (spec.md)
47
+ - `PLAN_FILE = FEATURE_DIR/plan.md` (must exist)
48
+ - `TASKS_FILE = FEATURE_DIR/tasks.md` (optional)
49
+ - `REVIEW_FILE = FEATURE_DIR/review.md` (output)
50
+
51
+ If `PLAN_FILE` does not exist, stop and instruct the user to run `$speckit plan <feature>` first.
52
+
53
+ ### 2) Load context (do not guess missing artifacts)
54
+
55
+ Read:
56
+ - `SPEC_FILE`
57
+ - `PLAN_FILE`
58
+ - `.specify/memory/constitution.md`
59
+
60
+ If present and relevant, also read:
61
+ - `TASKS_FILE`
62
+ - `FEATURE_DIR/research.md`
63
+ - `FEATURE_DIR/data-model.md`
64
+ - `FEATURE_DIR/contracts/*` (only if the plan/spec declares external contracts or you need to audit protocol/API correctness)
65
+
66
+ If you do not have codebase access, state that explicitly in the report under “Assumptions”, and avoid claiming verification of referenced files/symbols.
67
+
68
+ ### 3) Perform the review (aligned to speckit artifact boundaries)
69
+
70
+ Cover these dimensions (mark N/A when not relevant):
71
+
72
+ 1. Spec ↔ Plan alignment
73
+ - Is every FR/NFR/SC and success criteria in `spec.md` addressed in `plan.md`?
74
+ - Is there scope creep in `plan.md` that is not declared in `spec.md`?
75
+
76
+ 2. Constitution / quality gates
77
+ - Are the Constitution Check items complete, executable, and compliant?
78
+ - If touching runtime core paths / diagnostic protocols / public APIs:
79
+ - Is there a reproducible performance baseline & measurement plan?
80
+ - Are diagnostic events/surfaces and overhead budgets specified?
81
+
82
+ 3. Tasks consistency (tasks.md is the only task list artifact)
83
+ - If `tasks.md` exists: are tasks executable (concrete file paths, dependencies/parallelism, validation)?
84
+ - If `tasks.md` does not exist: do NOT ask to add “Phase 2 tasks” into `plan.md`;
85
+ instead, list task suggestions in the review and require `$speckit tasks` next.
86
+
87
+ 4. Risks & mitigations
88
+ - Performance regression risks, diagnosability gaps/cost, breaking changes & missing migration notes,
89
+ IR/anchor drift, non-deterministic identity (random/time defaults), IO inside transaction window,
90
+ writable escape hatches (e.g., SubscriptionRef), etc.
91
+ - Every risk must have a concrete mitigation and a validation plan.
92
+
93
+ ### 4) Write `review.md` (MUST follow this template)
94
+
95
+ Create or overwrite `REVIEW_FILE` with:
96
+
97
+ ```markdown
98
+ # Review Report: [FEATURE_ID - Feature Name]
99
+
100
+ **Status**: [REQUEST_CHANGES / APPROVED_WITH_SUGGESTIONS / APPROVED]
101
+ **Digest**: PENDING
102
+ **Reviewer**: [name]
103
+ **Date**: YYYY-MM-DD
104
+
105
+ ## 0. Assumptions
106
+
107
+ - [If any, e.g. “No codebase access; referenced paths not verified.”]
108
+
109
+ ## 1. Executive Summary
110
+
111
+ - One-line verdict: [...]
112
+ - Top 3 issues (if any): [...]
113
+
114
+ ## 2. Blockers
115
+
116
+ > Only list items that block implementation / task breakdown.
117
+
118
+ - R001 [BLOCKER] [Target: plan.md] [Location: plan.md#…] Issue: … Recommendation: … Acceptance: …
119
+ - R002 [BLOCKER] [Target: spec.md] [Location: spec.md#…] Issue: … Recommendation: … Acceptance: …
120
+
121
+ ## 3. Risks & Recommendations
122
+
123
+ - R101 [MAJOR] [Risk] … Mitigation: … Validation: …
124
+ - R102 [MINOR] [Suggestion] … Validation: …
125
+
126
+ ## 4. Technical Analysis
127
+
128
+ - Architecture soundness: …
129
+ - Alignment/drift vs repo conventions: …
130
+ - Feasibility and complexity: …
131
+
132
+ ## 5. Constitution Check
133
+
134
+ - Performance & diagnosability: PASS/CONCERN/N/A — Evidence: … Next: …
135
+ - IR/anchor drift risk: PASS/CONCERN/N/A — …
136
+ - Stable identifiers (instanceId/txnSeq/opSeq): PASS/CONCERN/N/A — …
137
+ - Transaction window (no IO): PASS/CONCERN/N/A — …
138
+ - Breaking changes & migration notes: PASS/CONCERN/N/A — …
139
+ - (If touching packages/*) public submodules / internal layering: PASS/CONCERN/N/A — …
140
+
141
+ ## 6. Coverage & Drift
142
+
143
+ - Uncovered FR/NFR/SC gaps (only list gaps): …
144
+ - plan ↔ tasks drift points (if tasks.md exists): …
145
+
146
+ ## 7. Next Actions
147
+
148
+ - Save this file as `specs/<feature>/review.md`.
149
+ - Go back to the speckit session and run: `$speckit plan-from-review <feature-id>` (and run `$speckit tasks` if you need to refresh the task list).
150
+ ```
151
+
152
+ ### 5) Report
153
+
154
+ In your final response, include:
155
+ - The `review.md` path you produced.
156
+ - The recommended next command(s): typically `$speckit plan-from-review <feature-id>`.