nitm-ai-dev-toolkit 3.0.23 → 5.0.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 (187) hide show
  1. package/CHANGELOG.md +44 -3
  2. package/README.md +93 -6
  3. package/bin/cli.js +155 -25
  4. package/bin/factory-archive.js +71 -0
  5. package/bin/factory-prune.js +79 -0
  6. package/bin/factory-watch.js +509 -0
  7. package/package.json +1 -1
  8. package/src/monorepo/.agents/skills/factory/SKILL.md +593 -0
  9. package/src/monorepo/.claude/agents/admin-portal.agent.md +1 -1
  10. package/src/monorepo/.claude/agents/api-specialist.agent.md +1 -1
  11. package/src/monorepo/.claude/agents/backend-architect.agent.md +1 -1
  12. package/src/monorepo/.claude/agents/documenter.agent.md +1 -1
  13. package/src/monorepo/.claude/agents/factory-approver.agent.md +12 -0
  14. package/src/monorepo/.claude/agents/factory-builder.agent.md +12 -0
  15. package/src/monorepo/.claude/agents/factory-reviewer-code.agent.md +12 -0
  16. package/src/monorepo/.claude/agents/factory-reviewer-security.agent.md +12 -0
  17. package/src/monorepo/.claude/agents/factory-reviewer-ui.agent.md +12 -0
  18. package/src/monorepo/.claude/agents/factory-reviewer-ux.agent.md +12 -0
  19. package/src/monorepo/.claude/agents/factory-spec-writer.agent.md +12 -0
  20. package/src/monorepo/.claude/agents/feature-builder.agent.md +1 -1
  21. package/src/monorepo/.claude/agents/frontend-developer.agent.md +1 -1
  22. package/src/monorepo/.claude/agents/green.agent.md +1 -1
  23. package/src/monorepo/.claude/agents/implementer.agent.md +1 -1
  24. package/src/monorepo/.claude/agents/planner.agent.md +1 -1
  25. package/src/monorepo/.claude/agents/red.agent.md +1 -1
  26. package/src/monorepo/.claude/agents/refactor.agent.md +1 -1
  27. package/src/monorepo/.claude/agents/researcher.agent.md +1 -1
  28. package/src/monorepo/.claude/agents/reviewer.agent.md +1 -1
  29. package/src/monorepo/.claude/agents/tdd.agent.md +1 -1
  30. package/src/monorepo/.claude/agents-snippets/factory-approver.md +72 -0
  31. package/src/monorepo/.claude/agents-snippets/factory-builder.md +101 -0
  32. package/src/monorepo/.claude/agents-snippets/factory-reviewer-code.md +57 -0
  33. package/src/monorepo/.claude/agents-snippets/factory-reviewer-security.md +48 -0
  34. package/src/monorepo/.claude/agents-snippets/factory-reviewer-ui.md +64 -0
  35. package/src/monorepo/.claude/agents-snippets/factory-reviewer-ux.md +64 -0
  36. package/src/monorepo/.claude/agents-snippets/factory-spec-writer.md +119 -0
  37. package/src/monorepo/.claude/agents-snippets/feature-builder.md +1 -1
  38. package/src/monorepo/.claude/commands/factory.md +24 -0
  39. package/src/monorepo/.claude/commands/ponytail-audit.md +4 -6
  40. package/src/monorepo/.claude/commands/ponytail-debt.md +3 -5
  41. package/src/monorepo/.claude/commands/ponytail-gain.md +2 -4
  42. package/src/monorepo/.claude/commands/ponytail-help.md +2 -4
  43. package/src/monorepo/.claude/commands/ponytail-review.md +3 -5
  44. package/src/monorepo/.claude/commands/ponytail.md +3 -5
  45. package/src/monorepo/.claude/prompt-snippets/assign-tasks.md +6 -2
  46. package/src/monorepo/.claude/prompt-snippets/bootstrap-patch.md +32 -17
  47. package/src/monorepo/.claude/prompt-snippets/bootstrap-upgrade.md +76 -51
  48. package/src/monorepo/.claude/prompt-snippets/bootstrap.md +57 -29
  49. package/src/monorepo/.claude/prompt-snippets/factory.md +20 -0
  50. package/src/monorepo/.claude/prompt-snippets/implement-feature.md +2 -2
  51. package/src/monorepo/.claude/prompt-snippets/tasks.md +49 -87
  52. package/src/monorepo/.claude/rules-snippets/documentation.md +8 -6
  53. package/src/monorepo/.cursor/agents/factory-approver.agent.md +11 -0
  54. package/src/monorepo/.cursor/agents/factory-builder.agent.md +11 -0
  55. package/src/monorepo/.cursor/agents/factory-reviewer-code.agent.md +11 -0
  56. package/src/monorepo/.cursor/agents/factory-reviewer-security.agent.md +11 -0
  57. package/src/monorepo/.cursor/agents/factory-reviewer-ui.agent.md +11 -0
  58. package/src/monorepo/.cursor/agents/factory-reviewer-ux.agent.md +11 -0
  59. package/src/monorepo/.cursor/agents/factory-spec-writer.agent.md +11 -0
  60. package/src/monorepo/.cursor/commands/factory.md +24 -0
  61. package/src/monorepo/.github/agents/factory-approver.agent.md +11 -0
  62. package/src/monorepo/.github/agents/factory-builder.agent.md +11 -0
  63. package/src/monorepo/.github/agents/factory-reviewer-code.agent.md +11 -0
  64. package/src/monorepo/.github/agents/factory-reviewer-security.agent.md +11 -0
  65. package/src/monorepo/.github/agents/factory-reviewer-ui.agent.md +11 -0
  66. package/src/monorepo/.github/agents/factory-reviewer-ux.agent.md +11 -0
  67. package/src/monorepo/.github/agents/factory-spec-writer.agent.md +11 -0
  68. package/src/monorepo/.github/prompts/factory.prompt.md +25 -0
  69. package/src/monorepo/.github/prompts/review-staged.prompt.md +1 -1
  70. package/src/monorepo/.opencode/agents/admin-portal.md +10 -4
  71. package/src/monorepo/.opencode/agents/api-specialist.md +10 -4
  72. package/src/monorepo/.opencode/agents/backend-architect.md +10 -4
  73. package/src/monorepo/.opencode/agents/documenter.md +10 -4
  74. package/src/monorepo/.opencode/agents/factory-approver.md +20 -0
  75. package/src/monorepo/.opencode/agents/factory-builder.md +20 -0
  76. package/src/monorepo/.opencode/agents/factory-reviewer-code.md +20 -0
  77. package/src/monorepo/.opencode/agents/factory-reviewer-security.md +20 -0
  78. package/src/monorepo/.opencode/agents/factory-reviewer-ui.md +20 -0
  79. package/src/monorepo/.opencode/agents/factory-reviewer-ux.md +20 -0
  80. package/src/monorepo/.opencode/agents/factory-spec-writer.md +20 -0
  81. package/src/monorepo/.opencode/agents/feature-builder.md +13 -5
  82. package/src/monorepo/.opencode/agents/frontend-developer.md +10 -4
  83. package/src/monorepo/.opencode/agents/green.md +10 -4
  84. package/src/monorepo/.opencode/agents/implementer.md +10 -4
  85. package/src/monorepo/.opencode/agents/planner.md +10 -4
  86. package/src/monorepo/.opencode/agents/red.md +10 -4
  87. package/src/monorepo/.opencode/agents/refactor.md +10 -4
  88. package/src/monorepo/.opencode/agents/researcher.md +10 -4
  89. package/src/monorepo/.opencode/agents/reviewer.md +10 -4
  90. package/src/monorepo/.opencode/agents/tdd.md +13 -5
  91. package/src/monorepo/.opencode/commands/factory.md +29 -0
  92. package/src/monorepo/.opencode/opencode.jsonc +8 -10
  93. package/src/monorepo/AGENTS.md +30 -1
  94. package/src/monorepo/CLAUDE.md +1 -1
  95. package/src/monorepo/README.md +20 -0
  96. package/src/monorepo/factory/README.md +194 -0
  97. package/src/monorepo/factory/_gitignore +5 -0
  98. package/src/repo/.agents/skills/factory/SKILL.md +593 -0
  99. package/src/repo/.claude/agents/admin-portal.agent.md +1 -1
  100. package/src/repo/.claude/agents/api-specialist.agent.md +1 -1
  101. package/src/repo/.claude/agents/backend-architect.agent.md +1 -1
  102. package/src/repo/.claude/agents/documenter.agent.md +2 -2
  103. package/src/repo/.claude/agents/factory-approver.agent.md +12 -0
  104. package/src/repo/.claude/agents/factory-builder.agent.md +12 -0
  105. package/src/repo/.claude/agents/factory-reviewer-code.agent.md +12 -0
  106. package/src/repo/.claude/agents/factory-reviewer-security.agent.md +12 -0
  107. package/src/repo/.claude/agents/factory-reviewer-ui.agent.md +12 -0
  108. package/src/repo/.claude/agents/factory-reviewer-ux.agent.md +12 -0
  109. package/src/repo/.claude/agents/factory-spec-writer.agent.md +12 -0
  110. package/src/repo/.claude/agents/feature-builder.agent.md +1 -1
  111. package/src/repo/.claude/agents/frontend-developer.agent.md +1 -1
  112. package/src/repo/.claude/agents/green.agent.md +1 -1
  113. package/src/repo/.claude/agents/implementer.agent.md +1 -1
  114. package/src/repo/.claude/agents/planner.agent.md +2 -2
  115. package/src/repo/.claude/agents/red.agent.md +1 -1
  116. package/src/repo/.claude/agents/refactor.agent.md +1 -1
  117. package/src/repo/.claude/agents/researcher.agent.md +2 -2
  118. package/src/repo/.claude/agents/reviewer.agent.md +2 -2
  119. package/src/repo/.claude/agents/tdd.agent.md +1 -1
  120. package/src/repo/.claude/agents-snippets/factory-approver.md +72 -0
  121. package/src/repo/.claude/agents-snippets/factory-builder.md +100 -0
  122. package/src/repo/.claude/agents-snippets/factory-reviewer-code.md +57 -0
  123. package/src/repo/.claude/agents-snippets/factory-reviewer-security.md +48 -0
  124. package/src/repo/.claude/agents-snippets/factory-reviewer-ui.md +64 -0
  125. package/src/repo/.claude/agents-snippets/factory-reviewer-ux.md +64 -0
  126. package/src/repo/.claude/agents-snippets/factory-spec-writer.md +117 -0
  127. package/src/repo/.claude/agents-snippets/feature-builder.md +1 -1
  128. package/src/repo/.claude/commands/factory.md +24 -0
  129. package/src/repo/.claude/commands/ponytail-audit.md +4 -6
  130. package/src/repo/.claude/commands/ponytail-debt.md +3 -5
  131. package/src/repo/.claude/commands/ponytail-gain.md +2 -4
  132. package/src/repo/.claude/commands/ponytail-help.md +2 -4
  133. package/src/repo/.claude/commands/ponytail-review.md +3 -5
  134. package/src/repo/.claude/commands/ponytail.md +3 -5
  135. package/src/repo/.claude/prompt-snippets/assign-tasks.md +6 -2
  136. package/src/repo/.claude/prompt-snippets/bootstrap-patch.md +32 -17
  137. package/src/repo/.claude/prompt-snippets/bootstrap-upgrade.md +87 -77
  138. package/src/repo/.claude/prompt-snippets/bootstrap.md +71 -74
  139. package/src/repo/.claude/prompt-snippets/factory.md +20 -0
  140. package/src/repo/.claude/prompt-snippets/implement-feature.md +2 -2
  141. package/src/repo/.claude/prompt-snippets/tasks.md +49 -112
  142. package/src/repo/.cursor/agents/factory-approver.agent.md +11 -0
  143. package/src/repo/.cursor/agents/factory-builder.agent.md +11 -0
  144. package/src/repo/.cursor/agents/factory-reviewer-code.agent.md +11 -0
  145. package/src/repo/.cursor/agents/factory-reviewer-security.agent.md +11 -0
  146. package/src/repo/.cursor/agents/factory-reviewer-ui.agent.md +11 -0
  147. package/src/repo/.cursor/agents/factory-reviewer-ux.agent.md +11 -0
  148. package/src/repo/.cursor/agents/factory-spec-writer.agent.md +11 -0
  149. package/src/repo/.cursor/commands/factory.md +24 -0
  150. package/src/repo/.github/agents/factory-approver.agent.md +11 -0
  151. package/src/repo/.github/agents/factory-builder.agent.md +11 -0
  152. package/src/repo/.github/agents/factory-reviewer-code.agent.md +11 -0
  153. package/src/repo/.github/agents/factory-reviewer-security.agent.md +11 -0
  154. package/src/repo/.github/agents/factory-reviewer-ui.agent.md +11 -0
  155. package/src/repo/.github/agents/factory-reviewer-ux.agent.md +11 -0
  156. package/src/repo/.github/agents/factory-spec-writer.agent.md +11 -0
  157. package/src/repo/.github/prompts/factory.prompt.md +25 -0
  158. package/src/repo/.opencode/agents/admin-portal.md +10 -4
  159. package/src/repo/.opencode/agents/api-specialist.md +10 -4
  160. package/src/repo/.opencode/agents/backend-architect.md +10 -4
  161. package/src/repo/.opencode/agents/documenter.md +10 -4
  162. package/src/repo/.opencode/agents/factory-approver.md +20 -0
  163. package/src/repo/.opencode/agents/factory-builder.md +20 -0
  164. package/src/repo/.opencode/agents/factory-reviewer-code.md +20 -0
  165. package/src/repo/.opencode/agents/factory-reviewer-security.md +20 -0
  166. package/src/repo/.opencode/agents/factory-reviewer-ui.md +20 -0
  167. package/src/repo/.opencode/agents/factory-reviewer-ux.md +20 -0
  168. package/src/repo/.opencode/agents/factory-spec-writer.md +20 -0
  169. package/src/repo/.opencode/agents/feature-builder.md +13 -5
  170. package/src/repo/.opencode/agents/frontend-developer.md +10 -4
  171. package/src/repo/.opencode/agents/green.md +10 -4
  172. package/src/repo/.opencode/agents/implementer.md +10 -4
  173. package/src/repo/.opencode/agents/planner.md +10 -4
  174. package/src/repo/.opencode/agents/red.md +10 -4
  175. package/src/repo/.opencode/agents/refactor.md +10 -4
  176. package/src/repo/.opencode/agents/researcher.md +10 -4
  177. package/src/repo/.opencode/agents/reviewer.md +10 -4
  178. package/src/repo/.opencode/agents/tdd.md +13 -5
  179. package/src/repo/.opencode/commands/factory.md +29 -0
  180. package/src/repo/.opencode/opencode.jsonc +8 -10
  181. package/src/repo/AGENTS.md +27 -1
  182. package/src/repo/CLAUDE.md +1 -1
  183. package/src/repo/README.md +20 -0
  184. package/src/repo/factory/README.md +194 -0
  185. package/src/repo/factory/_gitignore +5 -0
  186. package/src/monorepo/.opencode/plugins/ponytail.mjs +0 -93
  187. package/src/repo/.opencode/plugins/ponytail.mjs +0 -93
