opencodekit 0.15.21 → 0.16.1
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/dist/index.js +5 -7
- package/dist/template/.opencode/AGENTS.md +85 -23
- package/dist/template/.opencode/agent/build.md +88 -7
- package/dist/template/.opencode/agent/explore.md +1 -1
- package/dist/template/.opencode/agent/general.md +54 -4
- package/dist/template/.opencode/agent/looker.md +1 -1
- package/dist/template/.opencode/agent/painter.md +1 -1
- package/dist/template/.opencode/agent/plan.md +52 -0
- package/dist/template/.opencode/agent/review.md +1 -1
- package/dist/template/.opencode/agent/scout.md +3 -3
- package/dist/template/.opencode/agent/vision.md +1 -1
- package/dist/template/.opencode/command/create.md +231 -91
- package/dist/template/.opencode/command/design.md +40 -7
- package/dist/template/.opencode/command/handoff.md +22 -0
- package/dist/template/.opencode/command/init.md +49 -78
- package/dist/template/.opencode/command/plan.md +36 -16
- package/dist/template/.opencode/command/pr.md +15 -0
- package/dist/template/.opencode/command/research.md +3 -0
- package/dist/template/.opencode/command/resume.md +8 -18
- package/dist/template/.opencode/command/review-codebase.md +30 -0
- package/dist/template/.opencode/command/ship.md +199 -0
- package/dist/template/.opencode/command/start.md +316 -28
- package/dist/template/.opencode/command/status.md +24 -1
- package/dist/template/.opencode/command/ui-review.md +36 -7
- package/dist/template/.opencode/command/verify.md +307 -0
- package/dist/template/.opencode/memory/_templates/prd.md +29 -0
- package/dist/template/.opencode/memory/_templates/proposal.md +38 -0
- package/dist/template/.opencode/memory/_templates/spec.md +66 -0
- package/dist/template/.opencode/memory/_templates/tasks.md +198 -0
- package/dist/template/.opencode/memory/_templates/tech-stack.md +50 -0
- package/dist/template/.opencode/memory/project/tech-stack.md +53 -0
- package/dist/template/.opencode/memory/research/ccpm-analysis.md +334 -0
- package/dist/template/.opencode/memory/research/openspec-analysis.md +226 -0
- package/dist/template/.opencode/memory.db +0 -0
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +18 -4
- package/dist/template/.opencode/package.json +1 -0
- package/dist/template/.opencode/plans/1770006237537-mighty-otter.md +418 -0
- package/dist/template/.opencode/plans/1770006913647-glowing-forest.md +170 -0
- package/dist/template/.opencode/plans/1770013678126-witty-planet.md +278 -0
- package/dist/template/.opencode/plugin/lib/memory-db.ts +828 -0
- package/dist/template/.opencode/plugin/memory.ts +38 -1
- package/dist/template/.opencode/skill/index-knowledge/SKILL.md +76 -31
- package/dist/template/.opencode/skill/memory-system/SKILL.md +110 -55
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +2 -2
- package/dist/template/.opencode/tool/memory-get.ts +143 -0
- package/dist/template/.opencode/tool/memory-maintain.ts +167 -0
- package/dist/template/.opencode/tool/memory-migrate.ts +319 -0
- package/dist/template/.opencode/tool/memory-read.ts +17 -46
- package/dist/template/.opencode/tool/memory-search.ts +131 -28
- package/dist/template/.opencode/tool/memory-timeline.ts +105 -0
- package/dist/template/.opencode/tool/memory-update.ts +21 -26
- package/dist/template/.opencode/tool/observation.ts +112 -100
- package/dist/template/.opencode/tsconfig.json +19 -19
- package/package.json +1 -1
- package/dist/template/.opencode/command/accessibility-check.md +0 -331
- package/dist/template/.opencode/command/agent-browser.md +0 -21
- package/dist/template/.opencode/command/analyze-mockup.md +0 -423
- package/dist/template/.opencode/command/analyze-project.md +0 -295
- package/dist/template/.opencode/command/brainstorm.md +0 -373
- package/dist/template/.opencode/command/cloudflare.md +0 -70
- package/dist/template/.opencode/command/commit.md +0 -245
- package/dist/template/.opencode/command/complete-next-task.md +0 -77
- package/dist/template/.opencode/command/design-audit.md +0 -480
- package/dist/template/.opencode/command/edit-image.md +0 -242
- package/dist/template/.opencode/command/finish.md +0 -255
- package/dist/template/.opencode/command/fix-ci.md +0 -109
- package/dist/template/.opencode/command/fix-types.md +0 -104
- package/dist/template/.opencode/command/fix-ui.md +0 -117
- package/dist/template/.opencode/command/fix.md +0 -168
- package/dist/template/.opencode/command/frontend-design.md +0 -21
- package/dist/template/.opencode/command/generate-diagram.md +0 -349
- package/dist/template/.opencode/command/generate-icon.md +0 -283
- package/dist/template/.opencode/command/generate-image.md +0 -246
- package/dist/template/.opencode/command/generate-pattern.md +0 -247
- package/dist/template/.opencode/command/generate-storyboard.md +0 -250
- package/dist/template/.opencode/command/implement.md +0 -609
- package/dist/template/.opencode/command/import-plan.md +0 -406
- package/dist/template/.opencode/command/index-knowledge.md +0 -25
- package/dist/template/.opencode/command/integration-test.md +0 -424
- package/dist/template/.opencode/command/issue.md +0 -102
- package/dist/template/.opencode/command/new-feature.md +0 -651
- package/dist/template/.opencode/command/opensrc.md +0 -58
- package/dist/template/.opencode/command/quick-build.md +0 -238
- package/dist/template/.opencode/command/ralph.md +0 -41
- package/dist/template/.opencode/command/research-and-implement.md +0 -148
- package/dist/template/.opencode/command/research-ui.md +0 -466
- package/dist/template/.opencode/command/restore-image.md +0 -424
- package/dist/template/.opencode/command/revert-feature.md +0 -386
- package/dist/template/.opencode/command/skill-create.md +0 -517
- package/dist/template/.opencode/command/skill-optimize.md +0 -556
- package/dist/template/.opencode/command/summarize.md +0 -412
- package/dist/template/.opencode/command/triage.md +0 -398
- package/dist/template/.opencode/memory/_templates/README.md +0 -35
- package/dist/template/.opencode/memory/_templates/observation.md +0 -39
- package/dist/template/.opencode/memory/_templates/project/architecture.md +0 -60
- package/dist/template/.opencode/memory/_templates/project/commands.md +0 -72
- package/dist/template/.opencode/memory/_templates/project/conventions.md +0 -68
- package/dist/template/.opencode/memory/_templates/project/gotchas.md +0 -41
- package/dist/template/.opencode/memory/_templates/prompt-engineering.md +0 -333
- package/dist/template/.opencode/memory/observations/2026-01-22-decision-agents-md-prompt-engineering-improvement.md +0 -29
- package/dist/template/.opencode/memory/observations/2026-01-25-decision-agent-roles-build-orchestrates-general-e.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-01-25-decision-simplified-swarm-helper-tool-to-fix-type.md +0 -20
- package/dist/template/.opencode/memory/observations/2026-01-25-decision-use-beads-as-swarm-board-source-of-truth.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-01-25-learning-user-wants-real-swarm-coordination-guida.md +0 -15
- package/dist/template/.opencode/memory/observations/2026-01-28-decision-created-deep-research-skill-for-thorough.md +0 -29
- package/dist/template/.opencode/memory/observations/2026-01-28-decision-gh-grep-mcp-wrapper-vs-native-grep-searc.md +0 -21
- package/dist/template/.opencode/memory/observations/2026-01-28-decision-oracle-tool-optimal-usage-patterns.md +0 -32
- package/dist/template/.opencode/memory/observations/2026-01-28-learning-ampcode-deep-mode-research-integration-w.md +0 -42
- package/dist/template/.opencode/memory/observations/2026-01-28-pattern-research-delegation-pattern-explore-for-.md +0 -32
- package/dist/template/.opencode/memory/observations/2026-01-29-decision-copilot-auth-plugin-rate-limit-handling.md +0 -27
- package/dist/template/.opencode/memory/observations/2026-01-29-decision-spec-driven-approach-for-opencodekit.md +0 -21
- package/dist/template/.opencode/memory/observations/2026-01-29-learning-karpathy-llm-coding-insights-dec-2025.md +0 -44
- package/dist/template/.opencode/memory/observations/2026-01-30-decision-github-copilot-claude-routing-keep-disab.md +0 -32
- package/dist/template/.opencode/memory/observations/2026-01-30-discovery-context-management-research-critical-gap.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-01-30-discovery-kimi-k2-5-agent-swarm-architecture-patte.md +0 -45
- package/dist/template/.opencode/memory/observations/2026-01-30-pattern-swarm-tools-architecture.md +0 -28
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-copilot-auth-plugin-updated-with-baseurl.md +0 -63
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-created-dedicated-worker-agent-for-swarm.md +0 -20
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-rollback-to-v1-1-47-for-copilot-claude-r.md +0 -21
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-simplified-swarm-to-task-tool-pattern.md +0 -44
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-swarm-architecture-task-tool-over-tmux.md +0 -33
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-worker-skills-defined-for-swarm-delegati.md +0 -30
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-gpt-reasoning-config-for-github-copilot.md +0 -51
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-auth-comparison-finding.md +0 -61
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-reasoning-architecture-.md +0 -66
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-custom-tools-api.md +0 -48
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-v1-1-48-skills-as-slash-command.md +0 -21
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-swarm-system-simplified-removed-mailbox-.md +0 -30
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-v1-1-48-native-copilot-reasoning-via-pr-.md +0 -45
- package/dist/template/.opencode/memory/observations/2026-01-31-warning-cannot-add-custom-config-to-opencode-jso.md +0 -18
- package/dist/template/.opencode/memory/observations/2026-01-31-warning-copilot-claude-v1-endpoint-returns-404-c.md +0 -48
- package/dist/template/.opencode/memory/observations/2026-01-31-warning-opencode-v1-1-48-claude-thinking-block-s.md +0 -51
- package/dist/template/.opencode/memory/project/architecture.md +0 -60
- package/dist/template/.opencode/memory/project/commands.md +0 -72
- package/dist/template/.opencode/memory/project/conventions.md +0 -68
- package/dist/template/.opencode/memory/project/gotchas.md +0 -41
- package/dist/template/.opencode/skill/notebooklm/SKILL.md +0 -272
- package/dist/template/.opencode/skill/notebooklm/references/setup.md +0 -353
- package/dist/template/.opencode/tool/notebooklm.ts +0 -488
- package/dist/template/.opencode/tool/oracle.ts +0 -240
- /package/dist/template/.opencode/memory/{user.example.md → _templates/user.md} +0 -0
- /package/dist/template/.opencode/memory/{user.md → project/user.md} +0 -0
|
@@ -1,556 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Optimize an existing skill for clarity, brevity, and effectiveness
|
|
3
|
-
argument-hint: "<skill-name> [--audit] [--compress] [--test]"
|
|
4
|
-
agent: build
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Optimize Skill: $ARGUMENTS
|
|
8
|
-
|
|
9
|
-
Improve an existing skill to be more effective, concise, and resistant to agent rationalization.
|
|
10
|
-
|
|
11
|
-
## Prerequisites
|
|
12
|
-
|
|
13
|
-
Load the skill-creator skill:
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
skill({ name: "skill-creator" });
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Phase 1: Locate and Load Current Skill
|
|
20
|
-
|
|
21
|
-
### Find Skill Location
|
|
22
|
-
|
|
23
|
-
!`ls -la .opencode/skill/$ARGUMENTS/ 2>/dev/null`
|
|
24
|
-
!`ls -la .opencode/superpowers/skills/$ARGUMENTS/ 2>/dev/null`
|
|
25
|
-
!`ls -la ~/.opencode/skills/$ARGUMENTS/ 2>/dev/null`
|
|
26
|
-
|
|
27
|
-
### Load Current Content
|
|
28
|
-
|
|
29
|
-
```typescript
|
|
30
|
-
read({ filePath: ".opencode/skill/$ARGUMENTS/SKILL.md" });
|
|
31
|
-
read({ filePath: ".opencode/skill/$ARGUMENTS/instructions.md" });
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Phase 2: Skill Audit
|
|
35
|
-
|
|
36
|
-
### Metrics to Evaluate
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
SKILL AUDIT: $ARGUMENTS
|
|
40
|
-
━━━━━━━━━━━━━━━━━━━━━━━
|
|
41
|
-
|
|
42
|
-
STRUCTURE
|
|
43
|
-
─────────
|
|
44
|
-
Lines in SKILL.md: [count]
|
|
45
|
-
Lines in instructions.md: [count]
|
|
46
|
-
Total tokens (est): [count]
|
|
47
|
-
Phases defined: [count]
|
|
48
|
-
Verification steps: [count]
|
|
49
|
-
|
|
50
|
-
QUALITY INDICATORS
|
|
51
|
-
──────────────────
|
|
52
|
-
Score Notes
|
|
53
|
-
Trigger Clarity [1-5] [notes]
|
|
54
|
-
Step Specificity [1-5] [notes]
|
|
55
|
-
Rationalization Resistance [1-5] [notes]
|
|
56
|
-
Verification Coverage [1-5] [notes]
|
|
57
|
-
Anti-Pattern Coverage [1-5] [notes]
|
|
58
|
-
Example Quality [1-5] [notes]
|
|
59
|
-
|
|
60
|
-
Overall Score: [X]/30
|
|
61
|
-
|
|
62
|
-
ISSUES DETECTED
|
|
63
|
-
───────────────
|
|
64
|
-
⚠️ [Issue 1]
|
|
65
|
-
⚠️ [Issue 2]
|
|
66
|
-
⚠️ [Issue 3]
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Common Issues to Check
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
const auditChecklist = [
|
|
73
|
-
// Clarity Issues
|
|
74
|
-
{ pattern: /usually|typically|generally/gi, issue: "Ambiguous language" },
|
|
75
|
-
{ pattern: /consider|might want to/gi, issue: "Weak directives" },
|
|
76
|
-
{ pattern: /if you feel|as needed/gi, issue: "Subjective conditions" },
|
|
77
|
-
|
|
78
|
-
// Missing Structure
|
|
79
|
-
{ check: "no_phases", issue: "Missing phase structure" },
|
|
80
|
-
{ check: "no_verification", issue: "No verification steps" },
|
|
81
|
-
{ check: "no_antipatterns", issue: "Missing anti-patterns section" },
|
|
82
|
-
|
|
83
|
-
// Bloat
|
|
84
|
-
{
|
|
85
|
-
check: "excessive_explanation",
|
|
86
|
-
issue: "Too much rationale, not enough instruction",
|
|
87
|
-
},
|
|
88
|
-
{ check: "duplicate_content", issue: "Repeated information" },
|
|
89
|
-
{ check: "no_examples", issue: "Abstract without examples" },
|
|
90
|
-
|
|
91
|
-
// Gaps
|
|
92
|
-
{ check: "no_error_handling", issue: "Missing error handling" },
|
|
93
|
-
{ check: "no_escape_hatch", issue: "No exit conditions defined" },
|
|
94
|
-
];
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## Phase 3: Identify Optimization Goals
|
|
98
|
-
|
|
99
|
-
### Optimization Types
|
|
100
|
-
|
|
101
|
-
| Goal | When to Use | Approach |
|
|
102
|
-
| --------------- | ------------------------------- | ----------------------------------- |
|
|
103
|
-
| **Compress** | Skill is too verbose | Remove redundancy, tighten language |
|
|
104
|
-
| **Clarify** | Agents misinterpret steps | Make instructions more specific |
|
|
105
|
-
| **Harden** | Agents rationalize around rules | Add MUST/NEVER, close loopholes |
|
|
106
|
-
| **Expand** | Missing edge cases | Add scenarios, anti-patterns |
|
|
107
|
-
| **Restructure** | Poor flow | Reorganize phases |
|
|
108
|
-
|
|
109
|
-
### Select Optimization Mode
|
|
110
|
-
|
|
111
|
-
Based on audit, prioritize:
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
OPTIMIZATION PLAN: $ARGUMENTS
|
|
115
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
116
|
-
|
|
117
|
-
Primary Goal: [COMPRESS/CLARIFY/HARDEN/EXPAND/RESTRUCTURE]
|
|
118
|
-
|
|
119
|
-
Changes Needed:
|
|
120
|
-
1. [High priority change]
|
|
121
|
-
2. [Medium priority change]
|
|
122
|
-
3. [Low priority change]
|
|
123
|
-
|
|
124
|
-
Estimated Token Savings: [X tokens]
|
|
125
|
-
Expected Effectiveness Gain: [description]
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Phase 4: Apply Optimizations
|
|
129
|
-
|
|
130
|
-
### Compression Techniques
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
BEFORE (verbose):
|
|
134
|
-
─────────────────
|
|
135
|
-
"When you are working on this task, you should typically try
|
|
136
|
-
to make sure that you check the test results before moving
|
|
137
|
-
forward to the next step. This is important because tests
|
|
138
|
-
can reveal issues that might otherwise go unnoticed."
|
|
139
|
-
|
|
140
|
-
AFTER (compressed):
|
|
141
|
-
───────────────────
|
|
142
|
-
"MUST run tests before proceeding. If any fail, STOP and fix."
|
|
143
|
-
|
|
144
|
-
Rules:
|
|
145
|
-
- Remove hedging words (typically, usually, might)
|
|
146
|
-
- Convert passive to active voice
|
|
147
|
-
- Replace explanations with imperatives
|
|
148
|
-
- Use MUST/NEVER for non-negotiable steps
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Clarification Techniques
|
|
152
|
-
|
|
153
|
-
````
|
|
154
|
-
BEFORE (vague):
|
|
155
|
-
──────────────
|
|
156
|
-
"Check that the configuration is correct."
|
|
157
|
-
|
|
158
|
-
AFTER (specific):
|
|
159
|
-
────────────────
|
|
160
|
-
"Verify config:
|
|
161
|
-
1. Run: `npm run config:check`
|
|
162
|
-
2. Confirm output shows: 'Configuration valid'
|
|
163
|
-
3. If errors, check [specific file] for [specific issue]"
|
|
164
|
-
|
|
165
|
-
Rules:
|
|
166
|
-
- Replace "check" with specific verification command
|
|
167
|
-
- Include expected output
|
|
168
|
-
- Add troubleshooting for failures
|
|
169
|
-
|
|
170
|
-
Use question tool to confirm:
|
|
171
|
-
```typescript
|
|
172
|
-
question({
|
|
173
|
-
questions: [{
|
|
174
|
-
header: "Verify",
|
|
175
|
-
question: "Configuration verified. Ready to continue?",
|
|
176
|
-
options: [
|
|
177
|
-
{ label: "Yes, continue", description: "Proceed with optimization" },
|
|
178
|
-
{ label: "No, fix issues", description: "Address validation errors first" }
|
|
179
|
-
]
|
|
180
|
-
}]
|
|
181
|
-
});
|
|
182
|
-
````
|
|
183
|
-
|
|
184
|
-
BEFORE (vague):
|
|
185
|
-
───────────────
|
|
186
|
-
"Check that the configuration is correct."
|
|
187
|
-
|
|
188
|
-
AFTER (specific):
|
|
189
|
-
─────────────────
|
|
190
|
-
"Verify config:
|
|
191
|
-
|
|
192
|
-
1. Run: `npm run config:check`
|
|
193
|
-
2. Confirm output shows: 'Configuration valid'
|
|
194
|
-
3. If errors, check [specific file] for [specific issue]"
|
|
195
|
-
|
|
196
|
-
Rules:
|
|
197
|
-
|
|
198
|
-
- Replace "check" with specific verification command
|
|
199
|
-
- Include expected output
|
|
200
|
-
- Add troubleshooting for failures
|
|
201
|
-
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Hardening Techniques
|
|
205
|
-
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
BEFORE (soft):
|
|
209
|
-
──────────────
|
|
210
|
-
"You should generally avoid committing directly to main."
|
|
211
|
-
|
|
212
|
-
AFTER (hardened):
|
|
213
|
-
─────────────────
|
|
214
|
-
"NEVER commit directly to main. ALWAYS use feature branches.
|
|
215
|
-
|
|
216
|
-
If tempted to commit to main because 'it's just a small fix':
|
|
217
|
-
|
|
218
|
-
- STOP
|
|
219
|
-
- Create branch anyway: git checkout -b fix/small-fix
|
|
220
|
-
- This is NOT optional"
|
|
221
|
-
|
|
222
|
-
Rules:
|
|
223
|
-
|
|
224
|
-
- Add MUST/NEVER to critical rules
|
|
225
|
-
- Anticipate rationalizations
|
|
226
|
-
- Explicitly reject common excuses
|
|
227
|
-
- Name the anti-pattern
|
|
228
|
-
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### Expansion Techniques
|
|
232
|
-
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
BEFORE (incomplete):
|
|
236
|
-
────────────────────
|
|
237
|
-
"Handle errors appropriately."
|
|
238
|
-
|
|
239
|
-
AFTER (comprehensive):
|
|
240
|
-
──────────────────────
|
|
241
|
-
"Error Handling:
|
|
242
|
-
|
|
243
|
-
Network Errors:
|
|
244
|
-
|
|
245
|
-
- Retry 2x with exponential backoff
|
|
246
|
-
- If still failing, log and surface to user
|
|
247
|
-
|
|
248
|
-
Validation Errors:
|
|
249
|
-
|
|
250
|
-
- Display specific field errors
|
|
251
|
-
- Do NOT proceed with invalid data
|
|
252
|
-
|
|
253
|
-
Permission Errors:
|
|
254
|
-
|
|
255
|
-
- Log with full context
|
|
256
|
-
- Display user-friendly message
|
|
257
|
-
- Do NOT expose internal details"
|
|
258
|
-
|
|
259
|
-
Rules:
|
|
260
|
-
|
|
261
|
-
- List specific error categories
|
|
262
|
-
- Provide handling for each
|
|
263
|
-
- Include what NOT to do
|
|
264
|
-
|
|
265
|
-
````
|
|
266
|
-
|
|
267
|
-
## Phase 5: Test Optimizations
|
|
268
|
-
|
|
269
|
-
### Before/After Comparison
|
|
270
|
-
|
|
271
|
-
```typescript
|
|
272
|
-
// Test with original skill
|
|
273
|
-
task({
|
|
274
|
-
subagent_type: "build",
|
|
275
|
-
description: "Test original skill",
|
|
276
|
-
prompt: `
|
|
277
|
-
Load skill: skill({ name: "$ARGUMENTS" })
|
|
278
|
-
|
|
279
|
-
Scenario: [test scenario]
|
|
280
|
-
|
|
281
|
-
Follow the skill and report each step.
|
|
282
|
-
`,
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
// Test with optimized skill (after saving changes)
|
|
286
|
-
task({
|
|
287
|
-
subagent_type: "build",
|
|
288
|
-
description: "Test optimized skill",
|
|
289
|
-
prompt: `
|
|
290
|
-
Load skill: skill({ name: "$ARGUMENTS" })
|
|
291
|
-
|
|
292
|
-
Scenario: [same test scenario]
|
|
293
|
-
|
|
294
|
-
Follow the skill and report each step.
|
|
295
|
-
`,
|
|
296
|
-
});
|
|
297
|
-
````
|
|
298
|
-
|
|
299
|
-
### Compare Results
|
|
300
|
-
|
|
301
|
-
```
|
|
302
|
-
TEST COMPARISON
|
|
303
|
-
━━━━━━━━━━━━━━━
|
|
304
|
-
|
|
305
|
-
Original Optimized
|
|
306
|
-
────────────────────────────────────────────
|
|
307
|
-
Completed correctly 70% 95%
|
|
308
|
-
Steps followed 8/10 10/10
|
|
309
|
-
Rationalizations 3 0
|
|
310
|
-
Verification done Partial Full
|
|
311
|
-
Token usage 12,000 8,000
|
|
312
|
-
|
|
313
|
-
Improvement: ✓ Significant
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
## Phase 6: Validate Anti-Rationalization
|
|
317
|
-
|
|
318
|
-
### Intentional Pressure Test
|
|
319
|
-
|
|
320
|
-
```typescript
|
|
321
|
-
task({
|
|
322
|
-
subagent_type: "build",
|
|
323
|
-
description: "Pressure test skill",
|
|
324
|
-
prompt: `
|
|
325
|
-
Load skill: skill({ name: "$ARGUMENTS" })
|
|
326
|
-
|
|
327
|
-
Scenario: [test scenario]
|
|
328
|
-
|
|
329
|
-
IMPORTANT: You are under time pressure. Try to complete
|
|
330
|
-
this as quickly as possible. Some steps may seem
|
|
331
|
-
unnecessary - use your judgment on what to skip.
|
|
332
|
-
|
|
333
|
-
Report what you did.
|
|
334
|
-
`,
|
|
335
|
-
});
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
**If agent skips steps:** Skill needs hardening at those points.
|
|
339
|
-
|
|
340
|
-
### Edge Case Test
|
|
341
|
-
|
|
342
|
-
```typescript
|
|
343
|
-
task({
|
|
344
|
-
subagent_type: "build",
|
|
345
|
-
description: "Edge case test",
|
|
346
|
-
prompt: `
|
|
347
|
-
Load skill: skill({ name: "$ARGUMENTS" })
|
|
348
|
-
|
|
349
|
-
Scenario: [unusual edge case]
|
|
350
|
-
|
|
351
|
-
Follow the skill. If the skill doesn't cover this case,
|
|
352
|
-
note what guidance was missing.
|
|
353
|
-
`,
|
|
354
|
-
});
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
## Phase 7: Document Changes
|
|
358
|
-
|
|
359
|
-
### Create Changelog
|
|
360
|
-
|
|
361
|
-
```markdown
|
|
362
|
-
# $ARGUMENTS Optimization Changelog
|
|
363
|
-
|
|
364
|
-
## Version [X.Y] - [Date]
|
|
365
|
-
|
|
366
|
-
### Changed
|
|
367
|
-
|
|
368
|
-
- Compressed phase 2 instructions (saved ~2000 tokens)
|
|
369
|
-
- Added specific verification commands to phase 3
|
|
370
|
-
- Hardened commit rules with explicit anti-patterns
|
|
371
|
-
|
|
372
|
-
### Added
|
|
373
|
-
|
|
374
|
-
- Error handling section for network failures
|
|
375
|
-
- Edge case: handling empty input
|
|
376
|
-
- Troubleshooting: common TypeScript errors
|
|
377
|
-
|
|
378
|
-
### Removed
|
|
379
|
-
|
|
380
|
-
- Redundant explanations in phase 1
|
|
381
|
-
- Duplicate verification steps
|
|
382
|
-
|
|
383
|
-
### Metrics
|
|
384
|
-
|
|
385
|
-
- Token count: 12,000 → 8,500 (-29%)
|
|
386
|
-
- Test pass rate: 70% → 95%
|
|
387
|
-
- Rationalization incidents: 3 → 0
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
## Phase 8: Apply and Verify
|
|
391
|
-
|
|
392
|
-
### Save Changes
|
|
393
|
-
|
|
394
|
-
```typescript
|
|
395
|
-
write({
|
|
396
|
-
filePath: ".opencode/skill/$ARGUMENTS/SKILL.md",
|
|
397
|
-
content: optimizedSkillContent,
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
write({
|
|
401
|
-
filePath: ".opencode/skill/$ARGUMENTS/instructions.md",
|
|
402
|
-
content: optimizedInstructionsContent,
|
|
403
|
-
});
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
### Final Verification
|
|
407
|
-
|
|
408
|
-
```typescript
|
|
409
|
-
// Reload and verify
|
|
410
|
-
skill({ name: "$ARGUMENTS" });
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
```typescript
|
|
414
|
-
question({
|
|
415
|
-
questions: [
|
|
416
|
-
{
|
|
417
|
-
header: "Verify",
|
|
418
|
-
question: "Skill optimized and saved. Ready to deploy?",
|
|
419
|
-
options: [
|
|
420
|
-
{
|
|
421
|
-
label: "Yes, deploy (Recommended)",
|
|
422
|
-
description: "All verifications passed",
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
label: "No, fix issues",
|
|
426
|
-
description: "Need to address verification failures",
|
|
427
|
-
},
|
|
428
|
-
],
|
|
429
|
-
},
|
|
430
|
-
],
|
|
431
|
-
});
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
Confirm:
|
|
435
|
-
|
|
436
|
-
- [ ] Skill loads without error
|
|
437
|
-
- [ ] Instructions display correctly
|
|
438
|
-
- [ ] Token count reduced (if compression goal)
|
|
439
|
-
- [ ] Test scenarios pass
|
|
440
|
-
- [ ] Anti-rationalization test passes
|
|
441
|
-
|
|
442
|
-
## Quick Optimization Modes
|
|
443
|
-
|
|
444
|
-
### Compress Mode (--compress)
|
|
445
|
-
|
|
446
|
-
Focus only on reducing token count:
|
|
447
|
-
|
|
448
|
-
```bash
|
|
449
|
-
/skill-optimize my-skill --compress
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
Targets:
|
|
453
|
-
|
|
454
|
-
- Remove redundant explanations
|
|
455
|
-
- Consolidate duplicate steps
|
|
456
|
-
- Shorten verbose instructions
|
|
457
|
-
- Goal: 30% token reduction
|
|
458
|
-
|
|
459
|
-
### Audit Mode (--audit)
|
|
460
|
-
|
|
461
|
-
Only analyze, don't modify:
|
|
462
|
-
|
|
463
|
-
```bash
|
|
464
|
-
/skill-optimize my-skill --audit
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
Produces audit report without changes.
|
|
468
|
-
|
|
469
|
-
### Test Mode (--test)
|
|
470
|
-
|
|
471
|
-
Run full test suite against skill:
|
|
472
|
-
|
|
473
|
-
```bash
|
|
474
|
-
/skill-optimize my-skill --test
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
Runs baseline and skill tests, reports effectiveness.
|
|
478
|
-
|
|
479
|
-
## Optimization Patterns
|
|
480
|
-
|
|
481
|
-
### Pattern: Guard Clauses
|
|
482
|
-
|
|
483
|
-
```
|
|
484
|
-
BEFORE:
|
|
485
|
-
"If the input is valid, proceed with processing.
|
|
486
|
-
Otherwise, return an error."
|
|
487
|
-
|
|
488
|
-
AFTER:
|
|
489
|
-
"GUARD: Check input validity first
|
|
490
|
-
- If invalid: return error immediately
|
|
491
|
-
- If valid: continue to processing
|
|
492
|
-
|
|
493
|
-
DO NOT proceed with invalid input under any circumstances."
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
### Pattern: Named Anti-Patterns
|
|
497
|
-
|
|
498
|
-
```
|
|
499
|
-
BEFORE:
|
|
500
|
-
"Don't skip the tests."
|
|
501
|
-
|
|
502
|
-
AFTER:
|
|
503
|
-
"❌ ANTI-PATTERN: 'YOLO Deploy'
|
|
504
|
-
Skipping tests because 'it's a small change' or 'I tested manually'
|
|
505
|
-
|
|
506
|
-
This ALWAYS leads to production bugs. NO EXCEPTIONS.
|
|
507
|
-
Run the full test suite even for one-line changes."
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
### Pattern: Verification Gates
|
|
511
|
-
|
|
512
|
-
```
|
|
513
|
-
BEFORE:
|
|
514
|
-
"Make sure the build passes."
|
|
515
|
-
|
|
516
|
-
AFTER:
|
|
517
|
-
"GATE: Build Verification
|
|
518
|
-
Run: npm run build
|
|
519
|
-
Expected: 'Build completed successfully'
|
|
520
|
-
|
|
521
|
-
⛔ DO NOT PROCEED if:
|
|
522
|
-
- Build fails
|
|
523
|
-
- Warnings about missing dependencies
|
|
524
|
-
- TypeScript errors (even if build 'succeeds')
|
|
525
|
-
|
|
526
|
-
If gate fails, fix issues before continuing."
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
## Output
|
|
530
|
-
|
|
531
|
-
```
|
|
532
|
-
SKILL OPTIMIZED: $ARGUMENTS
|
|
533
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
534
|
-
|
|
535
|
-
Changes Applied:
|
|
536
|
-
✓ Compressed phase 2 (saved 2,100 tokens)
|
|
537
|
-
✓ Added 3 verification gates
|
|
538
|
-
✓ Hardened 2 critical rules
|
|
539
|
-
✓ Added 4 anti-patterns
|
|
540
|
-
|
|
541
|
-
Metrics:
|
|
542
|
-
Before After Change
|
|
543
|
-
──────────────────────────────────────
|
|
544
|
-
12,000 tokens 8,500 tokens -29%
|
|
545
|
-
70% pass rate 95% pass rate +36%
|
|
546
|
-
3 rationalizations 0 -100%
|
|
547
|
-
|
|
548
|
-
Files Modified:
|
|
549
|
-
.opencode/skill/$ARGUMENTS/SKILL.md
|
|
550
|
-
.opencode/skill/$ARGUMENTS/instructions.md
|
|
551
|
-
|
|
552
|
-
Next Steps:
|
|
553
|
-
- Run additional edge case tests
|
|
554
|
-
- Consider sharing upstream: skill({ name: "sharing-skills" })
|
|
555
|
-
- Monitor for new failure modes in production use
|
|
556
|
-
```
|