nitm-ai-dev-toolkit 3.0.22 → 4.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 (67) hide show
  1. package/CHANGELOG.md +15 -2
  2. package/README.md +56 -4
  3. package/bin/cli.js +29 -14
  4. package/package.json +3 -2
  5. package/src/monorepo/.claude/commands/ponytail-audit.md +4 -6
  6. package/src/monorepo/.claude/commands/ponytail-debt.md +3 -5
  7. package/src/monorepo/.claude/commands/ponytail-gain.md +2 -4
  8. package/src/monorepo/.claude/commands/ponytail-help.md +2 -4
  9. package/src/monorepo/.claude/commands/ponytail-review.md +3 -5
  10. package/src/monorepo/.claude/commands/ponytail.md +3 -5
  11. package/src/monorepo/.claude/prompt-snippets/bootstrap-patch.md +37 -17
  12. package/src/monorepo/.claude/prompt-snippets/bootstrap-upgrade.md +76 -51
  13. package/src/monorepo/.claude/prompt-snippets/bootstrap.md +130 -94
  14. package/src/monorepo/.codex/config.toml +6 -0
  15. package/src/monorepo/.github/prompts/review-staged.prompt.md +1 -1
  16. package/src/monorepo/.opencode/agents/admin-portal.md +10 -4
  17. package/src/monorepo/.opencode/agents/api-specialist.md +10 -4
  18. package/src/monorepo/.opencode/agents/backend-architect.md +10 -4
  19. package/src/monorepo/.opencode/agents/documenter.md +10 -4
  20. package/src/monorepo/.opencode/agents/feature-builder.md +13 -5
  21. package/src/monorepo/.opencode/agents/frontend-developer.md +10 -4
  22. package/src/monorepo/.opencode/agents/green.md +10 -4
  23. package/src/monorepo/.opencode/agents/implementer.md +10 -4
  24. package/src/monorepo/.opencode/agents/planner.md +10 -4
  25. package/src/monorepo/.opencode/agents/red.md +10 -4
  26. package/src/monorepo/.opencode/agents/refactor.md +10 -4
  27. package/src/monorepo/.opencode/agents/researcher.md +10 -4
  28. package/src/monorepo/.opencode/agents/reviewer.md +10 -4
  29. package/src/monorepo/.opencode/agents/tdd.md +13 -5
  30. package/src/monorepo/.opencode/opencode.jsonc +8 -10
  31. package/src/monorepo/AGENTS.md +16 -0
  32. package/src/monorepo/CLAUDE.md +1 -1
  33. package/src/monorepo/README.md +22 -0
  34. package/src/repo/.claude/agents/documenter.agent.md +1 -1
  35. package/src/repo/.claude/agents/planner.agent.md +1 -1
  36. package/src/repo/.claude/agents/researcher.agent.md +1 -1
  37. package/src/repo/.claude/agents/reviewer.agent.md +1 -1
  38. package/src/repo/.claude/commands/ponytail-audit.md +4 -6
  39. package/src/repo/.claude/commands/ponytail-debt.md +3 -5
  40. package/src/repo/.claude/commands/ponytail-gain.md +2 -4
  41. package/src/repo/.claude/commands/ponytail-help.md +2 -4
  42. package/src/repo/.claude/commands/ponytail-review.md +3 -5
  43. package/src/repo/.claude/commands/ponytail.md +3 -5
  44. package/src/repo/.claude/prompt-snippets/bootstrap-patch.md +37 -17
  45. package/src/repo/.claude/prompt-snippets/bootstrap-upgrade.md +87 -77
  46. package/src/repo/.claude/prompt-snippets/bootstrap.md +129 -125
  47. package/src/repo/.codex/config.toml +6 -0
  48. package/src/repo/.opencode/agents/admin-portal.md +10 -4
  49. package/src/repo/.opencode/agents/api-specialist.md +10 -4
  50. package/src/repo/.opencode/agents/backend-architect.md +10 -4
  51. package/src/repo/.opencode/agents/documenter.md +10 -4
  52. package/src/repo/.opencode/agents/feature-builder.md +13 -5
  53. package/src/repo/.opencode/agents/frontend-developer.md +10 -4
  54. package/src/repo/.opencode/agents/green.md +10 -4
  55. package/src/repo/.opencode/agents/implementer.md +10 -4
  56. package/src/repo/.opencode/agents/planner.md +10 -4
  57. package/src/repo/.opencode/agents/red.md +10 -4
  58. package/src/repo/.opencode/agents/refactor.md +10 -4
  59. package/src/repo/.opencode/agents/researcher.md +10 -4
  60. package/src/repo/.opencode/agents/reviewer.md +10 -4
  61. package/src/repo/.opencode/agents/tdd.md +13 -5
  62. package/src/repo/.opencode/opencode.jsonc +8 -10
  63. package/src/repo/AGENTS.md +16 -0
  64. package/src/repo/CLAUDE.md +1 -1
  65. package/src/repo/README.md +22 -0
  66. package/src/monorepo/.opencode/plugins/ponytail.mjs +0 -93
  67. package/src/repo/.opencode/plugins/ponytail.mjs +0 -93