@@ -0,0 +1,119 @@
1
+ # Factory Spec Writer
2
+
3
+ You turn a feature request into a testable spec, and then into a plan. You are one agent in the [factory](../../.agents/skills/factory/SKILL.md) pipeline. You work from the paths block the orchestrator gives you. The task line names your mode: **spec** or **plan**.
4
+
5
+ ## Inputs
6
+
7
+ Read these, in this order:
8
+
9
+ 1. The feature request in your prompt.
10
+ 2. The project's `AGENTS.md` (conventions and commands).
11
+ 3. The existing code the feature touches. Inspect it. Do not write a spec or plan from the request alone.
12
+ 4. The `AGENTS.md` of each affected app or package, for its patterns and commands.
13
+ 5. [Feature spec template](../../templates/feature-spec.template.md) for the section structure.
14
+ 6. Any existing `spec.md`, `plan.md`, and `tasks.md` in the feature folder, and the change note the orchestrator gave you (`spec-<k>.md` in spec mode, `plan-<k>.md` in plan mode). Update them, do not start over blind.
15
+ 7. `intake.md` in the job folder, if the paths block lists it: the operator's answers to the intake questions. They clarify the request and win over the request text where they conflict.
16
+
17
+ ## Spec mode
18
+
19
+ You write `spec.md` in the feature folder (paths block). Nothing else.
20
+
21
+ Use this skeleton, keeping the template's section order and dropping sections that do not apply (Timeline, References, Changelog):
22
+
23
+ ```markdown
24
+ # Feature Specification: <short title>
25
+
26
+ ## Summary
27
+
28
+ One paragraph: what changes for whom.
29
+
30
+ ## Background
31
+
32
+ - **Problem:** what is wrong or missing today.
33
+ - **Current behavior:** what the code does now, with file references.
34
+
35
+ ## Requirements
36
+
37
+ - **FR-1:** The system shall ...
38
+ - **FR-2:** ...
39
+
40
+ ## Acceptance Criteria
41
+
42
+ Numbered, each one testable by a command or an observable step.
43
+
44
+ - **AC-1:** Given ..., when ..., then ... (verify: `<command or step>`)
45
+ - **AC-2:** ...
46
+
47
+ ## Affected Code
48
+
49
+ - `path/to/file`: why it changes
50
+
51
+ ## Out of Scope
52
+
53
+ - ...
54
+
55
+ ## Assumptions
56
+
57
+ - Technical assumption: ...
58
+ - **[PRODUCT DECISION]** Assumption that a person must decide: ... (options: ...)
59
+
60
+ ## Open Questions
61
+
62
+ - ... (or "None")
63
+ ```
64
+
65
+ Rules for the spec:
66
+
67
+ - Every acceptance criterion must be testable. Name the check (a test, a command, or an observable UI step). "Works well" is not testable.
68
+ - Acceptance criteria are numbered `AC-n`, and requirements are numbered `FR-n`. Builders and reviewers refer to these numbers.
69
+ - Keep scope to what the request asks. Put tempting extras under Out of Scope.
70
+ - An assumption that a product owner should decide is flagged `[PRODUCT DECISION]`. Do not decide it silently. The spec gate collects the operator's answer, and the approver escalates only on `[PRODUCT DECISION]` items still open in the spec.
71
+ - Prefer the smallest spec that covers the request. Ponytail applies to specs too: if the request is already one line of code, say so in Summary and keep the rest short.
72
+ - Do not write a size line or a plan in the spec. Sizing happens in plan mode.
73
+
74
+ ## Plan mode
75
+
76
+ You write `plan.md` in the feature folder, and `tasks.md` for large work. Nothing else. Do not change `spec.md`.
77
+
78
+ `plan.md` is concise. Use this skeleton:
79
+
80
+ ```markdown
81
+ # Plan: <short title>
82
+
83
+ **Size:** small — one line of reason. (The word after `Size:` is exactly one of `small`, `large`, or `unclear`.)
84
+
85
+ ## Approach
86
+
87
+ Short: how the change is built, and which files it touches.
88
+
89
+ ## Steps
90
+
91
+ 1. <step, in build order>
92
+ 2. ...
93
+
94
+ ## Checks
95
+
96
+ - AC-n: <test or command that proves it>
97
+ ```
98
+
99
+ Sizing: **small** is one or two steps, so write no `tasks.md` and delete a stale one. **Large** has more steps than that, so write `tasks.md`. **Unclear** means you cannot tell from the spec and the code. Say why in the Size line; the operator decides at the plan gate.
100
+
101
+ `tasks.md` (large only) is a slim list, one line per task, with no per-task sections:
102
+
103
+ ```markdown
104
+ # Tasks: <KEY-or-slug>
105
+ - [ ] T1 <one-line task>
106
+ - [ ] T2 <one-line task> [P]
107
+ ```
108
+
109
+ Number tasks `T1`, `T2`, and so on in build order. Add `[P]` only to tasks that can run in parallel. Do not write ticket keys; the orchestrator adds them at tracking.
110
+
111
+ On a re-plan, keep each existing task line that still applies, with its T-number, its text, and any ` — <KEY>` suffix, unchanged. Match a kept task by its T-number and text. Number new tasks after the highest existing number. A line that already has a ticket key keeps it, because that ticket exists.
112
+
113
+ ## Rules
114
+
115
+ - A change note with `spec-<k>.md` or `plan-<k>.md` is the operator's request. Apply it, and keep everything else the operator already accepted.
116
+ - When a change note answers a `[PRODUCT DECISION]` item, rewrite that item to start with `[DECIDED]` and the operator's answer, for example `[DECIDED] Free tier: 3 seats.`. Items the note does not answer stay `[PRODUCT DECISION]`. Never mark an item decided yourself.
117
+ - Name every affected app and package in the plan's Steps and in the spec's Affected Code (`apps/<app>/...` or `packages/<pkg>/...`). If a shared package changes, list its downstream consumers too, so the build and reviews test them.
118
+ - Keep `spec.md` and `plan.md` free of tooling chatter. They are feature docs that merge with the code.
119
+ - Do not modify code, tests, `build.md`, `job.json`, `qa.md`, or any file outside the feature folder. Your writes are `spec.md` (spec mode), or `plan.md` and `tasks.md` (plan mode), in the feature folder only.
@@ -34,7 +34,7 @@ For each feature request:
34
34
 
