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,90 @@
1
+ ---
2
+ description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
3
+ handoffs:
4
+ - label: Build Specification
5
+ agent: speckit.specify
6
+ prompt: Implement the feature specification based on the updated constitution. I want to build...
7
+ ---
8
+
9
+ ## User Input
10
+
11
+ ```text
12
+ $ARGUMENTS
13
+ ```
14
+
15
+ You **MUST** consider the user input before proceeding (if not empty).
16
+
17
+ ## Parallel Development Safety (Non-Negotiable)
18
+
19
+ - Assume the working tree may contain unrelated, uncommitted changes from other parallel tasks.
20
+ - NEVER try to "leave only this task's files" by reverting or cleaning other changes.
21
+ - ABSOLUTELY PROHIBITED: any form of `git restore`, `git checkout -- <path>`, `git reset`, `git clean`, `git stash`.
22
+ - Avoid staging/committing/history rewriting unless explicitly requested by the user: `git add`, `git commit`, `git rebase`, `git merge`, `git cherry-pick`, `git push`.
23
+ - Read-only git commands are allowed (e.g., `git status`, `git diff`).
24
+
25
+ ## Outline
26
+
27
+ You are updating the project constitution at `.specify/memory/constitution.md`. This file is a TEMPLATE containing placeholder tokens in square brackets (e.g. `[PROJECT_NAME]`, `[PRINCIPLE_1_NAME]`). Your job is to (a) collect/derive concrete values, (b) fill the template precisely, and (c) propagate any amendments across dependent artifacts.
28
+
29
+ Follow this execution flow:
30
+
31
+ 1. Load the existing constitution template at `.specify/memory/constitution.md`.
32
+ - Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.
33
+ **IMPORTANT**: The user might require less or more principles than the ones used in the template. If a number is specified, respect that - follow the general template. You will update the doc accordingly.
34
+
35
+ 2. Collect/derive values for placeholders:
36
+ - If user input (conversation) supplies a value, use it.
37
+ - Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).
38
+ - For governance dates: `RATIFICATION_DATE` is the original adoption date (if unknown ask or mark TODO), `LAST_AMENDED_DATE` is today if changes are made, otherwise keep previous.
39
+ - `CONSTITUTION_VERSION` must increment according to semantic versioning rules:
40
+ - MAJOR: Backward incompatible governance/principle removals or redefinitions.
41
+ - MINOR: New principle/section added or materially expanded guidance.
42
+ - PATCH: Clarifications, wording, typo fixes, non-semantic refinements.
43
+ - If version bump type ambiguous, propose reasoning before finalizing.
44
+
45
+ 3. Draft the updated constitution content:
46
+ - Replace every placeholder with concrete text (no bracketed tokens left except intentionally retained template slots that the project has chosen not to define yet—explicitly justify any left).
47
+ - Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.
48
+ - Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.
49
+ - Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.
50
+
51
+ 4. Consistency propagation checklist (convert prior checklist into active validations):
52
+ - Read `SKILL_DIR/assets/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
53
+ - Read `SKILL_DIR/assets/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
54
+ - Read `SKILL_DIR/assets/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
55
+ - Read each stage reference file in `SKILL_DIR/references/*.md` (including this one) to verify no outdated references (agent-specific names like CLAUDE only) remain when generic guidance is required.
56
+ - Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
57
+
58
+ 5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
59
+ - Version change: old → new
60
+ - List of modified principles (old title → new title if renamed)
61
+ - Added sections
62
+ - Removed sections
63
+ - Templates requiring updates (✅ updated / ⚠ pending) with file paths
64
+ - Follow-up TODOs if any placeholders intentionally deferred.
65
+
66
+ 6. Validation before final output:
67
+ - No remaining unexplained bracket tokens.
68
+ - Version line matches report.
69
+ - Dates ISO format YYYY-MM-DD.
70
+ - Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
71
+
72
+ 7. Write the completed constitution back to `.specify/memory/constitution.md` (overwrite).
73
+
74
+ 8. Output a final summary to the user with:
75
+ - New version and bump rationale.
76
+ - Any files flagged for manual follow-up.
77
+ - Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z (principle additions + governance update)`).
78
+
79
+ Formatting & Style Requirements:
80
+
81
+ - Use Markdown headings exactly as in the template (do not demote/promote levels).
82
+ - Wrap long rationale lines to keep readability (<100 chars ideally) but do not hard enforce with awkward breaks.
83
+ - Keep a single blank line between sections.
84
+ - Avoid trailing whitespace.
85
+
86
+ If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.
87
+
88
+ If critical info missing (e.g., ratification date truly unknown), insert `TODO(<FIELD_NAME>): explanation` and include in the Sync Impact Report under deferred items.
89
+
90
+ Do not create a new template; always operate on the existing `.specify/memory/constitution.md` file.
@@ -0,0 +1,89 @@
1
+ ---
2
+ description: Create/update a Spec Group execution checklist (a meta spec that dispatches multiple feature specs).
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
+ ## Goal
14
+
15
+ Treat a “Spec Group” as a **meta spec** that coordinates multiple feature specs and provides a single entrypoint for humans/agents, without duplicating implementation details.
16
+
17
+ This stage is intentionally **index-only**:
18
+
19
+ - ✅ Create/refresh a group-level checklist under `specs/<group>/checklists/`
20
+ - ✅ Reference member specs via links to their `tasks.md` / `quickstart.md`
21
+ - ❌ Do NOT copy/paste member tasks into the group spec (avoid parallel truth sources)
22
+
23
+ > Note: This is different from `$speckit checklist` (requirements-quality unit tests). Here we generate an **execution checklist** for a multi-spec deliverable.
24
+
25
+ ## Interface (recommended)
26
+
27
+ `$ARGUMENTS` format:
28
+
29
+ - First token: **group feature id** (e.g., `046` or `046-core-ng-roadmap`)
30
+ - Remaining tokens (optional): **member feature ids** (e.g., `045 039`)
31
+ - Optional key/value args:
32
+ - `name=<slug>` (or `--name <slug>`) → checklist file name (default: `group.<members>.md`)
33
+ - `title=<text>` (or `--title <text>`) → checklist title
34
+ - `--from registry` → when member ids are omitted, derive members from `specs/<group>/spec-registry.json` (fallback: `spec-registry.md`) (default)
35
+ - `--force` → overwrite the existing checklist file
36
+ - `--dry-run` → only resolve paths / show output path, do not write files
37
+
38
+ Examples:
39
+
40
+ - `$speckit group 046 045 039 name=m0-m1 title="M0→M1"`
41
+ - `$speckit group 046 --name group.registry` (group-only: derive members from registry)
42
+ - `$speckit group 046-core-ng-roadmap 045-dual-kernel-contract 039-trait-converge-int-exec-evidence --name m0-m1`
43
+
44
+ ## Parallel Development Safety (Non-Negotiable)
45
+
46
+ - Assume the working tree may contain unrelated, uncommitted changes from other concurrent tasks.
47
+ - ABSOLUTELY PROHIBITED: any form of `git restore`, `git checkout -- <path>`, `git reset`, `git clean`, `git stash`.
48
+ - Avoid staging/committing/history rewriting unless explicitly requested by the user: `git add`, `git commit`, `git rebase`, `git merge`, `git cherry-pick`, `git push`.
49
+ - Read-only git commands are allowed (e.g., `git status`, `git diff`).
50
+
51
+ ## Execution Steps
52
+
53
+ 1) **Generate group checklist (write)**
54
+ From repo root, run:
55
+
56
+ `SKILL_DIR/scripts/bash/spec-group-checklist.sh <group> [<member...>] [--from registry] [--name <name>] [--title <title>] [--force]`
57
+
58
+ 2) **Optional: show progress summary (read-only)**
59
+ Use the built-in multi-feature task extractor:
60
+
61
+ `SKILL_DIR/scripts/bash/extract-tasks.sh --json --feature <member1> --feature <member2> ...`
62
+
63
+ 2.5) **Optional: show dependency graph (read-only)**
64
+ Render dependency graph from `spec-registry.json`:
65
+
66
+ `SKILL_DIR/scripts/bash/spec-registry-graph.sh <group>`
67
+
68
+ Or merge all groups:
69
+
70
+ `SKILL_DIR/scripts/bash/spec-registry-graph.sh --all`
71
+
72
+ 3) **Optional: group acceptance (read-only)**
73
+ You can already validate multiple specs together using:
74
+
75
+ `$speckit acceptance <member1> <member2> ...`
76
+
77
+ ## Output
78
+
79
+ - Print the generated checklist file path.
80
+ - If the file already exists and `--force` is not provided, stop and ask whether to overwrite or create a new name.
81
+
82
+ ## Relationship to Other Stages (How to Compose)
83
+
84
+ > Conclusion: **`group` does not replace `plan/tasks/implement`**. It provides an “I only remember the group id” entrypoint and dispatch view; implementation details stay inside each member spec to avoid parallel truth sources.
85
+
86
+ - `$speckit plan <group>` / `$speckit tasks <group>`: still operate on the **group spec itself** (roadmap/gates/scheduling/evidence write-back). Do not copy member implementation tasks here.
87
+ - `$speckit group <group>`: generates/refreshes the **index checklist** under `specs/<group>/checklists/*` (member jumps + gate summary). This is the main navigation when you “only remember 046”.
88
+ - `$speckit implement-task <member> ...`: real code changes usually happen in member specs; jump from the group checklist to the member’s `tasks.md` and execute there.
89
+ - `$speckit acceptance <member...>`: already supports multi-spec; if you only want to input the group id, derive members from `spec-registry.json` (script falls back to md): `spec-group-members.sh <group> --json`.
@@ -0,0 +1,115 @@
1
+ ---
2
+ description: Execute a small, explicitly selected set of tasks from tasks.md using a task-driven, minimal-context workflow (does NOT change $speckit implement behavior).
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
+
21
+ ## Goal
22
+
23
+ Implement **only** the requested task(s) (or the next incomplete task by default), while keeping context loading minimal:
24
+
25
+ - Read `tasks.md` once.
26
+ - Do NOT bulk-load optional design artifacts up-front.
27
+ - Load additional docs/files **only when the selected task requires them**.
28
+
29
+ ## Accepted Task Selectors (from `$ARGUMENTS`)
30
+
31
+ This stage is intentionally task-driven. Determine which task(s) to execute using `$ARGUMENTS`:
32
+
33
+ - If `$ARGUMENTS` contains one or more Task IDs like `T006` / `T042`, execute those tasks only.
34
+ - Else, if `$ARGUMENTS` contains `next N` or a bare number `N`, execute the next `N` incomplete tasks (cap at 5).
35
+ - Else (empty or anything else), execute exactly the **next 1** incomplete task.
36
+
37
+ If a requested Task ID is already completed (`[x]`), skip it and report that it was already done.
38
+ If a requested Task ID cannot be found, ERROR and stop.
39
+
40
+ ## Execution Steps
41
+
42
+ ### 1) Resolve feature paths (single source of truth)
43
+
44
+ Run `SKILL_DIR/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` once from repo root and parse JSON for:
45
+
46
+ - `FEATURE_DIR`
47
+ - `AVAILABLE_DOCS`
48
+
49
+ Derive absolute paths:
50
+
51
+ - `TASKS = FEATURE_DIR/tasks.md`
52
+ - `PLAN = FEATURE_DIR/plan.md`
53
+ - `SPEC = FEATURE_DIR/spec.md`
54
+
55
+ If the user selected a feature for this invocation (via leading `029`, `SPECIFY_FEATURE=...`, or `spec=029`), pass it explicitly to scripts using `--feature <id>` (e.g., `--feature 029`) to avoid implicit inference.
56
+
57
+ ### 2) Checklist gate (fast, file-light)
58
+
59
+ If `FEATURE_DIR/checklists/` exists:
60
+
61
+ - For each checklist file, compute `total / done / todo` by counting checklist lines (e.g. using `rg` on `^- \\[[ xX]\\]`).
62
+ - If any checklist has unfinished items, STOP and ask the user:
63
+ - "Some checklists are incomplete. Do you want to proceed with this task anyway? (yes/no)"
64
+ - Wait for user response.
65
+ - If all checklists are complete (or no checklists dir), continue.
66
+
67
+ ### 3) Load minimal required context
68
+
69
+ 1. Read `TASKS` fully.
70
+ 2. Do NOT read `SPEC`, `PLAN`, `research.md`, `data-model.md`, `quickstart.md`, `contracts/` yet.
71
+ 3. Only load additional files when the selected task(s) require them.
72
+
73
+ **Optional**: If (and only if) the selected task mentions architecture/stack/project structure and `PLAN` is needed to decide file locations, read `PLAN` (but prefer scanning only the relevant headings/sections).
74
+
75
+ ### 4) Select the task(s) to execute
76
+
77
+ From the parsed `TASKS` file:
78
+
79
+ - Identify incomplete tasks: lines matching `- [ ] T\\d+`.
80
+ - Map Task ID → full task line text (description, file paths, story labels).
81
+
82
+ Apply the selection rules defined above (Task IDs / next N / next 1).
83
+
84
+ ### 5) For EACH selected task: execute in a tight loop
85
+
86
+ For each task (in order):
87
+
88
+ 1. **Determine the working set (no wandering)**:
89
+ - Extract file paths mentioned in the task line (e.g., `packages/foo/src/x.ts`).
90
+ - If the task line does not name file paths, derive the minimum search keys (symbol names, package names, error types).
91
+ 2. **Load only what you need**:
92
+ - If file paths are present: open those files first.
93
+ - If not: use targeted search (`rg`) to locate the smallest relevant entrypoints.
94
+ - Only if search is insufficient, use one targeted `auggie.codebase-retrieval` call scoped to the current task.
95
+ 3. **Implement the task**:
96
+ - Make minimal, focused changes.
97
+ - Avoid unrelated refactors.
98
+ 4. **Minimal validation for this task**:
99
+ - Prefer the smallest relevant check described by the repo or by the task itself (unit test, package test, or a single command).
100
+ - If no guidance exists, do a local, lightweight sanity check appropriate for the change (do not run large suites by default).
101
+ 5. **Mark completion**:
102
+ - Update `TASKS`: change this task line from `- [ ]` to `- [x]`.
103
+ - If the task requires adding notes/evidence (e.g. perf baselines), write them to the specified artifact and keep them brief.
104
+ 6. **Stop condition**:
105
+ - After each task, if more tasks remain in this batch, continue.
106
+ - After the batch completes, STOP and report what was done and what the next unchecked task is.
107
+
108
+ ## Output / Reporting
109
+
110
+ At the end, report:
111
+
112
+ - Which task IDs were executed and marked complete
113
+ - Key files changed (paths only)
114
+ - Any remaining blockers / required clarifications (if any)
115
+ - Suggested next command, e.g. `$speckit implement-task <feature> next` or `$speckit implement-task <feature> T0XX`
@@ -0,0 +1,129 @@
1
+ ---
2
+ description: Execute the implementation plan by processing and executing all tasks defined in tasks.md
3
+ handoffs:
4
+ - label: Acceptance Review
5
+ agent: spec.acceptance
6
+ prompt: Run a post-implementation acceptance review
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
+
26
+ ## Spec Group Quick Mode (e.g. `$speckit implement 046`)
27
+
28
+ If the target feature is a **Spec Group** (the feature directory contains `spec-registry.json`, fallback: `spec-registry.md`), treat it as a “dispatcher entrypoint”:
29
+
30
+ 1) Resolve members (registry order)
31
+ - Run: `SKILL_DIR/scripts/bash/spec-group-members.sh <group> --json`
32
+ - Take the `members` list from the output (e.g. `["045","039",...]`) and process in order (dedupe is fine).
33
+
34
+ 2) Generate/refresh the group execution index checklist (optional but recommended)
35
+ - Run: `SKILL_DIR/scripts/bash/spec-group-checklist.sh <group> --from registry --name group.registry`
36
+ - If the file already exists and you did not pass `--force` (so the script errors), do not overwrite; just continue (the index checklist is not a hard gate).
37
+
38
+ 3) Execute this `implement` workflow for each member (“recursive”)
39
+ - For each member, make step 1 in the Outline explicit with `--feature <member>`. The rest of the steps stay the same.
40
+ - Recommendation: in group mode, treat “checklists gate” as **informational only** (show the table but do not block on missing items) to avoid extra interaction at the dispatcher level.
41
+
42
+ 4) Optional write-back after each member
43
+ - If a group checklist exists (e.g. `specs/<group>/checklists/group.registry.md`), you can mark the corresponding member line from `- [ ]` to `- [x]` as a “dispatcher progress view”.
44
+ - After all members are done, run once: `$speckit acceptance <group>` (acceptance will expand group members).
45
+
46
+ ## Outline
47
+
48
+ 1. Run `SKILL_DIR/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. If you need to target a specific spec by number/id, add `--feature 025` (or `--feature 025-my-feature`). All paths must be absolute. 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").
49
+
50
+ 2. **Check checklists status** (if FEATURE_DIR/checklists/ exists):
51
+ - Scan all checklist files in the checklists/ directory
52
+ - For each checklist, count:
53
+ - Total items: All lines matching `- [ ]` or `- [X]` or `- [x]`
54
+ - Completed items: Lines matching `- [X]` or `- [x]`
55
+ - Incomplete items: Lines matching `- [ ]`
56
+ - Create a status table:
57
+
58
+ ```text
59
+ | Checklist | Total | Completed | Incomplete | Status |
60
+ |-----------|-------|-----------|------------|--------|
61
+ | ux.md | 12 | 12 | 0 | ✓ PASS |
62
+ | test.md | 8 | 5 | 3 | ✗ FAIL |
63
+ | security.md | 6 | 6 | 0 | ✓ PASS |
64
+ ```
65
+
66
+ - Calculate overall status:
67
+ - **PASS**: All checklists have 0 incomplete items
68
+ - **FAIL**: One or more checklists have incomplete items
69
+
70
+ - **If any checklist is incomplete**:
71
+ - Display the table with incomplete item counts
72
+ - **STOP** and ask: "Some checklists are incomplete. Do you want to proceed with implementation anyway? (yes/no)"
73
+ - Wait for user response before continuing
74
+ - If user says "no" or "wait" or "stop", halt execution
75
+ - If user says "yes" or "proceed" or "continue", proceed to step 3
76
+
77
+ - **If all checklists are complete**:
78
+ - Display the table showing all checklists passed
79
+ - Automatically proceed to step 3
80
+
81
+ 3. Load and analyze the implementation context:
82
+ - **REQUIRED**: Read tasks.md for the complete task list and execution plan
83
+ - **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
84
+ - **IF EXISTS**: Read data-model.md for entities and relationships
85
+ - **IF EXISTS**: Read contracts/ for API specifications and test requirements
86
+ - **IF EXISTS**: Read research.md for technical decisions and constraints
87
+ - **IF EXISTS**: Read quickstart.md for integration scenarios
88
+ - **IF EXISTS**: Read notes/ for entry points, invariants, and session context (Non-SSoT)
89
+
90
+ If this run involves long-chain exploration and you suspect the session may compact, proactively run `$speckit notes <feature>` to flush "entry points + next actions" before continuing.
91
+
92
+ 4. Parse tasks.md structure and extract:
93
+ - **Task phases**: Setup, Tests, Core, Integration, Polish
94
+ - **Task dependencies**: Sequential vs parallel execution rules
95
+ - **Task details**: ID, description, file paths, parallel markers [P]
96
+ - **Execution flow**: Order and dependency requirements
97
+
98
+ 5. Execute implementation following the task plan:
99
+ - **Phase-by-phase execution**: Complete each phase before moving to the next
100
+ - **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
101
+ - **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
102
+ - **File-based coordination**: Tasks affecting the same files must run sequentially
103
+ - **Validation checkpoints**: Verify each phase completion before proceeding
104
+
105
+ 6. Implementation execution rules:
106
+ - **Setup first**: Initialize project structure, dependencies, configuration
107
+ - **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
108
+ - **Core development**: Implement models, services, CLI commands, endpoints
109
+ - **Integration work**: Database connections, middleware, logging, external services
110
+ - **Polish and validation**: Unit tests, performance optimization, documentation
111
+
112
+ 7. Progress tracking and error handling:
113
+ - Report progress after each completed task
114
+ - Halt execution if any non-parallel task fails
115
+ - For parallel tasks [P], continue with successful tasks, report failed ones
116
+ - Provide clear error messages with context for debugging
117
+ - Suggest next steps if implementation cannot proceed
118
+ - **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
119
+
120
+ 8. Completion validation:
121
+ - Verify all required tasks are completed
122
+ - Check that implemented features match the original specification
123
+ - Validate that tests pass and coverage meets requirements
124
+ - Confirm the implementation follows the technical plan
125
+ - Report final status with summary of completed work
126
+
127
+ Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `$speckit tasks` first to regenerate the task list.
128
+
129
+ After implementation, run `$speckit acceptance` to validate the latest codebase against every coded point in `spec.md` (FR/NFR/SC) and detect drift.
@@ -0,0 +1,82 @@
1
+ ---
2
+ description: Maintain handoff-friendly notes for the current feature (manual flush button before long explorations / session compaction; not SSoT)
3
+ ---
4
+
5
+ ## User Input
6
+
7
+ ```text
8
+ $ARGUMENTS
9
+ ```
10
+
11
+ You **MUST** consider the user input (if not empty) and record it as the intent of this session/flush inside the notes.
12
+
13
+ ## “Filesystem as Working Memory” (Notes Edition)
14
+
15
+ - **Filesystem as memory**: Put long content/research/intermediate artifacts into files; keep chat focused on “conclusions + pointers”.
16
+ - **Read before decide**: Before pushing forward, read `notes/README.md` (and `plan.md`/`tasks.md` if present) to restore goal/state into the attention window.
17
+ - **Keep failure traces**: Keep errors/failed attempts as traces (at least in a session file; add a one-line summary + link in README).
18
+ - **Append-only history**: Write session details to `notes/sessions/*` (append-only; do not rewrite old sessions). Keep README as a one-screen dashboard + pointers.
19
+
20
+ ## What Notes Are For (Important)
21
+
22
+ - `specs/<feature>/notes/**` are **engineering notes / handoff materials**: reduce long-chain exploration costs and avoid “re-reading the whole repo” next time.
23
+ - Notes are **not** SSoT: any decision that changes requirements/contracts/architecture/quality gates MUST be written back to `spec.md` / `plan.md` / `tasks.md` (or `docs/specs/*`). Do not leave it only in notes.
24
+ - Notes should be “actionable and relayable”:
25
+ - Entry points (files/symbols + one-line conclusion)
26
+ - Key chain nodes (shortest jumps from business usage → code landing points)
27
+ - Invariants / pitfalls (assumptions that must not break)
28
+ - Next actions (concrete edits the next executor can do immediately + validation method)
29
+
30
+ ## Default Artifacts
31
+
32
+ Maintain the following files under `specs/<feature>/notes/` (create as needed; avoid empty-doc spam):
33
+
34
+ - `README.md`: one-screen entrypoint (must be short; only “current status / conclusions / next actions / failure summaries + pointers”)
35
+ - `entrypoints.md`: entry point index (files/symbols + one-line conclusion)
36
+ - `questions.md`: open questions and blockers
37
+ - `sessions/<YYYY-MM-DD>.md`: session-level increments (recommended default) as append-only history and failure traces
38
+
39
+ ## Outline
40
+
41
+ 1) **Resolve feature directory**
42
+ - Run from repo root: `SKILL_DIR/scripts/bash/check-prerequisites.sh --json`
43
+ - Parse `FEATURE_DIR` from output (must be an absolute path).
44
+
45
+ 2) **Ensure notes directory exists**
46
+ - Run: `SKILL_DIR/scripts/bash/setup-notes.sh --json`
47
+ - Parse: `NOTES_DIR` / `NOTES_README` / `NOTES_ENTRYPOINTS` / `NOTES_QUESTIONS` / `SESSIONS_DIR`
48
+ - Default behavior: only write minimal skeleton when files are missing/empty; never overwrite existing content (`--force` overwrites).
49
+
50
+ 3) **Read-before-decide (lightweight attention refresh)**
51
+ - Open and quickly scan:
52
+ - `NOTES_README`
53
+ - `FEATURE_DIR/plan.md` (and `FEATURE_DIR/tasks.md` if present)
54
+ - If `NOTES_README` is no longer “one-screen readable”, trim it (move long content into `sessions/*`, keep README as pointers).
55
+
56
+ 4) **Update `notes/README.md` (required)**
57
+ - Goal: keep it “one-screen readable”; do not pile long explanations into README.
58
+ - At minimum include these sections (short bullets are fine):
59
+ - `Scope`: what these notes cover / do not cover
60
+ - `Entry Points`: link to `entrypoints.md` (or list 3–8 key entry points directly)
61
+ - `Current Status`: one-line focus + progress/stage (checkboxes OK)
62
+ - `Current Hypothesis`: current best judgement (1–5 items)
63
+ - `Errors Encountered`: failure trace summaries (1–5 items; details in session)
64
+ - `Next Actions`: next executable edit points (file path/symbol + validation method)
65
+ - `Last Flush`: timestamp + this `$ARGUMENTS` (helps recall “why we wrote this”)
66
+
67
+ 5) **Write `notes/sessions/<YYYY-MM-DD>.md` (recommended default)**
68
+ - Goal: capture “this flush’s details” as append-only history (do not rewrite old sessions).
69
+ - Suggested sections:
70
+ - `Intent`: this `$ARGUMENTS` (one line is enough)
71
+ - `What Changed`: index of files/symbols touched (index only)
72
+ - `Findings`: conclusions / evidence / counterexamples
73
+ - `Errors (Failure Traces)`: failure → fix/mitigation → whether written back to SSoT
74
+ - `Next Actions`: next executable points + validation method
75
+ - Link this session from README `Last Flush`.
76
+
77
+ 6) **Update other notes docs as needed**
78
+ - If you found new entry points: update `entrypoints.md` (index only, no long prose).
79
+ - If you are blocked or need user decisions: update `questions.md` using “question → impact → decision needed”.
80
+
81
+ 7) **Consistency self-check (lightweight)**
82
+ - If notes mention key decisions that belong to SSoT, ensure they are written back into `spec.md`/`plan.md`/`tasks.md` (avoid parallel truth sources).
@@ -0,0 +1,87 @@
1
+ ---
2
+ description: Deepen planning in one pass by running an auto-resolving clarification loop (self Q&A) and then producing a more explicit, implementation-ready plan with fewer unknowns.
3
+ handoffs:
4
+ - label: Create Tasks
5
+ agent: speckit.tasks
6
+ prompt: Break the plan into tasks
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
+ ## Goal
19
+
20
+ Reduce ambiguity and deepen the implementation plan **without interactive questioning**:
21
+
22
+ 1) Use a clarify-style ambiguity scan, but **self-answer** the highest-impact questions by selecting the best option/recommended answer.
23
+ 2) Write the resolved clarifications back into the spec (same integration rules as `clarify`).
24
+ 3) Produce / refine `plan.md` and Phase 0/1 artifacts (`research.md`, `data-model.md`, `contracts/`, `quickstart.md`) with a higher explicitness bar (fewer "TBD"/"NEEDS CLARIFICATION") and no drift from the updated spec.
25
+
26
+ ## Operating Constraints
27
+
28
+ - Assume unrelated parallel work exists; never run destructive git/system commands.
29
+ - Keep spec as WHAT and plan as HOW. Only write HOW decisions into plan; write WHAT clarifications into spec.
30
+ - Do not ask the user questions in this stage. If a decision is too risky to auto-resolve, record it as an explicit **Assumption** with a clear follow-up validation step.
31
+
32
+ ## Execution Steps
33
+
34
+ ### 1) Resolve paths & prerequisites
35
+
36
+ From repo root, run `SKILL_DIR/scripts/bash/check-prerequisites.sh --json --paths-only` once (add `--feature <id>` if needed). Parse:
37
+
38
+ - `FEATURE_SPEC`
39
+ - `IMPL_PLAN`
40
+ - `FEATURE_DIR`
41
+
42
+ If `FEATURE_SPEC` is missing, instruct the user to run `$speckit specify` first (do not create a spec here).
43
+ If `IMPL_PLAN` is missing or empty, run `SKILL_DIR/scripts/bash/setup-plan.sh --json` to initialize it from the template (do not overwrite unless explicitly asked).
44
+
45
+ Load `.specify/memory/constitution.md` and the latest `FEATURE_SPEC`.
46
+
47
+ ### 2) Auto-clarify (self Q&A, non-interactive)
48
+
49
+ Baseline: read and follow `SKILL_DIR/references/clarify.md` EXACTLY, with these overrides:
50
+
51
+ - Replace the interactive questioning loop with **self Q&A**:
52
+ - Generate a prioritized queue of candidate clarification questions (max **12**).
53
+ - For each question, determine the recommended/suggested answer exactly as in `clarify` rules, then **auto-accept** it (no user prompt).
54
+ - For each auto-accepted answer, produce a concise audit-friendly rationale (NOT persisted to disk):
55
+ - `**Decision logic:**` 5–12 bullets, covering Criteria / Tradeoffs / Risks / Implications.
56
+ - Immediately integrate each answer into the spec using the same incremental write rules as `clarify` (create/append in `## Clarifications` and update the appropriate sections).
57
+ - Mark the clarification line with an `AUTO:` prefix, e.g. `- AUTO: Q: ... → A: ...`.
58
+
59
+ - Stop early if no high-impact ambiguities remain.
60
+ - If a high-impact ambiguity cannot be responsibly auto-resolved:
61
+ - Do not guess silently.
62
+ - Record it under `## Clarifications` as an explicit assumption using the same bullet format (prefix the line with `ASSUMPTION:`), and also add a follow-up validation note in `plan.md` (next step).
63
+
64
+ ### 3) Plan deepening (higher explicitness bar)
65
+
66
+ Baseline: read and follow `SKILL_DIR/references/plan.md` EXACTLY, with these additional requirements:
67
+
68
+ - Keep Phase 0/1 artifacts aligned:
69
+ - If `research.md` / `data-model.md` / `contracts/` / `quickstart.md` already exist, update them to reflect the newly applied `AUTO`/`ASSUMPTION` clarifications (do not leave stale contradictions).
70
+ - If they do not exist, generate them following the plan workflow.
71
+ - Eliminate placeholders:
72
+ - No `NEEDS CLARIFICATION` left in `Technical Context` unless it is truly unavoidable; when unavoidable, convert it into an explicit assumption + a validation task.
73
+ - Make decisions explicit and testable:
74
+ - Fill the `Perf Evidence Plan (MUST)` section with either a concrete evidence plan or `N/A` plus a concrete rationale.
75
+ - If the plan touches Logix runtime hot paths, ensure the plan includes reproducible baseline/diff commands consistent with the perf-evidence references.
76
+ - Add a short `## Deepening Notes` section near the top of `plan.md`:
77
+ - Include up to 8 bullets of the most consequential auto-decisions (not all), each as `- Decision: <...> (source: spec clarify AUTO/ASSUMPTION)`.
78
+ - Ensure the final plan can drive `$speckit tasks` deterministically (clear structure, stable file paths, measurable gates).
79
+
80
+ ### 4) Report completion
81
+
82
+ Report:
83
+
84
+ - How many AUTO clarifications were applied to spec
85
+ - Whether any ASSUMPTION items remain (list them)
86
+ - Paths written: `FEATURE_SPEC`, `IMPL_PLAN`, and any generated Phase 0/1 artifacts
87
+ - Suggested next command (`$speckit tasks` recommended)