opencodekit 0.18.0 → 0.18.2
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 +1 -1
- package/dist/template/.opencode/AGENTS.md +57 -0
- package/dist/template/.opencode/agent/scout.md +0 -37
- package/dist/template/.opencode/command/resume.md +1 -1
- package/dist/template/.opencode/command/status.md +7 -14
- 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/plugin/README.md +37 -25
- package/dist/template/.opencode/skill/accessibility-audit/SKILL.md +11 -5
- package/dist/template/.opencode/skill/agent-browser/SKILL.md +55 -18
- package/dist/template/.opencode/skill/agent-teams/SKILL.md +12 -1
- package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +11 -1
- package/dist/template/.opencode/skill/beads/SKILL.md +57 -390
- package/dist/template/.opencode/skill/beads/references/BEST_PRACTICES.md +27 -0
- package/dist/template/.opencode/skill/beads/references/EXAMPLES.md +45 -0
- package/dist/template/.opencode/skill/beads/references/FILE_CLAIMING.md +101 -0
- package/dist/template/.opencode/skill/beads/references/GIT_SYNC.md +25 -0
- package/dist/template/.opencode/skill/beads/references/HIERARCHY.md +71 -0
- package/dist/template/.opencode/skill/beads/references/MULTI_AGENT.md +40 -0
- package/dist/template/.opencode/skill/beads/references/SESSION_PROTOCOL.md +61 -0
- package/dist/template/.opencode/skill/beads/references/TASK_CREATION.md +38 -0
- package/dist/template/.opencode/skill/beads/references/TROUBLESHOOTING.md +13 -0
- package/dist/template/.opencode/skill/beads-bridge/SKILL.md +10 -10
- package/dist/template/.opencode/skill/brainstorming/SKILL.md +13 -0
- package/dist/template/.opencode/skill/chrome-devtools/SKILL.md +11 -1
- package/dist/template/.opencode/skill/cloudflare/SKILL.md +87 -67
- package/dist/template/.opencode/skill/compaction/SKILL.md +11 -3
- package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +11 -25
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +13 -2
- package/dist/template/.opencode/skill/context-initialization/SKILL.md +11 -1
- package/dist/template/.opencode/skill/context-management/SKILL.md +13 -1
- package/dist/template/.opencode/skill/core-data-expert/SKILL.md +13 -2
- package/dist/template/.opencode/skill/deep-research/SKILL.md +5 -8
- package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +13 -0
- package/dist/template/.opencode/skill/design-system-audit/SKILL.md +9 -3
- package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +51 -0
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +19 -30
- package/dist/template/.opencode/skill/executing-plans/SKILL.md +36 -0
- package/dist/template/.opencode/skill/figma/SKILL.md +11 -1
- package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +31 -0
- package/dist/template/.opencode/skill/frontend-design/SKILL.md +13 -3
- package/dist/template/.opencode/skill/gemini-large-context/SKILL.md +11 -0
- package/dist/template/.opencode/skill/index-knowledge/SKILL.md +11 -1
- package/dist/template/.opencode/skill/jira/SKILL.md +11 -1
- package/dist/template/.opencode/skill/memory-system/SKILL.md +115 -60
- package/dist/template/.opencode/skill/mockup-to-code/SKILL.md +9 -3
- package/dist/template/.opencode/skill/mqdh/SKILL.md +11 -1
- package/dist/template/.opencode/skill/obsidian/SKILL.md +11 -1
- package/dist/template/.opencode/skill/opensrc/SKILL.md +18 -6
- package/dist/template/.opencode/skill/pdf-extract/SKILL.md +11 -1
- package/dist/template/.opencode/skill/playwright/SKILL.md +11 -1
- package/dist/template/.opencode/skill/playwriter/SKILL.md +11 -1
- package/dist/template/.opencode/skill/polar/SKILL.md +11 -1
- package/dist/template/.opencode/skill/prd/SKILL.md +13 -4
- package/dist/template/.opencode/skill/prd-task/SKILL.md +13 -3
- package/dist/template/.opencode/skill/ralph/SKILL.md +4 -8
- package/dist/template/.opencode/skill/react-best-practices/SKILL.md +24 -16
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +22 -0
- package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +30 -2
- package/dist/template/.opencode/skill/resend/SKILL.md +11 -1
- package/dist/template/.opencode/skill/root-cause-tracing/SKILL.md +12 -23
- package/dist/template/.opencode/skill/session-management/SKILL.md +33 -36
- package/dist/template/.opencode/skill/sharing-skills/SKILL.md +11 -0
- package/dist/template/.opencode/skill/skill-creator/SKILL.md +12 -11
- package/dist/template/.opencode/skill/source-code-research/SKILL.md +20 -266
- package/dist/template/.opencode/skill/source-code-research/references/analysis-tips.md +43 -0
- package/dist/template/.opencode/skill/source-code-research/references/anti-patterns.md +36 -0
- package/dist/template/.opencode/skill/source-code-research/references/common-patterns.md +57 -0
- package/dist/template/.opencode/skill/source-code-research/references/example-workflow.md +60 -0
- package/dist/template/.opencode/skill/source-code-research/references/further-reading.md +5 -0
- package/dist/template/.opencode/skill/source-code-research/references/source-structure.md +45 -0
- package/dist/template/.opencode/skill/stitch/SKILL.md +11 -1
- package/dist/template/.opencode/skill/structured-edit/SKILL.md +13 -0
- package/dist/template/.opencode/skill/subagent-driven-development/SKILL.md +13 -14
- package/dist/template/.opencode/skill/supabase/SKILL.md +11 -1
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/SKILL.md +23 -15
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +23 -923
- package/dist/template/.opencode/skill/swarm-coordination/references/architecture.md +39 -0
- package/dist/template/.opencode/skill/swarm-coordination/references/delegation-worker-protocol.md +145 -0
- package/dist/template/.opencode/skill/swarm-coordination/references/dependency-graph.md +50 -0
- package/dist/template/.opencode/skill/swarm-coordination/references/drift-check.md +90 -0
- package/dist/template/.opencode/skill/swarm-coordination/references/integration-beads.md +20 -0
- package/dist/template/.opencode/skill/swarm-coordination/references/launch-flow.md +186 -0
- package/dist/template/.opencode/skill/swarm-coordination/references/reconciler.md +172 -0
- package/dist/template/.opencode/skill/swarm-coordination/references/tier-enforcement.md +78 -0
- package/dist/template/.opencode/skill/swarm-coordination/references/tmux-integration.md +134 -0
- package/dist/template/.opencode/skill/swift-concurrency/SKILL.md +22 -2
- package/dist/template/.opencode/skill/swiftui-expert-skill/SKILL.md +58 -19
- package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +25 -25
- package/dist/template/.opencode/skill/test-driven-development/SKILL.md +19 -15
- package/dist/template/.opencode/skill/testing-anti-patterns/SKILL.md +13 -0
- package/dist/template/.opencode/skill/testing-skills-with-subagents/SKILL.md +13 -15
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +13 -0
- package/dist/template/.opencode/skill/ui-ux-research/SKILL.md +9 -3
- package/dist/template/.opencode/skill/using-git-worktrees/SKILL.md +11 -0
- package/dist/template/.opencode/skill/using-skills/SKILL.md +13 -0
- package/dist/template/.opencode/skill/v0/SKILL.md +11 -1
- package/dist/template/.opencode/skill/v1-run/SKILL.md +11 -1
- package/dist/template/.opencode/skill/vercel-deploy-claimable/SKILL.md +14 -2
- package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +22 -0
- package/dist/template/.opencode/skill/visual-analysis/SKILL.md +9 -3
- package/dist/template/.opencode/skill/web-design-guidelines/SKILL.md +12 -5
- package/dist/template/.opencode/skill/writing-plans/SKILL.md +13 -0
- package/dist/template/.opencode/skill/writing-skills/SKILL.md +26 -421
- package/dist/template/.opencode/skill/writing-skills/references/anti-patterns.md +25 -0
- package/dist/template/.opencode/skill/writing-skills/references/claude-search-optimization.md +140 -0
- package/dist/template/.opencode/skill/writing-skills/references/discovery-workflow.md +11 -0
- package/dist/template/.opencode/skill/writing-skills/references/file-organization.md +32 -0
- package/dist/template/.opencode/skill/writing-skills/references/flowcharts-and-examples.md +57 -0
- package/dist/template/.opencode/skill/writing-skills/references/rationalization-hardening.md +75 -0
- package/dist/template/.opencode/skill/writing-skills/references/testing-skill-types.md +52 -0
- package/package.json +15 -4
- package/dist/template/.opencode/plugin/compaction.ts +0 -190
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Claude Search Optimization (CSO)
|
|
2
|
+
|
|
3
|
+
**Critical for discovery:** Future Claude needs to FIND your skill
|
|
4
|
+
|
|
5
|
+
## 1. Rich Description Field
|
|
6
|
+
|
|
7
|
+
**Purpose:** Claude reads description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"
|
|
8
|
+
|
|
9
|
+
**Format:** Start with "Use when..." to focus on triggering conditions, then explain what it does
|
|
10
|
+
|
|
11
|
+
**Content:**
|
|
12
|
+
|
|
13
|
+
- Use concrete triggers, symptoms, and situations that signal this skill applies
|
|
14
|
+
- Describe the _problem_ (race conditions, inconsistent behavior) not _language-specific symptoms_ (setTimeout, sleep)
|
|
15
|
+
- Keep triggers technology-agnostic unless the skill itself is technology-specific
|
|
16
|
+
- If skill is technology-specific, make that explicit in the trigger
|
|
17
|
+
- Write in third person (injected into system prompt)
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
# ❌ BAD: Too abstract, vague, doesn't include when to use
|
|
21
|
+
description: For async testing
|
|
22
|
+
|
|
23
|
+
# ❌ BAD: First person
|
|
24
|
+
description: I can help you with async tests when they're flaky
|
|
25
|
+
|
|
26
|
+
# ❌ BAD: Mentions technology but skill isn't specific to it
|
|
27
|
+
description: Use when tests use setTimeout/sleep and are flaky
|
|
28
|
+
|
|
29
|
+
# ✅ GOOD: Starts with "Use when", describes problem, then what it does
|
|
30
|
+
description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently - replaces arbitrary timeouts with condition polling for reliable async tests
|
|
31
|
+
|
|
32
|
+
# ✅ GOOD: Technology-specific skill with explicit trigger
|
|
33
|
+
description: Use when using React Router and handling authentication redirects - provides patterns for protected routes and auth state management
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 2. Keyword Coverage
|
|
37
|
+
|
|
38
|
+
Use words Claude would search for:
|
|
39
|
+
|
|
40
|
+
- Error messages: "Hook timed out", "ENOTEMPTY", "race condition"
|
|
41
|
+
- Symptoms: "flaky", "hanging", "zombie", "pollution"
|
|
42
|
+
- Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach"
|
|
43
|
+
- Tools: Actual commands, library names, file types
|
|
44
|
+
|
|
45
|
+
## 3. Descriptive Naming
|
|
46
|
+
|
|
47
|
+
**Use active voice, verb-first:**
|
|
48
|
+
|
|
49
|
+
- ✅ `creating-skills` not `skill-creation`
|
|
50
|
+
- ✅ `testing-skills-with-subagents` not `subagent-skill-testing`
|
|
51
|
+
|
|
52
|
+
## 4. Token Efficiency (Critical)
|
|
53
|
+
|
|
54
|
+
**Problem:** getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.
|
|
55
|
+
|
|
56
|
+
**Target word counts:**
|
|
57
|
+
|
|
58
|
+
- getting-started workflows: <150 words each
|
|
59
|
+
- Frequently-loaded skills: <200 words total
|
|
60
|
+
- Other skills: <500 words (still be concise)
|
|
61
|
+
|
|
62
|
+
**Techniques:**
|
|
63
|
+
|
|
64
|
+
**Move details to tool help:**
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# ❌ BAD: Document all flags in SKILL.md
|
|
68
|
+
search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
|
|
69
|
+
|
|
70
|
+
# ✅ GOOD: Reference --help
|
|
71
|
+
search-conversations supports multiple modes and filters. Run --help for details.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Use cross-references:**
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
# ❌ BAD: Repeat workflow details
|
|
78
|
+
|
|
79
|
+
When searching, dispatch subagent with template...
|
|
80
|
+
[20 lines of repeated instructions]
|
|
81
|
+
|
|
82
|
+
# ✅ GOOD: Reference other skill
|
|
83
|
+
|
|
84
|
+
Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Compress examples:**
|
|
88
|
+
|
|
89
|
+
```markdown
|
|
90
|
+
# ❌ BAD: Verbose example (42 words)
|
|
91
|
+
|
|
92
|
+
your human partner: "How did we handle authentication errors in React Router before?"
|
|
93
|
+
You: I'll search past conversations for React Router authentication patterns.
|
|
94
|
+
[Dispatch subagent with search query: "React Router authentication error handling 401"]
|
|
95
|
+
|
|
96
|
+
# ✅ GOOD: Minimal example (20 words)
|
|
97
|
+
|
|
98
|
+
Partner: "How did we handle auth errors in React Router?"
|
|
99
|
+
You: Searching...
|
|
100
|
+
[Dispatch subagent → synthesis]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Eliminate redundancy:**
|
|
104
|
+
|
|
105
|
+
- Don't repeat what's in cross-referenced skills
|
|
106
|
+
- Don't explain what's obvious from command
|
|
107
|
+
- Don't include multiple examples of same pattern
|
|
108
|
+
|
|
109
|
+
**Verification:**
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
wc -w skills/path/SKILL.md
|
|
113
|
+
# getting-started workflows: aim for <150 each
|
|
114
|
+
# Other frequently-loaded: aim for <200 total
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Name by what you DO or core insight:**
|
|
118
|
+
|
|
119
|
+
- ✅ `condition-based-waiting` > `async-test-helpers`
|
|
120
|
+
- ✅ `using-skills` not `skill-usage`
|
|
121
|
+
- ✅ `flatten-with-flags` > `data-structure-refactoring`
|
|
122
|
+
- ✅ `root-cause-tracing` > `debugging-techniques`
|
|
123
|
+
|
|
124
|
+
**Gerunds (-ing) work well for processes:**
|
|
125
|
+
|
|
126
|
+
- `creating-skills`, `testing-skills`, `debugging-with-logs`
|
|
127
|
+
- Active, describes the action you're taking
|
|
128
|
+
|
|
129
|
+
## 4. Cross-Referencing Other Skills
|
|
130
|
+
|
|
131
|
+
**When writing documentation that references other skills:**
|
|
132
|
+
|
|
133
|
+
Use skill name only, with explicit requirement markers:
|
|
134
|
+
|
|
135
|
+
- ✅ Good: `**REQUIRED SUB-SKILL:** Use skill({ name: "test-driven-development" })`
|
|
136
|
+
- ✅ Good: `**REQUIRED BACKGROUND:** You MUST understand systematic-debugging`
|
|
137
|
+
- ❌ Bad: `See skills/testing/test-driven-development` (unclear if required)
|
|
138
|
+
- ❌ Bad: `@skills/testing/test-driven-development/SKILL.md` (force-loads, burns context)
|
|
139
|
+
|
|
140
|
+
**Why no @ links:** `@` syntax force-loads files immediately, consuming 200k+ context before you need them.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Discovery Workflow
|
|
2
|
+
|
|
3
|
+
How future Claude finds your skill:
|
|
4
|
+
|
|
5
|
+
1. **Encounters problem** ("tests are flaky")
|
|
6
|
+
2. **Finds SKILL** (description matches)
|
|
7
|
+
3. **Scans overview** (is this relevant?)
|
|
8
|
+
4. **Reads patterns** (quick reference table)
|
|
9
|
+
5. **Loads example** (only when implementing)
|
|
10
|
+
|
|
11
|
+
**Optimize for this flow** - put searchable terms early and often.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# File Organization
|
|
2
|
+
|
|
3
|
+
## Self-Contained Skill
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
defense-in-depth/
|
|
7
|
+
SKILL.md # Everything inline
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
When: All content fits, no heavy reference needed
|
|
11
|
+
|
|
12
|
+
## Skill with Reusable Tool
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
condition-based-waiting/
|
|
16
|
+
SKILL.md # Overview + patterns
|
|
17
|
+
example.ts # Working helpers to adapt
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
When: Tool is reusable code, not just narrative
|
|
21
|
+
|
|
22
|
+
## Skill with Heavy Reference
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
pptx/
|
|
26
|
+
SKILL.md # Overview + workflows
|
|
27
|
+
pptxgenjs.md # 600 lines API reference
|
|
28
|
+
ooxml.md # 500 lines XML structure
|
|
29
|
+
scripts/ # Executable tools
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
When: Reference material too large for inline
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Flowchart Usage and Code Examples
|
|
2
|
+
|
|
3
|
+
## Flowchart Usage
|
|
4
|
+
|
|
5
|
+
```dot
|
|
6
|
+
digraph when_flowchart {
|
|
7
|
+
"Need to show information?" [shape=diamond];
|
|
8
|
+
"Decision where I might go wrong?" [shape=diamond];
|
|
9
|
+
"Use markdown" [shape=box];
|
|
10
|
+
"Small inline flowchart" [shape=box];
|
|
11
|
+
|
|
12
|
+
"Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
|
|
13
|
+
"Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
|
|
14
|
+
"Decision where I might go wrong?" -> "Use markdown" [label="no"];
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Use flowcharts ONLY for:**
|
|
19
|
+
|
|
20
|
+
- Non-obvious decision points
|
|
21
|
+
- Process loops where you might stop too early
|
|
22
|
+
- "When to use A vs B" decisions
|
|
23
|
+
|
|
24
|
+
**Never use flowcharts for:**
|
|
25
|
+
|
|
26
|
+
- Reference material → Tables, lists
|
|
27
|
+
- Code examples → Markdown blocks
|
|
28
|
+
- Linear instructions → Numbered lists
|
|
29
|
+
- Labels without semantic meaning (step1, helper2)
|
|
30
|
+
|
|
31
|
+
See @graphviz-conventions.dot for graphviz style rules.
|
|
32
|
+
|
|
33
|
+
## Code Examples
|
|
34
|
+
|
|
35
|
+
**One excellent example beats many mediocre ones**
|
|
36
|
+
|
|
37
|
+
Choose most relevant language:
|
|
38
|
+
|
|
39
|
+
- Testing techniques → TypeScript/JavaScript
|
|
40
|
+
- System debugging → Shell/Python
|
|
41
|
+
- Data processing → Python
|
|
42
|
+
|
|
43
|
+
**Good example:**
|
|
44
|
+
|
|
45
|
+
- Complete and runnable
|
|
46
|
+
- Well-commented explaining WHY
|
|
47
|
+
- From real scenario
|
|
48
|
+
- Shows pattern clearly
|
|
49
|
+
- Ready to adapt (not generic template)
|
|
50
|
+
|
|
51
|
+
**Don't:**
|
|
52
|
+
|
|
53
|
+
- Implement in 5+ languages
|
|
54
|
+
- Create fill-in-the-blank templates
|
|
55
|
+
- Write contrived examples
|
|
56
|
+
|
|
57
|
+
You're good at porting - one great example is enough.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Bulletproofing Skills Against Rationalization
|
|
2
|
+
|
|
3
|
+
Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.
|
|
4
|
+
|
|
5
|
+
**Psychology note:** Understanding WHY persuasion techniques work helps you apply them systematically. See persuasion-principles.md for research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles.
|
|
6
|
+
|
|
7
|
+
## Close Every Loophole Explicitly
|
|
8
|
+
|
|
9
|
+
Don't just state the rule - forbid specific workarounds:
|
|
10
|
+
|
|
11
|
+
<Bad>
|
|
12
|
+
```markdown
|
|
13
|
+
Write code before test? Delete it.
|
|
14
|
+
```
|
|
15
|
+
</Bad>
|
|
16
|
+
|
|
17
|
+
<Good>
|
|
18
|
+
```markdown
|
|
19
|
+
Write code before test? Delete it. Start over.
|
|
20
|
+
|
|
21
|
+
**No exceptions:**
|
|
22
|
+
|
|
23
|
+
- Don't keep it as "reference"
|
|
24
|
+
- Don't "adapt" it while writing tests
|
|
25
|
+
- Don't look at it
|
|
26
|
+
- Delete means delete
|
|
27
|
+
|
|
28
|
+
````
|
|
29
|
+
</Good>
|
|
30
|
+
|
|
31
|
+
## Address "Spirit vs Letter" Arguments
|
|
32
|
+
|
|
33
|
+
Add foundational principle early:
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
**Violating the letter of the rules is violating the spirit of the rules.**
|
|
37
|
+
````
|
|
38
|
+
|
|
39
|
+
This cuts off entire class of "I'm following the spirit" rationalizations.
|
|
40
|
+
|
|
41
|
+
## Build Rationalization Table
|
|
42
|
+
|
|
43
|
+
Capture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table:
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
| Excuse | Reality |
|
|
47
|
+
| -------------------------------- | ----------------------------------------------------------------------- |
|
|
48
|
+
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
|
|
49
|
+
| "I'll test after" | Tests passing immediately prove nothing. |
|
|
50
|
+
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Create Red Flags List
|
|
54
|
+
|
|
55
|
+
Make it easy for agents to self-check when rationalizing:
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
## Red Flags - STOP and Start Over
|
|
59
|
+
|
|
60
|
+
- Code before test
|
|
61
|
+
- "I already manually tested it"
|
|
62
|
+
- "Tests after achieve the same purpose"
|
|
63
|
+
- "It's about spirit not ritual"
|
|
64
|
+
- "This is different because..."
|
|
65
|
+
|
|
66
|
+
**All of these mean: Delete code. Start over with TDD.**
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Update CSO for Violation Symptoms
|
|
70
|
+
|
|
71
|
+
Add to description: symptoms of when you're ABOUT to violate the rule:
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
description: use when implementing any feature or bugfix, before writing implementation code
|
|
75
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Testing All Skill Types
|
|
2
|
+
|
|
3
|
+
Different skill types need different test approaches:
|
|
4
|
+
|
|
5
|
+
## Discipline-Enforcing Skills (rules/requirements)
|
|
6
|
+
|
|
7
|
+
**Examples:** TDD, verification-before-completion, designing-before-coding
|
|
8
|
+
|
|
9
|
+
**Test with:**
|
|
10
|
+
|
|
11
|
+
- Academic questions: Do they understand the rules?
|
|
12
|
+
- Pressure scenarios: Do they comply under stress?
|
|
13
|
+
- Multiple pressures combined: time + sunk cost + exhaustion
|
|
14
|
+
- Identify rationalizations and add explicit counters
|
|
15
|
+
|
|
16
|
+
**Success criteria:** Agent follows rule under maximum pressure
|
|
17
|
+
|
|
18
|
+
## Technique Skills (how-to guides)
|
|
19
|
+
|
|
20
|
+
**Examples:** condition-based-waiting, root-cause-tracing, defensive-programming
|
|
21
|
+
|
|
22
|
+
**Test with:**
|
|
23
|
+
|
|
24
|
+
- Application scenarios: Can they apply the technique correctly?
|
|
25
|
+
- Variation scenarios: Do they handle edge cases?
|
|
26
|
+
- Missing information tests: Do instructions have gaps?
|
|
27
|
+
|
|
28
|
+
**Success criteria:** Agent successfully applies technique to new scenario
|
|
29
|
+
|
|
30
|
+
## Pattern Skills (mental models)
|
|
31
|
+
|
|
32
|
+
**Examples:** reducing-complexity, information-hiding concepts
|
|
33
|
+
|
|
34
|
+
**Test with:**
|
|
35
|
+
|
|
36
|
+
- Recognition scenarios: Do they recognize when pattern applies?
|
|
37
|
+
- Application scenarios: Can they use the mental model?
|
|
38
|
+
- Counter-examples: Do they know when NOT to apply?
|
|
39
|
+
|
|
40
|
+
**Success criteria:** Agent correctly identifies when/how to apply pattern
|
|
41
|
+
|
|
42
|
+
## Reference Skills (documentation/APIs)
|
|
43
|
+
|
|
44
|
+
**Examples:** API documentation, command references, library guides
|
|
45
|
+
|
|
46
|
+
**Test with:**
|
|
47
|
+
|
|
48
|
+
- Retrieval scenarios: Can they find the right information?
|
|
49
|
+
- Application scenarios: Can they use what they found correctly?
|
|
50
|
+
- Gap testing: Are common use cases covered?
|
|
51
|
+
|
|
52
|
+
**Success criteria:** Agent finds and correctly applies reference information
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencodekit",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agents",
|
|
7
|
+
"cli",
|
|
8
|
+
"mcp",
|
|
9
|
+
"opencode",
|
|
10
|
+
"opencodekit",
|
|
11
|
+
"template"
|
|
12
|
+
],
|
|
6
13
|
"license": "MIT",
|
|
7
14
|
"author": "OpenCodeKit",
|
|
8
15
|
"repository": {
|
|
@@ -12,7 +19,10 @@
|
|
|
12
19
|
"bin": {
|
|
13
20
|
"ock": "dist/index.js"
|
|
14
21
|
},
|
|
15
|
-
"files": [
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
16
26
|
"type": "module",
|
|
17
27
|
"publishConfig": {
|
|
18
28
|
"access": "public",
|
|
@@ -26,7 +36,8 @@
|
|
|
26
36
|
"test:watch": "vitest",
|
|
27
37
|
"validate:command-doc": "tsx src/validation/command-doc.ts --check",
|
|
28
38
|
"validate:docs-drift": "tsx src/validation/docs-drift.ts --check",
|
|
29
|
-
"validate:
|
|
39
|
+
"validate:skill-lint": "tsx src/validation/skill-lint.ts --check",
|
|
40
|
+
"validate:governance": "npm run validate:command-doc && npm run validate:docs-drift && npm run validate:skill-lint",
|
|
30
41
|
"lint": "oxlint .",
|
|
31
42
|
"lint:fix": "oxlint --fix .",
|
|
32
43
|
"format": "oxfmt",
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session Continuity Plugin (compaction-time context injection)
|
|
3
|
-
*
|
|
4
|
-
* Purpose:
|
|
5
|
-
* - Provide compact, bounded state needed to resume work after compaction.
|
|
6
|
-
* - Keep injected prompt guidance minimal and deterministic.
|
|
7
|
-
*
|
|
8
|
-
* Non-goals:
|
|
9
|
-
* - Replace DCP policy/rules management.
|
|
10
|
-
* - Inject large free-form manuals into the prompt.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { Database } from "bun:sqlite";
|
|
14
|
-
import { readFile, readdir, stat } from "node:fs/promises";
|
|
15
|
-
import path from "node:path";
|
|
16
|
-
import type { Plugin } from "@opencode-ai/plugin";
|
|
17
|
-
|
|
18
|
-
const MAX_SESSION_CONTEXT_CHARS = 3000;
|
|
19
|
-
const MAX_PROJECT_FILES = 3;
|
|
20
|
-
const MAX_PROJECT_FILE_CHARS = 900;
|
|
21
|
-
const MAX_HANDOFF_CHARS = 2500;
|
|
22
|
-
const MAX_BEADS = 8;
|
|
23
|
-
const MAX_COMBINED_CONTEXT_CHARS = 9000;
|
|
24
|
-
|
|
25
|
-
interface BeadRow {
|
|
26
|
-
id: string;
|
|
27
|
-
title: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function truncate(text: string, maxChars: number): string {
|
|
31
|
-
if (text.length <= maxChars) return text;
|
|
32
|
-
return `${text.slice(0, maxChars)}\n...[truncated]`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async function safeReadFile(filePath: string): Promise<string> {
|
|
36
|
-
try {
|
|
37
|
-
return await readFile(filePath, "utf-8");
|
|
38
|
-
} catch {
|
|
39
|
-
return "";
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function renderSection(title: string, body: string): string {
|
|
44
|
-
if (!body.trim()) return "";
|
|
45
|
-
return `## ${title}\n${body.trim()}`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async function readProjectMemoryContext(memoryDir: string): Promise<string> {
|
|
49
|
-
const projectDir = path.join(memoryDir, "project");
|
|
50
|
-
let names: string[] = [];
|
|
51
|
-
try {
|
|
52
|
-
names = (await readdir(projectDir))
|
|
53
|
-
.filter((name) => name.endsWith(".md"))
|
|
54
|
-
.sort()
|
|
55
|
-
.slice(0, MAX_PROJECT_FILES);
|
|
56
|
-
} catch {
|
|
57
|
-
return "";
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const chunks: string[] = [];
|
|
61
|
-
for (const name of names) {
|
|
62
|
-
const fullPath = path.join(projectDir, name);
|
|
63
|
-
const content = (await safeReadFile(fullPath)).trim();
|
|
64
|
-
if (!content) continue;
|
|
65
|
-
chunks.push(
|
|
66
|
-
`### ${name.replace(/\.md$/, "")}\n${truncate(content, MAX_PROJECT_FILE_CHARS)}`,
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return chunks.join("\n\n");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async function readLatestHandoff(handoffDir: string): Promise<string> {
|
|
74
|
-
let names: string[] = [];
|
|
75
|
-
try {
|
|
76
|
-
names = (await readdir(handoffDir)).filter((name) => name.endsWith(".md"));
|
|
77
|
-
} catch {
|
|
78
|
-
return "";
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (names.length === 0) return "";
|
|
82
|
-
|
|
83
|
-
const withMtime = await Promise.all(
|
|
84
|
-
names.map(async (name) => {
|
|
85
|
-
const fullPath = path.join(handoffDir, name);
|
|
86
|
-
try {
|
|
87
|
-
const info = await stat(fullPath);
|
|
88
|
-
return { name, fullPath, mtimeMs: info.mtimeMs };
|
|
89
|
-
} catch {
|
|
90
|
-
return { name, fullPath, mtimeMs: 0 };
|
|
91
|
-
}
|
|
92
|
-
}),
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
withMtime.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
96
|
-
const latest = withMtime[0];
|
|
97
|
-
const content = (await safeReadFile(latest.fullPath)).trim();
|
|
98
|
-
if (!content) return "";
|
|
99
|
-
|
|
100
|
-
return `Source: ${latest.name}\n${truncate(content, MAX_HANDOFF_CHARS)}`;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Read in-progress beads directly from SQLite database.
|
|
105
|
-
* Cross-platform alternative to shell command execution.
|
|
106
|
-
*/
|
|
107
|
-
function readInProgressBeads(directory: string): string {
|
|
108
|
-
const dbPath = path.join(directory, ".beads", "beads.db");
|
|
109
|
-
let db: Database | undefined;
|
|
110
|
-
|
|
111
|
-
try {
|
|
112
|
-
db = new Database(dbPath, { readonly: true });
|
|
113
|
-
|
|
114
|
-
const rows = db
|
|
115
|
-
.query<BeadRow, [number]>(
|
|
116
|
-
"SELECT id, title FROM issues WHERE status = 'in_progress' ORDER BY updated_at DESC LIMIT ?",
|
|
117
|
-
)
|
|
118
|
-
.all(MAX_BEADS);
|
|
119
|
-
|
|
120
|
-
if (rows.length === 0) return "";
|
|
121
|
-
|
|
122
|
-
return rows.map((row) => `- ${row.id}: ${row.title}`).join("\n");
|
|
123
|
-
} catch {
|
|
124
|
-
// Database may not exist, be locked, or have different schema
|
|
125
|
-
// Return empty string to allow graceful degradation
|
|
126
|
-
return "";
|
|
127
|
-
} finally {
|
|
128
|
-
db?.close();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export const CompactionPlugin: Plugin = async ({ directory }) => {
|
|
133
|
-
const memoryDir = path.join(directory, ".opencode", "memory");
|
|
134
|
-
const handoffDir = path.join(memoryDir, "handoffs");
|
|
135
|
-
|
|
136
|
-
return {
|
|
137
|
-
"experimental.session.compacting": async (_input, output) => {
|
|
138
|
-
const sessionContext = truncate(
|
|
139
|
-
(await safeReadFile(path.join(memoryDir, "session-context.md"))).trim(),
|
|
140
|
-
MAX_SESSION_CONTEXT_CHARS,
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
const [projectContext, handoffContext] = await Promise.all([
|
|
144
|
-
readProjectMemoryContext(memoryDir),
|
|
145
|
-
readLatestHandoff(handoffDir),
|
|
146
|
-
]);
|
|
147
|
-
|
|
148
|
-
// Synchronous SQLite query - no async/await needed
|
|
149
|
-
const beadsContext = readInProgressBeads(directory);
|
|
150
|
-
|
|
151
|
-
const combined = [
|
|
152
|
-
renderSection("Session Continuity", sessionContext),
|
|
153
|
-
renderSection("Active Beads", beadsContext),
|
|
154
|
-
renderSection("Previous Handoff", handoffContext),
|
|
155
|
-
renderSection("Project Memory", projectContext),
|
|
156
|
-
]
|
|
157
|
-
.filter(Boolean)
|
|
158
|
-
.join("\n\n");
|
|
159
|
-
|
|
160
|
-
if (combined) {
|
|
161
|
-
output.context.push(
|
|
162
|
-
`## Session Context\n${truncate(combined, MAX_COMBINED_CONTEXT_CHARS)}\n`,
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
output.prompt = `${output.prompt}
|
|
167
|
-
|
|
168
|
-
<compaction_task>
|
|
169
|
-
Summarize conversation state for reliable continuation after compaction.
|
|
170
|
-
</compaction_task>
|
|
171
|
-
|
|
172
|
-
<compaction_rules>
|
|
173
|
-
- Preserve exact IDs, file paths, and unresolved constraints.
|
|
174
|
-
- Distinguish completed work from current in-progress work.
|
|
175
|
-
- Keep summary concise and execution-focused.
|
|
176
|
-
- If critical context is missing, state uncertainty explicitly.
|
|
177
|
-
</compaction_rules>
|
|
178
|
-
|
|
179
|
-
<compaction_output>
|
|
180
|
-
Include:
|
|
181
|
-
- What was done
|
|
182
|
-
- What is being worked on now
|
|
183
|
-
- Files currently in play
|
|
184
|
-
- Next actions
|
|
185
|
-
- Persistent user constraints/preferences
|
|
186
|
-
</compaction_output>
|
|
187
|
-
`;
|
|
188
|
-
},
|
|
189
|
-
};
|
|
190
|
-
};
|