35
35
  When dispatching a specialist subagent, provide:
36
36
 
37
- 1. Full task description and acceptance criteria
37
+ 1. Full task description (the `tasks.md` line) and the acceptance criteria from `spec.md` that it covers
38
38
  2. Relevant file paths and patterns from the codebase
39
39
  3. Related tasks already completed (for context)
40
40
  4. Testing expectations
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: "Run an opt-in factory job: intake, spec and plan gates, build in a worktree or in place, reviews, approval, local merge"
3
+ allowed-tools: "Read, Grep, Glob, Write, Edit, Bash(*), agent"
4
+ argument-hint: "[--in-place] <feature request> | start [--in-place] <request | KEY | slug | job-id> | approve <job-id> | rework <job-id> <note> | abandon <job-id> | status [--all] | watch [--all] | archive [--all] [--dry-run] | prune [--all] [--abandoned] [--dry-run]"
5
+ ---
6
+
7
+ # Factory
8
+
9
+ ## Agent Dispatch
10
+ > **Run in the main session.** The orchestrator dispatches these agents; they cannot dispatch others.
11
+
12
+ | Agent | When to use |
13
+ |-------|-------------|
14
+ | `factory-spec-writer` | Spec stage (`spec` mode) writes `spec.md`; plan stage (`plan` mode) writes `plan.md` and `tasks.md` |
15
+ | `factory-builder` | Build, repair, and rework: writes `build.md` in the job folder; its code goes in the build location |
16
+ | `factory-reviewer-code` | Review round, `code` lens |
17
+ | `factory-reviewer-security` | Review round, `security` lens |
18
+ | `factory-reviewer-ux` | Review round, `ux` lens (opt-in) |
19
+ | `factory-reviewer-ui` | Review round, `ui` lens (opt-in) |
20
+ | `factory-approver` | Approval gate: writes `decision.md` |
21
+
22
+ Dispatch each agent by its kebab-case name, as in the first column. Copilot may show a display name; pick the agent with that name.
23
+
24
+ Follow the prompt defined in [.claude/prompt-snippets/factory.md](../prompt-snippets/factory.md).
@@ -1,15 +1,13 @@
1
1
  ---
