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.
- package/CHANGELOG.md +44 -3
- package/README.md +93 -6
- package/bin/cli.js +155 -25
- package/bin/factory-archive.js +71 -0
- package/bin/factory-prune.js +79 -0
- package/bin/factory-watch.js +509 -0
- package/package.json +1 -1
- package/src/monorepo/.agents/skills/factory/SKILL.md +593 -0
- package/src/monorepo/.claude/agents/admin-portal.agent.md +1 -1
- package/src/monorepo/.claude/agents/api-specialist.agent.md +1 -1
- package/src/monorepo/.claude/agents/backend-architect.agent.md +1 -1
- package/src/monorepo/.claude/agents/documenter.agent.md +1 -1
- package/src/monorepo/.claude/agents/factory-approver.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-builder.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-reviewer-code.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-reviewer-security.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-reviewer-ui.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-reviewer-ux.agent.md +12 -0
- package/src/monorepo/.claude/agents/factory-spec-writer.agent.md +12 -0
- package/src/monorepo/.claude/agents/feature-builder.agent.md +1 -1
- package/src/monorepo/.claude/agents/frontend-developer.agent.md +1 -1
- package/src/monorepo/.claude/agents/green.agent.md +1 -1
- package/src/monorepo/.claude/agents/implementer.agent.md +1 -1
- package/src/monorepo/.claude/agents/planner.agent.md +1 -1
- package/src/monorepo/.claude/agents/red.agent.md +1 -1
- package/src/monorepo/.claude/agents/refactor.agent.md +1 -1
- package/src/monorepo/.claude/agents/researcher.agent.md +1 -1
- package/src/monorepo/.claude/agents/reviewer.agent.md +1 -1
- package/src/monorepo/.claude/agents/tdd.agent.md +1 -1
- package/src/monorepo/.claude/agents-snippets/factory-approver.md +72 -0
- package/src/monorepo/.claude/agents-snippets/factory-builder.md +101 -0
- package/src/monorepo/.claude/agents-snippets/factory-reviewer-code.md +57 -0
- package/src/monorepo/.claude/agents-snippets/factory-reviewer-security.md +48 -0
- package/src/monorepo/.claude/agents-snippets/factory-reviewer-ui.md +64 -0
- package/src/monorepo/.claude/agents-snippets/factory-reviewer-ux.md +64 -0
- package/src/monorepo/.claude/agents-snippets/factory-spec-writer.md +119 -0
- package/src/monorepo/.claude/agents-snippets/feature-builder.md +1 -1
- package/src/monorepo/.claude/commands/factory.md +24 -0
- package/src/monorepo/.claude/commands/ponytail-audit.md +4 -6
- package/src/monorepo/.claude/commands/ponytail-debt.md +3 -5
- package/src/monorepo/.claude/commands/ponytail-gain.md +2 -4
- package/src/monorepo/.claude/commands/ponytail-help.md +2 -4
- package/src/monorepo/.claude/commands/ponytail-review.md +3 -5
- package/src/monorepo/.claude/commands/ponytail.md +3 -5
- package/src/monorepo/.claude/prompt-snippets/assign-tasks.md +6 -2
- package/src/monorepo/.claude/prompt-snippets/bootstrap-patch.md +32 -17
- package/src/monorepo/.claude/prompt-snippets/bootstrap-upgrade.md +76 -51
- package/src/monorepo/.claude/prompt-snippets/bootstrap.md +57 -29
- package/src/monorepo/.claude/prompt-snippets/factory.md +20 -0
- package/src/monorepo/.claude/prompt-snippets/implement-feature.md +2 -2
- package/src/monorepo/.claude/prompt-snippets/tasks.md +49 -87
- package/src/monorepo/.claude/rules-snippets/documentation.md +8 -6
- package/src/monorepo/.cursor/agents/factory-approver.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-builder.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-reviewer-code.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-reviewer-security.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-reviewer-ui.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-reviewer-ux.agent.md +11 -0
- package/src/monorepo/.cursor/agents/factory-spec-writer.agent.md +11 -0
- package/src/monorepo/.cursor/commands/factory.md +24 -0
- package/src/monorepo/.github/agents/factory-approver.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-builder.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-reviewer-code.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-reviewer-security.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-reviewer-ui.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-reviewer-ux.agent.md +11 -0
- package/src/monorepo/.github/agents/factory-spec-writer.agent.md +11 -0
- package/src/monorepo/.github/prompts/factory.prompt.md +25 -0
- package/src/monorepo/.github/prompts/review-staged.prompt.md +1 -1
- package/src/monorepo/.opencode/agents/admin-portal.md +10 -4
- package/src/monorepo/.opencode/agents/api-specialist.md +10 -4
- package/src/monorepo/.opencode/agents/backend-architect.md +10 -4
- package/src/monorepo/.opencode/agents/documenter.md +10 -4
- package/src/monorepo/.opencode/agents/factory-approver.md +20 -0
- package/src/monorepo/.opencode/agents/factory-builder.md +20 -0
- package/src/monorepo/.opencode/agents/factory-reviewer-code.md +20 -0
- package/src/monorepo/.opencode/agents/factory-reviewer-security.md +20 -0
- package/src/monorepo/.opencode/agents/factory-reviewer-ui.md +20 -0
- package/src/monorepo/.opencode/agents/factory-reviewer-ux.md +20 -0
- package/src/monorepo/.opencode/agents/factory-spec-writer.md +20 -0
- package/src/monorepo/.opencode/agents/feature-builder.md +13 -5
- package/src/monorepo/.opencode/agents/frontend-developer.md +10 -4
- package/src/monorepo/.opencode/agents/green.md +10 -4
- package/src/monorepo/.opencode/agents/implementer.md +10 -4
- package/src/monorepo/.opencode/agents/planner.md +10 -4
- package/src/monorepo/.opencode/agents/red.md +10 -4
- package/src/monorepo/.opencode/agents/refactor.md +10 -4
- package/src/monorepo/.opencode/agents/researcher.md +10 -4
- package/src/monorepo/.opencode/agents/reviewer.md +10 -4
- package/src/monorepo/.opencode/agents/tdd.md +13 -5
- package/src/monorepo/.opencode/commands/factory.md +29 -0
- package/src/monorepo/.opencode/opencode.jsonc +8 -10
- package/src/monorepo/AGENTS.md +30 -1
- package/src/monorepo/CLAUDE.md +1 -1
- package/src/monorepo/README.md +20 -0
- package/src/monorepo/factory/README.md +194 -0
- package/src/monorepo/factory/_gitignore +5 -0
- package/src/repo/.agents/skills/factory/SKILL.md +593 -0
- package/src/repo/.claude/agents/admin-portal.agent.md +1 -1
- package/src/repo/.claude/agents/api-specialist.agent.md +1 -1
- package/src/repo/.claude/agents/backend-architect.agent.md +1 -1
- package/src/repo/.claude/agents/documenter.agent.md +2 -2
- package/src/repo/.claude/agents/factory-approver.agent.md +12 -0
- package/src/repo/.claude/agents/factory-builder.agent.md +12 -0
- package/src/repo/.claude/agents/factory-reviewer-code.agent.md +12 -0
- package/src/repo/.claude/agents/factory-reviewer-security.agent.md +12 -0
- package/src/repo/.claude/agents/factory-reviewer-ui.agent.md +12 -0
- package/src/repo/.claude/agents/factory-reviewer-ux.agent.md +12 -0
- package/src/repo/.claude/agents/factory-spec-writer.agent.md +12 -0
- package/src/repo/.claude/agents/feature-builder.agent.md +1 -1
- package/src/repo/.claude/agents/frontend-developer.agent.md +1 -1
- package/src/repo/.claude/agents/green.agent.md +1 -1
- package/src/repo/.claude/agents/implementer.agent.md +1 -1
- package/src/repo/.claude/agents/planner.agent.md +2 -2
- package/src/repo/.claude/agents/red.agent.md +1 -1
- package/src/repo/.claude/agents/refactor.agent.md +1 -1
- package/src/repo/.claude/agents/researcher.agent.md +2 -2
- package/src/repo/.claude/agents/reviewer.agent.md +2 -2
- package/src/repo/.claude/agents/tdd.agent.md +1 -1
- package/src/repo/.claude/agents-snippets/factory-approver.md +72 -0
- package/src/repo/.claude/agents-snippets/factory-builder.md +100 -0
- package/src/repo/.claude/agents-snippets/factory-reviewer-code.md +57 -0
- package/src/repo/.claude/agents-snippets/factory-reviewer-security.md +48 -0
- package/src/repo/.claude/agents-snippets/factory-reviewer-ui.md +64 -0
- package/src/repo/.claude/agents-snippets/factory-reviewer-ux.md +64 -0
- package/src/repo/.claude/agents-snippets/factory-spec-writer.md +117 -0
- package/src/repo/.claude/agents-snippets/feature-builder.md +1 -1
- package/src/repo/.claude/commands/factory.md +24 -0
- package/src/repo/.claude/commands/ponytail-audit.md +4 -6
- package/src/repo/.claude/commands/ponytail-debt.md +3 -5
- package/src/repo/.claude/commands/ponytail-gain.md +2 -4
- package/src/repo/.claude/commands/ponytail-help.md +2 -4
- package/src/repo/.claude/commands/ponytail-review.md +3 -5
- package/src/repo/.claude/commands/ponytail.md +3 -5
- package/src/repo/.claude/prompt-snippets/assign-tasks.md +6 -2
- package/src/repo/.claude/prompt-snippets/bootstrap-patch.md +32 -17
- package/src/repo/.claude/prompt-snippets/bootstrap-upgrade.md +87 -77
- package/src/repo/.claude/prompt-snippets/bootstrap.md +71 -74
- package/src/repo/.claude/prompt-snippets/factory.md +20 -0
- package/src/repo/.claude/prompt-snippets/implement-feature.md +2 -2
- package/src/repo/.claude/prompt-snippets/tasks.md +49 -112
- package/src/repo/.cursor/agents/factory-approver.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-builder.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-reviewer-code.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-reviewer-security.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-reviewer-ui.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-reviewer-ux.agent.md +11 -0
- package/src/repo/.cursor/agents/factory-spec-writer.agent.md +11 -0
- package/src/repo/.cursor/commands/factory.md +24 -0
- package/src/repo/.github/agents/factory-approver.agent.md +11 -0
- package/src/repo/.github/agents/factory-builder.agent.md +11 -0
- package/src/repo/.github/agents/factory-reviewer-code.agent.md +11 -0
- package/src/repo/.github/agents/factory-reviewer-security.agent.md +11 -0
- package/src/repo/.github/agents/factory-reviewer-ui.agent.md +11 -0
- package/src/repo/.github/agents/factory-reviewer-ux.agent.md +11 -0
- package/src/repo/.github/agents/factory-spec-writer.agent.md +11 -0
- package/src/repo/.github/prompts/factory.prompt.md +25 -0
- package/src/repo/.opencode/agents/admin-portal.md +10 -4
- package/src/repo/.opencode/agents/api-specialist.md +10 -4
- package/src/repo/.opencode/agents/backend-architect.md +10 -4
- package/src/repo/.opencode/agents/documenter.md +10 -4
- package/src/repo/.opencode/agents/factory-approver.md +20 -0
- package/src/repo/.opencode/agents/factory-builder.md +20 -0
- package/src/repo/.opencode/agents/factory-reviewer-code.md +20 -0
- package/src/repo/.opencode/agents/factory-reviewer-security.md +20 -0
- package/src/repo/.opencode/agents/factory-reviewer-ui.md +20 -0
- package/src/repo/.opencode/agents/factory-reviewer-ux.md +20 -0
- package/src/repo/.opencode/agents/factory-spec-writer.md +20 -0
- package/src/repo/.opencode/agents/feature-builder.md +13 -5
- package/src/repo/.opencode/agents/frontend-developer.md +10 -4
- package/src/repo/.opencode/agents/green.md +10 -4
- package/src/repo/.opencode/agents/implementer.md +10 -4
- package/src/repo/.opencode/agents/planner.md +10 -4
- package/src/repo/.opencode/agents/red.md +10 -4
- package/src/repo/.opencode/agents/refactor.md +10 -4
- package/src/repo/.opencode/agents/researcher.md +10 -4
- package/src/repo/.opencode/agents/reviewer.md +10 -4
- package/src/repo/.opencode/agents/tdd.md +13 -5
- package/src/repo/.opencode/commands/factory.md +29 -0
- package/src/repo/.opencode/opencode.jsonc +8 -10
- package/src/repo/AGENTS.md +27 -1
- package/src/repo/CLAUDE.md +1 -1
- package/src/repo/README.md +20 -0
- package/src/repo/factory/README.md +194 -0
- package/src/repo/factory/_gitignore +5 -0
- package/src/monorepo/.opencode/plugins/ponytail.mjs +0 -93
- package/src/repo/.opencode/plugins/ponytail.mjs +0 -93
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
# Bootstrap Upgrade — Monorepo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Upgrade this monorepo to toolkit 4.0.0, including native OpenCode V2 for confirmed OpenCode users. For pre-3.0 installations, also migrate inline content to snippet-based architecture. Only modify confirmed harness targets; preserve unrelated harness/Codex behavior.
|
|
4
|
+
|
|
5
|
+
## OpenCode version preflight (before any changes)
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
- 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`.
|
|
9
|
+
- 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.
|
|
10
|
+
- 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.
|
|
11
|
+
- 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.
|
|
12
|
+
|
|
13
|
+
## Toolkit version routing (before parallel dispatch)
|
|
14
|
+
|
|
15
|
+
Read `.toolkit-version` and select the route before dispatching agents or changing files; apply only confirmed harness scopes:
|
|
16
|
+
|
|
17
|
+
- **>=4.0.0**: Use bootstrap-patch and **STOP** this upgrade without rewrites or version marking.
|
|
18
|
+
- **v3 (`3.x`)**: **Skip Steps 2–6 and 8–10.** Run only the relevant native OpenCode migration in Step 7 (confirmed OpenCode use only), then applicable approved merge/validation/version/report steps 11–15. Preserve existing snippet bodies/frontmatter and unrelated harness files.
|
|
19
|
+
- **Pre-3.0 or missing marker**: Steps 2–6 and applicable approved legacy steps 8–10 require a verified legacy inline installation. A missing marker alone is not legacy evidence; if snippets already exist or the installed version cannot be verified, **STOP** and ask rather than extracting/rewriting them. Back up before legacy conversion and preserve existing customizations.
|
|
20
|
+
- **Invalid or unverified version**: **STOP** and ask; never guess a route or downgrade.
|
|
21
|
+
|
|
22
|
+
## OpenCode migration guardrails
|
|
23
|
+
|
|
24
|
+
Back up V1; native-converted files are incompatible with V1. Preserve models/providers/user-global plugins. Templates register the author's native V2 package `@dietrichgebert/ponytail@4.12.0`; obsolete toolkit-local Ponytail copies are replaced only after backup and approval (Step 7), with no API port or bridge. Keep `opentmux` commented as V1-only. Only with approval, merge pinned `"plugins": ["oh-my-opencode-slim@3.0.0"]` locally without replacing other registrations. Slim's separate strict schema retains `prompt`/`permission`/`variant`; do not host-migrate it or silently upgrade the separate external starter. Activate on the next run/restart; plugin/runtime integration is untested and publishing 4.0.0 has not been executed.
|
|
4
25
|
|
|
5
26
|
## Orchestrator Checkpoint
|
|
6
27
|
|
|
7
28
|
> **🛑 Before starting**: This command involves reading, extracting, and rewriting many files across multiple directories.
|
|
8
|
-
>
|
|
9
|
-
> Steps 3-6 can run in parallel per directory. Steps 7-15 are sequential.
|
|
29
|
+
> Complete version routing above before parallel dispatch; only the verified legacy route may dispatch Steps 3–6, for confirmed harnesses. Applicable Steps 7–15 are sequential.
|
|
10
30
|
|
|
11
31
|
## Usage
|
|
12
32
|
|
|
@@ -25,9 +45,7 @@ Migrate this monorepo's AI instruction files from the pre-3.0 inline pattern to
|
|
|
25
45
|
|
|
26
46
|
1. **Confirm monorepo structure**: Verify `apps/` and `packages/` directories exist at root. If not, abort and suggest using the single-repo upgrade command instead.
|
|
27
47
|
|
|
28
|
-
2. **Check existing version**:
|
|
29
|
-
- If version is `>= 3.0.0` and snippet directories exist → **abort**: "Already on v3.0+. No migration needed."
|
|
30
|
-
- If version is `< 3.0.0` or missing → proceed.
|
|
48
|
+
2. **Check existing version**: Apply the route selected above; inventory and confirm only its applicable steps and confirmed harness targets.
|
|
31
49
|
|
|
32
50
|
3. **Detect build system** (for CLAUDE.md update in Step 10):
|
|
33
51
|
- `turbo.json` → Turborepo
|
|
@@ -53,17 +71,17 @@ Migrate this monorepo's AI instruction files from the pre-3.0 inline pattern to
|
|
|
53
71
|
5. **Present summary and ask for confirmation**:
|
|
54
72
|
|
|
55
73
|
```markdown
|
|
56
|
-
|
|
74
|
+
## 🔄 Monorepo Upgrade: toolkit v4.0.0
|
|
57
75
|
|
|
58
|
-
|
|
76
|
+
**Selected route**: verified legacy | v3 native OpenCode
|
|
59
77
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- Write `.toolkit-version` with `
|
|
78
|
+
### What will change (omit skipped steps for the selected route)
|
|
79
|
+
|
|
80
|
+
- Verified legacy only: create missing snippet directories, extract inline content from {{N}} files, and convert confirmed harness wrappers (Steps 2–6)
|
|
81
|
+
- Confirmed OpenCode only: merge native V2 host files and approved missing wrappers (Step 7)
|
|
82
|
+
- Verified legacy only: approved hook installation and verified identical duplicate skill cleanup (Steps 8–10); preserve custom skills
|
|
83
|
+
- Merge only applicable missing documentation and validate the selected route; v3 keeps existing snippet bodies/frontmatter unchanged
|
|
84
|
+
- Write `.toolkit-version` with `4.0.0` after the approved migration
|
|
67
85
|
|
|
68
86
|
### Monorepo-specific changes
|
|
69
87
|
|
|
@@ -76,6 +94,8 @@ Migrate this monorepo's AI instruction files from the pre-3.0 inline pattern to
|
|
|
76
94
|
|
|
77
95
|
### Step 2: Create Snippet Directories
|
|
78
96
|
|
|
97
|
+
**Steps 2–6 are verified-legacy-only.** Skip this entire block for v3; never extract or rewrite existing snippet bodies/frontmatter. Process only confirmed harness targets.
|
|
98
|
+
|
|
79
99
|
Create these directories if they don't exist:
|
|
80
100
|
|
|
81
101
|
```bash
|
|
@@ -233,27 +253,29 @@ Follow the rules defined in [.claude/rules-snippets/{{NAME}}.md](../../.claude/r
|
|
|
233
253
|
2. If no matching snippet: extract body → create `.claude/agents-snippets/<name>.md`
|
|
234
254
|
3. Replace body with thin wrapper referencing `../../.claude/agents-snippets/{{NAME}}.md`
|
|
235
255
|
|
|
236
|
-
### Step 7: Create .opencode/ Directory
|
|
256
|
+
### Step 7: Create .opencode/ Directory (confirmed OpenCode use only)
|
|
257
|
+
|
|
258
|
+
For the v3 route, merge only relevant native OpenCode host fields; preserve existing wrapper bodies, modes, unrelated frontmatter, and shared snippet bodies/frontmatter. The wrapper examples below apply only to approved missing files, not replacement of existing wrappers.
|
|
237
259
|
|
|
238
|
-
1.
|
|
260
|
+
1. Merge `.opencode/opencode.jsonc` using native V2 fields:
|
|
239
261
|
|
|
240
262
|
```json
|
|
241
263
|
{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
"lsp": true
|
|
264
|
+
"$schema": "https://opencode.ai/config.json",
|
|
265
|
+
"instructions": ["AGENTS.md", ".opencode/rules/*.md"],
|
|
266
|
+
"skills": [".agents/skills"],
|
|
267
|
+
"plugins": ["@dietrichgebert/ponytail@4.12.0"],
|
|
268
|
+
"lsp": true
|
|
248
269
|
}
|
|
249
270
|
```
|
|
250
271
|
|
|
251
|
-
|
|
272
|
+
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; do not use it or a V1 API fetch as native V2 validation authority. Use `agents`/JSON `system` (Markdown bodies for file agents), `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`.
|
|
252
273
|
|
|
253
|
-
|
|
274
|
+
`instructions` entries are accepted but not loaded; ambient root/nested `AGENTS.md` works. `@refs` are ordinary text, not attachments: wrappers must explicitly tell agents to read referenced 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 current V2 LSP tools/diagnostics). `--env opencode` supplies minimal shared references without other harness activation. Verify using installed V2 after the next run/restart; report only checks actually run.
|
|
254
275
|
|
|
255
|
-
2. **
|
|
256
|
-
-
|
|
276
|
+
2. **Replace obsolete toolkit Ponytail (backup and approval only)**:
|
|
277
|
+
- Back up the local config and known obsolete toolkit-owned `.opencode/plugins/ponytail.js`, `.opencode/plugins/ponytail.mjs`, and `.opencode/plugins/ponytail.ts` copies; obtain approval before removing only those copies. Preserve unrelated local plugins.
|
|
278
|
+
- Merge/deduplicate the author's native V2 `@dietrichgebert/ponytail@4.12.0` package in the local `plugins` array where appropriate, preserving other registrations/options. Do not edit global config or overwrite global plugins. Keep `opentmux` commented as V1-only; do not copy local Ponytail source, port APIs, or introduce bridges. Native local discovery needs no duplicate explicit registration; runtime integration remains untested.
|
|
257
279
|
|
|
258
280
|
3. Create `.opencode/commands/*.md` — one thin wrapper per `.claude/commands/*.md`:
|
|
259
281
|
|
|
@@ -265,7 +287,7 @@ Follow the rules defined in [.claude/rules-snippets/{{NAME}}.md](../../.claude/r
|
|
|
265
287
|
|
|
266
288
|
# {{TITLE}}
|
|
267
289
|
|
|
268
|
-
|
|
290
|
+
Read and follow `.claude/prompt-snippets/{{NAME}}.md` before executing this command.
|
|
269
291
|
```
|
|
270
292
|
|
|
271
293
|
4. Create `.opencode/rules/*.md` — one thin wrapper per `.claude/rules/*.md`:
|
|
@@ -273,7 +295,7 @@ Follow the rules defined in [.claude/rules-snippets/{{NAME}}.md](../../.claude/r
|
|
|
273
295
|
```markdown
|
|
274
296
|
# {{TITLE}}
|
|
275
297
|
|
|
276
|
-
|
|
298
|
+
Read and follow `.claude/rules-snippets/{{NAME}}.md` when these standards apply.
|
|
277
299
|
```
|
|
278
300
|
|
|
279
301
|
5. Create `.opencode/agents/*.md` — one thin wrapper per `.claude/agents/*.agent.md`:
|
|
@@ -286,7 +308,7 @@ Follow the rules defined in [.claude/rules-snippets/{{NAME}}.md](../../.claude/r
|
|
|
286
308
|
|
|
287
309
|
# {{AGENT_NAME}}
|
|
288
310
|
|
|
289
|
-
|
|
311
|
+
Read and follow `.claude/agents-snippets/{{NAME}}.md` before performing this role.
|
|
290
312
|
```
|
|
291
313
|
|
|
292
314
|
### Step 8: Install Pre-Commit Hook
|
|
@@ -317,16 +339,14 @@ Use `git commit --no-verify` to bypass.
|
|
|
317
339
|
|
|
318
340
|
### Step 10: Clean Up Duplicate Skills
|
|
319
341
|
|
|
320
|
-
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
- If directory exists, remove all subdirectories except `README.md`
|
|
325
|
-
3. Remove any nested duplicates: `subagent-driven-development/subagent-driven-development/`
|
|
342
|
+
- Merge approved `.agents/rules/*.md` additions without overwriting custom content; skip this step on the v3 route.
|
|
343
|
+
- Preserve custom, unmatched, modified, and nested skill content; name or location alone does not prove duplication.
|
|
344
|
+
- A candidate in a confirmed harness skill directory may be removed only after the same-name canonical `.agents/skills/<skill-name>/` copy exists and a complete recursive comparison (`diff -qr` or equivalent, including nested content) proves them identical. Missing canonical copy, differences, or comparison errors mean preserve and report, not delete.
|
|
345
|
+
- Back up the verified identical duplicate and obtain explicit approval before removing only that duplicate; keep the canonical copy intact. No bulk deletion or name/location-based nested cleanup.
|
|
326
346
|
|
|
327
347
|
### Step 11: Update CLAUDE.md
|
|
328
348
|
|
|
329
|
-
|
|
349
|
+
If `CLAUDE.md` is an applicable confirmed harness target, merge only missing relevant sections; preserve existing bodies/frontmatter:
|
|
330
350
|
|
|
331
351
|
1. **Multi-tool sections** — add if missing:
|
|
332
352
|
- GitHub Copilot section (references `.github/instructions/`, `.github/prompts/`, `.github/agents/`)
|
|
@@ -354,32 +374,37 @@ Read the existing `CLAUDE.md` and add missing sections:
|
|
|
354
374
|
- `.cursor/rules/*.mdc` → `.claude/rules-snippets/`
|
|
355
375
|
- `.cursor/commands/*.md` → `.claude/prompt-snippets/`
|
|
356
376
|
- `.cursor/agents/*.agent.md` → `.claude/agents-snippets/`
|
|
357
|
-
- `.opencode/{commands,rules,agents}/*.md` →
|
|
377
|
+
- `.opencode/{commands,rules,agents}/*.md` → explicit read instructions for `.claude/{snippet-type}/` (no automatic `@ref` attachment)
|
|
358
378
|
```
|
|
359
379
|
|
|
360
380
|
### Step 12: Create .toolkit-version File
|
|
361
381
|
|
|
362
|
-
Write `
|
|
382
|
+
Write `4.0.0` to `.toolkit-version` only after the approved migration and OpenCode preflight pass (or OpenCode is confirmed out of scope).
|
|
363
383
|
|
|
364
384
|
### Step 13: Validation
|
|
365
385
|
|
|
366
|
-
Run
|
|
386
|
+
Run only checks applicable to the selected route and confirmed harnesses (parallelizable); on v3 compare retained snippet bodies/frontmatter to backups:
|
|
367
387
|
|
|
368
388
|
1. **Snippet completeness**: Every `.md` file in `.claude/rules-snippets/`, `.claude/prompt-snippets/`, `.claude/agents-snippets/` must have content (not empty)
|
|
369
389
|
2. **Thin wrapper correctness**: Every thin wrapper must contain a reference to its snippet with the correct relative path
|
|
370
390
|
3. **Monorepo `paths:` preserved**: For files that had `paths:` frontmatter in `.claude/rules/`, verify the snippet also contains `paths:`
|
|
371
391
|
4. **No lost placeholders**: Scan all snippet files — any `{{` in original must appear in snippet
|
|
372
392
|
5. **No broken paths**: Verify all relative paths resolve correctly (e.g., `../rules-snippets/` from `.claude/rules/`)
|
|
393
|
+
6. **Custom skills preserved**: Only approved verified identical duplicates were removed; canonical copies and custom, unmatched, and nested content remain
|
|
373
394
|
|
|
374
395
|
If `--verbose`: log each check result.
|
|
375
396
|
|
|
376
397
|
### Step 14: Generate Upgrade Report
|
|
377
398
|
|
|
399
|
+
Include only operations/checks actually performed for the selected route; omit legacy extraction/cleanup rows on v3 and never pre-mark skipped checks as passed.
|
|
400
|
+
|
|
378
401
|
```markdown
|
|
379
|
-
## ✅ Monorepo Upgrade Complete:
|
|
402
|
+
## ✅ Monorepo Upgrade Complete: v4.0.0
|
|
380
403
|
|
|
381
404
|
### Build System: {{BUILD_SYSTEM}}
|
|
382
405
|
|
|
406
|
+
**Selected route**: verified legacy | v3 native OpenCode
|
|
407
|
+
|
|
383
408
|
### Directories Created
|
|
384
409
|
|
|
385
410
|
| Directory | Files |
|
|
@@ -410,22 +435,22 @@ If `--verbose`: log each check result.
|
|
|
410
435
|
| File | Purpose |
|
|
411
436
|
| -------------------------- | -------------------------- |
|
|
412
437
|
| `.opencode/opencode.jsonc` | OpenCode configuration |
|
|
413
|
-
| `.toolkit-version` | Version tracking (`
|
|
438
|
+
| `.toolkit-version` | Version tracking (`4.0.0`) |
|
|
414
439
|
|
|
415
440
|
### Validation Results
|
|
416
441
|
|
|
417
442
|
| Check | Status |
|
|
418
443
|
| ------------------------------ | ------------------------------------------ |
|
|
419
|
-
| Snippet completeness |
|
|
420
|
-
| Thin wrapper references |
|
|
421
|
-
| `paths:` frontmatter preserved |
|
|
422
|
-
| No lost placeholders |
|
|
423
|
-
| No broken paths |
|
|
444
|
+
| Snippet completeness | Report actual applicable checks |
|
|
445
|
+
| Thin wrapper references | Report actual applicable checks |
|
|
446
|
+
| `paths:` frontmatter preserved | Report actual checks; v3 snippets unchanged |
|
|
447
|
+
| No lost placeholders | Report actual `{{VAR}}` preservation checks |
|
|
448
|
+
| No broken paths | Report actual applicable checks |
|
|
424
449
|
|
|
425
450
|
### Cleanup
|
|
426
451
|
|
|
427
|
-
- Removed
|
|
428
|
-
-
|
|
452
|
+
- Removed only verified identical duplicates after comparison, backup, and approval (if performed)
|
|
453
|
+
- Preserved custom, unmatched, and nested skill content and canonical `.agents/skills/` copies
|
|
429
454
|
|
|
430
455
|
### Next Steps
|
|
431
456
|
|
|
@@ -439,7 +464,7 @@ If `--verbose`: log each check result.
|
|
|
439
464
|
|
|
440
465
|
```bash
|
|
441
466
|
git add -A
|
|
442
|
-
git commit -m "chore: upgrade AI instructions to toolkit
|
|
467
|
+
git commit -m "chore: upgrade AI instructions to toolkit v4.0.0"
|
|
443
468
|
```
|
|
444
469
|
|
|
445
470
|
## Error Handling
|
|
@@ -447,7 +472,7 @@ git commit -m "chore: upgrade AI instructions to toolkit v3.0.0 (snippet archite
|
|
|
447
472
|
- If a `.claude/rules/*.md` file is already a thin wrapper (< 20 lines with a snippet reference), skip it
|
|
448
473
|
- If `.github/instructions/*.instructions.md` already references `.claude/rules-snippets/`, skip it
|
|
449
474
|
- If a snippet file already exists with content, do not overwrite — log a warning
|
|
450
|
-
- If `.opencode/` already exists,
|
|
475
|
+
- If `.opencode/` already exists, add missing files and propose native V2 conversion of existing host files; preserve customizations and skip files already migrated
|
|
451
476
|
|
|
452
477
|
## Notes
|
|
453
478
|
|
|
@@ -2,6 +2,14 @@ You are helping to bootstrap AI instructions for this monorepo by analyzing the
|
|
|
2
2
|
|
|
3
3
|
> **Merge, don't clobber.** If a target file already exists and carries project-specific content — customized agents, rules, skills, or `{{PLACEHOLDER}}` values already replaced — preserve it. Add missing structure; never overwrite a customized file with template defaults. When a template change conflicts with an existing customization, merge the addition and flag it for the user rather than replacing the file. For incremental updates after the first bootstrap, prefer `/bootstrap-patch`, which is purpose-built for meticulous merging.
|
|
4
4
|
|
|
5
|
+
## OpenCode version preflight (before any changes)
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
- 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`.
|
|
9
|
+
- 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.
|
|
10
|
+
- 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.
|
|
11
|
+
- 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.
|
|
12
|
+
|
|
5
13
|
## Harness selection and native Codex targets
|
|
6
14
|
|
|
7
15
|
**Codex:** `/bootstrap` is not a native Codex command. For npm installs, ask Codex to read and follow `.nitm/BOOTSTRAP.md`. For manually copied templates without `.nitm/`, ask it to read and follow `.claude/prompt-snippets/bootstrap.md` as a task document.
|
|
@@ -41,19 +49,28 @@ You are helping to bootstrap AI instructions for this monorepo by analyzing the
|
|
|
41
49
|
|
|
42
50
|
2. **Infer Root-Level Variables**:
|
|
43
51
|
|
|
44
|
-
| Variable
|
|
45
|
-
|
|
|
46
|
-
| `{{PROJECT_NAME}}`
|
|
47
|
-
| `{{PROJECT_DESCRIPTION}}`
|
|
48
|
-
| `{{LANGUAGE}}`
|
|
49
|
-
| `{{PACKAGE_MANAGER}}`
|
|
50
|
-
| `{{
|
|
51
|
-
| `{{
|
|
52
|
-
| `{{
|
|
53
|
-
| `{{
|
|
54
|
-
| `{{
|
|
55
|
-
| `{{
|
|
56
|
-
| `{{
|
|
52
|
+
| Variable | How to Infer |
|
|
53
|
+
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| `{{PROJECT_NAME}}` | Root config name or directory name |
|
|
55
|
+
| `{{PROJECT_DESCRIPTION}}` | Root config description |
|
|
56
|
+
| `{{LANGUAGE}}` | Detected ecosystem |
|
|
57
|
+
| `{{PACKAGE_MANAGER}}` | Lock file or config (pnpm, composer, dotnet, etc.) |
|
|
58
|
+
| `{{SETUP_COMMAND}}` | Root install from the lock file (`pnpm install --frozen-lockfile`, `npm ci`, `yarn install --immutable`); a root `setup` script wins if present |
|
|
59
|
+
| `{{BUILD_SYSTEM}}` | Build tool (Turborepo, Nx, MSBuild, Maven, etc.) |
|
|
60
|
+
| `{{DEFAULT_BRANCH}}` | `git symbolic-ref --short refs/remotes/origin/HEAD`, minus `origin/`; else `main` |
|
|
61
|
+
| `{{TEST_FRAMEWORK}}` | Common test framework across packages |
|
|
62
|
+
| `{{DEV_COMMAND}}` | Root dev script or task (`turbo run dev`, `nx run-many -t serve`) |
|
|
63
|
+
| `{{DEV_PORT_FLAG}}` | Port flag or env var the root dev command passes to apps (`--port <port>`, `PORT=<port>`); check each app config. Ask if none |
|
|
64
|
+
| `{{TEST_COMMAND}}` | Root test script or task (`turbo run test`, `nx run-many -t test`) |
|
|
65
|
+
| `{{LINT_COMMAND}}` | Root lint script or task (`turbo run lint`, `nx run-many -t lint`) |
|
|
66
|
+
| `{{BUILD_COMMAND}}` | Root build script or task (`turbo run build`, `nx run-many -t build`) |
|
|
67
|
+
| `{{ISSUE_TRACKER}}` | Detected project management tool |
|
|
68
|
+
| `{{PM_URL}}` | Project management URL (if applicable) |
|
|
69
|
+
| `{{PROJECT_KEY}}` | Project/workspace ID (if applicable) |
|
|
70
|
+
| `{{PM_ISSUE_KEY}}` | Issue key format (e.g., PROJ-###, #42) |
|
|
71
|
+
| `{{FACTORY_PORT_BASE}}` | Default `5100` |
|
|
72
|
+
| `{{APPROVAL_MODE}}` | Default `human` |
|
|
73
|
+
| `{{FACTORY_REVIEW_LENSES}}` | Default `code, security`; add `ux, ui` only if the project has a UI and a browser tool is configured (for example a browser MCP server) |
|
|
57
74
|
|
|
58
75
|
3. **Analyze Apps**:
|
|
59
76
|
|
|
@@ -133,6 +150,8 @@ You are helping to bootstrap AI instructions for this monorepo by analyzing the
|
|
|
133
150
|
|
|
134
151
|
7. **Update Template Files**:
|
|
135
152
|
|
|
153
|
+
For confirmed OpenCode use, complete the Ponytail pre-activation cleanup below before customizing OpenCode files or marking the migration complete.
|
|
154
|
+
|
|
136
155
|
**Root Level:**
|
|
137
156
|
- `AGENTS.md` (include project management section)
|
|
138
157
|
- `.agents/skills/*/SKILL.md` (shared native skills, including Codex)
|
|
@@ -148,27 +167,36 @@ You are helping to bootstrap AI instructions for this monorepo by analyzing the
|
|
|
148
167
|
- `.claude/rules-snippets/*.md` (rules content — source of truth)
|
|
149
168
|
- `.claude/prompt-snippets/*.md` (prompt content — source of truth)
|
|
150
169
|
- `.claude/agents-snippets/*.md` (agent definitions — source of truth)
|
|
151
|
-
- `.opencode/opencode.jsonc` (OpenCode configuration —
|
|
170
|
+
- `.opencode/opencode.jsonc` (OpenCode configuration — see native V2 checks below)
|
|
152
171
|
- `.opencode/commands/*.md` (OpenCode commands)
|
|
153
172
|
- `.opencode/rules/*.md` (OpenCode rules)
|
|
154
173
|
- `.opencode/agents/*.md` (OpenCode agents)
|
|
155
174
|
- `.toolkit-version` (version tracking)
|
|
156
175
|
- `CLAUDE.md` (if it contains placeholders)
|
|
157
176
|
|
|
158
|
-
|
|
177
|
+
**OpenCode native V2 checks (only for confirmed OpenCode use):**
|
|
178
|
+
|
|
179
|
+
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, not V1 API/schema fetches. The published schema may describe V1; do not reject native plural keys based on it.
|
|
159
180
|
|
|
160
|
-
|
|
181
|
+
- After the version preflight passes, use `agents`/JSON `system` (Markdown bodies for file agents), `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`.
|
|
182
|
+
- Back up V1; native-converted files are incompatible with V1. Merge rather than clobber models/providers/user-global plugins. Only with approval, merge pinned `"plugins": ["oh-my-opencode-slim@3.0.0"]` locally. Slim's separate strict schema retains `prompt`/`permission`/`variant`; do not host-migrate it or silently upgrade the separate external starter.
|
|
183
|
+
- Templates register the author's native V2 package `@dietrichgebert/ponytail@4.12.0` locally; no local Ponytail source is bundled or ported. Keep `opentmux` commented as V1-only. Native local discovery needs no duplicate registration; do not introduce API ports or bridges or claim tested runtime integration.
|
|
184
|
+
- Config `instructions` entries are 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).
|
|
185
|
+
- `--env opencode` supplies minimal shared references without other harness activation. Activate on the next run/restart; report only checks actually run with installed V2. Scaffold/placeholder checks are not runtime validation; publishing 4.0.0 has not been executed.
|
|
161
186
|
|
|
162
|
-
**
|
|
187
|
+
**Ponytail pre-activation cleanup (confirmed OpenCode use only):**
|
|
163
188
|
|
|
164
|
-
|
|
189
|
+
1. In this bootstrap flow, inspect `.opencode/plugins/ponytail.js`, `.opencode/plugins/ponytail.mjs`, and `.opencode/plugins/ponytail.ts` for existing-target leftovers. Verify obsolete toolkit ownership from contents/provenance, not filename alone; absent paths need no deletion. Preserve unrelated/custom plugins and global config.
|
|
190
|
+
2. Back up the local config and verified obsolete toolkit copies, obtain explicit removal approval, then remove ONLY those copies. Do not automatically delete files in the CLI or remove custom plugins.
|
|
191
|
+
3. With approval, merge/deduplicate upstream `@dietrichgebert/ponytail@4.12.0` registration locally where appropriate, preserving other registrations/options and leaving global config untouched. No API port or bridge.
|
|
192
|
+
4. If any present copy's ownership or safe removal is unverified, or required removal approval is denied, **STOP OpenCode activation and migration completion**; leave `.toolkit-version` unchanged and report blocked, not complete. Proceed/restart only after this gate passes; runtime integration remains untested.
|
|
165
193
|
|
|
166
194
|
**Create Toolkit Version File:**
|
|
167
195
|
|
|
168
|
-
Create a `.toolkit-version` file in the project root with the current toolkit version:
|
|
196
|
+
Create a `.toolkit-version` file in the project root with the current toolkit version only after the OpenCode preflight and Ponytail cleanup gate pass (or OpenCode is confirmed out of scope):
|
|
169
197
|
|
|
170
198
|
```
|
|
171
|
-
|
|
199
|
+
4.0.0
|
|
172
200
|
```
|
|
173
201
|
|
|
174
202
|
This file enables `bootstrap-patch` to detect version changes and apply migrations automatically.
|
|
@@ -251,9 +279,9 @@ For multi-app monorepos with different frameworks, list all with app context (e.
|
|
|
251
279
|
|
|
252
280
|
#### Agent Tool & Permission Calibration
|
|
253
281
|
|
|
254
|
-
The `tools:` block (Claude Code, GitHub Copilot) and `
|
|
282
|
+
The `tools:` block (Claude Code, GitHub Copilot) and ordered `permissions:` rules (OpenCode V2) must match each agent's role **and** the detected project. Inspect actual defaults before proposing changes; calibrate without over-provisioning.
|
|
255
283
|
|
|
256
|
-
**Codex native calibration:** customize project instructions and skills, not Claude/Copilot `tools:` frontmatter or OpenCode `
|
|
284
|
+
**Codex native calibration:** customize project instructions and skills, not Claude/Copilot `tools:` frontmatter or OpenCode `permissions:` rules. This toolkit ships no Codex custom-agent format. Use only delegation capabilities actually available in the running harness; do not generate agent files from this table or change native security settings to simulate per-role tool gating.
|
|
257
285
|
|
|
258
286
|
**1. Capability baseline per role** — what the agent functionally needs:
|
|
259
287
|
|
|
@@ -268,22 +296,22 @@ The `tools:` block (Claude Code, GitHub Copilot) and `permission:` block (OpenCo
|
|
|
268
296
|
|
|
269
297
|
**2. Translate the baseline to each platform's syntax:**
|
|
270
298
|
|
|
271
|
-
| Capability | Claude Code | GitHub Copilot | OpenCode (`
|
|
299
|
+
| Capability | Claude Code | GitHub Copilot | OpenCode (`permissions:` rule) | Cursor |
|
|
272
300
|
| ------------------ | --------------- | -------------------------------------- | ------------------------ | ------- |
|
|
273
301
|
| read | `Read` | `read` | default | default |
|
|
274
302
|
| search | `Grep` | `search` | default | default |
|
|
275
|
-
| write / edit files | `Write`, `Edit` | `edit` | `edit: allow`
|
|
276
|
-
| terminal | `Bash(*)` | `runInTerminal`, `terminalLastCommand` | `
|
|
277
|
-
| spawn subagents | `agent` | n/a | `
|
|
303
|
+
| write / edit files | `Write`, `Edit` | `edit` | `{action: edit, resource: "*", effect: allow}` | default |
|
|
304
|
+
| terminal | `Bash(*)` | `runInTerminal`, `terminalLastCommand` | `{action: shell, resource: "*", effect: allow}` | default |
|
|
305
|
+
| spawn subagents | `agent` | n/a | `{action: subagent, resource: "*", effect: allow}` | default |
|
|
278
306
|
|
|
279
307
|
> **Cursor note:** these templates declare no `tools:` field, so Cursor subagents inherit the full default toolset. Read-only intent (Researcher, Reviewer) is enforced by the agent's instructions, not tool gating. If your Cursor version supports per-agent tool restriction, add a `tools:` field to match the baseline.
|
|
280
308
|
|
|
281
309
|
**3. Project-driven adjustments** (widen or narrow from the baseline):
|
|
282
310
|
|
|
283
|
-
- **Planner** —
|
|
284
|
-
- **Documenter** —
|
|
311
|
+
- **Planner** — Persisted plans need write + terminal. If Copilot is read-only (`["read","search"]`), widen to the baseline. If Claude lacks `Bash(*)`, add it for `git log` / test discovery. For OpenCode, inspect ordered rules and propose `edit`/`shell` allows only when missing and approved.
|
|
312
|
+
- **Documenter** — Needs edit for docs, terminal for doc generators. If Claude omits `Edit`/`Bash(*)`, propose them. For OpenCode, inspect ordered `edit`/`shell` rules against this baseline, not presumed legacy defaults.
|
|
285
313
|
- **Researcher** — Must stay read-only on every platform. The Claude Code default currently grants `Write` — **remove it** (`["Read","Grep"]`).
|
|
286
|
-
- **Reviewer** — Read + terminal only; never grant write/edit.
|
|
314
|
+
- **Reviewer** — Read + terminal only; never grant write/edit. OpenCode ordered rules should allow `shell` and deny `edit` for this baseline. If Claude grants `Write`, remove it (keep `Bash(*)`).
|
|
287
315
|
- **Worker agents** (Planner, Implementer, Red, Green, Refactor) — in a monorepo keep `user-invocable: false`; they are coordinator-dispatched only.
|
|
288
316
|
|
|
289
317
|
**4. Apply:** for each agent file (`.claude/agents/*.agent.md`, `.github/agents/*.agent.md`, `.opencode/agents/*.md`), compare the declared tools/permissions to the calibrated baseline and adjust. List the changes, then confirm before applying.
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
---
|
|
4
|
+
|
|
5
|
+
You are the factory orchestrator for this session. Arguments: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
Follow the [factory orchestrator skill](../../.agents/skills/factory/SKILL.md) exactly. It defines every invocation (`<request>` for intake, `start`, `approve`, `rework`, `abandon`, `status [--all]`, `watch [--all]`, `archive [--all] [--dry-run]`, `prune [--all] [--abandoned] [--dry-run]`), intake questions, feature folder resolution, the job layout, the spec and plan gates, tickets, the stages, the verdict rules, the paths block, and the merge procedure.
|
|
8
|
+
|
|
9
|
+
Ground rules:
|
|
10
|
+
|
|
11
|
+
- Run the orchestrator in this session. Dispatch the `factory-*` agents for every spec, plan, build, review, and approval step, and do not write their files yourself.
|
|
12
|
+
- Only write `job.json`, `intake.md`, `spec-<k>.md`, `plan-<k>.md`, `rework-<k>.md`, the escalation `decision.md`, `merge-conflict.md`, the ticket keys in `tasks.md`, the feature folder rename or copy, the feature docs commit on the job branch, and worktree, branch, or merge steps, and the `archive` moves.
|
|
13
|
+
- Intake asks in chat before any folder, job, or spec exists. Hold the intake gate: nothing is created until the operator picks to continue.
|
|
14
|
+
- Hold the spec gate and the plan gate: nothing is planned, ticketed, or built until the operator confirms in chat. The spec cannot be confirmed while a `[PRODUCT DECISION]` item is open.
|
|
15
|
+
- `--in-place` on the command, or the operator saying in place, builds in the main checkout instead of a worktree. Only a new job takes it.
|
|
16
|
+
- `abandon <job-id>` closes a job without merging it. Ask first when an agent may still be running.
|
|
17
|
+
- Never push. Merges stay local.
|
|
18
|
+
- `archive` moves closed jobs only, to `factory/archive/`. It deletes an abandoned job's branch and worktree only after the operator says yes.
|
|
19
|
+
- `prune` permanently deletes closed jobs from `factory/jobs/` and `factory/archive/`, after one confirmation in chat: merged jobs by default, and abandoned jobs too with `--abandoned`. It never touches an open job or `docs/features/`.
|
|
20
|
+
- If `$ARGUMENTS` is empty, show the invocation list from the skill and ask which one the user wants.
|
|
@@ -56,7 +56,7 @@ Implement a feature by completing tasks sequentially with proper tracking.
|
|
|
56
56
|
|
|
57
57
|
c. **Implement (TDD required)**:
|
|
58
58
|
|
|
59
|
-
- Follow acceptance criteria
|
|
59
|
+
- Follow the acceptance criteria in `spec.md` for this task's deliverable
|
|
60
60
|
- Use patterns from `AGENTS.md`
|
|
61
61
|
- **Write a failing test first** — one behavior per test, clear name, real code
|
|
62
62
|
- **Verify it fails** — watch it fail for the right reason (feature missing, not error)
|
|
@@ -79,7 +79,7 @@ Implement a feature by completing tasks sequentially with proper tracking.
|
|
|
79
79
|
git commit -m "feat({{SCOPE}}): {{DESCRIPTION}}"
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
f. **Mark Task Complete
|
|
82
|
+
f. **Mark Task Complete**: tick `- [x]` for the task in `tasks.md`
|
|
83
83
|
|
|
84
84
|
5. **Post-Implementation Review**:
|
|
85
85
|
- Dispatch **Reviewer** agent on all changes before proceeding
|