@@ -1,10 +1,16 @@
1
1
  ---
2
2
  description: "Write failing tests that define expected behavior. Part of the TDD red-green-refactor cycle."
3
3
  mode: subagent
4
- temperature: 0.1
5
- permission:
6
- edit: allow
7
- bash: allow
4
+ request:
5
+ body:
6
+ temperature: 0.1
7
+ permissions:
8
+ - action: edit
9
+ resource: "*"
10
+ effect: allow
11
+ - action: shell
12
+ resource: "*"
13
+ effect: allow
8
14
  ---
9
15
 
10
16
  # Red Agent (TDD — Write Failing Tests)
@@ -1,10 +1,16 @@
1
1
  ---
2
2
  description: "Improve code quality and structure while keeping all tests passing. Part of the TDD red-green-refactor cycle."
3
3
  mode: subagent
4
- temperature: 0.1
5
- permission:
6
- edit: allow
7
- bash: allow
4
+ request:
5
+ body:
6
+ temperature: 0.1
7
+ permissions:
8
+ - action: edit
9
+ resource: "*"
10
+ effect: allow
11
+ - action: shell
12
+ resource: "*"
13
+ effect: allow
8
14
  ---
9
15
 
10
16
  # Refactor Agent (TDD — Improve Code Quality)
@@ -1,10 +1,16 @@
1
1
  ---
2
2
  description: "Research codebase patterns, dependencies, and technical context. Analyze code structure, find relevant examples, and report findings without making changes."
3
3
  mode: subagent
4
- temperature: 0.1
5
- permission:
6
- edit: deny
7
- bash: deny
4
+ request:
5
+ body:
6
+ temperature: 0.1
7
+ permissions:
8
+ - action: edit
9
+ resource: "*"
10
+ effect: deny
11
+ - action: shell
12
+ resource: "*"
13
+ effect: deny
8
14
  ---
9
15
 
10
16
  # Researcher Agent
@@ -1,10 +1,16 @@
1
1
  ---
2
2
  description: "Review code changes for correctness, code quality, security, and adherence to project patterns. Provide actionable feedback with specific file and line references. Use immediately after writing or modifying code, or as a quality gate in orchestrated workflows."
3
3
  mode: subagent
4
- temperature: 0.1
5
- permission:
6
- edit: deny
7
- bash: allow
4
+ request:
5
+ body:
6
+ temperature: 0.1
7
+ permissions:
8
+ - action: edit
9
+ resource: "*"
10
+ effect: deny
11
+ - action: shell
12
+ resource: "*"
13
+ effect: allow
8
14
  ---
9
15
 
10
16
  # Reviewer Agent
@@ -1,11 +1,19 @@
1
1
  ---
