opencodekit 0.18.1 → 0.18.3
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 +161 -38
- package/dist/template/.opencode/.version +1 -1
- package/dist/template/.opencode/AGENTS.md +39 -9
- package/dist/template/.opencode/AGENT_ALIGNMENT.md +6 -6
- package/dist/template/.opencode/agent/build.md +7 -103
- package/dist/template/.opencode/agent/general.md +0 -52
- package/dist/template/.opencode/agent/plan.md +10 -0
- package/dist/template/.opencode/agent/runner.md +79 -0
- package/dist/template/.opencode/command/create.md +13 -1
- package/dist/template/.opencode/command/init-context.md +20 -6
- package/dist/template/.opencode/command/init-user.md +18 -16
- package/dist/template/.opencode/command/lfg.md +3 -4
- package/dist/template/.opencode/command/ship.md +6 -48
- package/dist/template/.opencode/command/start.md +20 -3
- package/dist/template/.opencode/command/verify.md +12 -17
- package/dist/template/.opencode/context/README.md +29 -0
- package/dist/template/.opencode/memory/_templates/{STATE.md → state.md} +1 -1
- 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 +131 -7
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plugin/lib/memory-helpers.ts +51 -16
- package/dist/template/.opencode/plugin/lib/memory-hooks.ts +1 -1
- 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 +38 -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 +13 -1
- 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 +11 -1
- 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 +37 -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/verification-before-completion/references/VERIFICATION_PROTOCOL.md +67 -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/memory/_templates/{PROJECT.md → project.md} +0 -0
- /package/dist/template/.opencode/memory/_templates/{ROADMAP.md → roadmap.md} +0 -0
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verification-before-completion
|
|
3
3
|
description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [workflow, code-quality]
|
|
6
|
+
dependencies: []
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Verification Before Completion
|
|
7
10
|
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- Before claiming tests/lint/build pass or a bug is fixed
|
|
14
|
+
- Before committing, opening PRs, or stating completion in a status update
|
|
15
|
+
|
|
16
|
+
## When NOT to Use
|
|
17
|
+
|
|
18
|
+
- While still actively coding without a completion claim
|
|
19
|
+
- When you cannot run verification commands yet (e.g., missing dependencies) — resolve first
|
|
20
|
+
|
|
8
21
|
## Overview
|
|
9
22
|
|
|
10
23
|
Claiming work is complete without verification is dishonesty, not efficiency.
|
|
@@ -35,8 +48,17 @@ BEFORE claiming any status or expressing satisfaction:
|
|
|
35
48
|
5. ONLY THEN: Make the claim
|
|
36
49
|
|
|
37
50
|
Skip any step = lying, not verifying
|
|
51
|
+
|
|
38
52
|
```
|
|
39
53
|
|
|
54
|
+
## Verification Checklist
|
|
55
|
+
|
|
56
|
+
- [ ] Identify the exact command that proves the claim
|
|
57
|
+
- [ ] Run the full command (fresh)
|
|
58
|
+
- [ ] Read the full output and exit code
|
|
59
|
+
- [ ] Confirm the output matches the claim
|
|
60
|
+
- [ ] Only then state the completion claim with evidence
|
|
61
|
+
|
|
40
62
|
## Common Failures
|
|
41
63
|
|
|
42
64
|
| Claim | Requires | Not Sufficient |
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Verification Protocol
|
|
2
|
+
|
|
3
|
+
## Standard Gates
|
|
4
|
+
|
|
5
|
+
Run these gates in parallel where possible:
|
|
6
|
+
|
|
7
|
+
### Parallel Group (independent — run simultaneously)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Gate 1: Typecheck
|
|
11
|
+
npm run typecheck 2>&1 &
|
|
12
|
+
PID_TC=$!
|
|
13
|
+
|
|
14
|
+
# Gate 2: Lint (incremental when possible)
|
|
15
|
+
# Full codebase:
|
|
16
|
+
npm run lint 2>&1 &
|
|
17
|
+
# Or incremental (changed files only):
|
|
18
|
+
# npx oxlint $(git diff --name-only --diff-filter=d HEAD | grep -E '\.(ts|tsx|js|jsx)$')
|
|
19
|
+
PID_LINT=$!
|
|
20
|
+
|
|
21
|
+
wait $PID_TC $PID_LINT
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Sequential Group (depends on parallel group passing)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Gate 3: Tests (incremental when possible)
|
|
28
|
+
# Full: npm test
|
|
29
|
+
# Incremental: npx vitest --changed
|
|
30
|
+
npm test
|
|
31
|
+
|
|
32
|
+
# Gate 4: Build (only if shipping)
|
|
33
|
+
npm run build
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Incremental Mode
|
|
37
|
+
|
|
38
|
+
Use incremental mode when:
|
|
39
|
+
|
|
40
|
+
- Only a few files changed (< 20 files)
|
|
41
|
+
- Not shipping/releasing (pre-commit, mid-development)
|
|
42
|
+
|
|
43
|
+
| Gate | Full Command | Incremental Command |
|
|
44
|
+
| --------- | ------------------- | ------------------------------------------ |
|
|
45
|
+
| Typecheck | `npm run typecheck` | `npm run typecheck` (always full — needed) |
|
|
46
|
+
| Lint | `npm run lint` | `npx oxlint $(git diff --name-only HEAD)` |
|
|
47
|
+
| Test | `npm test` | `npx vitest --changed` |
|
|
48
|
+
| Build | `npm run build` | Skip (only needed for ship/release) |
|
|
49
|
+
|
|
50
|
+
## Gate Results Format
|
|
51
|
+
|
|
52
|
+
Report results as:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
| Gate | Status | Time |
|
|
56
|
+
|-----------|--------|--------|
|
|
57
|
+
| Typecheck | PASS | 2.1s |
|
|
58
|
+
| Lint | PASS | 0.8s |
|
|
59
|
+
| Test | PASS | 5.3s |
|
|
60
|
+
| Build | SKIP | — |
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Failure Handling
|
|
64
|
+
|
|
65
|
+
- If any gate fails, stop and fix before proceeding
|
|
66
|
+
- Show the FULL error output for failed gates
|
|
67
|
+
- After fixing, re-run ONLY the failed gate(s) + any downstream gates
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: visual-analysis
|
|
3
3
|
description: Use when analyzing images, screenshots, UI mockups, or visual content for extracting information, comparing designs, or assessing visual properties like colors, typography, and layout
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [design, research]
|
|
6
|
+
dependencies: []
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Visual Analysis Skill
|
|
7
10
|
|
|
8
|
-
Analyze images, screenshots, and visual content.
|
|
9
|
-
|
|
10
11
|
## When to Use
|
|
11
12
|
|
|
12
13
|
- Analyzing UI mockups or screenshots
|
|
@@ -14,6 +15,11 @@ Analyze images, screenshots, and visual content.
|
|
|
14
15
|
- Comparing visual designs
|
|
15
16
|
- Quick visual assessments
|
|
16
17
|
|
|
18
|
+
## When NOT to Use
|
|
19
|
+
|
|
20
|
+
- Pure text/code review without any visual assets.
|
|
21
|
+
|
|
22
|
+
|
|
17
23
|
## Quick Mode
|
|
18
24
|
|
|
19
25
|
Fast, focused analysis for specific questions.
|
|
@@ -132,4 +138,4 @@ Save findings to `.opencode/memory/design/analysis/`
|
|
|
132
138
|
| Found accessibility issues | `accessibility-audit` |
|
|
133
139
|
| Need to implement design | `mockup-to-code` |
|
|
134
140
|
| Want design tokens | `design-system-audit` |
|
|
135
|
-
| Need aesthetic improvements | `frontend-design`
|
|
141
|
+
| Need aesthetic improvements | `frontend-design` |
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: web-design-guidelines
|
|
3
3
|
description: Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
argument-hint: <file-or-pattern>
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [ui, design]
|
|
6
|
+
dependencies: []
|
|
8
7
|
---
|
|
9
8
|
|
|
10
9
|
# Web Interface Guidelines
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- Reviewing UI files against Web Interface Guidelines for UX/design compliance.
|
|
14
|
+
|
|
15
|
+
## When NOT to Use
|
|
16
|
+
|
|
17
|
+
- Non-UI code reviews or when no files/pattern are provided.
|
|
18
|
+
|
|
13
19
|
|
|
14
20
|
## How It Works
|
|
15
21
|
|
|
@@ -31,6 +37,7 @@ Use WebFetch to retrieve the latest rules. The fetched content contains all the
|
|
|
31
37
|
## Usage
|
|
32
38
|
|
|
33
39
|
When a user provides a file or pattern argument:
|
|
40
|
+
|
|
34
41
|
1. Fetch guidelines from the source URL above
|
|
35
42
|
2. Read the specified files
|
|
36
43
|
3. Apply all rules from the fetched guidelines
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: writing-plans
|
|
3
3
|
description: Use when design is complete and you need detailed implementation tasks for engineers with zero codebase context - creates comprehensive implementation plans with exact file paths, complete code examples, and verification steps assuming engineer has minimal domain knowledge
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [planning, documentation]
|
|
6
|
+
dependencies: []
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Writing Plans
|
|
7
10
|
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- Design/PRD is complete and you need a detailed, step-by-step implementation plan
|
|
14
|
+
- You need a plan for engineers with minimal codebase context and explicit file paths
|
|
15
|
+
|
|
16
|
+
## When NOT to Use
|
|
17
|
+
|
|
18
|
+
- Requirements are still being defined (use brainstorming or prd)
|
|
19
|
+
- You already have a vetted plan and only need execution (use executing-plans)
|
|
20
|
+
|
|
8
21
|
## Overview
|
|
9
22
|
|
|
10
23
|
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: writing-skills
|
|
3
|
-
description: Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization
|
|
3
|
+
description: "Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization"
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [documentation, workflow]
|
|
6
|
+
dependencies: []
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
# Writing Skills
|
|
7
10
|
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- Creating a new skill from scratch
|
|
14
|
+
- Editing or improving an existing skill
|
|
15
|
+
- Verifying a skill works correctly before deployment
|
|
16
|
+
- Applying TDD methodology to process documentation
|
|
17
|
+
|
|
18
|
+
## When NOT to Use
|
|
19
|
+
|
|
20
|
+
- Routine code implementation (use executing-plans instead)
|
|
21
|
+
- One-off instructions that don't need to be reusable
|
|
22
|
+
- Quick configuration changes that don't warrant a skill
|
|
23
|
+
|
|
8
24
|
## Overview
|
|
9
25
|
|
|
10
26
|
**Writing skills IS Test-Driven Development applied to process documentation.**
|
|
@@ -148,236 +164,6 @@ What goes wrong + fixes
|
|
|
148
164
|
Concrete results
|
|
149
165
|
```
|
|
150
166
|
|
|
151
|
-
## Claude Search Optimization (CSO)
|
|
152
|
-
|
|
153
|
-
**Critical for discovery:** Future Claude needs to FIND your skill
|
|
154
|
-
|
|
155
|
-
### 1. Rich Description Field
|
|
156
|
-
|
|
157
|
-
**Purpose:** Claude reads description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"
|
|
158
|
-
|
|
159
|
-
**Format:** Start with "Use when..." to focus on triggering conditions, then explain what it does
|
|
160
|
-
|
|
161
|
-
**Content:**
|
|
162
|
-
|
|
163
|
-
- Use concrete triggers, symptoms, and situations that signal this skill applies
|
|
164
|
-
- Describe the _problem_ (race conditions, inconsistent behavior) not _language-specific symptoms_ (setTimeout, sleep)
|
|
165
|
-
- Keep triggers technology-agnostic unless the skill itself is technology-specific
|
|
166
|
-
- If skill is technology-specific, make that explicit in the trigger
|
|
167
|
-
- Write in third person (injected into system prompt)
|
|
168
|
-
|
|
169
|
-
```yaml
|
|
170
|
-
# ❌ BAD: Too abstract, vague, doesn't include when to use
|
|
171
|
-
description: For async testing
|
|
172
|
-
|
|
173
|
-
# ❌ BAD: First person
|
|
174
|
-
description: I can help you with async tests when they're flaky
|
|
175
|
-
|
|
176
|
-
# ❌ BAD: Mentions technology but skill isn't specific to it
|
|
177
|
-
description: Use when tests use setTimeout/sleep and are flaky
|
|
178
|
-
|
|
179
|
-
# ✅ GOOD: Starts with "Use when", describes problem, then what it does
|
|
180
|
-
description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently - replaces arbitrary timeouts with condition polling for reliable async tests
|
|
181
|
-
|
|
182
|
-
# ✅ GOOD: Technology-specific skill with explicit trigger
|
|
183
|
-
description: Use when using React Router and handling authentication redirects - provides patterns for protected routes and auth state management
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### 2. Keyword Coverage
|
|
187
|
-
|
|
188
|
-
Use words Claude would search for:
|
|
189
|
-
|
|
190
|
-
- Error messages: "Hook timed out", "ENOTEMPTY", "race condition"
|
|
191
|
-
- Symptoms: "flaky", "hanging", "zombie", "pollution"
|
|
192
|
-
- Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach"
|
|
193
|
-
- Tools: Actual commands, library names, file types
|
|
194
|
-
|
|
195
|
-
### 3. Descriptive Naming
|
|
196
|
-
|
|
197
|
-
**Use active voice, verb-first:**
|
|
198
|
-
|
|
199
|
-
- ✅ `creating-skills` not `skill-creation`
|
|
200
|
-
- ✅ `testing-skills-with-subagents` not `subagent-skill-testing`
|
|
201
|
-
|
|
202
|
-
### 4. Token Efficiency (Critical)
|
|
203
|
-
|
|
204
|
-
**Problem:** getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.
|
|
205
|
-
|
|
206
|
-
**Target word counts:**
|
|
207
|
-
|
|
208
|
-
- getting-started workflows: <150 words each
|
|
209
|
-
- Frequently-loaded skills: <200 words total
|
|
210
|
-
- Other skills: <500 words (still be concise)
|
|
211
|
-
|
|
212
|
-
**Techniques:**
|
|
213
|
-
|
|
214
|
-
**Move details to tool help:**
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
# ❌ BAD: Document all flags in SKILL.md
|
|
218
|
-
search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
|
|
219
|
-
|
|
220
|
-
# ✅ GOOD: Reference --help
|
|
221
|
-
search-conversations supports multiple modes and filters. Run --help for details.
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
**Use cross-references:**
|
|
225
|
-
|
|
226
|
-
```markdown
|
|
227
|
-
# ❌ BAD: Repeat workflow details
|
|
228
|
-
|
|
229
|
-
When searching, dispatch subagent with template...
|
|
230
|
-
[20 lines of repeated instructions]
|
|
231
|
-
|
|
232
|
-
# ✅ GOOD: Reference other skill
|
|
233
|
-
|
|
234
|
-
Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
**Compress examples:**
|
|
238
|
-
|
|
239
|
-
```markdown
|
|
240
|
-
# ❌ BAD: Verbose example (42 words)
|
|
241
|
-
|
|
242
|
-
your human partner: "How did we handle authentication errors in React Router before?"
|
|
243
|
-
You: I'll search past conversations for React Router authentication patterns.
|
|
244
|
-
[Dispatch subagent with search query: "React Router authentication error handling 401"]
|
|
245
|
-
|
|
246
|
-
# ✅ GOOD: Minimal example (20 words)
|
|
247
|
-
|
|
248
|
-
Partner: "How did we handle auth errors in React Router?"
|
|
249
|
-
You: Searching...
|
|
250
|
-
[Dispatch subagent → synthesis]
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
**Eliminate redundancy:**
|
|
254
|
-
|
|
255
|
-
- Don't repeat what's in cross-referenced skills
|
|
256
|
-
- Don't explain what's obvious from command
|
|
257
|
-
- Don't include multiple examples of same pattern
|
|
258
|
-
|
|
259
|
-
**Verification:**
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
wc -w skills/path/SKILL.md
|
|
263
|
-
# getting-started workflows: aim for <150 each
|
|
264
|
-
# Other frequently-loaded: aim for <200 total
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
**Name by what you DO or core insight:**
|
|
268
|
-
|
|
269
|
-
- ✅ `condition-based-waiting` > `async-test-helpers`
|
|
270
|
-
- ✅ `using-skills` not `skill-usage`
|
|
271
|
-
- ✅ `flatten-with-flags` > `data-structure-refactoring`
|
|
272
|
-
- ✅ `root-cause-tracing` > `debugging-techniques`
|
|
273
|
-
|
|
274
|
-
**Gerunds (-ing) work well for processes:**
|
|
275
|
-
|
|
276
|
-
- `creating-skills`, `testing-skills`, `debugging-with-logs`
|
|
277
|
-
- Active, describes the action you're taking
|
|
278
|
-
|
|
279
|
-
### 4. Cross-Referencing Other Skills
|
|
280
|
-
|
|
281
|
-
**When writing documentation that references other skills:**
|
|
282
|
-
|
|
283
|
-
Use skill name only, with explicit requirement markers:
|
|
284
|
-
|
|
285
|
-
- ✅ Good: `**REQUIRED SUB-SKILL:** Use skill({ name: "test-driven-development" })`
|
|
286
|
-
- ✅ Good: `**REQUIRED BACKGROUND:** You MUST understand systematic-debugging`
|
|
287
|
-
- ❌ Bad: `See skills/testing/test-driven-development` (unclear if required)
|
|
288
|
-
- ❌ Bad: `@skills/testing/test-driven-development/SKILL.md` (force-loads, burns context)
|
|
289
|
-
|
|
290
|
-
**Why no @ links:** `@` syntax force-loads files immediately, consuming 200k+ context before you need them.
|
|
291
|
-
|
|
292
|
-
## Flowchart Usage
|
|
293
|
-
|
|
294
|
-
```dot
|
|
295
|
-
digraph when_flowchart {
|
|
296
|
-
"Need to show information?" [shape=diamond];
|
|
297
|
-
"Decision where I might go wrong?" [shape=diamond];
|
|
298
|
-
"Use markdown" [shape=box];
|
|
299
|
-
"Small inline flowchart" [shape=box];
|
|
300
|
-
|
|
301
|
-
"Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
|
|
302
|
-
"Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
|
|
303
|
-
"Decision where I might go wrong?" -> "Use markdown" [label="no"];
|
|
304
|
-
}
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
**Use flowcharts ONLY for:**
|
|
308
|
-
|
|
309
|
-
- Non-obvious decision points
|
|
310
|
-
- Process loops where you might stop too early
|
|
311
|
-
- "When to use A vs B" decisions
|
|
312
|
-
|
|
313
|
-
**Never use flowcharts for:**
|
|
314
|
-
|
|
315
|
-
- Reference material → Tables, lists
|
|
316
|
-
- Code examples → Markdown blocks
|
|
317
|
-
- Linear instructions → Numbered lists
|
|
318
|
-
- Labels without semantic meaning (step1, helper2)
|
|
319
|
-
|
|
320
|
-
See @graphviz-conventions.dot for graphviz style rules.
|
|
321
|
-
|
|
322
|
-
## Code Examples
|
|
323
|
-
|
|
324
|
-
**One excellent example beats many mediocre ones**
|
|
325
|
-
|
|
326
|
-
Choose most relevant language:
|
|
327
|
-
|
|
328
|
-
- Testing techniques → TypeScript/JavaScript
|
|
329
|
-
- System debugging → Shell/Python
|
|
330
|
-
- Data processing → Python
|
|
331
|
-
|
|
332
|
-
**Good example:**
|
|
333
|
-
|
|
334
|
-
- Complete and runnable
|
|
335
|
-
- Well-commented explaining WHY
|
|
336
|
-
- From real scenario
|
|
337
|
-
- Shows pattern clearly
|
|
338
|
-
- Ready to adapt (not generic template)
|
|
339
|
-
|
|
340
|
-
**Don't:**
|
|
341
|
-
|
|
342
|
-
- Implement in 5+ languages
|
|
343
|
-
- Create fill-in-the-blank templates
|
|
344
|
-
- Write contrived examples
|
|
345
|
-
|
|
346
|
-
You're good at porting - one great example is enough.
|
|
347
|
-
|
|
348
|
-
## File Organization
|
|
349
|
-
|
|
350
|
-
### Self-Contained Skill
|
|
351
|
-
|
|
352
|
-
```
|
|
353
|
-
defense-in-depth/
|
|
354
|
-
SKILL.md # Everything inline
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
When: All content fits, no heavy reference needed
|
|
358
|
-
|
|
359
|
-
### Skill with Reusable Tool
|
|
360
|
-
|
|
361
|
-
```
|
|
362
|
-
condition-based-waiting/
|
|
363
|
-
SKILL.md # Overview + patterns
|
|
364
|
-
example.ts # Working helpers to adapt
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
When: Tool is reusable code, not just narrative
|
|
368
|
-
|
|
369
|
-
### Skill with Heavy Reference
|
|
370
|
-
|
|
371
|
-
```
|
|
372
|
-
pptx/
|
|
373
|
-
SKILL.md # Overview + workflows
|
|
374
|
-
pptxgenjs.md # 600 lines API reference
|
|
375
|
-
ooxml.md # 500 lines XML structure
|
|
376
|
-
scripts/ # Executable tools
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
When: Reference material too large for inline
|
|
380
|
-
|
|
381
167
|
## The Iron Law (Same as TDD)
|
|
382
168
|
|
|
383
169
|
```
|
|
@@ -396,153 +182,10 @@ Edit skill without testing? Same violation.
|
|
|
396
182
|
- Not for "documentation updates"
|
|
397
183
|
- Don't keep untested changes as "reference"
|
|
398
184
|
- Don't "adapt" while running tests
|
|
399
|
-
- Delete means delete
|
|
400
|
-
|
|
401
|
-
**REQUIRED BACKGROUND:** The test-driven-development skill explains why this matters. Same principles apply to documentation.
|
|
402
|
-
|
|
403
|
-
## Testing All Skill Types
|
|
404
|
-
|
|
405
|
-
Different skill types need different test approaches:
|
|
406
|
-
|
|
407
|
-
### Discipline-Enforcing Skills (rules/requirements)
|
|
408
|
-
|
|
409
|
-
**Examples:** TDD, verification-before-completion, designing-before-coding
|
|
410
|
-
|
|
411
|
-
**Test with:**
|
|
412
|
-
|
|
413
|
-
- Academic questions: Do they understand the rules?
|
|
414
|
-
- Pressure scenarios: Do they comply under stress?
|
|
415
|
-
- Multiple pressures combined: time + sunk cost + exhaustion
|
|
416
|
-
- Identify rationalizations and add explicit counters
|
|
417
|
-
|
|
418
|
-
**Success criteria:** Agent follows rule under maximum pressure
|
|
419
|
-
|
|
420
|
-
### Technique Skills (how-to guides)
|
|
421
|
-
|
|
422
|
-
**Examples:** condition-based-waiting, root-cause-tracing, defensive-programming
|
|
423
|
-
|
|
424
|
-
**Test with:**
|
|
425
|
-
|
|
426
|
-
- Application scenarios: Can they apply the technique correctly?
|
|
427
|
-
- Variation scenarios: Do they handle edge cases?
|
|
428
|
-
- Missing information tests: Do instructions have gaps?
|
|
429
|
-
|
|
430
|
-
**Success criteria:** Agent successfully applies technique to new scenario
|
|
431
|
-
|
|
432
|
-
### Pattern Skills (mental models)
|
|
433
|
-
|
|
434
|
-
**Examples:** reducing-complexity, information-hiding concepts
|
|
435
|
-
|
|
436
|
-
**Test with:**
|
|
437
|
-
|
|
438
|
-
- Recognition scenarios: Do they recognize when pattern applies?
|
|
439
|
-
- Application scenarios: Can they use the mental model?
|
|
440
|
-
- Counter-examples: Do they know when NOT to apply?
|
|
441
|
-
|
|
442
|
-
**Success criteria:** Agent correctly identifies when/how to apply pattern
|
|
443
|
-
|
|
444
|
-
### Reference Skills (documentation/APIs)
|
|
445
|
-
|
|
446
|
-
**Examples:** API documentation, command references, library guides
|
|
447
|
-
|
|
448
|
-
**Test with:**
|
|
449
|
-
|
|
450
|
-
- Retrieval scenarios: Can they find the right information?
|
|
451
|
-
- Application scenarios: Can they use what they found correctly?
|
|
452
|
-
- Gap testing: Are common use cases covered?
|
|
453
|
-
|
|
454
|
-
**Success criteria:** Agent finds and correctly applies reference information
|
|
455
|
-
|
|
456
|
-
## Common Rationalizations for Skipping Testing
|
|
457
|
-
|
|
458
|
-
| Excuse | Reality |
|
|
459
|
-
| ------------------------------ | ---------------------------------------------------------------- |
|
|
460
|
-
| "Skill is obviously clear" | Clear to you ≠ clear to other agents. Test it. |
|
|
461
|
-
| "It's just a reference" | References can have gaps, unclear sections. Test retrieval. |
|
|
462
|
-
| "Testing is overkill" | Untested skills have issues. Always. 15 min testing saves hours. |
|
|
463
|
-
| "I'll test if problems emerge" | Problems = agents can't use skill. Test BEFORE deploying. |
|
|
464
|
-
| "Too tedious to test" | Testing is less tedious than debugging bad skill in production. |
|
|
465
|
-
| "I'm confident it's good" | Overconfidence guarantees issues. Test anyway. |
|
|
466
|
-
| "Academic review is enough" | Reading ≠ using. Test application scenarios. |
|
|
467
|
-
| "No time to test" | Deploying untested skill wastes more time fixing it later. |
|
|
468
|
-
|
|
469
|
-
**All of these mean: Test before deploying. No exceptions.**
|
|
470
|
-
|
|
471
|
-
## Bulletproofing Skills Against Rationalization
|
|
472
|
-
|
|
473
|
-
Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.
|
|
474
|
-
|
|
475
|
-
**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.
|
|
476
|
-
|
|
477
|
-
### Close Every Loophole Explicitly
|
|
478
|
-
|
|
479
|
-
Don't just state the rule - forbid specific workarounds:
|
|
480
|
-
|
|
481
|
-
<Bad>
|
|
482
|
-
```markdown
|
|
483
|
-
Write code before test? Delete it.
|
|
484
|
-
```
|
|
485
|
-
</Bad>
|
|
486
|
-
|
|
487
|
-
<Good>
|
|
488
|
-
```markdown
|
|
489
|
-
Write code before test? Delete it. Start over.
|
|
490
|
-
|
|
491
|
-
**No exceptions:**
|
|
492
|
-
|
|
493
|
-
- Don't keep it as "reference"
|
|
494
|
-
- Don't "adapt" it while writing tests
|
|
495
185
|
- Don't look at it
|
|
496
186
|
- Delete means delete
|
|
497
187
|
|
|
498
|
-
|
|
499
|
-
</Good>
|
|
500
|
-
|
|
501
|
-
### Address "Spirit vs Letter" Arguments
|
|
502
|
-
|
|
503
|
-
Add foundational principle early:
|
|
504
|
-
|
|
505
|
-
```markdown
|
|
506
|
-
**Violating the letter of the rules is violating the spirit of the rules.**
|
|
507
|
-
````
|
|
508
|
-
|
|
509
|
-
This cuts off entire class of "I'm following the spirit" rationalizations.
|
|
510
|
-
|
|
511
|
-
### Build Rationalization Table
|
|
512
|
-
|
|
513
|
-
Capture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table:
|
|
514
|
-
|
|
515
|
-
```markdown
|
|
516
|
-
| Excuse | Reality |
|
|
517
|
-
| -------------------------------- | ----------------------------------------------------------------------- |
|
|
518
|
-
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
|
|
519
|
-
| "I'll test after" | Tests passing immediately prove nothing. |
|
|
520
|
-
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
|
|
521
|
-
```
|
|
522
|
-
|
|
523
|
-
### Create Red Flags List
|
|
524
|
-
|
|
525
|
-
Make it easy for agents to self-check when rationalizing:
|
|
526
|
-
|
|
527
|
-
```markdown
|
|
528
|
-
## Red Flags - STOP and Start Over
|
|
529
|
-
|
|
530
|
-
- Code before test
|
|
531
|
-
- "I already manually tested it"
|
|
532
|
-
- "Tests after achieve the same purpose"
|
|
533
|
-
- "It's about spirit not ritual"
|
|
534
|
-
- "This is different because..."
|
|
535
|
-
|
|
536
|
-
**All of these mean: Delete code. Start over with TDD.**
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
### Update CSO for Violation Symptoms
|
|
540
|
-
|
|
541
|
-
Add to description: symptoms of when you're ABOUT to violate the rule:
|
|
542
|
-
|
|
543
|
-
```yaml
|
|
544
|
-
description: use when implementing any feature or bugfix, before writing implementation code
|
|
545
|
-
```
|
|
188
|
+
**REQUIRED BACKGROUND:** The test-driven-development skill explains why this matters. Same principles apply to documentation.
|
|
546
189
|
|
|
547
190
|
## RED-GREEN-REFACTOR for Skills
|
|
548
191
|
|
|
@@ -575,32 +218,6 @@ Agent found new rationalization? Add explicit counter. Re-test until bulletproof
|
|
|
575
218
|
- Plugging holes systematically
|
|
576
219
|
- Meta-testing techniques
|
|
577
220
|
|
|
578
|
-
## Anti-Patterns
|
|
579
|
-
|
|
580
|
-
### ❌ Narrative Example
|
|
581
|
-
|
|
582
|
-
"In session 2025-10-03, we found empty projectDir caused..."
|
|
583
|
-
**Why bad:** Too specific, not reusable
|
|
584
|
-
|
|
585
|
-
### ❌ Multi-Language Dilution
|
|
586
|
-
|
|
587
|
-
example-js.js, example-py.py, example-go.go
|
|
588
|
-
**Why bad:** Mediocre quality, maintenance burden
|
|
589
|
-
|
|
590
|
-
### ❌ Code in Flowcharts
|
|
591
|
-
|
|
592
|
-
```dot
|
|
593
|
-
step1 [label="import fs"];
|
|
594
|
-
step2 [label="read file"];
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
**Why bad:** Can't copy-paste, hard to read
|
|
598
|
-
|
|
599
|
-
### ❌ Generic Labels
|
|
600
|
-
|
|
601
|
-
helper1, helper2, step3, pattern4
|
|
602
|
-
**Why bad:** Labels should have semantic meaning
|
|
603
|
-
|
|
604
221
|
## STOP: Before Moving to Next Skill
|
|
605
222
|
|
|
606
223
|
**After writing ANY skill, you MUST STOP and complete the deployment process.**
|
|
@@ -659,24 +276,12 @@ Deploying untested skills = deploying untested code. It's a violation of quality
|
|
|
659
276
|
- [ ] Commit skill to git and push to your fork (if configured)
|
|
660
277
|
- [ ] Consider contributing back via PR (if broadly useful)
|
|
661
278
|
|
|
662
|
-
##
|
|
663
|
-
|
|
664
|
-
How future Claude finds your skill:
|
|
665
|
-
|
|
666
|
-
1. **Encounters problem** ("tests are flaky")
|
|
667
|
-
2. **Finds SKILL** (description matches)
|
|
668
|
-
3. **Scans overview** (is this relevant?)
|
|
669
|
-
4. **Reads patterns** (quick reference table)
|
|
670
|
-
5. **Loads example** (only when implementing)
|
|
671
|
-
|
|
672
|
-
**Optimize for this flow** - put searchable terms early and often.
|
|
673
|
-
|
|
674
|
-
## The Bottom Line
|
|
675
|
-
|
|
676
|
-
**Creating skills IS TDD for process documentation.**
|
|
677
|
-
|
|
678
|
-
Same Iron Law: No skill without failing test first.
|
|
679
|
-
Same cycle: RED (baseline) → GREEN (write skill) → REFACTOR (close loopholes).
|
|
680
|
-
Same benefits: Better quality, fewer surprises, bulletproof results.
|
|
279
|
+
## References
|
|
681
280
|
|
|
682
|
-
|
|
281
|
+
- `references/claude-search-optimization.md` - CSO guidance: descriptions, keywords, token efficiency, cross-references
|
|
282
|
+
- `references/flowcharts-and-examples.md` - Flowchart usage rules and code example guidance
|
|
283
|
+
- `references/file-organization.md` - Patterns for self-contained vs heavy-reference skills
|
|
284
|
+
- `references/testing-skill-types.md` - How to test discipline, technique, pattern, and reference skills
|
|
285
|
+
- `references/rationalization-hardening.md` - Loophole closure, rationalization tables, red flags
|
|
286
|
+
- `references/anti-patterns.md` - Anti-patterns to avoid
|
|
287
|
+
- `references/discovery-workflow.md` - How future agents find and use skills
|