2
- description: Audit the whole repo for over-engineering and identify what can be deleted
3
- allowed-tools: "Read, Grep, Bash"
2
+ description: Audit the whole repo for over-engineering — find what can be deleted
3
+ allowed-tools: "Read, Grep"
4
4
  argument-hint: "no arguments required"
5
5
  ---
6
6
 
7
- ## Agent Dispatch
7
+ # Ponytail Audit
8
8
 
9
+ ## Agent Dispatch
9
10
  > **Recommended agent:** `oracle`
10
11
  > Whole-repo over-engineering analysis
11
12
 
12
-
13
- # Ponytail Audit
14
-
15
13
  Follow the prompt defined in [.claude/prompt-snippets/ponytail-audit.md](../prompt-snippets/ponytail-audit.md).
@@ -1,15 +1,13 @@
1
1
  ---
2
2
  description: "Harvest ponytail: comments into a tracked debt ledger"
3
- allowed-tools: "Read, Grep, Bash"
3
+ allowed-tools: "Read, Grep"
4
4
  argument-hint: "no arguments required"
5
5
  ---
6
6
 
7
- ## Agent Dispatch
7
+ # Ponytail Debt
8
8
 
9
+ ## Agent Dispatch
9
10
  > **Recommended agent:** `fixer`
10
11
  > Debt ledger harvesting
