nitm-ai-dev-toolkit 3.0.23 → 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.
- package/CHANGELOG.md +7 -2
- package/README.md +33 -2
- package/bin/cli.js +4 -1
- package/package.json +1 -1
- 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/bootstrap-patch.md +32 -17
- package/src/monorepo/.claude/prompt-snippets/bootstrap-upgrade.md +76 -51
- package/src/monorepo/.claude/prompt-snippets/bootstrap.md +35 -16
- 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/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/opencode.jsonc +8 -10
- package/src/monorepo/AGENTS.md +8 -0
- package/src/monorepo/CLAUDE.md +1 -1
- package/src/monorepo/README.md +14 -0
- package/src/repo/.claude/agents/documenter.agent.md +1 -1
- package/src/repo/.claude/agents/planner.agent.md +1 -1
- package/src/repo/.claude/agents/researcher.agent.md +1 -1
- package/src/repo/.claude/agents/reviewer.agent.md +1 -1
- 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/bootstrap-patch.md +32 -17
- package/src/repo/.claude/prompt-snippets/bootstrap-upgrade.md +87 -77
- package/src/repo/.claude/prompt-snippets/bootstrap.md +41 -54
- 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/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/opencode.jsonc +8 -10
- package/src/repo/AGENTS.md +8 -0
- package/src/repo/CLAUDE.md +1 -1
- package/src/repo/README.md +14 -0
- package/src/monorepo/.opencode/plugins/ponytail.mjs +0 -93
- package/src/repo/.opencode/plugins/ponytail.mjs +0 -93
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Review changes for over-engineering
|
|
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
|
-
|
|
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
|
|
3
|
+
allowed-tools: "Read, Grep"
|
|
4
4
|
argument-hint: "optional level (lite/full/ultra/off)"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
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
|
|
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
|
-
>
|
|
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
|
|
@@ -25,13 +33,16 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
|
|
|
25
33
|
|
|
26
34
|
1. **Fetch Latest Templates**:
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
Fetch only the supported `v4.x` source branch:
|
|
29
37
|
|
|
30
38
|
```bash
|
|
39
|
+
set -e
|
|
31
40
|
TOOLKIT_TEMP=$(mktemp -d)
|
|
32
|
-
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"
|
|
33
42
|
```
|
|
34
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
|
+
|
|
35
46
|
Determine the correct source path based on project structure:
|
|
36
47
|
- **Single repo**: Use `$TOOLKIT_TEMP/src/repo/`
|
|
37
48
|
- **Monorepo**: Use `$TOOLKIT_TEMP/src/monorepo/`
|
|
@@ -44,9 +55,11 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
|
|
|
44
55
|
|
|
45
56
|
Check for a `.toolkit-version` file in the project root:
|
|
46
57
|
- If exists: Read the version string (e.g., `2.0.10`, `3.0.0`)
|
|
47
|
-
- If missing:
|
|
58
|
+
- If missing: Verify the installed version or legacy state with the user; absence alone does not prove a pre-3.0 installation
|
|
48
59
|
|
|
49
|
-
Read the toolkit's version from `$TOOLKIT_TEMP
|
|
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.
|
|
61
|
+
|
|
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.
|
|
50
63
|
|
|
51
64
|
**Version Comparison:**
|
|
52
65
|
- **Same version**: No structural changes expected
|
|
@@ -78,20 +91,20 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
|
|
|
78
91
|
| **OpenCode Commands** | `.opencode/commands/*.md` | `src/{type}/.opencode/commands/*.md` |
|
|
79
92
|
| **OpenCode Rules** | `.opencode/rules/*.md` | `src/{type}/.opencode/rules/*.md` |
|
|
80
93
|
| **OpenCode Agents** | `.opencode/agents/*.md` | `src/{type}/.opencode/agents/*.md` |
|
|
81
|
-
| **OpenCode Plugins**
|
|
94
|
+
| **OpenCode Local Plugins** | `.opencode/plugins/*.{js,mjs,ts}` | Inventory only; preserve unrelated plugins |
|
|
82
95
|
| **Hooks** | `hooks/*.{js,sh,ps1}` | `src/{type}/hooks/*.{js,sh,ps1}` |
|
|
83
96
|
| **Agent Rules** | `.agents/rules/*.md` | `src/{type}/.agents/rules/*.md` |
|
|
84
|
-
| **Toolkit Version** | `.toolkit-version` |
|
|
85
|
-
|
|
86
|
-
**⚠️ OpenCode `opencode.jsonc` Schema Validation:**
|
|
87
|
-
|
|
88
|
-
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) |
|
|
89
98
|
|
|
90
|
-
**
|
|
99
|
+
**OpenCode native V2 merge checks (confirmed OpenCode use only):**
|
|
91
100
|
|
|
92
|
-
|
|
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.
|
|
93
102
|
|
|
94
|
-
|
|
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.
|
|
95
108
|
|
|
96
109
|
3. **Diff Analysis** (parallelizable — dispatch one subagent per category):
|
|
97
110
|
|
|
@@ -102,7 +115,7 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
|
|
|
102
115
|
- **📝 Updated**: Exists in both but template has newer content → candidate for merge
|
|
103
116
|
- **✅ Current**: Exists in both and content matches → no action needed
|
|
104
117
|
- **🔧 Customized**: Exists in both, project version has non-placeholder customizations → careful merge
|
|
105
|
-
- **⚠️ 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
|
|
106
119
|
|
|
107
120
|
b. **For updated files, generate a structured diff**:
|
|
108
121
|
- Preserve project-specific `{{PLACEHOLDER}}` replacements (already-bootstrapped values)
|
|
@@ -162,7 +175,9 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
|
|
|
162
175
|
a. **New files**: Copy directly from template
|
|
163
176
|
b. **Updated files (no customization)**: Replace with template version
|
|
164
177
|
c. **Updated files (customized)**: Apply structural additions while preserving project values
|
|
165
|
-
d. **
|
|
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:
|
|
166
181
|
```bash
|
|
167
182
|
git add -A
|
|
168
183
|
git commit -m "chore: patch AI instructions from toolkit [$(date +%Y-%m-%d)]"
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
# Bootstrap Upgrade to
|
|
1
|
+
# Bootstrap Upgrade to v4.0
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Upgrade 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 and clean up duplicate skills. 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
|
## Usage
|
|
6
27
|
|
|
@@ -17,7 +38,7 @@ One-time migration from pre-3.0 inline pattern to 3.0+ snippet-based architectur
|
|
|
17
38
|
## Orchestrator Checkpoint
|
|
18
39
|
|
|
19
40
|
> **🛑 Before starting**: This command modifies files across 5+ directory trees (`.claude/`, `.github/`, `.cursor/`, `.opencode/`, `.agents/`).
|
|
20
|
-
>
|
|
41
|
+
> Complete version routing above before parallel dispatch; only the verified legacy route may dispatch Steps 3–6, for confirmed harnesses.
|
|
21
42
|
> See `.claude/rules-snippets/subagent-workflow.md` for patterns.
|
|
22
43
|
|
|
23
44
|
## Process
|
|
@@ -30,33 +51,25 @@ Run all checks before making any changes:
|
|
|
30
51
|
- If `apps/` and `packages/` directories exist at root → `monorepo` (use `src/monorepo/` templates)
|
|
31
52
|
- Otherwise → `repo` (use `src/repo/` templates)
|
|
32
53
|
|
|
33
|
-
2. **Check toolkit version**:
|
|
34
|
-
- If `.toolkit-version` exists and contains `3.0.0` or higher → **abort** with message: "Project already on v3.0+. Run `/bootstrap-patch` for incremental updates."
|
|
35
|
-
- If `.toolkit-version` exists with a version below `3.0.0` → migration needed
|
|
36
|
-
- If `.toolkit-version` is missing → migration needed (legacy project)
|
|
54
|
+
2. **Check toolkit version**: Apply the route selected above; inventory and confirm only its applicable steps and confirmed harness targets.
|
|
37
55
|
|
|
38
56
|
3. **Confirm migration scope**:
|
|
39
57
|
|
|
40
58
|
```markdown
|
|
41
|
-
## 🔄 Bootstrap Upgrade:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
8. Install project hooks (runtime hooks and ponytail support)
|
|
56
|
-
9. Clean up duplicate skill directories
|
|
57
|
-
10. Update `CLAUDE.md` with multi-tool sections
|
|
58
|
-
11. Create `.toolkit-version` with `3.0.0`
|
|
59
|
-
12. Commit all changes
|
|
59
|
+
## 🔄 Bootstrap Upgrade: toolkit v4.0.0
|
|
60
|
+
|
|
61
|
+
**Project type**: repo | monorepo
|
|
62
|
+
**Current version**: <version or "none (legacy)">
|
|
63
|
+
**Selected route**: verified legacy | v3 native OpenCode
|
|
64
|
+
|
|
65
|
+
### What will happen (omit skipped steps for the selected route):
|
|
66
|
+
|
|
67
|
+
1. Verified legacy only: create missing snippet directories, extract inline content, and convert confirmed harness wrappers (Steps 2–6)
|
|
68
|
+
2. Confirmed OpenCode only: merge native V2 host files and approved missing wrappers (Step 7)
|
|
69
|
+
3. Verified legacy only: approved hook installation and verified identical duplicate skill cleanup (Steps 8–10); preserve custom skills
|
|
70
|
+
4. Merge only applicable missing documentation and validate the selected route; v3 keeps existing snippet bodies/frontmatter unchanged
|
|
71
|
+
5. Create `.toolkit-version` with `4.0.0` after the approved migration
|
|
72
|
+
6. Commit all changes
|
|
60
73
|
|
|
61
74
|
Proceed? (Y/n)
|
|
62
75
|
```
|
|
@@ -65,6 +78,8 @@ Run all checks before making any changes:
|
|
|
65
78
|
|
|
66
79
|
### 2. Create Snippet Directories
|
|
67
80
|
|
|
81
|
+
**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.
|
|
82
|
+
|
|
68
83
|
```bash
|
|
69
84
|
mkdir -p .claude/rules-snippets
|
|
70
85
|
mkdir -p .claude/prompt-snippets
|
|
@@ -150,35 +165,37 @@ Same pattern as Steps 4–5 — preserve frontmatter, replace body with referenc
|
|
|
150
165
|
|
|
151
166
|
For `.cursor/rules/*.mdc`: preserve the original frontmatter exactly (it may use different field names than `.claude/` rules).
|
|
152
167
|
|
|
153
|
-
### 7. Create `.opencode/` Directory
|
|
168
|
+
### 7. Create `.opencode/` Directory (confirmed OpenCode use only)
|
|
169
|
+
|
|
170
|
+
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.
|
|
154
171
|
|
|
155
|
-
1. **
|
|
172
|
+
1. **Merge `.opencode/opencode.jsonc`** using native V2 fields:
|
|
156
173
|
|
|
157
174
|
```json
|
|
158
175
|
{
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"lsp": true
|
|
176
|
+
"$schema": "https://opencode.ai/config.json",
|
|
177
|
+
"instructions": ["AGENTS.md", ".opencode/rules/*.md"],
|
|
178
|
+
"skills": [".agents/skills"],
|
|
179
|
+
"plugins": ["@dietrichgebert/ponytail@4.12.0"],
|
|
180
|
+
"lsp": true
|
|
165
181
|
}
|
|
166
182
|
```
|
|
167
183
|
|
|
168
|
-
|
|
184
|
+
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`.
|
|
169
185
|
|
|
170
|
-
|
|
186
|
+
`instructions` entries are accepted but not loaded; ambient `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 project 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.
|
|
171
187
|
|
|
172
|
-
2. **
|
|
173
|
-
-
|
|
188
|
+
2. **Replace obsolete toolkit Ponytail (backup and approval only)**:
|
|
189
|
+
- 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.
|
|
190
|
+
- 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.
|
|
174
191
|
|
|
175
|
-
3. **Create wrappers
|
|
192
|
+
3. **Create wrappers with explicit snippet-read instructions** — one file per snippet:
|
|
176
193
|
|
|
177
194
|
| Directory | Source Snippets | Wrapper Body |
|
|
178
195
|
| ------------------------- | -------------------------- | ------------------------------------ |
|
|
179
|
-
| `.opencode/commands/*.md` | `.claude/prompt-snippets/` |
|
|
180
|
-
| `.opencode/rules/*.md` | `.claude/rules-snippets/` |
|
|
181
|
-
| `.opencode/agents/*.md` | `.claude/agents-snippets/` |
|
|
196
|
+
| `.opencode/commands/*.md` | `.claude/prompt-snippets/` | `Read and follow .claude/prompt-snippets/<name>.md` |
|
|
197
|
+
| `.opencode/rules/*.md` | `.claude/rules-snippets/` | `Read and follow .claude/rules-snippets/<name>.md` |
|
|
198
|
+
| `.opencode/agents/*.md` | `.claude/agents-snippets/` | `Read and follow .claude/agents-snippets/<name>.md` |
|
|
182
199
|
|
|
183
200
|
Wrapper format for all three:
|
|
184
201
|
|
|
@@ -189,7 +206,7 @@ For `.cursor/rules/*.mdc`: preserve the original frontmatter exactly (it may use
|
|
|
189
206
|
|
|
190
207
|
# <Title>
|
|
191
208
|
|
|
192
|
-
|
|
209
|
+
Read and follow `.claude/<snippet-type>/<name>.md` before performing this task.
|
|
193
210
|
```
|
|
194
211
|
|
|
195
212
|
### 8. Install Pre-Commit Hook
|
|
@@ -220,24 +237,14 @@ Use `git commit --no-verify` to bypass.
|
|
|
220
237
|
|
|
221
238
|
### 10. Clean Up Duplicate Skills
|
|
222
239
|
|
|
223
|
-
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
```bash
|
|
229
|
-
# Remove duplicate skill subdirs (keep README.md if present)
|
|
230
|
-
find .claude/skills -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} +
|
|
231
|
-
find .cursor/skills -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} +
|
|
232
|
-
find .github/skills -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} +
|
|
233
|
-
|
|
234
|
-
# Remove nested duplicates (e.g., subagent-driven-development/subagent-driven-development/)
|
|
235
|
-
rm -rf .agents/skills/subagent-driven-development/subagent-driven-development/
|
|
236
|
-
```
|
|
240
|
+
- Merge approved `.agents/rules/*.md` additions without overwriting custom content; skip this step on the v3 route.
|
|
241
|
+
- Preserve custom, unmatched, modified, and nested skill content; name or location alone does not prove duplication.
|
|
242
|
+
- 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.
|
|
243
|
+
- 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.
|
|
237
244
|
|
|
238
245
|
### 11. Update `CLAUDE.md`
|
|
239
246
|
|
|
240
|
-
If `CLAUDE.md` is a thin redirect to `AGENTS.md`,
|
|
247
|
+
If `CLAUDE.md` is an applicable confirmed harness target and a thin redirect to `AGENTS.md`, merge only missing relevant sections; preserve existing bodies/frontmatter:
|
|
241
248
|
|
|
242
249
|
1. **Snippet Directories** section with links to `rules-snippets/`, `prompt-snippets/`, `agents-snippets/`
|
|
243
250
|
2. **Multi-Tool Support** section with links to `.github/`, `.cursor/`, `.opencode/`
|
|
@@ -247,13 +254,15 @@ See existing `CLAUDE.md` in the toolkit template (`src/repo/CLAUDE.md`) for the
|
|
|
247
254
|
|
|
248
255
|
### 12. Create `.toolkit-version` File
|
|
249
256
|
|
|
257
|
+
Only after the approved migration and OpenCode preflight pass (or OpenCode is confirmed out of scope):
|
|
258
|
+
|
|
250
259
|
```bash
|
|
251
|
-
echo "
|
|
260
|
+
echo "4.0.0" > .toolkit-version
|
|
252
261
|
```
|
|
253
262
|
|
|
254
263
|
### 13. Validation
|
|
255
264
|
|
|
256
|
-
Run
|
|
265
|
+
Run only checks applicable to the selected route and confirmed harnesses; on v3 compare retained snippet bodies/frontmatter to backups:
|
|
257
266
|
|
|
258
267
|
| Check | Method | Pass Criteria |
|
|
259
268
|
| ------------------------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------- |
|
|
@@ -262,19 +271,20 @@ Run all checks after writing files:
|
|
|
262
271
|
| No `{{PLACEHOLDER}}` lost | `grep -r '{{' .claude/*-snippets/` | Count matches original files |
|
|
263
272
|
| No broken relative paths | For each wrapper, verify linked snippet exists | All links resolve |
|
|
264
273
|
| `.opencode/` complete | Check `opencode.jsonc` + one file per snippet in commands/, rules/, agents/ | Counts match |
|
|
265
|
-
|
|
|
274
|
+
| Custom skills preserved | Compare the before/after inventory and any removed duplicate against its canonical copy | Only approved verified identical duplicates removed |
|
|
266
275
|
|
|
267
276
|
If `--verbose`: log each check result with file paths.
|
|
268
277
|
|
|
269
278
|
### 14. Generate Upgrade Report
|
|
270
279
|
|
|
271
|
-
Output the report to stdout (and optionally to `docs/upgrade-report-
|
|
280
|
+
Output the report to stdout (and optionally to `docs/upgrade-report-v4.md`). 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:
|
|
272
281
|
|
|
273
282
|
```markdown
|
|
274
283
|
## 🚀 Bootstrap Upgrade Report
|
|
275
284
|
|
|
276
|
-
**From**: pre-3.0
|
|
277
|
-
**To**:
|
|
285
|
+
**From**: detected installed version (include inline extraction only for pre-3.0)
|
|
286
|
+
**To**: 4.0.0 (native V2 for confirmed OpenCode use; snippet conversion only for verified legacy)
|
|
287
|
+
**Selected route**: verified legacy | v3 native OpenCode
|
|
278
288
|
**Date**: {{DATE}}
|
|
279
289
|
**Dry run**: yes | no
|
|
280
290
|
|
|
@@ -302,21 +312,21 @@ Output the report to stdout (and optionally to `docs/upgrade-report-v3.md`):
|
|
|
302
312
|
|
|
303
313
|
### Cleanup
|
|
304
314
|
|
|
305
|
-
- Removed X
|
|
306
|
-
-
|
|
315
|
+
- Removed X verified identical duplicates after comparison, backup, and approval (if performed)
|
|
316
|
+
- Preserved custom, unmatched, and nested skill content and canonical copies
|
|
307
317
|
|
|
308
318
|
### Files Created
|
|
309
319
|
|
|
310
|
-
- `.toolkit-version` —
|
|
320
|
+
- `.toolkit-version` — 4.0.0
|
|
311
321
|
|
|
312
322
|
### Validation
|
|
313
323
|
|
|
314
|
-
- [
|
|
315
|
-
- [
|
|
316
|
-
- [
|
|
317
|
-
- [
|
|
318
|
-
- [
|
|
319
|
-
- [
|
|
324
|
+
- [ ] Applicable snippet files exist and have content
|
|
325
|
+
- [ ] Applicable thin wrappers reference correct snippets
|
|
326
|
+
- [ ] No {{PLACEHOLDER}} syntax lost; v3 snippet bodies/frontmatter unchanged
|
|
327
|
+
- [ ] No broken relative paths
|
|
328
|
+
- [ ] .opencode/ checks passed (confirmed OpenCode use only)
|
|
329
|
+
- [ ] Custom skills preserved; any duplicate removal met the safety checks
|
|
320
330
|
```
|
|
321
331
|
|
|
322
332
|
If `--verbose`: include a file-by-file log of every operation.
|
|
@@ -327,14 +337,14 @@ If not `--dry-run`, stage and commit all changes:
|
|
|
327
337
|
|
|
328
338
|
```bash
|
|
329
339
|
git add -A
|
|
330
|
-
git commit -m "chore: upgrade AI instructions to toolkit
|
|
340
|
+
git commit -m "chore: upgrade AI instructions to toolkit v4.0.0"
|
|
331
341
|
```
|
|
332
342
|
|
|
333
343
|
If `--dry-run`: skip commit, note in report: "Dry run — no changes committed."
|
|
334
344
|
|
|
335
345
|
## Parallelization Summary
|
|
336
346
|
|
|
337
|
-
|
|
347
|
+
Only after route selection, verified-legacy steps may run in parallel for confirmed harnesses:
|
|
338
348
|
|
|
339
349
|
| Step | Parallelizable Groups |
|
|
340
350
|
| ---- | ------------------------------------------------------------- |
|
|
@@ -344,13 +354,13 @@ Steps that can run in parallel (dispatch subagents):
|
|
|
344
354
|
| 6 | rules wrappers ‖ commands wrappers ‖ agents wrappers |
|
|
345
355
|
| 10 | Independent of 3–6 — can run in parallel with file conversion |
|
|
346
356
|
|
|
347
|
-
|
|
357
|
+
Verified legacy sequence: 1 → 2 → (3‖4‖5‖6‖10) → 7 → 8 → 9 → 11 → 12 → 13 → 14 → 15, skipping unconfirmed scopes/unapproved operations. V3 sequence: 1 → applicable 7 → applicable 11–15; never run Steps 2–6 or 8–10.
|
|
348
358
|
|
|
349
359
|
## Error Handling
|
|
350
360
|
|
|
351
361
|
- If a file has no frontmatter: treat entire file as body content, create wrapper with empty frontmatter fields
|
|
352
362
|
- If a snippet file already exists: **skip** with warning (do not overwrite)
|
|
353
|
-
- If `.opencode/` already exists: merge — add missing files
|
|
363
|
+
- If `.opencode/` already exists: merge — add missing files and propose native V2 conversion of existing host files; preserve customizations and skip files already migrated
|
|
354
364
|
- If git commit fails: show error, suggest manual commit
|
|
355
365
|
- If any validation check fails: report the failure but continue with remaining checks
|
|
356
366
|
|