nitm-ai-dev-toolkit 3.0.19 → 3.0.21
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/package.json +1 -1
- package/src/monorepo/.claude/prompt-snippets/bootstrap-patch.md +130 -130
- package/src/monorepo/.claude/prompt-snippets/bootstrap-upgrade.md +61 -56
- package/src/monorepo/.claude/prompt-snippets/bootstrap.md +31 -31
- package/src/monorepo/.opencode/opencode.jsonc +21 -0
- package/src/monorepo/.opencode/plugins/ponytail.mjs +63 -49
- package/src/monorepo/AGENTS.md +35 -35
- package/src/monorepo/CLAUDE.md +1 -1
- package/src/repo/.claude/prompt-snippets/bootstrap-patch.md +133 -133
- package/src/repo/.claude/prompt-snippets/bootstrap-upgrade.md +70 -65
- package/src/repo/.claude/prompt-snippets/bootstrap.md +40 -40
- package/src/repo/.opencode/opencode.jsonc +21 -0
- package/src/repo/.opencode/plugins/ponytail.mjs +63 -49
- package/src/repo/AGENTS.md +35 -35
- package/src/repo/CLAUDE.md +1 -1
- package/src/monorepo/.opencode/opencode.json +0 -9
- package/src/repo/.opencode/opencode.json +0 -9
|
@@ -19,24 +19,24 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
|
|
|
19
19
|
|
|
20
20
|
## Process
|
|
21
21
|
|
|
22
|
-
1.
|
|
22
|
+
1. **Fetch Latest Templates**:
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Clone or fetch the latest ai-assisted-dev-toolkit templates:
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
```bash
|
|
27
|
+
TOOLKIT_TEMP=$(mktemp -d)
|
|
28
|
+
git clone --depth 1 https://github.com/ninjasitm/ai-assisted-dev-toolkit.git "$TOOLKIT_TEMP"
|
|
29
|
+
```
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
Determine the correct source path based on project structure:
|
|
32
|
+
- **Single repo**: Use `$TOOLKIT_TEMP/src/repo/`
|
|
33
|
+
- **Monorepo**: Use `$TOOLKIT_TEMP/src/monorepo/`
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
Detection heuristic:
|
|
36
|
+
- If `apps/` and `packages/` directories exist at root → monorepo
|
|
37
|
+
- Otherwise → single repo
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
**Detect Toolkit Version:**
|
|
40
40
|
|
|
41
41
|
Check for a `.toolkit-version` file in the project root:
|
|
42
42
|
- If exists: Read the version string (e.g., `2.0.10`, `3.0.0`)
|
|
@@ -48,131 +48,131 @@ Fetch the latest AI instruction templates from the ai-assisted-dev-toolkit repos
|
|
|
48
48
|
- **Same version**: No structural changes expected
|
|
49
49
|
- **Newer version**: Check for structural changes (new directories, renamed files, format changes)
|
|
50
50
|
|
|
51
|
-
2.
|
|
51
|
+
2. **Inventory Current State**:
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Scan the project's AI configuration directories:
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| **Claude Cmds**
|
|
65
|
-
| **Claude Agents
|
|
66
|
-
| **Skills**
|
|
67
|
-
| **AGENTS.md**
|
|
68
|
-
| **CLAUDE.md**
|
|
69
|
-
| **Claude Rules Snippets**
|
|
70
|
-
| **Claude Prompt Snippets** | `.claude/prompt-snippets/*.md`
|
|
71
|
-
| **Claude Agent Snippets**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
3.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
4.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
6. **Cleanup**:
|
|
55
|
+
| Category | Project Paths | Template Source Paths |
|
|
56
|
+
| -------------------------- | ---------------------------------------- | --------------------------------------------------- |
|
|
57
|
+
| **Cursor Rules** | `.cursor/rules/*.mdc` | `src/{type}/.cursor/rules/*.mdc` |
|
|
58
|
+
| **Cursor Cmds** | `.cursor/commands/*.md` | `src/{type}/.cursor/commands/*.md` |
|
|
59
|
+
| **Cursor Agents** | `.cursor/agents/*.agent.md` | `src/{type}/.cursor/agents/*.agent.md` |
|
|
60
|
+
| **GH Prompts** | `.github/prompts/*.prompt.md` | `src/{type}/.github/prompts/*.prompt.md` |
|
|
61
|
+
| **GH Instrs** | `.github/instructions/*.instructions.md` | `src/{type}/.github/instructions/*.instructions.md` |
|
|
62
|
+
| **GH Agents** | `.github/agents/*.agent.md` | `src/{type}/.github/agents/*.agent.md` |
|
|
63
|
+
| **Claude Rules** | `.claude/rules/*.md` | `src/{type}/.claude/rules/*.md` |
|
|
64
|
+
| **Claude Cmds** | `.claude/commands/*.md` | `src/{type}/.claude/commands/*.md` |
|
|
65
|
+
| **Claude Agents** | `.claude/agents/*.agent.md` | `src/{type}/.claude/agents/*.agent.md` |
|
|
66
|
+
| **Skills** | `.agents/skills/*/SKILL.md` | `src/{type}/.agents/skills/*/SKILL.md` |
|
|
67
|
+
| **AGENTS.md** | `AGENTS.md` | `src/{type}/AGENTS.md` |
|
|
68
|
+
| **CLAUDE.md** | `CLAUDE.md` | `src/{type}/CLAUDE.md` |
|
|
69
|
+
| **Claude Rules Snippets** | `.claude/rules-snippets/*.md` | `src/{type}/.claude/rules-snippets/*.md` |
|
|
70
|
+
| **Claude Prompt Snippets** | `.claude/prompt-snippets/*.md` | `src/{type}/.claude/prompt-snippets/*.md` |
|
|
71
|
+
| **Claude Agent Snippets** | `.claude/agents-snippets/*.md` | `src/{type}/.claude/agents-snippets/*.md` |
|
|
72
|
+
| **OpenCode Config** | `.opencode/opencode.jsonc` | `src/{type}/.opencode/opencode.jsonc` |
|
|
73
|
+
| **OpenCode Commands** | `.opencode/commands/*.md` | `src/{type}/.opencode/commands/*.md` |
|
|
74
|
+
| **OpenCode Rules** | `.opencode/rules/*.md` | `src/{type}/.opencode/rules/*.md` |
|
|
75
|
+
| **OpenCode Agents** | `.opencode/agents/*.md` | `src/{type}/.opencode/agents/*.md` |
|
|
76
|
+
| **OpenCode Plugins** | `.opencode/plugins/*.mjs` | `src/{type}/.opencode/plugins/*.mjs` |
|
|
77
|
+
| **Hooks** | `hooks/*.{js,sh,ps1}` | `src/{type}/hooks/*.{js,sh,ps1}` |
|
|
78
|
+
| **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.
|
|
84
|
+
|
|
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`
|
|
86
|
+
|
|
87
|
+
**Do NOT add** keys like `rules`, `agents`, `commands`, `prompts` as top-level keys — OpenCode uses the `.opencode/` directory structure and `instructions` array instead.
|
|
88
|
+
|
|
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.
|
|
90
|
+
|
|
91
|
+
3. **Diff Analysis** (parallelizable — dispatch one subagent per category):
|
|
92
|
+
|
|
93
|
+
For each category, compare template files against project files:
|
|
94
|
+
|
|
95
|
+
a. **Classify each file**:
|
|
96
|
+
- **🆕 New**: Exists in template but not in project → candidate for addition
|
|
97
|
+
- **📝 Updated**: Exists in both but template has newer content → candidate for merge
|
|
98
|
+
- **✅ Current**: Exists in both and content matches → no action needed
|
|
99
|
+
- **🔧 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
|
|
101
|
+
|
|
102
|
+
b. **For updated files, generate a structured diff**:
|
|
103
|
+
- Preserve project-specific `{{PLACEHOLDER}}` replacements (already-bootstrapped values)
|
|
104
|
+
- Identify structural additions (new sections, new rules, new steps)
|
|
105
|
+
- Identify structural removals (deprecated guidance, removed sections)
|
|
106
|
+
- Identify content updates (changed instructions, improved wording)
|
|
107
|
+
|
|
108
|
+
c. **Smart Merge Rules**:
|
|
109
|
+
- **Never overwrite** project-specific values that replaced `{{PLACEHOLDER}}`
|
|
110
|
+
- **Always add** new files that don't exist in the project
|
|
111
|
+
- **Merge structural additions** into existing customized files
|
|
112
|
+
- **Flag for review** any removals from files that have been customized
|
|
113
|
+
- **Preserve custom agents/skills** that were added by the project
|
|
114
|
+
|
|
115
|
+
4. **Generate Patch Report**:
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
## 🩹 Bootstrap Patch Report
|
|
119
|
+
|
|
120
|
+
**Toolkit Version**: [commit hash] ([date])
|
|
121
|
+
**Project Type**: repo | monorepo
|
|
122
|
+
**Categories Scanned**: [list]
|
|
123
|
+
|
|
124
|
+
### 🆕 New Files (X files)
|
|
125
|
+
|
|
126
|
+
| File | Category | Description |
|
|
127
|
+
| ---------------------------- | -------- | ------------------------ |
|
|
128
|
+
| `.cursor/rules/new-rule.mdc` | Rules | New coding standard rule |
|
|
129
|
+
|
|
130
|
+
### 📝 Updated Files (X files)
|
|
131
|
+
|
|
132
|
+
| File | Changes | Risk |
|
|
133
|
+
| ------------------------------- | ----------------------------- | -------------- |
|
|
134
|
+
| `.cursor/commands/implement.md` | Added orchestrator checkpoint | Low - additive |
|
|
135
|
+
|
|
136
|
+
### ✅ Current Files (X files)
|
|
137
|
+
|
|
138
|
+
[No action needed]
|
|
139
|
+
|
|
140
|
+
### 🔧 Customized Files Requiring Review (X files)
|
|
141
|
+
|
|
142
|
+
| File | Template Changes | Project Customizations | Merge Strategy |
|
|
143
|
+
| ----------- | ----------------- | ---------------------------- | -------------- |
|
|
144
|
+
| `AGENTS.md` | New section added | Has project-specific content | Manual merge |
|
|
145
|
+
|
|
146
|
+
### Summary
|
|
147
|
+
|
|
148
|
+
- **Auto-apply**: X new files + Y updated files with no conflicts
|
|
149
|
+
- **Review needed**: Z customized files with structural changes
|
|
150
|
+
- **No action**: W files already current
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
5. **Confirm and Apply**:
|
|
154
|
+
- If `--dry-run` flag: Output the report without making changes
|
|
155
|
+
- Otherwise: Present the report and ask the user to confirm with (Y/n)
|
|
156
|
+
- On confirmation:
|
|
157
|
+
a. **New files**: Copy directly from template
|
|
158
|
+
b. **Updated files (no customization)**: Replace with template version
|
|
159
|
+
c. **Updated files (customized)**: Apply structural additions while preserving project values
|
|
160
|
+
d. **Git commit**: Stage and commit all changes with message:
|
|
161
|
+
```bash
|
|
162
|
+
git add -A
|
|
163
|
+
git commit -m "chore: patch AI instructions from toolkit [$(date +%Y-%m-%d)]"
|
|
164
|
+
```
|
|
166
165
|
|
|
167
|
-
|
|
168
|
-
rm -rf "$TOOLKIT_TEMP"
|
|
169
|
-
```
|
|
166
|
+
6. **Cleanup**:
|
|
170
167
|
|
|
171
|
-
|
|
168
|
+
```bash
|
|
169
|
+
rm -rf "$TOOLKIT_TEMP"
|
|
170
|
+
```
|
|
172
171
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
7. **Post-Patch Validation**:
|
|
173
|
+
- Verify no `{{PLACEHOLDER}}` syntax was accidentally re-introduced
|
|
174
|
+
- Confirm all files are valid (no broken frontmatter, no syntax errors)
|
|
175
|
+
- List any new placeholders that need manual `bootstrap` to fill
|
|
176
176
|
|
|
177
177
|
## Smart Merge Strategy
|
|
178
178
|
|
|
@@ -43,20 +43,20 @@ Run all checks before making any changes:
|
|
|
43
43
|
**Project type**: repo | monorepo
|
|
44
44
|
**Current version**: <version or "none (legacy)">
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
### What will happen:
|
|
47
|
+
|
|
48
|
+
1. Create snippet directories: `.claude/rules-snippets/`, `.claude/prompt-snippets/`, `.claude/agents-snippets/`
|
|
49
|
+
2. Extract content from `.claude/` files → snippet files
|
|
50
|
+
3. Convert `.claude/` files to thin wrappers
|
|
51
|
+
4. Convert `.github/` files to thin wrappers
|
|
52
|
+
5. Convert `.cursor/` files to thin wrappers
|
|
53
|
+
6. Create `.opencode/` directory with config and wrappers
|
|
54
|
+
7. Install pre-commit hook (CHANGELOG/Zone.Identifier/secrets enforcement)
|
|
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
|
|
60
60
|
|
|
61
61
|
Proceed? (Y/n)
|
|
62
62
|
```
|
|
@@ -77,11 +77,11 @@ mkdir -p .claude/agents-snippets
|
|
|
77
77
|
|
|
78
78
|
**Frontmatter extraction rule**: Content between the first `---` and the second `---` is frontmatter. Everything after the second `---` (including leading newline) is the body.
|
|
79
79
|
|
|
80
|
-
| Source
|
|
81
|
-
|
|
82
|
-
| `.claude/rules/*.md` body
|
|
83
|
-
| `.claude/commands/*.md` body
|
|
84
|
-
| `.claude/agents/*.agent.md` body | `.claude/agents-snippets/<name>.md` | `reviewer.agent.md`
|
|
80
|
+
| Source | Destination | Example |
|
|
81
|
+
| -------------------------------- | ----------------------------------- | --------------------- |
|
|
82
|
+
| `.claude/rules/*.md` body | `.claude/rules-snippets/<name>.md` | `coding-standards.md` |
|
|
83
|
+
| `.claude/commands/*.md` body | `.claude/prompt-snippets/<name>.md` | `bootstrap.md` |
|
|
84
|
+
| `.claude/agents/*.agent.md` body | `.claude/agents-snippets/<name>.md` | `reviewer.agent.md` |
|
|
85
85
|
|
|
86
86
|
For each file: read → extract body after frontmatter → write to snippet destination. **Preserve all `{{PLACEHOLDER}}` values exactly.**
|
|
87
87
|
|
|
@@ -91,13 +91,14 @@ For each file: read → extract body after frontmatter → write to snippet dest
|
|
|
91
91
|
|
|
92
92
|
Replace each file's body with a wrapper that preserves frontmatter and references the snippet:
|
|
93
93
|
|
|
94
|
-
| File Type
|
|
95
|
-
|
|
96
|
-
| `.claude/rules/*.md`
|
|
97
|
-
| `.claude/commands/*.md`
|
|
98
|
-
| `.claude/agents/*.agent.md` | `name`, `description`, `tools`
|
|
94
|
+
| File Type | Frontmatter to Keep | Reference Line |
|
|
95
|
+
| --------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
96
|
+
| `.claude/rules/*.md` | `applyTo`, `description` | `Follow the rules defined in [../rules-snippets/<name>.md](../rules-snippets/<name>.md).` |
|
|
97
|
+
| `.claude/commands/*.md` | `description`, `allowed-tools`, `argument-hint` | `Follow the prompt defined in [../prompt-snippets/<name>.md](../prompt-snippets/<name>.md).` |
|
|
98
|
+
| `.claude/agents/*.agent.md` | `name`, `description`, `tools` | `Follow the agent definition in [../agents-snippets/<name>.md](../agents-snippets/<name>.md).` |
|
|
99
99
|
|
|
100
100
|
Wrapper format:
|
|
101
|
+
|
|
101
102
|
```markdown
|
|
102
103
|
---
|
|
103
104
|
<original frontmatter preserved>
|
|
@@ -114,21 +115,23 @@ Wrapper format:
|
|
|
114
115
|
|
|
115
116
|
Same wrapper pattern as Step 4 — preserve frontmatter, replace body with reference:
|
|
116
117
|
|
|
117
|
-
| Source
|
|
118
|
-
|
|
119
|
-
| `.github/instructions/*.instructions.md` | `applyTo`, `description`
|
|
120
|
-
| `.github/prompts/*.prompt.md`
|
|
121
|
-
| `.github/agents/*.agent.md`
|
|
118
|
+
| Source | Frontmatter | Snippet Target | Reference Path |
|
|
119
|
+
| ---------------------------------------- | ------------------------------ | ----------------------------------- | ----------------------------------------- |
|
|
120
|
+
| `.github/instructions/*.instructions.md` | `applyTo`, `description` | `.claude/rules-snippets/<name>.md` | `../../.claude/rules-snippets/<name>.md` |
|
|
121
|
+
| `.github/prompts/*.prompt.md` | `description` | `.claude/prompt-snippets/<name>.md` | `../../.claude/prompt-snippets/<name>.md` |
|
|
122
|
+
| `.github/agents/*.agent.md` | `name`, `description`, `tools` | `.claude/agents-snippets/<name>.md` | `../../.claude/agents-snippets/<name>.md` |
|
|
122
123
|
|
|
123
124
|
**Name mapping for instructions**: Strip `.instructions` suffix — `agent-conduct.instructions.md` → `agent-conduct.md`.
|
|
124
125
|
|
|
125
126
|
**Missing snippet?** If an instruction file (e.g., `deployment.instructions.md`) has no matching `.claude/rules/` file, first create the snippet by copying the full content to `.claude/rules-snippets/<name>.md`, then convert to wrapper.
|
|
126
127
|
|
|
127
128
|
For `.github/instructions/` wrappers, include 2–3 key bullet points after the reference line:
|
|
129
|
+
|
|
128
130
|
```markdown
|
|
129
131
|
Follow the rules defined in [../../.claude/rules-snippets/<name>.md](../../.claude/rules-snippets/<name>.md).
|
|
130
132
|
|
|
131
133
|
Key points:
|
|
134
|
+
|
|
132
135
|
- <first key point from original>
|
|
133
136
|
- <second key point from original>
|
|
134
137
|
```
|
|
@@ -139,32 +142,26 @@ Key points:
|
|
|
139
142
|
|
|
140
143
|
Same pattern as Steps 4–5 — preserve frontmatter, replace body with reference:
|
|
141
144
|
|
|
142
|
-
| Source
|
|
143
|
-
|
|
144
|
-
| `.cursor/rules/*.mdc`
|
|
145
|
-
| `.cursor/commands/*.md`
|
|
145
|
+
| Source | Snippet Target | Reference Path |
|
|
146
|
+
| --------------------------- | ----------------------------------- | ----------------------------------------- |
|
|
147
|
+
| `.cursor/rules/*.mdc` | `.claude/rules-snippets/<name>.md` | `../../.claude/rules-snippets/<name>.md` |
|
|
148
|
+
| `.cursor/commands/*.md` | `.claude/prompt-snippets/<name>.md` | `../../.claude/prompt-snippets/<name>.md` |
|
|
146
149
|
| `.cursor/agents/*.agent.md` | `.claude/agents-snippets/<name>.md` | `../../.claude/agents-snippets/<name>.md` |
|
|
147
150
|
|
|
148
151
|
For `.cursor/rules/*.mdc`: preserve the original frontmatter exactly (it may use different field names than `.claude/` rules).
|
|
149
152
|
|
|
150
153
|
### 7. Create `.opencode/` Directory
|
|
151
154
|
|
|
152
|
-
1. **Create `.opencode/opencode.
|
|
155
|
+
1. **Create `.opencode/opencode.jsonc`** using only supported schema keys:
|
|
153
156
|
|
|
154
157
|
```json
|
|
155
158
|
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
"paths": [
|
|
163
|
-
".agents/skills/**/*.md",
|
|
164
|
-
".claude/skills/**/*.md"
|
|
165
|
-
]
|
|
166
|
-
},
|
|
167
|
-
"lsp": true
|
|
159
|
+
"$schema": "https://opencode.ai/config.json",
|
|
160
|
+
"instructions": ["AGENTS.md", ".opencode/rules/*.md"],
|
|
161
|
+
"skills": {
|
|
162
|
+
"paths": [".agents/skills/**/*.md", ".claude/skills/**/*.md"]
|
|
163
|
+
},
|
|
164
|
+
"lsp": true
|
|
168
165
|
}
|
|
169
166
|
```
|
|
170
167
|
|
|
@@ -177,13 +174,14 @@ For `.cursor/rules/*.mdc`: preserve the original frontmatter exactly (it may use
|
|
|
177
174
|
|
|
178
175
|
3. **Create wrappers using `@` import syntax** — one file per snippet:
|
|
179
176
|
|
|
180
|
-
| Directory
|
|
181
|
-
|
|
177
|
+
| Directory | Source Snippets | Wrapper Body |
|
|
178
|
+
| ------------------------- | -------------------------- | ------------------------------------ |
|
|
182
179
|
| `.opencode/commands/*.md` | `.claude/prompt-snippets/` | `@.claude/prompt-snippets/<name>.md` |
|
|
183
|
-
| `.opencode/rules/*.md`
|
|
184
|
-
| `.opencode/agents/*.md`
|
|
180
|
+
| `.opencode/rules/*.md` | `.claude/rules-snippets/` | `@.claude/rules-snippets/<name>.md` |
|
|
181
|
+
| `.opencode/agents/*.md` | `.claude/agents-snippets/` | `@.claude/agents-snippets/<name>.md` |
|
|
185
182
|
|
|
186
183
|
Wrapper format for all three:
|
|
184
|
+
|
|
187
185
|
```markdown
|
|
188
186
|
---
|
|
189
187
|
description: "<description from snippet frontmatter>"
|
|
@@ -207,6 +205,7 @@ Install the CHANGELOG/secrets enforcement hook to run before every commit:
|
|
|
207
205
|
```
|
|
208
206
|
|
|
209
207
|
This enforces:
|
|
208
|
+
|
|
210
209
|
- **CHANGELOG.md** — [Unreleased] must have content when non-trivial files are staged
|
|
211
210
|
- **Zone.Identifier** — `*:Zone.Identifier` files are blocked from commit
|
|
212
211
|
- **Secrets** — `.env`, `.env.*`, `*.key`, `*.pem` files are blocked from commit
|
|
@@ -256,14 +255,14 @@ echo "3.0.0" > .toolkit-version
|
|
|
256
255
|
|
|
257
256
|
Run all checks after writing files:
|
|
258
257
|
|
|
259
|
-
| Check
|
|
260
|
-
|
|
261
|
-
| Snippet files exist
|
|
262
|
-
| Thin wrappers reference correct paths | Grep each wrapper for its reference line
|
|
263
|
-
| No `{{PLACEHOLDER}}` lost
|
|
264
|
-
| No broken relative paths
|
|
265
|
-
| `.opencode/` complete
|
|
266
|
-
| Duplicate skills removed
|
|
258
|
+
| Check | Method | Pass Criteria |
|
|
259
|
+
| ------------------------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------- |
|
|
260
|
+
| Snippet files exist | `ls -la .claude/{rules,prompt,agents}-snippets/` | All files > 0 bytes |
|
|
261
|
+
| Thin wrappers reference correct paths | Grep each wrapper for its reference line | Every reference points to an existing snippet |
|
|
262
|
+
| No `{{PLACEHOLDER}}` lost | `grep -r '{{' .claude/*-snippets/` | Count matches original files |
|
|
263
|
+
| No broken relative paths | For each wrapper, verify linked snippet exists | All links resolve |
|
|
264
|
+
| `.opencode/` complete | Check `opencode.jsonc` + one file per snippet in commands/, rules/, agents/ | Counts match |
|
|
265
|
+
| Duplicate skills removed | No subdirs in `.claude/skills/`, `.cursor/skills/`, `.github/skills/` (except README.md) | Clean |
|
|
267
266
|
|
|
268
267
|
If `--verbose`: log each check result with file paths.
|
|
269
268
|
|
|
@@ -280,11 +279,13 @@ Output the report to stdout (and optionally to `docs/upgrade-report-v3.md`):
|
|
|
280
279
|
**Dry run**: yes | no
|
|
281
280
|
|
|
282
281
|
### Snippet Directories Created
|
|
282
|
+
|
|
283
283
|
- `.claude/rules-snippets/` — X files
|
|
284
284
|
- `.claude/prompt-snippets/` — X files
|
|
285
285
|
- `.claude/agents-snippets/` — X files
|
|
286
286
|
|
|
287
287
|
### Files Converted to Thin Wrappers
|
|
288
|
+
|
|
288
289
|
- `.claude/rules/` — X files
|
|
289
290
|
- `.claude/commands/` — X files
|
|
290
291
|
- `.claude/agents/` — X files
|
|
@@ -296,16 +297,20 @@ Output the report to stdout (and optionally to `docs/upgrade-report-v3.md`):
|
|
|
296
297
|
- `.cursor/agents/` — X files
|
|
297
298
|
|
|
298
299
|
### New Directories Created
|
|
300
|
+
|
|
299
301
|
- `.opencode/` — X files (config, commands, rules, agents)
|
|
300
302
|
|
|
301
303
|
### Cleanup
|
|
304
|
+
|
|
302
305
|
- Removed X duplicate skill directories
|
|
303
306
|
- Removed X nested duplicates
|
|
304
307
|
|
|
305
308
|
### Files Created
|
|
309
|
+
|
|
306
310
|
- `.toolkit-version` — 3.0.0
|
|
307
311
|
|
|
308
312
|
### Validation
|
|
313
|
+
|
|
309
314
|
- [x] All snippet files exist and have content
|
|
310
315
|
- [x] All thin wrappers reference correct snippets
|
|
311
316
|
- [x] No {{PLACEHOLDER}} syntax lost
|
|
@@ -331,13 +336,13 @@ If `--dry-run`: skip commit, note in report: "Dry run — no changes committed."
|
|
|
331
336
|
|
|
332
337
|
Steps that can run in parallel (dispatch subagents):
|
|
333
338
|
|
|
334
|
-
| Step | Parallelizable Groups
|
|
335
|
-
|
|
336
|
-
| 3
|
|
337
|
-
| 4
|
|
338
|
-
| 5
|
|
339
|
-
| 6
|
|
340
|
-
| 10
|
|
339
|
+
| Step | Parallelizable Groups |
|
|
340
|
+
| ---- | ------------------------------------------------------------- |
|
|
341
|
+
| 3 | rules extraction ‖ commands extraction ‖ agents extraction |
|
|
342
|
+
| 4 | rules wrappers ‖ commands wrappers ‖ agents wrappers |
|
|
343
|
+
| 5 | instructions wrappers ‖ prompts wrappers ‖ agents wrappers |
|
|
344
|
+
| 6 | rules wrappers ‖ commands wrappers ‖ agents wrappers |
|
|
345
|
+
| 10 | Independent of 3–6 — can run in parallel with file conversion |
|
|
341
346
|
|
|
342
347
|
Steps that must be sequential: 1 → 2 → (3‖4‖5‖6‖10) → 7 → 8 → 9 → 11 → 12 → 13 → 14 → 15.
|
|
343
348
|
|