11
12
 
12
-
13
- # Ponytail Debt
14
-
15
13
  Follow the prompt defined in [.claude/prompt-snippets/ponytail-debt.md](../prompt-snippets/ponytail-debt.md).
@@ -4,12 +4,10 @@ allowed-tools: "Read"
4
4
  argument-hint: "no arguments required"
5
5
  ---
6
6
 
7
- ## Agent Dispatch
7
+ # Ponytail Gain
8
8
 
9
+ ## Agent Dispatch
9
10
  > **Recommended agent:** `fixer`
10
11
  > Impact scoreboard display
11
12
 
12
-
13
- # Ponytail Gain
14
-
15
13
  Follow the prompt defined in [.claude/prompt-snippets/ponytail-gain.md](../prompt-snippets/ponytail-gain.md).
@@ -4,12 +4,10 @@ allowed-tools: "Read"
4
4
  argument-hint: "no arguments required"
5
5
  ---
6
6
 
7
- ## Agent Dispatch
7
+ # Ponytail Help
8
8
 
9
+ ## Agent Dispatch
9
10
  > **Recommended agent:** `fixer`
10
11
  > Quick-reference display
11
12
 
12
-
13
- # Ponytail Help
14
-
15
13
  Follow the prompt defined in [.claude/prompt-snippets/ponytail-help.md](../prompt-snippets/ponytail-help.md).
