@ctxthuta/cxops 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.antigravity-plugin/plugin.json +34 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +25 -0
- package/.codex-plugin/plugin.json +50 -0
- package/CLAUDE.md +94 -0
- package/assets/antigravity-logo.png +0 -0
- package/assets/app-icon.png +0 -0
- package/assets/superpowers-small.svg +1 -0
- package/hooks/hooks-cursor.json +10 -0
- package/hooks/hooks.json +18 -0
- package/hooks/run-hook.cmd +79 -0
- package/hooks/session-start +90 -0
- package/package.json +13 -2
- package/plugin/plugin.json +25 -14
- package/plugin/skills/brainstorming/SKILL.md +316 -0
- package/plugin/skills/brainstorming/builder-check-prompt.md +23 -0
- package/plugin/skills/brainstorming/scripts/frame-template.html +213 -0
- package/plugin/skills/brainstorming/scripts/helper.js +167 -0
- package/plugin/skills/brainstorming/scripts/server.cjs +723 -0
- package/plugin/skills/brainstorming/scripts/start-server.sh +216 -0
- package/plugin/skills/brainstorming/scripts/stop-server.sh +120 -0
- package/plugin/skills/brainstorming/visual-companion.md +299 -0
- package/plugin/skills/diagnosing-superpowers/SKILL.md +120 -0
- package/plugin/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
- package/plugin/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
- package/plugin/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
- package/plugin/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
- package/plugin/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
- package/plugin/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
- package/plugin/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
- package/plugin/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
- package/plugin/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
- package/plugin/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
- package/plugin/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
- package/plugin/skills/diagnosing-superpowers/references/context-safety.md +22 -0
- package/plugin/skills/diagnosing-superpowers/references/github-issues.md +47 -0
- package/plugin/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
- package/plugin/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
- package/plugin/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
- package/plugin/skills/diagnosing-superpowers/templates/case.md +64 -0
- package/plugin/skills/diagnosing-superpowers/templates/issue.md +70 -0
- package/plugin/skills/diagnosing-superpowers/templates/report.md +82 -0
- package/plugin/skills/dispatching-parallel-agents/SKILL.md +167 -0
- package/plugin/skills/executing-plans/SKILL.md +323 -0
- package/plugin/skills/executing-plans/scripts/task-done +55 -0
- package/plugin/skills/executing-plans/scripts/task-start +32 -0
- package/plugin/skills/finishing-a-development-branch/SKILL.md +225 -0
- package/plugin/skills/receiving-code-review/SKILL.md +205 -0
- package/plugin/skills/requesting-code-review/SKILL.md +95 -0
- package/plugin/skills/requesting-code-review/code-reviewer.md +198 -0
- package/plugin/skills/subagent-driven-development/SKILL.md +339 -0
- package/plugin/skills/subagent-driven-development/implementer-prompt.md +154 -0
- package/plugin/skills/subagent-driven-development/re-review-prompt.md +116 -0
- package/plugin/skills/subagent-driven-development/references/batching.md +11 -0
- package/plugin/skills/subagent-driven-development/references/cannot-verify.md +10 -0
- package/plugin/skills/subagent-driven-development/references/final-review.md +49 -0
- package/plugin/skills/subagent-driven-development/references/fix-loop.md +77 -0
- package/plugin/skills/subagent-driven-development/references/handling-reports.md +15 -0
- package/plugin/skills/subagent-driven-development/references/preflight.md +26 -0
- package/plugin/skills/subagent-driven-development/references/resuming.md +12 -0
- package/plugin/skills/subagent-driven-development/scripts/review-package +64 -0
- package/plugin/skills/subagent-driven-development/scripts/sdd-repo +54 -0
- package/plugin/skills/subagent-driven-development/scripts/sdd-workspace +110 -0
- package/plugin/skills/subagent-driven-development/scripts/task-brief +108 -0
- package/plugin/skills/subagent-driven-development/task-reviewer-prompt.md +209 -0
- package/plugin/skills/systematic-debugging/SKILL.md +283 -0
- package/plugin/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/plugin/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/plugin/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/plugin/skills/systematic-debugging/find-polluter.sh +72 -0
- package/plugin/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/plugin/skills/test-driven-development/SKILL.md +330 -0
- package/plugin/skills/test-driven-development/writing-good-tests.md +198 -0
- package/plugin/skills/using-git-worktrees/SKILL.md +167 -0
- package/plugin/skills/using-superpowers/SKILL.md +65 -0
- package/plugin/skills/using-superpowers/references/antigravity-tools.md +23 -0
- package/plugin/skills/using-superpowers/references/claude-code-tools.md +29 -0
- package/plugin/skills/using-superpowers/references/codex-tools.md +108 -0
- package/plugin/skills/using-superpowers/references/gemini-tools.md +63 -0
- package/plugin/skills/using-superpowers/references/hermes-tools.md +56 -0
- package/plugin/skills/using-superpowers/references/muse-tools.md +35 -0
- package/plugin/skills/using-superpowers/references/pi-tools.md +16 -0
- package/plugin/skills/verification-before-completion/SKILL.md +120 -0
- package/plugin/skills/writing-plans/SKILL.md +204 -0
- package/plugin/skills/writing-skills/SKILL.md +399 -0
- package/plugin/skills/writing-skills/references/CLAUDE_MD_TESTING.md +189 -0
- package/plugin/skills/writing-skills/references/anthropic-best-practices.md +1150 -0
- package/plugin/skills/writing-skills/references/bulletproofing.md +80 -0
- package/plugin/skills/writing-skills/references/discovery.md +201 -0
- package/plugin/skills/writing-skills/references/flowcharts.md +37 -0
- package/plugin/skills/writing-skills/references/graphviz-conventions.dot +172 -0
- package/plugin/skills/writing-skills/references/persuasion-principles.md +187 -0
- package/plugin/skills/writing-skills/references/testing-skills-with-subagents.md +384 -0
- package/plugin/skills/writing-skills/render-graphs.js +169 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-plans
|
|
3
|
+
description: Use when you have a spec or requirements for a multi-step task, before touching code
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing Plans
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Write implementation plans for an engineer who has not seen this codebase or this spec. Assume they write idiomatic code in the project's language once they know the exact interface and the exact test, and that they will make a reasonable choice wherever the plan leaves one open. What they cannot know is what you decided: which files, which names and signatures, which values from the spec, which tests prove each task. Document those. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
|
|
11
|
+
|
|
12
|
+
**Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
|
|
13
|
+
|
|
14
|
+
**Context:** If working in an isolated worktree, it should have been created via the `superpowers:using-git-worktrees` skill at execution time.
|
|
15
|
+
|
|
16
|
+
**Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
|
|
17
|
+
- (User preferences for plan location override this default)
|
|
18
|
+
|
|
19
|
+
## Scope Check
|
|
20
|
+
|
|
21
|
+
If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
|
|
22
|
+
|
|
23
|
+
## File Structure
|
|
24
|
+
|
|
25
|
+
Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
|
|
26
|
+
|
|
27
|
+
- Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
|
|
28
|
+
- You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
|
|
29
|
+
- Files that change together should live together. Split by responsibility, not by technical layer.
|
|
30
|
+
- In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
|
|
31
|
+
|
|
32
|
+
This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
|
|
33
|
+
|
|
34
|
+
## Task Right-Sizing
|
|
35
|
+
|
|
36
|
+
A task is the smallest unit that carries its own test cycle and is worth a
|
|
37
|
+
fresh reviewer's gate. When drawing task boundaries: fold setup,
|
|
38
|
+
configuration, scaffolding, and documentation steps into the task whose
|
|
39
|
+
deliverable needs them; split only where a reviewer could meaningfully
|
|
40
|
+
reject one task while approving its neighbor. Each task ends with an
|
|
41
|
+
independently testable deliverable.
|
|
42
|
+
|
|
43
|
+
## Step Granularity
|
|
44
|
+
|
|
45
|
+
**Each step is one action with a checkable result:**
|
|
46
|
+
- "Write the failing test" - step
|
|
47
|
+
- "Run it to make sure it fails" - step
|
|
48
|
+
- "Implement the minimal code to make the test pass" - step
|
|
49
|
+
- "Run the tests and make sure they pass" - step
|
|
50
|
+
- "Commit" - step
|
|
51
|
+
|
|
52
|
+
## Plan Document Header
|
|
53
|
+
|
|
54
|
+
**Every plan MUST start with this header:**
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
# [Feature Name] Implementation Plan
|
|
58
|
+
|
|
59
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
60
|
+
|
|
61
|
+
**Goal:** [One sentence describing what this builds]
|
|
62
|
+
|
|
63
|
+
**Architecture:** [2-3 sentences about approach]
|
|
64
|
+
|
|
65
|
+
**Tech Stack:** [Key technologies/libraries]
|
|
66
|
+
|
|
67
|
+
**Spec:** [path to the spec/design doc this plan implements — the plan
|
|
68
|
+
argues from the spec, so the spec travels with it; executors read both]
|
|
69
|
+
|
|
70
|
+
## Global Constraints
|
|
71
|
+
|
|
72
|
+
[The spec's project-wide requirements — version floors, dependency limits,
|
|
73
|
+
naming and copy rules, platform requirements — one line each, with exact
|
|
74
|
+
values copied verbatim from the spec. Every task's requirements implicitly
|
|
75
|
+
include this section.]
|
|
76
|
+
|
|
77
|
+
## Review Focus
|
|
78
|
+
|
|
79
|
+
[The five input classes or failure modes the spec implies but no task's
|
|
80
|
+
tests exercise that are most likely to bite a person using this software
|
|
81
|
+
— one line each, naming the input or condition and the behavior a
|
|
82
|
+
reasonable person would expect, most likely first. The spec is a vision
|
|
83
|
+
document: it says what the software must do, not everything it will
|
|
84
|
+
meet, and its silence on an input is not permission for that input to
|
|
85
|
+
break the program. Write the list here, once, with the spec in front of
|
|
86
|
+
you. Then, for each line, add the test that pins it to the task that
|
|
87
|
+
owns the code, in that task's own step style.]
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Task Structure
|
|
93
|
+
|
|
94
|
+
````markdown
|
|
95
|
+
### Task N: [Component Name]
|
|
96
|
+
|
|
97
|
+
**Files:**
|
|
98
|
+
- Create: `exact/path/to/file.py`
|
|
99
|
+
- Modify: `exact/path/to/existing.py:123-145`
|
|
100
|
+
- Test: `tests/exact/path/to/test.py`
|
|
101
|
+
|
|
102
|
+
**Interfaces:**
|
|
103
|
+
- Consumes: [what this task uses from earlier tasks — exact signatures]
|
|
104
|
+
- Produces: [what later tasks rely on — exact function names, parameter
|
|
105
|
+
and return types. A task's implementer sees only their own task; this
|
|
106
|
+
block is how they learn the names and types neighboring tasks use.]
|
|
107
|
+
|
|
108
|
+
- [ ] **Step 1: Write the failing test**
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
def test_specific_behavior():
|
|
112
|
+
result = function(input)
|
|
113
|
+
assert result == expected
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- [ ] **Step 2: Run test to verify it fails**
|
|
117
|
+
|
|
118
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
119
|
+
Expected: FAIL with "function not defined"
|
|
120
|
+
|
|
121
|
+
- [ ] **Step 3: Implement `function(input: InputType) -> ResultType` in `exact/path/to/file.py`**
|
|
122
|
+
|
|
123
|
+
One line on the approach when the signature and the test leave a choice
|
|
124
|
+
(which library call, which data structure); a code block only for an
|
|
125
|
+
algorithm they do not determine.
|
|
126
|
+
|
|
127
|
+
- [ ] **Step 4: Run test to verify it passes**
|
|
128
|
+
|
|
129
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
130
|
+
Expected: PASS
|
|
131
|
+
|
|
132
|
+
- [ ] **Step 5: Commit**
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
git add tests/path/test.py src/path/file.py
|
|
136
|
+
git commit -m "feat: add specific feature"
|
|
137
|
+
```
|
|
138
|
+
````
|
|
139
|
+
|
|
140
|
+
## What a Step Contains
|
|
141
|
+
|
|
142
|
+
A step is done when the implementer can write exactly one reasonable thing
|
|
143
|
+
from it. That is the whole requirement: unambiguous, not complete. Each kind
|
|
144
|
+
of step carries what makes it unambiguous and nothing more:
|
|
145
|
+
|
|
146
|
+
- **A test step:** the test's name and its assertions, as code, with the
|
|
147
|
+
spec's exact values in them.
|
|
148
|
+
- **A code step:** the exact signature (name, parameters, return type), the
|
|
149
|
+
file it lives in, and the specific values the spec pins. The implementer
|
|
150
|
+
writes the body. A body appears only for an algorithm the signature and
|
|
151
|
+
tests do not determine, or for exact copy the spec fixes.
|
|
152
|
+
- **A verification step:** the command to run and the output that means it
|
|
153
|
+
passed.
|
|
154
|
+
- **A reference to another task:** that task's Interfaces block says what
|
|
155
|
+
to use; the plan does not repeat that task's code.
|
|
156
|
+
|
|
157
|
+
A plan is the set of decisions the implementer cannot make alone. A plan
|
|
158
|
+
longer than the code it describes has written the code instead. Lines that
|
|
159
|
+
decide nothing ("TBD", "handle edge cases", "add appropriate validation",
|
|
160
|
+
"write tests for the above", a type or function no task defines) are the
|
|
161
|
+
opposite failure, and the self-review catches both.
|
|
162
|
+
|
|
163
|
+
## Self-Review
|
|
164
|
+
|
|
165
|
+
After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
|
|
166
|
+
|
|
167
|
+
**1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
|
|
168
|
+
|
|
169
|
+
**2. Step scan:** Every step must let the implementer write exactly one reasonable thing, and no step may carry more than that: a line that decides nothing is a gap, a function body the signature and tests already determine is a transcript. Fix both.
|
|
170
|
+
|
|
171
|
+
**3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
|
|
172
|
+
|
|
173
|
+
**4. Review Focus:** For each input class or failure mode the spec implies, is there a task whose tests exercise it? The five uncovered ones most likely to bite a person go in the Review Focus section, and each line there gets its test added to the owning task. An empty section means you checked and found none, not that you skipped the check.
|
|
174
|
+
|
|
175
|
+
**5. Proportion:** Compare the plan's length to the spec's. A plan several times longer than the spec it implements is a transcript of the program, not a plan. If code blocks are most of the document, replace bodies with signatures, test names and assertions, and check that each step is still unambiguous.
|
|
176
|
+
|
|
177
|
+
If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
|
|
178
|
+
|
|
179
|
+
## Execution Handoff
|
|
180
|
+
|
|
181
|
+
After saving and self-reviewing the plan, link it for your human partner
|
|
182
|
+
to read. If they have already explicitly supplied an execution method, ask
|
|
183
|
+
them to review the plan and confirm it captures what they want; wait for that
|
|
184
|
+
review before implementation, then use the preserved method. Otherwise, ask
|
|
185
|
+
them to review the plan and choose an execution method before implementation.
|
|
186
|
+
|
|
187
|
+
**When no execution method has already been supplied:**
|
|
188
|
+
|
|
189
|
+
**"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Please review the plan. Which execution approach would you prefer?**
|
|
190
|
+
|
|
191
|
+
- **Subagent-driven** - A fresh subagent implements each task and a fresh reviewer checks it before the next one starts, then a whole-branch review at the end. Most thorough; costs a fresh context per task and per review.
|
|
192
|
+
- **Native** - I implement every task myself in this session, the way this harness runs work, then one fresh reviewer on the most capable model checks the whole branch. Cheapest and fastest; no independent review until the end. Runs well with a mid-tier session model, since the plan carries the design.
|
|
193
|
+
|
|
194
|
+
**For this plan I recommend <one of the two>, because <one sentence from the plan: how much the tasks depend on each other's interfaces, how many there are, what a shipped mistake would cost>. Does the plan capture what you want, and which approach should we use?"**
|
|
195
|
+
|
|
196
|
+
**When an execution method has already been supplied:**
|
|
197
|
+
|
|
198
|
+
**"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Please review the plan. Does it capture what you want?"**
|
|
199
|
+
|
|
200
|
+
**If Subagent-driven chosen:**
|
|
201
|
+
- **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
|
|
202
|
+
|
|
203
|
+
**If Native chosen:**
|
|
204
|
+
- **REQUIRED SUB-SKILL:** Use superpowers:executing-plans
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-skills
|
|
3
|
+
description: Use when creating new skills, editing existing skills, or verifying skills work before deployment
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing Skills
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
**Writing skills IS Test-Driven Development applied to process documentation.**
|
|
11
|
+
|
|
12
|
+
**Personal skills live in your runtime's skills directory** (`~/.claude/skills/` on Claude Code) — see [codex-tools.md](../using-superpowers/references/codex-tools.md) or [gemini-tools.md](../using-superpowers/references/gemini-tools.md) for the path on those runtimes. Codex, Copilot CLI, and Gemini CLI all also recognize `~/.agents/skills/` as a cross-runtime alias.
|
|
13
|
+
|
|
14
|
+
You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
|
|
15
|
+
|
|
16
|
+
**Core principle:** If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.
|
|
17
|
+
|
|
18
|
+
**REQUIRED BACKGROUND:** You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
|
|
19
|
+
|
|
20
|
+
**Official guidance:** For Anthropic's official skill authoring best practices, see references/anthropic-best-practices.md. This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.
|
|
21
|
+
|
|
22
|
+
## What is a Skill?
|
|
23
|
+
|
|
24
|
+
A **skill** is a reference guide for proven techniques, patterns, or tools. Skills help future agents find and apply effective approaches.
|
|
25
|
+
|
|
26
|
+
**Skills are:** Reusable techniques, patterns, tools, reference guides
|
|
27
|
+
|
|
28
|
+
**Skills are NOT:** Narratives about how you solved a problem once
|
|
29
|
+
|
|
30
|
+
## TDD Mapping for Skills
|
|
31
|
+
|
|
32
|
+
| TDD Concept | Skill Creation |
|
|
33
|
+
|-------------|----------------|
|
|
34
|
+
| **Test case** | Pressure scenario with subagent |
|
|
35
|
+
| **Production code** | Skill document (SKILL.md) |
|
|
36
|
+
| **Test fails (RED)** | Agent violates rule without skill (baseline) |
|
|
37
|
+
| **Test passes (GREEN)** | Agent complies with skill present |
|
|
38
|
+
| **Refactor** | Close loopholes while maintaining compliance |
|
|
39
|
+
| **Write test first** | Run baseline scenario BEFORE writing skill |
|
|
40
|
+
| **Watch it fail** | Document exact rationalizations agent uses |
|
|
41
|
+
| **Minimal code** | Write skill addressing those specific violations |
|
|
42
|
+
| **Watch it pass** | Verify agent now complies |
|
|
43
|
+
| **Refactor cycle** | Find new rationalizations → plug → re-verify |
|
|
44
|
+
|
|
45
|
+
The entire skill creation process follows RED-GREEN-REFACTOR.
|
|
46
|
+
|
|
47
|
+
## When to Create a Skill
|
|
48
|
+
|
|
49
|
+
**Create when:**
|
|
50
|
+
- Technique wasn't intuitively obvious to you
|
|
51
|
+
- You'd reference this again across projects
|
|
52
|
+
- Pattern applies broadly (not project-specific)
|
|
53
|
+
- Others would benefit
|
|
54
|
+
|
|
55
|
+
**Don't create for:**
|
|
56
|
+
- One-off solutions
|
|
57
|
+
- Standard practices well-documented elsewhere
|
|
58
|
+
- Project-specific conventions (put in your instructions file)
|
|
59
|
+
- Mechanical constraints (if it's enforceable with regex/validation, automate it—save documentation for judgment calls)
|
|
60
|
+
|
|
61
|
+
## Skill Types
|
|
62
|
+
|
|
63
|
+
### Technique
|
|
64
|
+
Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)
|
|
65
|
+
|
|
66
|
+
### Pattern
|
|
67
|
+
Way of thinking about problems (flatten-with-flags, test-invariants)
|
|
68
|
+
|
|
69
|
+
### Reference
|
|
70
|
+
API docs, syntax guides, tool documentation (office docs)
|
|
71
|
+
|
|
72
|
+
## Directory Structure
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
skills/
|
|
77
|
+
skill-name/
|
|
78
|
+
SKILL.md # Main reference (required)
|
|
79
|
+
supporting-file.* # Only if needed
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Flat namespace** - all skills in one searchable namespace
|
|
83
|
+
|
|
84
|
+
**Separate files for:**
|
|
85
|
+
1. **Heavy reference** (100+ lines) - API docs, comprehensive syntax
|
|
86
|
+
2. **Reusable tools** - Scripts, utilities, templates
|
|
87
|
+
|
|
88
|
+
**Keep inline:**
|
|
89
|
+
- Principles and concepts
|
|
90
|
+
- Code patterns (< 50 lines)
|
|
91
|
+
- Everything else
|
|
92
|
+
|
|
93
|
+
## Writing SKILL.md
|
|
94
|
+
|
|
95
|
+
A skill's `description` says only when to use it: triggering conditions and
|
|
96
|
+
symptoms, starting with "Use when...". It never summarizes the skill's
|
|
97
|
+
workflow, because an agent that reads a workflow summary follows it instead
|
|
98
|
+
of reading the skill.
|
|
99
|
+
|
|
100
|
+
When you write or change a skill's frontmatter, name or description, or
|
|
101
|
+
need to cut its size, read [references/discovery.md](references/discovery.md):
|
|
102
|
+
the SKILL.md template, description and keyword guidance, naming, token
|
|
103
|
+
budgets, and cross-referencing other skills.
|
|
104
|
+
|
|
105
|
+
## Flowcharts
|
|
106
|
+
|
|
107
|
+
When you add or change a flowchart in a skill, read
|
|
108
|
+
[references/flowcharts.md](references/flowcharts.md) first: when a flowchart
|
|
109
|
+
earns its place, the graphviz conventions, and how to render one.
|
|
110
|
+
|
|
111
|
+
## Code Examples
|
|
112
|
+
|
|
113
|
+
**One excellent example beats many mediocre ones**
|
|
114
|
+
|
|
115
|
+
Choose most relevant language:
|
|
116
|
+
- Testing techniques → TypeScript/JavaScript
|
|
117
|
+
- System debugging → Shell/Python
|
|
118
|
+
- Data processing → Python
|
|
119
|
+
|
|
120
|
+
**Good example:**
|
|
121
|
+
- Complete and runnable
|
|
122
|
+
- Well-commented explaining WHY
|
|
123
|
+
- From real scenario
|
|
124
|
+
- Shows pattern clearly
|
|
125
|
+
- Ready to adapt (not generic template)
|
|
126
|
+
|
|
127
|
+
**Don't:**
|
|
128
|
+
- Implement in 5+ languages
|
|
129
|
+
- Create fill-in-the-blank templates
|
|
130
|
+
- Write contrived examples
|
|
131
|
+
|
|
132
|
+
You're good at porting - one great example is enough.
|
|
133
|
+
|
|
134
|
+
## File Organization
|
|
135
|
+
|
|
136
|
+
### Self-Contained Skill
|
|
137
|
+
```
|
|
138
|
+
defense-in-depth/
|
|
139
|
+
SKILL.md # Everything inline
|
|
140
|
+
```
|
|
141
|
+
When: All content fits, no heavy reference needed
|
|
142
|
+
|
|
143
|
+
### Skill with Reusable Tool
|
|
144
|
+
```
|
|
145
|
+
condition-based-waiting/
|
|
146
|
+
SKILL.md # Overview + patterns
|
|
147
|
+
example.ts # Working helpers to adapt
|
|
148
|
+
```
|
|
149
|
+
When: Tool is reusable code, not just narrative
|
|
150
|
+
|
|
151
|
+
### Skill with Heavy Reference
|
|
152
|
+
```
|
|
153
|
+
pptx/
|
|
154
|
+
SKILL.md # Overview + workflows
|
|
155
|
+
pptxgenjs.md # 600 lines API reference
|
|
156
|
+
ooxml.md # 500 lines XML structure
|
|
157
|
+
scripts/ # Executable tools
|
|
158
|
+
```
|
|
159
|
+
When: Reference material too large for inline
|
|
160
|
+
|
|
161
|
+
Invoke bundled scripts through their interpreter in the prose (`bash scripts/tool.sh`, `node scripts/tool.js`), never by bare path: some harness plugin packagers strip executable bits, and a bare `scripts/tool.sh` fails there with `Permission denied`.
|
|
162
|
+
|
|
163
|
+
## The Iron Law (Same as TDD)
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
NO SKILL WITHOUT A FAILING TEST FIRST
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
This applies to NEW skills AND EDITS to existing skills.
|
|
170
|
+
|
|
171
|
+
Write skill before testing? Delete it. Start over.
|
|
172
|
+
Edit skill without testing? Same violation.
|
|
173
|
+
|
|
174
|
+
**No exceptions:**
|
|
175
|
+
- Not for "simple additions"
|
|
176
|
+
- Not for "just adding a section"
|
|
177
|
+
- Not for "documentation updates"
|
|
178
|
+
- Don't keep untested changes as "reference"
|
|
179
|
+
- Don't "adapt" while running tests
|
|
180
|
+
- Delete means delete
|
|
181
|
+
|
|
182
|
+
**REQUIRED BACKGROUND:** The superpowers:test-driven-development skill explains why this matters. Same principles apply to documentation.
|
|
183
|
+
|
|
184
|
+
## Testing All Skill Types
|
|
185
|
+
|
|
186
|
+
Different skill types need different test approaches:
|
|
187
|
+
|
|
188
|
+
### Discipline-Enforcing Skills (rules/requirements)
|
|
189
|
+
|
|
190
|
+
**Examples:** TDD, verification-before-completion, designing-before-coding
|
|
191
|
+
|
|
192
|
+
**Test with:**
|
|
193
|
+
- Academic questions: Do they understand the rules?
|
|
194
|
+
- Pressure scenarios: Do they comply under stress?
|
|
195
|
+
- Multiple pressures combined: time + sunk cost + exhaustion
|
|
196
|
+
- Identify rationalizations and add explicit counters
|
|
197
|
+
|
|
198
|
+
**Success criteria:** Agent follows rule under maximum pressure
|
|
199
|
+
|
|
200
|
+
### Technique Skills (how-to guides)
|
|
201
|
+
|
|
202
|
+
**Examples:** condition-based-waiting, root-cause-tracing, defensive-programming
|
|
203
|
+
|
|
204
|
+
**Test with:**
|
|
205
|
+
- Application scenarios: Can they apply the technique correctly?
|
|
206
|
+
- Variation scenarios: Do they handle edge cases?
|
|
207
|
+
- Missing information tests: Do instructions have gaps?
|
|
208
|
+
|
|
209
|
+
**Success criteria:** Agent successfully applies technique to new scenario
|
|
210
|
+
|
|
211
|
+
### Pattern Skills (mental models)
|
|
212
|
+
|
|
213
|
+
**Examples:** reducing-complexity, information-hiding concepts
|
|
214
|
+
|
|
215
|
+
**Test with:**
|
|
216
|
+
- Recognition scenarios: Do they recognize when pattern applies?
|
|
217
|
+
- Application scenarios: Can they use the mental model?
|
|
218
|
+
- Counter-examples: Do they know when NOT to apply?
|
|
219
|
+
|
|
220
|
+
**Success criteria:** Agent correctly identifies when/how to apply pattern
|
|
221
|
+
|
|
222
|
+
### Reference Skills (documentation/APIs)
|
|
223
|
+
|
|
224
|
+
**Examples:** API documentation, command references, library guides
|
|
225
|
+
|
|
226
|
+
**Test with:**
|
|
227
|
+
- Retrieval scenarios: Can they find the right information?
|
|
228
|
+
- Application scenarios: Can they use what they found correctly?
|
|
229
|
+
- Gap testing: Are common use cases covered?
|
|
230
|
+
|
|
231
|
+
**Success criteria:** Agent finds and correctly applies reference information
|
|
232
|
+
|
|
233
|
+
## Common Rationalizations for Skipping Testing
|
|
234
|
+
|
|
235
|
+
| Excuse | Reality |
|
|
236
|
+
|--------|---------|
|
|
237
|
+
| "Skill is obviously clear" | Clear to you ≠ clear to other agents. Test it. |
|
|
238
|
+
| "It's just a reference" | References can have gaps, unclear sections. Test retrieval. |
|
|
239
|
+
| "Testing is overkill" | Untested skills have issues. Always. 15 min testing saves hours. |
|
|
240
|
+
| "I'll test if problems emerge" | Problems = agents can't use skill. Test BEFORE deploying. |
|
|
241
|
+
| "Too tedious to test" | Testing is less tedious than debugging bad skill in production. |
|
|
242
|
+
| "I'm confident it's good" | Overconfidence guarantees issues. Test anyway. |
|
|
243
|
+
| "Academic review is enough" | Reading ≠ using. Test application scenarios. |
|
|
244
|
+
| "No time to test" | Deploying untested skill wastes more time fixing it later. |
|
|
245
|
+
|
|
246
|
+
**All of these mean: Test before deploying. No exceptions.**
|
|
247
|
+
|
|
248
|
+
## Match the Form to the Failure
|
|
249
|
+
|
|
250
|
+
Before writing guidance, classify the baseline failure. The form that bulletproofs one failure type measurably backfires on another.
|
|
251
|
+
|
|
252
|
+
| Baseline failure | Right form | Wrong form |
|
|
253
|
+
|---|---|---|
|
|
254
|
+
| Skips/violates a rule under pressure (knows better, does it anyway) | Prohibition + rationalization table + red flags (see references/bulletproofing.md) | Soft guidance ("prefer...", "consider...") |
|
|
255
|
+
| Complies, but output has the wrong shape (bloated prompt, buried verdict, restated spec) | Positive recipe or contract: state what the output IS — its parts, in order | Prohibition list ("don't restate", "never narrate") |
|
|
256
|
+
| Omits a required element from something they already produce | Structural: REQUIRED field or slot in the template they fill in | Prose reminders near the template |
|
|
257
|
+
| Behavior should depend on a condition | Conditional keyed to an observable predicate ("if the brief exists, reference it") | Unconditional rule + exemption clauses |
|
|
258
|
+
|
|
259
|
+
**Why prohibitions backfire on shaping problems:** under a competing incentive ("make the prompt self-contained"), agents negotiate with "don't X". In head-to-head wording tests on dispatch-prompt guidance, the prohibition arm produced clearly more of the unwanted content than the recipe arm (fully separated distributions), and trended worse than even the no-guidance control — micro-test your own case rather than assuming, but never reach for the prohibition by default. A recipe leaves nothing to negotiate: the output matches the stated shape or it doesn't.
|
|
260
|
+
|
|
261
|
+
**Rules for whichever form you pick:**
|
|
262
|
+
- **No nuance clauses.** "Don't X unless it matters" reopens the negotiation — appending a single nuance clause to a winning recipe degraded it from consistent to noisy in the same wording tests. Express a real exception as its own conditional on an observable predicate.
|
|
263
|
+
- **Exemption clauses don't scope.** "This limit doesn't apply to code blocks" still suppresses code blocks. If part of the output must be exempt, restructure so the rule can't reach it.
|
|
264
|
+
|
|
265
|
+
## Bulletproofing Against Rationalization
|
|
266
|
+
|
|
267
|
+
When the baseline failure is a discipline failure, read
|
|
268
|
+
[references/bulletproofing.md](references/bulletproofing.md) before you write
|
|
269
|
+
the guidance: closing loopholes, the spirit-vs-letter line, the
|
|
270
|
+
rationalization table, and the red-flags list.
|
|
271
|
+
|
|
272
|
+
## RED-GREEN-REFACTOR for Skills
|
|
273
|
+
|
|
274
|
+
Follow the TDD cycle:
|
|
275
|
+
|
|
276
|
+
### RED: Write Failing Test (Baseline)
|
|
277
|
+
|
|
278
|
+
Run pressure scenario with subagent WITHOUT the skill. Document exact behavior:
|
|
279
|
+
- What choices did they make?
|
|
280
|
+
- What rationalizations did they use (verbatim)?
|
|
281
|
+
- Which pressures triggered violations?
|
|
282
|
+
|
|
283
|
+
This is "watch the test fail" - you must see what agents naturally do before writing the skill.
|
|
284
|
+
|
|
285
|
+
### GREEN: Write Minimal Skill
|
|
286
|
+
|
|
287
|
+
Write skill that addresses those specific rationalizations. Don't add extra content for hypothetical cases.
|
|
288
|
+
|
|
289
|
+
Run same scenarios WITH skill. Agent should now comply.
|
|
290
|
+
|
|
291
|
+
### REFACTOR: Close Loopholes
|
|
292
|
+
|
|
293
|
+
Agent found new rationalization? Add explicit counter. Re-test until bulletproof.
|
|
294
|
+
|
|
295
|
+
### Micro-Test Wording Before Full Scenarios
|
|
296
|
+
|
|
297
|
+
Full pressure-scenario runs are the final gate, but they are slow and expensive per iteration. Verify the wording itself first with micro-tests:
|
|
298
|
+
|
|
299
|
+
1. **One fresh-context sample per call** — a raw API call, or a single-shot subagent if you don't have API access. System prompt = the realistic context the guidance will live in (the full skill or prompt template, not the guidance in isolation); user message = a task that tempts the failure.
|
|
300
|
+
2. **Always include a no-guidance control.** If the control doesn't exhibit the failure, there is nothing to fix — stop, don't author the guidance.
|
|
301
|
+
3. **5+ reps per variant.** Single samples lie.
|
|
302
|
+
4. **Manually read every flagged match.** Score programmatically if you like, but template echoes and quoted counter-examples masquerade as hits; automated counts alone overstate both failure and success.
|
|
303
|
+
5. **Variance is a metric.** When guidance lands, reps converge on the same shape. Five different interpretations across five reps means the wording isn't binding — tighten the form before adding words.
|
|
304
|
+
|
|
305
|
+
Micro-tests verify wording; they do not replace pressure scenarios for discipline skills.
|
|
306
|
+
|
|
307
|
+
**Testing methodology:** See [references/testing-skills-with-subagents.md](references/testing-skills-with-subagents.md) for the complete testing methodology:
|
|
308
|
+
- How to write pressure scenarios
|
|
309
|
+
- Pressure types (time, sunk cost, authority, exhaustion)
|
|
310
|
+
- Plugging holes systematically
|
|
311
|
+
- Meta-testing techniques
|
|
312
|
+
|
|
313
|
+
## Anti-Patterns
|
|
314
|
+
|
|
315
|
+
### ❌ Narrative Example
|
|
316
|
+
"In session 2025-10-03, we found empty projectDir caused..."
|
|
317
|
+
**Why bad:** Too specific, not reusable
|
|
318
|
+
|
|
319
|
+
### ❌ Multi-Language Dilution
|
|
320
|
+
example-js.js, example-py.py, example-go.go
|
|
321
|
+
**Why bad:** Mediocre quality, maintenance burden
|
|
322
|
+
|
|
323
|
+
### ❌ Code in Flowcharts
|
|
324
|
+
```dot
|
|
325
|
+
step1 [label="import fs"];
|
|
326
|
+
step2 [label="read file"];
|
|
327
|
+
```
|
|
328
|
+
**Why bad:** Can't copy-paste, hard to read
|
|
329
|
+
|
|
330
|
+
### ❌ Generic Labels
|
|
331
|
+
helper1, helper2, step3, pattern4
|
|
332
|
+
**Why bad:** Labels should have semantic meaning
|
|
333
|
+
|
|
334
|
+
## STOP: Before Moving to Next Skill
|
|
335
|
+
|
|
336
|
+
**After writing ANY skill, you MUST STOP and complete the deployment process.**
|
|
337
|
+
|
|
338
|
+
**Do NOT:**
|
|
339
|
+
- Create multiple skills in batch without testing each
|
|
340
|
+
- Move to next skill before current one is verified
|
|
341
|
+
- Skip testing because "batching is more efficient"
|
|
342
|
+
|
|
343
|
+
**The deployment checklist below is MANDATORY for EACH skill.**
|
|
344
|
+
|
|
345
|
+
Deploying untested skills = deploying untested code. It's a violation of quality standards.
|
|
346
|
+
|
|
347
|
+
## Skill Creation Checklist (TDD Adapted)
|
|
348
|
+
|
|
349
|
+
**IMPORTANT: Create a todo for EACH checklist item below.**
|
|
350
|
+
|
|
351
|
+
**RED Phase - Write Failing Test:**
|
|
352
|
+
- [ ] Create pressure scenarios (3+ combined pressures for discipline skills)
|
|
353
|
+
- [ ] Run scenarios WITHOUT skill - document baseline behavior verbatim
|
|
354
|
+
- [ ] Identify patterns in rationalizations/failures
|
|
355
|
+
|
|
356
|
+
**GREEN Phase - Write Minimal Skill:**
|
|
357
|
+
- [ ] Name uses only letters, numbers, hyphens (no parentheses/special chars)
|
|
358
|
+
- [ ] YAML frontmatter with required `name` and `description` fields (max 1024 chars; see [spec](https://agentskills.io/specification))
|
|
359
|
+
- [ ] Description starts with "Use when..." and includes specific triggers/symptoms
|
|
360
|
+
- [ ] Description written in third person
|
|
361
|
+
- [ ] Keywords throughout for search (errors, symptoms, tools)
|
|
362
|
+
- [ ] Clear overview with core principle
|
|
363
|
+
- [ ] Address specific baseline failures identified in RED
|
|
364
|
+
- [ ] Guidance form matches the failure type (see Match the Form to the Failure)
|
|
365
|
+
- [ ] For behavior-shaping guidance: wording micro-tested against a no-guidance control (5+ reps, every flagged match read manually) — N/A for pure reference skills
|
|
366
|
+
- [ ] Code inline OR link to separate file
|
|
367
|
+
- [ ] One excellent example (not multi-language)
|
|
368
|
+
- [ ] Run scenarios WITH skill - verify agents now comply
|
|
369
|
+
|
|
370
|
+
**REFACTOR Phase - Close Loopholes:**
|
|
371
|
+
- [ ] Identify NEW rationalizations from testing
|
|
372
|
+
- [ ] Add explicit counters (if discipline skill)
|
|
373
|
+
- [ ] Build rationalization table from all test iterations
|
|
374
|
+
- [ ] Create red flags list
|
|
375
|
+
- [ ] Re-test until bulletproof
|
|
376
|
+
|
|
377
|
+
**Quality Checks:**
|
|
378
|
+
- [ ] Small flowchart only if decision non-obvious
|
|
379
|
+
- [ ] Quick reference table
|
|
380
|
+
- [ ] Common mistakes section
|
|
381
|
+
- [ ] No narrative storytelling
|
|
382
|
+
- [ ] Supporting files only for tools or heavy reference
|
|
383
|
+
|
|
384
|
+
**Deployment:**
|
|
385
|
+
- [ ] Commit skill to git and push to your fork (if configured)
|
|
386
|
+
- [ ] Consider contributing back via PR (if broadly useful)
|
|
387
|
+
|
|
388
|
+
## Discovery Workflow
|
|
389
|
+
|
|
390
|
+
How future agents find your skill:
|
|
391
|
+
|
|
392
|
+
1. **Encounters problem** ("tests are flaky")
|
|
393
|
+
2. **Searches skills** (greps descriptions, browses categories)
|
|
394
|
+
3. **Finds SKILL** (description matches)
|
|
395
|
+
4. **Scans overview** (is this relevant?)
|
|
396
|
+
5. **Reads patterns** (quick reference table)
|
|
397
|
+
6. **Loads example** (only when implementing)
|
|
398
|
+
|
|
399
|
+
**Optimize for this flow** - put searchable terms early and often.
|