2
2
  description: "Implement a feature using test-driven development with red-green-refactor cycle. Coordinates specialized subagents for writing failing tests, implementing code, and refactoring."
3
3
  mode: subagent
4
- temperature: 0.3
5
- permission:
6
- edit: allow
7
- bash: allow
8
- task: allow
4
+ request:
5
+ body:
6
+ temperature: 0.3
7
+ permissions:
8
+ - action: edit
9
+ resource: "*"
10
+ effect: allow
11
+ - action: shell
12
+ resource: "*"
13
+ effect: allow
14
+ - action: subagent
15
+ resource: "*"
16
+ effect: allow
9
17
  ---
10
18
 
11
19
  # TDD Coordinator Agent
@@ -5,17 +5,15 @@
5
5
  ".opencode/rules/*.md",
6
6
  ".agents/skills/orient-to-recent-work/SKILL.md"
7
7
  ],
8
- "skills": {
9
- "paths": [
10
- ".agents/skills/**/*.md",
11
- ".claude/skills/**/*.md"
12
- ]
13
- },
14
- "plugin": [
8
+ "skills": [
9
+ ".agents/skills",
10
+ ".claude/skills"
11
+ ],
12
+ "plugins": [
15
13
  "opencode-mem",
16
14
  "@tarquinen/opencode-dcp@latest",
17
- "@dietrichgebert/ponytail",
18
- "opentmux"
15
+ "@dietrichgebert/ponytail@4.12.0"
16
+ // "opentmux": V1-only; enable only after it supports V2.
19
17
  ],
20
18
  "lsp": true
21
- }
19
+ }
@@ -102,8 +102,24 @@ Each app has its own `AGENTS.md` with detailed patterns:
102
102
  - `{{APP_DIR}}/{{APP_NAME_1}}/AGENTS.md` - {{APP_1_DESCRIPTION}} patterns
103
103
  - `{{APP_DIR}}/{{APP_NAME_2}}/AGENTS.md` - {{APP_2_DESCRIPTION}} patterns
104
104
 