@@ -1,15 +1,13 @@
1
1
  ---
2
- description: Review changes for over-engineering and identify what can be deleted
2
+ description: Review changes for over-engineering — find what can be deleted
3
3
  allowed-tools: "Read, Grep"
4
4
  argument-hint: "no arguments required"
5
5
  ---
6
6
 
7
- ## Agent Dispatch
7
+ # Ponytail Review
8
8
 
9
+ ## Agent Dispatch
9
10
  > **Recommended agent:** `oracle`
10
11
  > Diff-level over-engineering review
11
12
 
12
-
13
- # Ponytail Review
14
-
15
13
  Follow the prompt defined in [.claude/prompt-snippets/ponytail-review.md](../prompt-snippets/ponytail-review.md).
@@ -1,15 +1,13 @@
1
1
  ---
2
2
  description: Switch ponytail intensity level (lite/full/ultra/off)
3
- allowed-tools: "Read, Grep, Bash, Edit, Write"
3
+ allowed-tools: "Read, Grep"
4
4
  argument-hint: "optional level (lite/full/ultra/off)"
5
5
  ---
6
6
 
7
- ## Agent Dispatch
7
+ # Ponytail
8
8
 
9
+ ## Agent Dispatch
9
10
  > **Recommended agent:** `fixer`
10
11
  > Apply YAGNI/stdlib discipline
11
12
 
12
-
13
- # Ponytail
14
-
15
13
  Follow the prompt defined in [.claude/prompt-snippets/ponytail.md](../prompt-snippets/ponytail.md).
@@ -48,9 +48,11 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
48
48
  1. **Parse Document**:
49
49
  - Load the specified document (.md, .txt, .json)
50
50
  - Detect document structure (headers, lists, task categories)
51
- - Extract task hierarchy: Epic → Story → Task → Subtask
51
+ - For `tasks.md`: each `- [ ]` line is one task. The text after the ID is the summary. A trailing ` — <KEY>` means a ticket already exists, so skip that line. Sub-bullets, if any, are subtasks
52
+ - For requirement documents: extract task hierarchy: Epic → Story → Task → Subtask
52
53
 
53
54
  2. **Consolidate & Classify** (do this BEFORE creating tickets):
55
+ - **A `tasks.md` from `/tasks` is pre-consolidated**: one line = one ticket. Only merge lines that are clearly one deliverable; do not re-split them
54
56
  - **Group related items** by component, feature area, or deliverable
55
57
  - **Merge small tasks** (< 2 SP) into related larger tasks
56
58
  - **Eliminate redundant subtasks** that are obvious steps
@@ -62,7 +64,7 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
62
64
  - **Task**: Implementation work, 2-8 story points (avoid < 2 SP tasks)
63
65
  - **Subtask**: Only for complex tasks needing breakdown, 1-3 story points
64
66
 
65
- 4. **Estimate Effort**:
67
+ 4. **Estimate Effort** (`tasks.md` has no effort field: take hours from `plan.md` for the matching work, or estimate from the scope in `spec.md`):
66
68
  - 0.5-1 hours → Merge with related task (too small alone)
67
69
  - 2-3 hours → 2 story points
68
70
  - 4-6 hours → 3-5 story points
@@ -74,6 +76,8 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
74
76
  - Link child issues to parents
75
77
  - Set assignees, labels, and story points
76
78
  - Create dependency links where noted
79
+ - Ticket description: the task summary plus the acceptance criteria from `spec.md` for that deliverable
80
+ - Write each ticket key back to its `tasks.md` line after the em dash (`- [ ] T1 Schema + migration — PROJ-124`)
77
81
 
78
82
  6. **Generate Report**:
79
83
  - List all created tickets with IDs
@@ -1,9 +1,17 @@
1
- You are helping to patch AI instructions in this project by comparing against the latest templates from the ai-assisted-dev-toolkit repository and applying any updates.
1
+ You are helping to patch AI instructions by comparing against supported toolkit v4.x templates from the ai-assisted-dev-toolkit repository's `v4.x` branch and merging updates into this project.
2
+
3
+ ## OpenCode version preflight (before any changes)
4
+
5
+ - Confirm OpenCode use from actual session/runtime evidence or ask the user; directory presence alone is not proof. If only other harnesses are used, skip this preflight and all OpenCode steps.
6
+ - For confirmed OpenCode use, run `opencode --version` before any project writes. Trim output and parse numeric major/minor/patch components, accepting an optional leading `v`; toolkit 4.x requires `major >= 2`.
7
+ - If OpenCode V1 (`major < 2`) is detected, **STOP** before customizing/migrating OpenCode files or writing `.toolkit-version` as `4.0.0`. Ask the user to upgrade OpenCode to V2 or remain on toolkit 3.x.
8
+ - If the CLI is missing, fails, or output is unparseable, **STOP OpenCode steps** and leave the version marker unchanged; ask the user to confirm/install a supported OpenCode version, then rerun this check. Never assume V2.
9
+ - If oh-my-opencode-slim >=3.0.0 is used or planned, require OpenCode >=2.0.7 (compare version components numerically); otherwise **STOP** before changes and ask to upgrade. Proceed only after this gate passes.
2
10
 
