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,246 @@
1
+ ---
2
+ description: Create or update the feature specification from a natural language feature description.
3
+ handoffs:
4
+ - label: Build Technical Plan
5
+ agent: speckit.plan
6
+ prompt: Create a plan for the spec. I am building with...
7
+ - label: Clarify Spec Requirements
8
+ agent: speckit.clarify
9
+ prompt: Clarify specification requirements
10
+ send: true
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
+ The text the user typed after `$speckit specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `$ARGUMENTS` appears literally below. Do not ask the user to repeat it unless they provided an empty command.
32
+
33
+ Given that feature description, do this:
34
+
35
+ 1. **Generate a concise short name** (2-4 words) for the branch:
36
+ - Analyze the feature description and extract the most meaningful keywords
37
+ - Create a 2-4 word short name that captures the essence of the feature
38
+ - Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")
39
+ - Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)
40
+ - Keep it concise but descriptive enough to understand the feature at a glance
41
+ - Examples:
42
+ - "I want to add user authentication" → "user-auth"
43
+ - "Implement OAuth2 integration for the API" → "oauth2-api-integration"
44
+ - "Create a dashboard for analytics" → "analytics-dashboard"
45
+ - "Fix payment processing timeout bug" → "fix-payment-timeout"
46
+
47
+ 2. **Create the feature directory (specs-only numbering)**:
48
+
49
+ a. Do **not** use any VCS/remote information to decide the feature number.
50
+
51
+ b. Run the script once to create the `specs/<NNN-*>/spec.md` directory structure. The script decides the next available `NNN` by scanning existing `specs/<NNN-*>` directories only:
52
+ - Bash example: `SKILL_DIR/scripts/bash/create-new-feature.sh --json --short-name "user-auth" "$ARGUMENTS"`
53
+ - PowerShell example: `SKILL_DIR/scripts/bash/create-new-feature.sh --json -ShortName "user-auth" "$ARGUMENTS"`
54
+
55
+ **IMPORTANT**:
56
+ - You must only ever run this script once per feature
57
+ - The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for
58
+ - The JSON output will contain BRANCH_NAME and SPEC_FILE paths
59
+ - 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")
60
+
61
+ 3. Load `SKILL_DIR/assets/templates/spec-template.md` to understand required sections.
62
+
63
+ 4. Follow this execution flow:
64
+ 1. Parse user description from Input
65
+ If empty: ERROR "No feature description provided"
66
+ 2. Extract key concepts from description
67
+ Identify: actors, actions, data, constraints
68
+ 3. For unclear aspects:
69
+ - Make informed guesses based on context and industry standards
70
+ - Only mark with [NEEDS CLARIFICATION: specific question] if:
71
+ - The choice significantly impacts feature scope or user experience
72
+ - Multiple reasonable interpretations exist with different implications
73
+ - No reasonable default exists
74
+ - **LIMIT: Maximum 3 [NEEDS CLARIFICATION] markers total**
75
+ - Prioritize clarifications by impact: scope > security/privacy > user experience > technical details
76
+ 4. Fill User Scenarios & Testing section
77
+ If no clear user flow: ERROR "Cannot determine user scenarios"
78
+ 5. Generate Functional Requirements
79
+ Each requirement must be testable
80
+ Use reasonable defaults for unspecified details (document assumptions in Assumptions section)
81
+ 6. Define Success Criteria
82
+ Create measurable, technology-agnostic outcomes
83
+ Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)
84
+ Each criterion must be verifiable without implementation details
85
+ 7. Identify Key Entities (if data involved)
86
+ 8. Return: SUCCESS (spec ready for planning)
87
+
88
+ 5. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
89
+
90
+ 6. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:
91
+
92
+ a. **Create Spec Quality Checklist**: Generate a checklist file at `FEATURE_DIR/checklists/requirements.md` using the checklist template structure with these validation items:
93
+
94
+ ```markdown
95
+ # Specification Quality Checklist: [FEATURE NAME]
96
+
97
+ **Purpose**: Validate specification completeness and quality before proceeding to planning
98
+ **Created**: [DATE]
99
+ **Feature**: [Link to spec.md]
100
+
101
+ ## Content Quality
102
+
103
+ - [ ] No implementation details (languages, frameworks, APIs)
104
+ - [ ] Focused on user value and business needs
105
+ - [ ] Written for non-technical stakeholders
106
+ - [ ] All mandatory sections completed
107
+
108
+ ## Requirement Completeness
109
+
110
+ - [ ] No [NEEDS CLARIFICATION] markers remain
111
+ - [ ] Requirements are testable and unambiguous
112
+ - [ ] Success criteria are measurable
113
+ - [ ] Success criteria are technology-agnostic (no implementation details)
114
+ - [ ] All acceptance scenarios are defined
115
+ - [ ] Edge cases are identified
116
+ - [ ] Scope is clearly bounded
117
+ - [ ] Dependencies and assumptions identified
118
+
119
+ ## Feature Readiness
120
+
121
+ - [ ] All functional requirements have clear acceptance criteria
122
+ - [ ] User scenarios cover primary flows
123
+ - [ ] Feature meets measurable outcomes defined in Success Criteria
124
+ - [ ] No implementation details leak into specification
125
+
126
+ ## Notes
127
+
128
+ - Items marked incomplete require spec updates before `$speckit clarify` or `$speckit plan`
129
+ ```
130
+
131
+ b. **Run Validation Check**: Review the spec against each checklist item:
132
+ - For each item, determine if it passes or fails
133
+ - Document specific issues found (quote relevant spec sections)
134
+
135
+ c. **Handle Validation Results**:
136
+ - **If all items pass**: Mark checklist complete and proceed to step 6
137
+
138
+ - **If items fail (excluding [NEEDS CLARIFICATION])**:
139
+ 1. List the failing items and specific issues
140
+ 2. Update the spec to address each issue
141
+ 3. Re-run validation until all items pass (max 3 iterations)
142
+ 4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user
143
+
144
+ - **If [NEEDS CLARIFICATION] markers remain**:
145
+ 1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec
146
+ 2. **LIMIT CHECK**: If more than 3 markers exist, keep only the 3 most critical (by scope/security/UX impact) and make informed guesses for the rest
147
+ 3. For each clarification needed (max 3), present options to user in this format:
148
+
149
+ ```markdown
150
+ ## Question [N]: [Topic]
151
+
152
+ **Context**: [Quote relevant spec section]
153
+
154
+ **What we need to know**: [Specific question from NEEDS CLARIFICATION marker]
155
+
156
+ **Suggested Answers**:
157
+
158
+ | Option | Answer | Implications |
159
+ |--------|--------|--------------|
160
+ | A | [First suggested answer] | [What this means for the feature] |
161
+ | B | [Second suggested answer] | [What this means for the feature] |
162
+ | C | [Third suggested answer] | [What this means for the feature] |
163
+ | Custom | Provide your own answer | [Explain how to provide custom input] |
164
+
165
+ **Your choice**: _[Wait for user response]_
166
+ ```
167
+
168
+ 4. **CRITICAL - Table Formatting**: Ensure markdown tables are properly formatted:
169
+ - Use consistent spacing with pipes aligned
170
+ - Each cell should have spaces around content: `| Content |` not `|Content|`
171
+ - Header separator must have at least 3 dashes: `|--------|`
172
+ - Test that the table renders correctly in markdown preview
173
+ 5. Number questions sequentially (Q1, Q2, Q3 - max 3 total)
174
+ 6. Present all questions together before waiting for responses
175
+ 7. Wait for user to respond with their choices for all questions (e.g., "Q1: A, Q2: Custom - [details], Q3: B")
176
+ 8. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user's selected or provided answer
177
+ 9. Re-run validation after all clarifications are resolved
178
+
179
+ d. **Update Checklist**: After each validation iteration, update the checklist file with current pass/fail status
180
+
181
+ 7. Report completion with branch name, spec file path, checklist results, and readiness for the next phase (`$speckit clarify` or `$speckit plan`).
182
+
183
+ **NOTE:** The script only creates `specs/<NNN-*>` directories/files (no VCS operations) before you write the spec content.
184
+
185
+ ## General Guidelines
186
+
187
+ ## Quick Guidelines
188
+
189
+ - Focus on **WHAT** users need and **WHY**.
190
+ - Avoid HOW to implement (no tech stack, APIs, code structure).
191
+ - Written for business stakeholders, not developers.
192
+ - DO NOT create any checklists that are embedded in the spec. That will be a separate command.
193
+
194
+ ### Section Requirements
195
+
196
+ - **Mandatory sections**: Must be completed for every feature
197
+ - **Optional sections**: Include only when relevant to the feature
198
+ - When a section doesn't apply, remove it entirely (don't leave as "N/A")
199
+
200
+ ### For AI Generation
201
+
202
+ When creating this spec from a user prompt:
203
+
204
+ 1. **Make informed guesses**: Use context, industry standards, and common patterns to fill gaps
205
+ 2. **Document assumptions**: Record reasonable defaults in the Assumptions section
206
+ 3. **Limit clarifications**: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:
207
+ - Significantly impact feature scope or user experience
208
+ - Have multiple reasonable interpretations with different implications
209
+ - Lack any reasonable default
210
+ 4. **Prioritize clarifications**: scope > security/privacy > user experience > technical details
211
+ 5. **Think like a tester**: Every vague requirement should fail the "testable and unambiguous" checklist item
212
+ 6. **Common areas needing clarification** (only if no reasonable default exists):
213
+ - Feature scope and boundaries (include/exclude specific use cases)
214
+ - User types and permissions (if multiple conflicting interpretations possible)
215
+ - Security/compliance requirements (when legally/financially significant)
216
+
217
+ **Examples of reasonable defaults** (don't ask about these):
218
+
219
+ - Data retention: Industry-standard practices for the domain
220
+ - Performance targets: Standard web/mobile app expectations unless specified
221
+ - Error handling: User-friendly messages with appropriate fallbacks
222
+ - Authentication method: Standard session-based or OAuth2 for web apps
223
+ - Integration patterns: RESTful APIs unless specified otherwise
224
+
225
+ ### Success Criteria Guidelines
226
+
227
+ Success criteria must be:
228
+
229
+ 1. **Measurable**: Include specific metrics (time, percentage, count, rate)
230
+ 2. **Technology-agnostic**: No mention of frameworks, languages, databases, or tools
231
+ 3. **User-focused**: Describe outcomes from user/business perspective, not system internals
232
+ 4. **Verifiable**: Can be tested/validated without knowing implementation details
233
+
234
+ **Good examples**:
235
+
236
+ - "Users can complete checkout in under 3 minutes"
237
+ - "System supports 10,000 concurrent users"
238
+ - "95% of searches return results in under 1 second"
239
+ - "Task completion rate improves by 40%"
240
+
241
+ **Bad examples** (implementation-focused):
242
+
243
+ - "API response time is under 200ms" (too technical, use "Users see results instantly")
244
+ - "Database can handle 1000 TPS" (implementation detail, use user-facing metric)
245
+ - "React components render efficiently" (framework-specific)
246
+ - "Redis cache hit rate above 80%" (technology-specific)
@@ -0,0 +1,155 @@
1
+ ---
2
+ description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.
3
+ handoffs:
4
+ - label: Analyze For Consistency
5
+ agent: speckit.analyze
6
+ prompt: Run a project analysis for consistency
7
+ send: true
8
+ - label: Implement Project
9
+ agent: speckit.implement
10
+ prompt: Start the implementation in phases
11
+ send: true
12
+ ---
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Parallel Development Safety (Non-Negotiable)
23
+
24
+ - Assume the working tree may contain unrelated, uncommitted changes from other parallel tasks.
25
+ - NEVER try to "leave only this task's files" by reverting or cleaning other changes.
26
+ - ABSOLUTELY PROHIBITED: any form of `git restore`, `git checkout -- <path>`, `git reset`, `git clean`, `git stash`.
27
+ - Avoid staging/committing/history rewriting unless explicitly requested by the user: `git add`, `git commit`, `git rebase`, `git merge`, `git cherry-pick`, `git push`.
28
+ - Read-only git commands are allowed (e.g., `git status`, `git diff`).
29
+
30
+ ## Outline
31
+
32
+ ## Spec Group (dispatcher spec) note
33
+
34
+ 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 the produced `tasks.md` should be **dispatcher tasks** (index-only):
35
+
36
+ - Task granularity focuses on “maintain registry / generate execution checklist / write back milestone evidence / create or advance member specs”.
37
+ - NEVER copy member implementation tasks into the group. Only include **link entrypoints** (each member’s `tasks.md` / `quickstart.md` / evidence files).
38
+ - If you need to generate/refresh the group execution index checklist (`specs/<group>/checklists/*`), prefer:
39
+ `SKILL_DIR/scripts/bash/spec-group-checklist.sh <group> --from registry --name group.registry`
40
+
41
+ 1. **Setup**: Run `SKILL_DIR/scripts/bash/check-prerequisites.sh --json` 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").
42
+
43
+ 2. **Load design documents**: Read from FEATURE_DIR:
44
+ - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)
45
+ - **Optional**: data-model.md (entities), contracts/ (API endpoints), research.md (decisions), quickstart.md (test scenarios)
46
+ - **Optional**: notes/ (Non-SSoT; entry points / invariants / exploration summary)
47
+ - Note: Not all projects have all documents. Generate tasks based on what's available.
48
+
49
+ 3. **Execute task generation workflow**:
50
+ - Load plan.md and extract tech stack, libraries, project structure
51
+ - Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)
52
+ - If data-model.md exists: Extract entities and map to user stories
53
+ - If contracts/ exists: Map endpoints to user stories
54
+ - If research.md exists: Extract decisions for setup tasks
55
+ - Generate tasks organized by user story (see Task Generation Rules below)
56
+ - Generate dependency graph showing user story completion order
57
+ - Create parallel execution examples per user story
58
+ - Validate task completeness (each user story has all needed tasks, independently testable)
59
+
60
+ 4. **Generate tasks.md**: Use `SKILL_DIR/assets/templates/tasks-template.md` as structure, fill with:
61
+ - Correct feature name from plan.md
62
+ - Phase 1: Setup tasks (project initialization)
63
+ - Phase 2: Foundational tasks (blocking prerequisites for all user stories)
64
+ - Phase 3+: One phase per user story (in priority order from spec.md)
65
+ - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks
66
+ - Final Phase: Polish & cross-cutting concerns
67
+ - All tasks must follow the strict checklist format (see Task Generation Rules below)
68
+ - Clear file paths for each task
69
+ - Dependencies section showing story completion order
70
+ - Parallel execution examples per story
71
+ - Implementation strategy section (MVP first, incremental delivery)
72
+
73
+ 5. **Report**: Output path to generated tasks.md and summary:
74
+ - Total task count
75
+ - Task count per user story
76
+ - Parallel opportunities identified
77
+ - Independent test criteria for each story
78
+ - Suggested MVP scope (typically just User Story 1)
79
+ - Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)
80
+
81
+ Context for task generation: $ARGUMENTS
82
+
83
+ The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
84
+
85
+ ## Task Generation Rules
86
+
87
+ **CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.
88
+
89
+ **Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.
90
+
91
+ ### Checklist Format (REQUIRED)
92
+
93
+ Every task MUST strictly follow this format:
94
+
95
+ ```text
96
+ - [ ] [TaskID] [P?] [Story?] Description with file path
97
+ ```
98
+
99
+ **Format Components**:
100
+
101
+ 1. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)
102
+ 2. **Task ID**: Sequential number (T001, T002, T003...) in execution order
103
+ 3. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)
104
+ 4. **[Story] label**: REQUIRED for user story phase tasks only
105
+ - Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)
106
+ - Setup phase: NO story label
107
+ - Foundational phase: NO story label
108
+ - User Story phases: MUST have story label
109
+ - Polish phase: NO story label
110
+ 5. **Description**: Clear action with exact file path
111
+
112
+ **Examples**:
113
+
114
+ - ✅ CORRECT: `- [ ] T001 Create project structure per implementation plan`
115
+ - ✅ CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`
116
+ - ✅ CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`
117
+ - ✅ CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`
118
+ - ❌ WRONG: `- [ ] Create User model` (missing ID and Story label)
119
+ - ❌ WRONG: `T001 [US1] Create model` (missing checkbox)
120
+ - ❌ WRONG: `- [ ] [US1] Create User model` (missing Task ID)
121
+ - ❌ WRONG: `- [ ] T001 [US1] Create model` (missing file path)
122
+
123
+ ### Task Organization
124
+
125
+ 1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:
126
+ - Each user story (P1, P2, P3...) gets its own phase
127
+ - Map all related components to their story:
128
+ - Models needed for that story
129
+ - Services needed for that story
130
+ - Endpoints/UI needed for that story
131
+ - If tests requested: Tests specific to that story
132
+ - Mark story dependencies (most stories should be independent)
133
+
134
+ 2. **From Contracts**:
135
+ - Map each contract/endpoint → to the user story it serves
136
+ - If tests requested: Each contract → contract test task [P] before implementation in that story's phase
137
+
138
+ 3. **From Data Model**:
139
+ - Map each entity to the user story(ies) that need it
140
+ - If entity serves multiple stories: Put in earliest story or Setup phase
141
+ - Relationships → service layer tasks in appropriate story phase
142
+
143
+ 4. **From Setup/Infrastructure**:
144
+ - Shared infrastructure → Setup phase (Phase 1)
145
+ - Foundational/blocking tasks → Foundational phase (Phase 2)
146
+ - Story-specific setup → within that story's phase
147
+
148
+ ### Phase Structure
149
+
150
+ - **Phase 1**: Setup (project initialization)
151
+ - **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)
152
+ - **Phase 3+**: User Stories in priority order (P1, P2, P3...)
153
+ - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration
154
+ - Each phase should be a complete, independently testable increment
155
+ - **Final Phase**: Polish & Cross-Cutting Concerns
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts.
3
+ tools: ['github/github-mcp-server/issue_write']
4
+ ---
5
+
6
+ ## User Input
7
+
8
+ ```text
9
+ $ARGUMENTS
10
+ ```
11
+
12
+ You **MUST** consider the user input before proceeding (if not empty).
13
+
14
+ ## Parallel Development Safety (Non-Negotiable)
15
+
16
+ - Assume the working tree may contain unrelated, uncommitted changes from other parallel tasks.
17
+ - NEVER try to "leave only this task's files" by reverting or cleaning other changes.
18
+ - ABSOLUTELY PROHIBITED: any form of `git restore`, `git checkout -- <path>`, `git reset`, `git clean`, `git stash`.
19
+ - Avoid staging/committing/history rewriting unless explicitly requested by the user: `git add`, `git commit`, `git rebase`, `git merge`, `git cherry-pick`, `git push`.
20
+ - Read-only git commands are allowed (e.g., `git status`, `git diff`).
21
+
22
+ ## Outline
23
+
24
+ 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").
25
+ 1. From the executed script, extract the path to **tasks**.
26
+ 1. Determine the target GitHub repository **from user input** (do not infer from local repo configuration):
27
+ - Accept either `owner/repo` or a full `https://github.com/owner/repo` URL.
28
+ - If the user did not provide the repo in `$ARGUMENTS` or earlier messages, ask once for it and stop.
29
+
30
+ 1. For each task in the list, use the GitHub MCP server to create a new issue in the **explicitly provided** repository.
31
+
32
+ > [!CAUTION]
33
+ > UNDER NO CIRCUMSTANCES EVER CREATE ISSUES IN REPOSITORIES THAT DO NOT MATCH THE EXPLICITLY PROVIDED REPO
@@ -0,0 +1,206 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Consolidated prerequisite checking script
4
+ #
5
+ # This script provides unified prerequisite checking for Spec-Driven Development workflow.
6
+ # It replaces the functionality previously spread across multiple scripts.
7
+ #
8
+ # Usage: ./check-prerequisites.sh [OPTIONS]
9
+ #
10
+ # OPTIONS:
11
+ # --json Output in JSON format
12
+ # --require-tasks Require tasks.md to exist (for implementation phase)
13
+ # --include-tasks Include tasks.md in AVAILABLE_DOCS list
14
+ # --paths-only Only output path variables (no validation)
15
+ # --help, -h Show help message
16
+ #
17
+ # OUTPUTS:
18
+ # JSON mode: {"FEATURE_DIR":"...", "AVAILABLE_DOCS":["..."]}
19
+ # Text mode: FEATURE_DIR:... \n AVAILABLE_DOCS: \n ✓/✗ file.md
20
+ # Paths only: REPO_ROOT: ... \n BRANCH: ... \n FEATURE_DIR: ... etc.
21
+
22
+ set -e
23
+
24
+ # Parse command line arguments
25
+ JSON_MODE=false
26
+ REQUIRE_TASKS=false
27
+ INCLUDE_TASKS=false
28
+ PATHS_ONLY=false
29
+ FEATURE_OVERRIDE=""
30
+ POSITIONAL=()
31
+
32
+ while [[ $# -gt 0 ]]; do
33
+ case "$1" in
34
+ --json)
35
+ JSON_MODE=true
36
+ shift
37
+ ;;
38
+ --require-tasks)
39
+ REQUIRE_TASKS=true
40
+ shift
41
+ ;;
42
+ --include-tasks)
43
+ INCLUDE_TASKS=true
44
+ shift
45
+ ;;
46
+ --paths-only)
47
+ PATHS_ONLY=true
48
+ shift
49
+ ;;
50
+ --feature)
51
+ if [[ $# -lt 2 || "$2" == --* ]]; then
52
+ echo "ERROR: --feature requires a value." >&2
53
+ exit 1
54
+ fi
55
+ FEATURE_OVERRIDE="$2"
56
+ shift 2
57
+ ;;
58
+ --feature=*)
59
+ FEATURE_OVERRIDE="${1#--feature=}"
60
+ shift
61
+ ;;
62
+ --help|-h)
63
+ cat << 'EOF'
64
+ Usage: check-prerequisites.sh [OPTIONS]
65
+
66
+ Consolidated prerequisite checking for Spec-Driven Development workflow.
67
+
68
+ OPTIONS:
69
+ --json Output in JSON format
70
+ --require-tasks Require tasks.md to exist (for implementation phase)
71
+ --include-tasks Include tasks.md in AVAILABLE_DOCS list
72
+ --paths-only Only output path variables (no prerequisite validation)
73
+ --feature <id> Target a specific spec (e.g., 025 or 025-my-feature)
74
+ --help, -h Show this help message
75
+
76
+ EXAMPLES:
77
+ # Check task prerequisites (plan.md required)
78
+ ./check-prerequisites.sh --json
79
+
80
+ # Check implementation prerequisites (plan.md + tasks.md required)
81
+ ./check-prerequisites.sh --json --require-tasks --include-tasks
82
+
83
+ # Get feature paths only (no validation)
84
+ ./check-prerequisites.sh --paths-only
85
+
86
+ # Target a specific spec by number or full id
87
+ ./check-prerequisites.sh --json --feature 025
88
+ ./check-prerequisites.sh --json 025-my-feature
89
+
90
+ EOF
91
+ exit 0
92
+ ;;
93
+ --*)
94
+ echo "ERROR: Unknown option '$1'. Use --help for usage information." >&2
95
+ exit 1
96
+ ;;
97
+ *)
98
+ POSITIONAL+=("$1")
99
+ shift
100
+ ;;
101
+ esac
102
+ done
103
+
104
+ if [[ -n "$FEATURE_OVERRIDE" ]]; then
105
+ SPECIFY_FEATURE="$FEATURE_OVERRIDE"
106
+ fi
107
+
108
+ if [[ ${#POSITIONAL[@]} -gt 0 ]]; then
109
+ if [[ -z "$FEATURE_OVERRIDE" && ${#POSITIONAL[@]} -eq 1 && "${POSITIONAL[0]}" =~ ^[0-9]{3}(-.+)?$ ]]; then
110
+ SPECIFY_FEATURE="${POSITIONAL[0]}"
111
+ else
112
+ echo "ERROR: Unknown argument(s): ${POSITIONAL[*]}. Use --help for usage information." >&2
113
+ exit 1
114
+ fi
115
+ fi
116
+
117
+ # Source common functions
118
+ SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
119
+ source "$SCRIPT_DIR/common.sh"
120
+
121
+ # Get feature paths and validate branch
122
+ eval $(get_feature_paths)
123
+ check_feature_branch "$CURRENT_BRANCH" || exit 1
124
+
125
+ # If paths-only mode, output paths and exit (support JSON + paths-only combined)
126
+ if $PATHS_ONLY; then
127
+ if $JSON_MODE; then
128
+ # Minimal JSON paths payload (no validation performed)
129
+ printf '{"REPO_ROOT":"%s","BRANCH":"%s","FEATURE_DIR":"%s","FEATURE_SPEC":"%s","IMPL_PLAN":"%s","TASKS":"%s"}\n' \
130
+ "$REPO_ROOT" "$CURRENT_BRANCH" "$FEATURE_DIR" "$FEATURE_SPEC" "$IMPL_PLAN" "$TASKS"
131
+ else
132
+ echo "REPO_ROOT: $REPO_ROOT"
133
+ echo "BRANCH: $CURRENT_BRANCH"
134
+ echo "FEATURE_DIR: $FEATURE_DIR"
135
+ echo "FEATURE_SPEC: $FEATURE_SPEC"
136
+ echo "IMPL_PLAN: $IMPL_PLAN"
137
+ echo "TASKS: $TASKS"
138
+ fi
139
+ exit 0
140
+ fi
141
+
142
+ # Validate required directories and files
143
+ if [[ ! -d "$FEATURE_DIR" ]]; then
144
+ echo "ERROR: Feature directory not found: $FEATURE_DIR" >&2
145
+ echo 'Run $speckit specify first to create the feature structure.' >&2
146
+ exit 1
147
+ fi
148
+
149
+ if [[ ! -f "$IMPL_PLAN" ]]; then
150
+ echo "ERROR: plan.md not found in $FEATURE_DIR" >&2
151
+ echo 'Run $speckit plan first to create the implementation plan.' >&2
152
+ exit 1
153
+ fi
154
+
155
+ # Check for tasks.md if required
156
+ if $REQUIRE_TASKS && [[ ! -f "$TASKS" ]]; then
157
+ echo "ERROR: tasks.md not found in $FEATURE_DIR" >&2
158
+ echo 'Run $speckit tasks first to create the task list.' >&2
159
+ exit 1
160
+ fi
161
+
162
+ # Build list of available documents
163
+ docs=()
164
+
165
+ # Always check these optional docs
166
+ [[ -f "$RESEARCH" ]] && docs+=("research.md")
167
+ [[ -f "$DATA_MODEL" ]] && docs+=("data-model.md")
168
+
169
+ # Check contracts directory (only if it exists and has files)
170
+ if [[ -d "$CONTRACTS_DIR" ]] && [[ -n "$(ls -A "$CONTRACTS_DIR" 2>/dev/null)" ]]; then
171
+ docs+=("contracts/")
172
+ fi
173
+
174
+ [[ -f "$QUICKSTART" ]] && docs+=("quickstart.md")
175
+
176
+ # Include tasks.md if requested and it exists
177
+ if $INCLUDE_TASKS && [[ -f "$TASKS" ]]; then
178
+ docs+=("tasks.md")
179
+ fi
180
+
181
+ # Output results
182
+ if $JSON_MODE; then
183
+ # Build JSON array of documents
184
+ if [[ ${#docs[@]} -eq 0 ]]; then
185
+ json_docs="[]"
186
+ else
187
+ json_docs=$(printf '"%s",' "${docs[@]}")
188
+ json_docs="[${json_docs%,}]"
189
+ fi
190
+
191
+ printf '{"FEATURE_DIR":"%s","AVAILABLE_DOCS":%s}\n' "$FEATURE_DIR" "$json_docs"
192
+ else
193
+ # Text output
194
+ echo "FEATURE_DIR:$FEATURE_DIR"
195
+ echo "AVAILABLE_DOCS:"
196
+
197
+ # Show status of each potential document
198
+ check_file "$RESEARCH" "research.md"
199
+ check_file "$DATA_MODEL" "data-model.md"
200
+ check_dir "$CONTRACTS_DIR" "contracts/"
201
+ check_file "$QUICKSTART" "quickstart.md"
202
+
203
+ if $INCLUDE_TASKS; then
204
+ check_file "$TASKS" "tasks.md"
205
+ fi
206
+ fi