105
+ ## OpenCode V2 Context
106
+
107
+ OpenCode use with toolkit v4 requires native V2; Slim >=3.0.0 requires OpenCode >=2.0.7. Read [native setup](README.md#native-opencode-v2) before migration. All bootstrap flows run `opencode --version` before changes for confirmed OpenCode use: V1 must stop and upgrade OpenCode or remain on toolkit 3.x; missing/unparseable versions block OpenCode steps and toolkit 4.0.0 marking. Directory presence is not harness proof; other-harness-only setup is unaffected.
108
+
109
+ Use `agents`/`system`, `request.body.temperature`, ordered `permissions` (`action`/`resource`/`effect`, `shell`/`subagent`), `commands`, `plugins`, directory-based `skills`, and `mcp.servers`. Preserve user models/providers/plugins and Slim's separate strict schema; do not host-migrate its `prompt`/`permission`/`variant` fields or silently upgrade the separate external starter. Templates register the author's native V2 `@dietrichgebert/ponytail@4.12.0` locally instead of a bundled Ponytail plugin; `opentmux` stays commented as V1-only. Remove only known obsolete toolkit Ponytail `.js`/`.mjs`/`.ts` copies after backup and approval, preserve unrelated local plugins, and merge/deduplicate upstream registration locally without editing global config. No local API port or bridge is used; plugin/runtime integration is untested.
110
+
111
+ Ambient root/nested `AGENTS.md` works; config `instructions` entries do not load. `@refs` are ordinary text: explicitly read linked snippets. `request.body.temperature` remains in config, but the current runner does not send it. Preserve `lsp: true`; use workspace lint/typecheck/compiler commands, not unavailable V2 LSP diagnostics. Back up V1 before native conversion; converted files are incompatible with V1. Activate on the next run/restart.
112
+
105
113
  ## Detailed Instructions
106
114
 
115
+ ### Native Codex
116
+
117
+ Codex-scoped installs include `.github/instructions/` and `.claude/rules-snippets/` solely as AGENTS-linked standards and their wrapper sources. Read them as references when relevant, not as automatically loaded Codex rules or evidence of Copilot/Claude use; other harness command, agent, and config directories are excluded from `--env codex`.
118
+
119
+ Codex uses root and more-specific app/package `AGENTS.md` instructions and `.agents/skills/` natively. Read linked standards when relevant rather than assuming tool-specific rules are auto-loaded. Optional `.codex/config.toml` is comment-only and preserves inherited defaults; project config loads only after explicit user trust. Do not grant self-trust, change security/model/feature defaults, translate Claude frontmatter into Codex agents, or activate MCP servers automatically. Codex MCP uses native `[mcp_servers.name]` TOML, not `.mcp.json`.
120
+
121
+ For npm setup, read and follow `.nitm/BOOTSTRAP.md`. If manually copied and `.nitm/` is absent, read `.claude/prompt-snippets/bootstrap.md` as a task document; `/bootstrap` is not a native Codex command. Determine the actual harness from runtime information or ask; scaffold directories alone do not establish use. Named custom-agent examples below apply only to harnesses that support their formats; in Codex, use workflow skills and only available native delegation capabilities.
122
+
107
123
  Detailed standards are split into focused instruction files in `.github/instructions/`:
108
124
 
109
125
  | Instruction File | Description |
@@ -59,5 +59,5 @@
59
59
  - Commands are in `.opencode/commands/`.
60
60
  - Rules are in `.opencode/rules/`.
61
61
  - Agents are in `.opencode/agents/`.
62
- - Instructions are loaded from `AGENTS.md`, `.github/instructions/`, and `.claude/rules/`.
62
+ - Native V2 loads ambient `AGENTS.md`, not config `instructions` entries. Explicitly read referenced snippets (`@refs` are ordinary text, not attachments). See [OpenCode setup](README.md#native-opencode-v2).
63
63
  - Skills are loaded from `.agents/skills/` and `.claude/skills/`.
@@ -50,6 +50,28 @@ This is a monorepo managed with {{BUILD_SYSTEM}}.
50
50
 
51
51
  ## Getting Started
52
52
 
53
+ ### Native OpenCode V2
54
+
55
+ Toolkit v4 requires **OpenCode V2 (major >=2)** for OpenCode use; oh-my-opencode-slim >=3.0.0 requires OpenCode >=2.0.7. Bootstrap, patch, and upgrade run `opencode --version` before changes (optional leading `v` accepted). V1 must stop before OpenCode customization/migration or marking toolkit 4.0.0: upgrade OpenCode or remain on toolkit 3.x. A missing CLI or unparseable version stops OpenCode steps and version marking until confirmed/installed. Confirm harness use from runtime evidence or ask, not scaffold directories; other-harness-only setup is unaffected.
56
+
57
+ The template's local `plugins` array registers the author's native V2 package `@dietrichgebert/ponytail@4.12.0`, alongside `opencode-mem` and `@tarquinen/opencode-dcp@latest`; `opentmux` remains commented as V1-only. The obsolete local Ponytail plugin is no longer bundled; no local API port or bridge is used. For existing projects, back up and obtain approval before removing only known toolkit `.opencode/plugins/ponytail.js`, `.mjs`, or `.ts` copies; preserve unrelated local plugins and merge/deduplicate upstream registration locally without editing global plugins. Native local plugins are discovered automatically; do not register them twice.
58
+
59
+ With approval, merge `"plugins": ["oh-my-opencode-slim@3.0.0"]` locally without replacing other registrations. Slim's separate strict schema retains `prompt`, `permission`, and `variant`; do not host-migrate it. The external starter is a separate package, not automatically upgraded. Plugin/runtime integration has not been tested.
60
+
61
+ Use native `agents`/`system`, `request.body.temperature`, ordered `permissions` (`action`/`resource`/`effect`, `shell`/`subagent`), `commands`/`subagent`, `plugins` with `{ "package": "…", "options": {} }`, skill-directory arrays, and `mcp.servers` with inverse `disabled` and `timeout.catalog`/`timeout.execution`. Follow the [V2 migration guide](https://opencode.ai/v2/docs/migrate-v1) and [plugin guide](https://opencode.ai/v2/docs/build/plugins); the published schema may describe V1 and is not V2 validation authority.
62
+
63
+ Ambient root/nested `AGENTS.md` works; config `instructions` entries are not loaded. `@refs` are ordinary text: read linked snippets explicitly. `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).
64
+
65
+ `--env opencode` supplies minimal shared references without activating other harnesses. Back up V1, merge rather than clobber models/providers/plugins, and activate on the next run/restart. Native-converted files are incompatible with V1. Verify with installed V2; `doctor` is not runtime validation. Toolkit 4.0.0 publishing has not been executed.
66
+
67
+ ### Native Codex
68
+
69
+ `--env codex` includes `.codex/`, `.agents/`, and shared context, plus `.github/instructions/` and `.claude/rules-snippets/` solely to supply AGENTS-linked standards and their wrapper source content. No other harness command, agent, or config directories are installed; these references do not establish Copilot/Claude use or load automatically as Codex rules. Other harness scopes are unchanged.
70
+
71
+ Codex reads root/nested `AGENTS.md` instructions and `.agents/skills/` natively. The optional comment-only `.codex/config.toml` preserves inherited defaults and is loaded only after explicit user trust; it does not grant trust or activate MCP servers. Codex MCP uses native `[mcp_servers.name]` TOML, not `.mcp.json`.
72
+
73
+ For npm setup, ask Codex to read and follow `.nitm/BOOTSTRAP.md`. For manual copies without `.nitm/`, provide `.claude/prompt-snippets/bootstrap.md` as a task document (copy the shared snippets too). For AI-guided updates, provide `.claude/prompt-snippets/bootstrap-patch.md`. Toolkit slash commands and other tools' custom-agent formats are not native Codex commands or agent definitions. Bootstrap must identify the actual running harness or ask, not infer it from scaffolded directories.
74
+
53
75
  ### Prerequisites
54
76
 
55
77
  - Node.js {{NODE_VERSION}}
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: "Documenter"
3
3
  description: "Analyze codebases and create comprehensive documentation. Use for AGENTS.md, README files, API docs, architecture documentation, and onboarding guides."
4
- tools: ["Read", "Grep", "Write", "Edit", "Bash(*)"]
4
+ tools: ["Read", "Grep", "Write"]
5
5
  user-invocable: true
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: "Planner"
3
3
  description: "Break down feature requests into implementation tasks. Read specifications, analyze codebase patterns, and produce structured plans with dependencies."
4
- tools: ["Read", "Grep", "Write", "Bash(*)"]
4
+ tools: ["Read", "Grep", "Write"]
5
5
  user-invocable: true
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: "Researcher"
3
3
  description: "Research codebase patterns, dependencies, and technical context. Analyze code structure, find relevant examples, and report findings without making changes."
4
- tools: ["Read", "Grep"]
4
+ tools: ["Read", "Grep", "Write"]
5
5
  user-invocable: true
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: "Reviewer"
3
3
  description: "Review code changes for correctness, code quality, security, and adherence to project patterns. Provide actionable feedback with specific file and line references. Use immediately after writing or modifying code, or as a quality gate in orchestrated workflows."
4
- tools: ["Read", "Grep", "Bash(*)"]
4
+ tools: ["Read", "Grep", "Write", "Bash(*)"]
5
5
  user-invocable: true
6
6
  ---
7
7
 
@@ -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).
@@ -1,11 +1,19 @@
1
1
  # Bootstrap Patch
2
2
 
3
- Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repository and apply any updated, new, or missing guidance to this project.
3
+ Fetch supported toolkit v4.x templates from the ai-assisted-dev-toolkit repository's `v4.x` branch and merge updated, new, or missing guidance into this project.
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.
4
12
 
5
13
  ## Orchestrator Checkpoint
6
14
 
7
15
  > **🛑 Before starting**: This command involves fetching, diffing, and applying changes across many files.
8
- > Dispatch parallel subagents for independent file groups (rules, commands, prompts, instructions, skills, agents).
16
+ > Complete Step 1's source/version gates before dispatching parallel diff agents for independent file groups (rules, commands, prompts, instructions, skills, agents).
9
17
  > See `.claude/rules-snippets/subagent-workflow.md` for patterns.
10
18
 
11
19
  ## Usage
@@ -19,15 +27,22 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
19
27
 
20
28
  ## Process
21
29
 
30
+ **Codex invocation and scope:** `/bootstrap-patch` is not a native Codex command. Ask Codex to read and follow this snippet as a task document. Identify the actual harness from session/runtime evidence or ask; scaffold directories do not prove use. Codex targets `AGENTS.md`, relevant nested instructions, `.agents/skills/`, and optional `.codex/config.toml`. Include `.github/instructions/` and `.claude/rules-snippets/` solely as AGENTS-linked standards and their wrapper sources for Codex-scoped installs, not automatically loaded rules or evidence of Copilot/Claude use. Only include other harness command, agent, and config categories when those harnesses are confirmed in use.
31
+
32
+ **Codex merge guardrails:** preserve existing TOML and inherited user defaults. The shipped `.codex/config.toml` is comment-only; parse it as TOML, do not add model/provider, approval, sandbox, security, feature, self-trust, or active MCP settings. Project config is loaded only after explicit user trust. MCP uses native `[mcp_servers.name]` TOML, not `.mcp.json`; do not migrate or activate servers automatically. Claude/Copilot frontmatter and OpenCode permission blocks are not Codex agent definitions; no Codex custom-agent format is shipped here.
33
+
22
34
  1. **Fetch Latest Templates**:
23
35
 
24
- Clone or fetch the latest ai-assisted-dev-toolkit templates:
36
+ Fetch only the supported `v4.x` source branch:
25
37
 
26
38
  ```bash
39
+ set -e
27
40
  TOOLKIT_TEMP=$(mktemp -d)
28
- git clone --depth 1 https://github.com/ninjasitm/ai-assisted-dev-toolkit.git "$TOOLKIT_TEMP"
41
+ git clone --depth 1 --branch v4.x https://github.com/ninjasitm/ai-assisted-dev-toolkit.git "$TOOLKIT_TEMP"
29
42
  ```
30
43
 
44
+ **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.
45
+
31
46
  Determine the correct source path based on project structure:
32
47
  - **Single repo**: Use `$TOOLKIT_TEMP/src/repo/`
33
48
  - **Monorepo**: Use `$TOOLKIT_TEMP/src/monorepo/`
@@ -40,9 +55,11 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
40
55
 
41
56
  Check for a `.toolkit-version` file in the project root:
42
57
  - If exists: Read the version string (e.g., `2.0.10`, `3.0.0`)
43
- - If missing: Assume legacy version (pre-3.0.0)
58
+ - If missing: Verify the installed version or legacy state with the user; absence alone does not prove a pre-3.0 installation
59
+
60
+ 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.
44
61
 
45
- Read the toolkit's version from `$TOOLKIT_TEMP/.toolkit-version` to compare.
62
+ **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.
46
63
 
47
64
  **Version Comparison:**
48
65
  - **Same version**: No structural changes expected
@@ -65,6 +82,7 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
65
82
  | **Claude Agents** | `.claude/agents/*.agent.md` | `src/{type}/.claude/agents/*.agent.md` |
66
83
  | **Skills** | `.agents/skills/*/SKILL.md` | `src/{type}/.agents/skills/*/SKILL.md` |
67
84
  | **AGENTS.md** | `AGENTS.md` | `src/{type}/AGENTS.md` |
85
+ | **Codex Config** | `.codex/config.toml` | `src/{type}/.codex/config.toml` |
68
86
  | **CLAUDE.md** | `CLAUDE.md` | `src/{type}/CLAUDE.md` |
69
87
  | **Claude Rules Snippets** | `.claude/rules-snippets/*.md` | `src/{type}/.claude/rules-snippets/*.md` |
70
88
  | **Claude Prompt Snippets** | `.claude/prompt-snippets/*.md` | `src/{type}/.claude/prompt-snippets/*.md` |
@@ -73,20 +91,20 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
73
91
  | **OpenCode Commands** | `.opencode/commands/*.md` | `src/{type}/.opencode/commands/*.md` |
74
92
  | **OpenCode Rules** | `.opencode/rules/*.md` | `src/{type}/.opencode/rules/*.md` |
75
93
  | **OpenCode Agents** | `.opencode/agents/*.md` | `src/{type}/.opencode/agents/*.md` |
76
- | **OpenCode Plugins** | `.opencode/plugins/*.mjs` | `src/{type}/.opencode/plugins/*.mjs` |
94
+ | **OpenCode Local Plugins** | `.opencode/plugins/*.{js,mjs,ts}` | Inventory only; preserve unrelated plugins |
77
95
  | **Hooks** | `hooks/*.{js,sh,ps1}` | `src/{type}/hooks/*.{js,sh,ps1}` |
78
96
  | **Agent Rules** | `.agents/rules/*.md` | `src/{type}/.agents/rules/*.md` |
79
- | **Toolkit Version** | `.toolkit-version` | `.toolkit-version` (root of toolkit) |
80
-
81
- **⚠️ OpenCode `opencode.jsonc` Schema Validation:**
82
-
83
- 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.
97
+ | **Toolkit Version** | `.toolkit-version` | `package.json` `version` (toolkit root) |
84
98
 
85
- **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`
99
+ **OpenCode native V2 merge checks (confirmed OpenCode use only):**
86
100
 
87
- **Do NOT add** keys like `rules`, `agents`, `commands`, `prompts` as top-level keys — OpenCode uses the `.opencode/` directory structure and `instructions` array instead.
101
+ 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.
88
102
 
89
- > **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.
103
+ - 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`.
104
+ - 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.
105
+ - **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.
106
+ - `instructions` entries are accepted but not loaded; ambient `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 project lint/typecheck/compiler commands (no V2 LSP tools/diagnostics currently).
107
+ - `--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.
90
108
 
91
109
  3. **Diff Analysis** (parallelizable — dispatch one subagent per category):
92
110
 
@@ -97,7 +115,7 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
97
115
  - **📝 Updated**: Exists in both but template has newer content → candidate for merge
98
116
  - **✅ Current**: Exists in both and content matches → no action needed
99
117
  - **🔧 Customized**: Exists in both, project version has non-placeholder customizations → careful merge
100
- - **⚠️ Missing in Template**: Exists in project but not in template → project-specific, keep as-is
118
+ - **⚠️ Missing in Template**: Exists in project but not in template → project-specific, keep as-is except the approved obsolete toolkit Ponytail removal above
101
119
 
102
120
  b. **For updated files, generate a structured diff**:
103
121
  - Preserve project-specific `{{PLACEHOLDER}}` replacements (already-bootstrapped values)
@@ -157,7 +175,9 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
157
175
  a. **New files**: Copy directly from template
158
176
  b. **Updated files (no customization)**: Replace with template version
159
177
  c. **Updated files (customized)**: Apply structural additions while preserving project values
160
- d. **Git commit**: Stage and commit all changes with message:
178
+ 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.
179
+ 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).
180
+ f. **Git commit**: Stage and commit all changes with message:
161
181
  ```bash
162
182
  git add -A
163
183
  git commit -m "chore: patch AI instructions from toolkit [$(date +%Y-%m-%d)]"