3
11
  ## Orchestrator Checkpoint
4
12
 
5
13
  > **🛑 Before starting**: This command involves fetching, diffing, and applying changes across many files.
6
- > Dispatch parallel subagents for independent file groups (rules, commands, prompts, instructions, skills, agents).
14
+ > Complete Step 1's source/version gates before dispatching parallel diff agents for independent file groups (rules, commands, prompts, instructions, skills, agents).
7
15
  > See `.claude/rules-snippets/subagent-workflow.md` for patterns.
8
16
 
9
17
  ## Usage
@@ -23,13 +31,16 @@ You are helping to patch AI instructions in this project by comparing against th
23
31
 
24
32
  1. **Fetch Latest Templates**:
25
33
 
26
- Clone or fetch the latest ai-assisted-dev-toolkit templates:
34
+ Fetch only the supported `v4.x` source branch:
27
35
 
28
36
  ```bash
37
+ set -e
29
38
  TOOLKIT_TEMP=$(mktemp -d)
30
- git clone --depth 1 https://github.com/ninjasitm/ai-assisted-dev-toolkit.git "$TOOLKIT_TEMP"
39
+ git clone --depth 1 --branch v4.x https://github.com/ninjasitm/ai-assisted-dev-toolkit.git "$TOOLKIT_TEMP"
31
40
  ```
32
41
 
42
+ **Source availability gate:** If the clone fails or `v4.x` is unavailable (for example, not yet published), **STOP** before diff/apply/version marking. Do not fall back to the default branch or V3, and do not push/publish a branch to unblock this task; ask for an approved available v4.x source.
43
+
33
44
  Determine the correct source path based on project structure:
34
45
  - **Single repo**: Use `$TOOLKIT_TEMP/src/repo/`
35
46
  - **Monorepo**: Use `$TOOLKIT_TEMP/src/monorepo/`
@@ -42,9 +53,11 @@ You are helping to patch AI instructions in this project by comparing against th
42
53
 
43
54
  Check for a `.toolkit-version` file in the project root:
44
55
  - If exists: Read the version string (e.g., `2.0.10`, `3.0.0`)
45
- - If missing: Assume legacy version (pre-3.0.0)
56
+ - If missing: Verify the installed version or legacy state with the user; absence alone does not prove a pre-3.0 installation
46
57
 
47
- Read the toolkit's version from `$TOOLKIT_TEMP/.toolkit-version` to compare.
58
+ Read the toolkit's version from the `version` field in `$TOOLKIT_TEMP/package.json` to compare; `.toolkit-version` tracks the target project's installed version.
59
+
60
+ **Source version guard (before diff/apply/version marking):** Parse source/target versions as SemVer and compare them (major/minor/patch numerically). If the fetched package's major is not `4`, or its version is older than the target `.toolkit-version`, **STOP** without diffing, applying changes, or updating the marker. Unknown/unparseable versions must also **STOP** and ask rather than guess. Never auto-downgrade.
48
61
 
49
62
  **Version Comparison:**
50
63
  - **Same version**: No structural changes expected
@@ -76,20 +89,20 @@ You are helping to patch AI instructions in this project by comparing against th
76
89
  | **OpenCode Commands** | `.opencode/commands/*.md` | `src/{type}/.opencode/commands/*.md` |
77
90
  | **OpenCode Rules** | `.opencode/rules/*.md` | `src/{type}/.opencode/rules/*.md` |
78
91
  | **OpenCode Agents** | `.opencode/agents/*.md` | `src/{type}/.opencode/agents/*.md` |
79
- | **OpenCode Plugins** | `.opencode/plugins/*.mjs` | `src/{type}/.opencode/plugins/*.mjs` |
92
+ | **OpenCode Local Plugins** | `.opencode/plugins/*.{js,mjs,ts}` | Inventory only; preserve unrelated plugins |
80
93
  | **Hooks** | `hooks/*.{js,sh,ps1}` | `src/{type}/hooks/*.{js,sh,ps1}` |
81
94
  | **Agent Rules** | `.agents/rules/*.md` | `src/{type}/.agents/rules/*.md` |
82
- | **Toolkit Version** | `.toolkit-version` | `.toolkit-version` (root of toolkit) |
83
-
84
- **⚠️ OpenCode `opencode.jsonc` Schema Validation:**
85
-
86
- When patching `.opencode/opencode.jsonc`, **only add or modify supported top-level keys**. The schema is defined at `https://opencode.ai/config.json`. Do NOT add unsupported keys.
95
+ | **Toolkit Version** | `.toolkit-version` | `package.json` `version` (toolkit root) |
87
96
 
88
- **Supported top-level keys:** `$schema`, `instructions`, `skills`, `agent`, `default_agent`, `model`, `small_model`, `provider`, `mcp`, `tools`, `permission`, `lsp`, `formatter`, `server`, `shell`, `command`, `plugin`, `watcher`, `snapshot`, `share`, `autoupdate`, `compaction`, `attachment`, `logLevel`, `disabled_providers`, `enabled_providers`, `tool_output`, `enterprise`, `experimental`
97
+ **OpenCode native V2 merge checks (confirmed OpenCode use only):**
89
98
 
90
- **Do NOT add** keys like `rules`, `agents`, `commands`, `prompts` as top-level keys — OpenCode uses the `.opencode/` directory structure and `instructions` array instead.
99
+ Follow official V2 [migration](https://opencode.ai/v2/docs/migrate-v1), [config](https://opencode.ai/v2/docs/config), [agents](https://opencode.ai/v2/docs/agents), and [plugins](https://opencode.ai/v2/docs/build/plugins) docs. The published schema may describe V1; neither it nor a V1 API fetch validates native V2. Plural keys are intentional.
91
100
 
92
- > **Watch out:** the ponytail template uses the `plugin` key (singular). If you see `plugins` (plural) in your `opencode.jsonc`, that's a typo and the plugin won't load.
101
+ - Use `agents`/`system`, `request.body.temperature`, ordered `permissions` (`action`/`resource`/`effect`, `shell`/`subagent`, last match wins), `commands`/`subagent`, `plugins` with `{ "package": "…", "options": {} }`, skill-directory arrays, and `mcp.servers` with inverse `disabled` and `timeout.catalog`/`timeout.execution`.
102
+ - The version preflight must pass before changes. Back up V1 before native conversion (converted files are incompatible with V1). Preserve models/providers/user-global plugins. Only with approval, merge `"plugins": ["oh-my-opencode-slim@3.0.0"]` locally. Slim's separate strict schema keeps `prompt`/`permission`/`variant`; do not host-migrate it or silently upgrade the separate external starter.
103
+ - **Ponytail replacement (plan here; apply after backup and approval in Step 5):** Remove only known obsolete toolkit-owned `.opencode/plugins/ponytail.js`, `.opencode/plugins/ponytail.mjs`, and `.opencode/plugins/ponytail.ts` copies. Preserve unrelated local plugins. Merge/deduplicate the author's native V2 `@dietrichgebert/ponytail@4.12.0` registration in the local `plugins` array where appropriate, retaining other registrations/options; do not edit global config. Keep `opentmux` commented as V1-only. Do not port local APIs or add bridges; runtime integration is untested. Native local discovery needs no duplicate registration.
104
+ - `instructions` entries are accepted but not loaded; ambient root/nested `AGENTS.md` works. `@refs` are ordinary text: explicitly read snippets. `request.body.temperature` remains in config, but the current runner does not send it. Preserve `lsp: true`; use workspace lint/typecheck/compiler commands (no V2 LSP tools/diagnostics currently).
105
+ - `--env opencode` supplies minimal shared references without other harness activation. Activate on the next run/restart and report only installed-V2 checks actually run, not assumed runtime validation. Publishing 4.0.0 has not been executed.
93
106
 
94
107
  3. **Diff Analysis** (parallelizable — dispatch one subagent per category):
95
108
 
@@ -100,7 +113,7 @@ You are helping to patch AI instructions in this project by comparing against th
100
113
  - **📝 Updated**: Exists in both but template has newer content → candidate for merge
101
114
  - **✅ Current**: Exists in both and content matches → no action needed
102
115
  - **🔧 Customized**: Exists in both, project version has non-placeholder customizations → careful merge
103
- - **⚠️ Missing in Template**: Exists in project but not in template → project-specific, keep as-is
116
+ - **⚠️ Missing in Template**: Exists in project but not in template → project-specific, keep as-is except the approved obsolete toolkit Ponytail removal above
104
117
 
105
118
  b. **For updated files, generate a structured diff**:
106
119
  - Preserve project-specific `{{PLACEHOLDER}}` replacements (already-bootstrapped values)
@@ -161,7 +174,9 @@ You are helping to patch AI instructions in this project by comparing against th
161
174
  a. **New files**: Copy directly from template
162
175
  b. **Updated files (no customization)**: Replace with template version
163
176
  c. **Updated files (customized)**: Apply structural additions while preserving project values
164
- d. **Git commit**: Stage and commit all changes with message:
177
+ d. **OpenCode plugins**: Apply only the approved Ponytail replacement above after backing up the known obsolete toolkit copies and local config; preserve all unrelated local/global plugins.
178
+ e. **Toolkit version**: Update `.toolkit-version` to the fetched toolkit version (`4.0.0` for this migration) only after the approved migration and OpenCode preflight pass (or OpenCode is confirmed out of scope).
179
+ f. **Git commit**: Stage and commit all changes with message:
165
180
  ```bash
166
181
  git add -A
167
182
  git commit -m "chore: patch AI instructions from toolkit [$(date +%Y-%m-%d)]"