claude-dev-env 1.2.1 → 1.7.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.
@@ -1,26 +1,45 @@
1
- # Skill Writer Reference
1
+ # Skill writer -- reference
2
2
 
3
- ## Table of Contents
3
+ ## Canonical resources
4
4
 
5
- 1. [Complete Frontmatter Fields](#complete-frontmatter-fields)
6
- 2. [Progressive Disclosure Architecture](#progressive-disclosure-architecture)
7
- 3. [Content Templates by Degree of Freedom](#content-templates)
8
- 4. [Validation Checklist](#validation-checklist)
5
+ When authoring or refining skills, ground decisions in these sources. If guidance conflicts, defer to the higher tier.
6
+
7
+ ### Tier 1: Anthropic (primary authority for Claude)
8
+
9
+ - https://platform.claude.com/docs/en/claude-code/skills -- official skill structure, frontmatter fields, progressive disclosure, string substitutions, directory layout.
10
+ - https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices -- the single living reference for Claude's latest models. Covers XML tags, tool use, thinking, agentic systems, overeagerness, anti-hallucination.
11
+ - https://transformer-circuits.pub/2026/emotions/index.html -- emotion concepts research (April 2026): 171 internal activation patterns that causally influence behavior. Key skill-writing takeaways: clear criteria and escape routes improve output quality, collaborative framing activates engagement, positive task framing correlates with better results.
12
+ - https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking -- adaptive thinking reference; replaces manual budget_tokens with effort-based control.
13
+
14
+ ### Tier 2: Major labs (strong secondary, often transfers across models)
15
+
16
+ - https://platform.openai.com/docs/guides/prompt-engineering -- six strategies: clear instructions, reference text, split complex tasks, give models time to think, use external tools, test systematically.
17
+ - https://deepmind.google/research/ -- chain-of-thought and structured reasoning research.
18
+
19
+ ### Tier 3: Community and individuals (supplementary)
20
+
21
+ - https://simonwillison.net/ -- practical LLM experiments, skill patterns, and automation insights.
22
+ - https://www.deeplearning.ai/short-courses/ -- foundational prompt engineering courses.
23
+ - https://www.latent.space/ -- AI engineering perspective.
24
+
25
+ ### Conflict resolution rule
26
+
27
+ If sources disagree on a technique, apply in order: Anthropic documentation first (it describes the actual model behavior), then OpenAI/Google/Microsoft (large-scale research with cross-model relevance), then community sources (patterns and intuition, not authoritative on model internals). When Tier 3 contradicts Tier 1, Tier 1 wins without exception.
9
28
 
10
29
  ---
11
30
 
12
- ## Complete Frontmatter Fields
31
+ ## Complete frontmatter fields
13
32
 
14
33
  Source: [Claude Code Skills](https://platform.claude.com/docs/en/claude-code/skills)
15
34
 
16
- ### Required Fields
35
+ ### Required fields
17
36
 
18
37
  | Field | Type | Constraints | Description |
19
38
  |-------|------|-------------|-------------|
20
39
  | `name` | string | Lowercase, hyphens, numbers. Max 64 chars. No `anthropic` or `claude`. | Must match directory name. Prefer gerund form. |
21
40
  | `description` | string | Max 1024 chars. Third person. No XML tags. | What it does + when to use it + trigger phrases. |
22
41
 
23
- ### Optional Fields
42
+ ### Optional fields
24
43
 
25
44
  | Field | Type | Default | Description |
26
45
  |-------|------|---------|-------------|
@@ -33,10 +52,10 @@ Source: [Claude Code Skills](https://platform.claude.com/docs/en/claude-code/ski
33
52
  | `disable-model-invocation` | boolean | `false` | Set `true` for manual-only via `/name` |
34
53
  | `paths` | string/list | (all files) | Glob patterns limiting activation. E.g., `"*.py"` or `["*.ts", "*.tsx"]` |
35
54
  | `argument-hint` | string | (none) | Autocomplete hint. E.g., `[filename] [format]` |
36
- | `shell` | string | `bash` | Shell for `!`command`` blocks. `bash` or `powershell` |
55
+ | `shell` | string | `bash` | Shell for `` !`command` `` blocks. `bash` or `powershell` |
37
56
  | `hooks` | object | (none) | Hooks scoped to this skill's lifecycle |
38
57
 
39
- ### String Substitutions (available in SKILL.md body)
58
+ ### String substitutions (available in SKILL.md body)
40
59
 
41
60
  | Variable | Description |
42
61
  |----------|-------------|
@@ -45,9 +64,9 @@ Source: [Claude Code Skills](https://platform.claude.com/docs/en/claude-code/ski
45
64
  | `$N` | Shorthand for `$ARGUMENTS[N]` (e.g., `$0`, `$1`) |
46
65
  | `${CLAUDE_SESSION_ID}` | Current session ID |
47
66
  | `${CLAUDE_SKILL_DIR}` | Directory containing SKILL.md |
48
- | `` !`command` `` | Dynamic context injection - shell command runs before Claude sees content |
67
+ | `` !`command` `` | Dynamic context injection -- shell command runs before Claude sees content |
49
68
 
50
- ### Permission Syntax
69
+ ### Permission syntax
51
70
 
52
71
  ```
53
72
  Skill(name) # Allow exact skill
@@ -56,191 +75,210 @@ Skill(name *) # Allow skill with any arguments
56
75
 
57
76
  ---
58
77
 
59
- ## Progressive Disclosure Architecture
78
+ ## Progressive disclosure architecture
60
79
 
61
- Source: [Agent Skills Overview](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview)
80
+ Source: [Claude Code Skills](https://platform.claude.com/docs/en/claude-code/skills)
62
81
 
63
82
  Skills load in three levels to minimize context usage:
64
83
 
65
- | Level | What Loads | Token Cost | When |
84
+ | Level | What loads | Token cost | When |
66
85
  |-------|-----------|------------|------|
67
86
  | **1. Metadata** | `name` and `description` from frontmatter | ~100 tokens | Always (system prompt) |
68
87
  | **2. Instructions** | SKILL.md body | <5k tokens | When triggered by matching request |
69
88
  | **3. Resources** | Additional files, scripts, schemas | Unlimited | When referenced from instructions |
70
89
 
71
- ### Key implications:
72
- - You can install many skills with minimal context cost (~100 tokens each)
73
- - SKILL.md body should stay under 500 lines
74
- - Scripts execute via bash - their code never enters context, only output does
75
- - Reference files load only when Claude reads them
90
+ ### Implications for skill authors
91
+
92
+ - Many skills can coexist with minimal context cost (~100 tokens each at Level 1)
93
+ - SKILL.md body should stay under 500 lines to fit the <5k token budget
94
+ - Scripts execute via bash -- their code never enters context, only output does
95
+ - Reference files load only when Claude reads them via `@` reference or explicit Read
96
+ - Heavy lookup tables, field mappings, and long examples belong in REFERENCE.md or separate files
76
97
 
77
98
  ---
78
99
 
79
- ## Content Templates
100
+ ## Content templates by degree of freedom
80
101
 
81
- ### High Freedom (Advisory)
102
+ ### High freedom (advisory)
82
103
 
83
- Best for guidance where multiple approaches are valid.
104
+ For guidance where multiple approaches are valid. States goals and acceptance criteria without prescribing exact steps.
84
105
 
85
106
  ```markdown
86
107
  ---
87
108
  name: analyzing-data
88
- description: "Analyzes datasets and generates statistical summaries. Use when working with CSV or Excel data requiring descriptive statistics, correlations, or visualizations."
109
+ description: >-
110
+ Analyzes datasets and generates statistical summaries. Use when working
111
+ with CSV or Excel data requiring descriptive statistics, correlations,
112
+ or visualizations. Triggers: 'analyze data', 'statistical summary'.
89
113
  ---
90
114
 
91
- # Analyzing Data
115
+ # Analyzing data
92
116
 
93
- ## Overview
117
+ **Core principle:** Let the data structure guide the analysis approach.
94
118
 
95
- Performs statistical analysis on tabular datasets.
119
+ ## When this skill applies
96
120
 
97
- **Announce at start:** "I'm using the analyzing-data skill."
121
+ Trigger when the user has tabular data and wants statistical insight,
122
+ trend identification, or visualization.
98
123
 
99
- ## Instructions
124
+ ## Goals
100
125
 
101
- 1. Load and inspect the data structure
102
- 2. Generate descriptive statistics
103
- 3. Identify correlations and patterns
126
+ 1. Inspect the data structure and report shape, types, missing values
127
+ 2. Generate descriptive statistics appropriate to the data types
128
+ 3. Identify correlations and patterns worth highlighting
104
129
  4. Produce visualizations if requested
105
130
 
106
- ## Examples
131
+ ## Output format
107
132
 
108
- **Input:** "Analyze sales_2024.csv for trends"
109
- **Output:** Summary statistics, monthly trend chart, top performers
133
+ Summary with key findings first, then supporting tables and charts.
134
+ Explain statistical choices so the user can evaluate appropriateness.
110
135
 
111
- ## Best Practices
136
+ ## Examples
112
137
 
113
- - Always show data shape and types before analysis
114
- - Handle missing values explicitly
115
- - Use appropriate chart types for the data
138
+ **Input:** "Analyze sales_2024.csv for trends"
139
+ **Output:** Monthly trend summary, top performers, seasonal patterns,
140
+ with charts for the clearest visual signals.
116
141
  ```
117
142
 
118
- ### Medium Freedom (Structured Workflow)
143
+ ### Medium freedom (structured workflow)
119
144
 
120
- Best for preferred patterns with some variation allowed.
145
+ For preferred patterns with room for adaptation. States a recommended sequence but allows deviation when justified.
121
146
 
122
147
  ```markdown
123
148
  ---
124
149
  name: reviewing-plans
125
- description: "Validates implementation plans against code standards, TDD compliance, and right-sized engineering. Use after writing plans and before executing them. Triggers: 'review plan', 'validate plan', 'check plan'."
150
+ description: >-
151
+ Validates implementation plans against code standards and TDD compliance.
152
+ Use after writing plans and before executing them.
153
+ Triggers: 'review plan', 'validate plan', 'check plan'.
126
154
  ---
127
155
 
128
- # Reviewing Plans
129
-
130
- ## Overview
156
+ # Reviewing plans
131
157
 
132
- **Core principle:** Bad plans produce bad code. Review before you execute.
158
+ **Core principle:** Bad plans produce bad code. Validate before executing.
133
159
 
134
- **Announce at start:** "I'm using the reviewing-plans skill to validate this plan."
160
+ ## When this skill applies
135
161
 
136
- **Context:** Use after write-plan and before plan-executor. Quality gate between planning and implementation.
162
+ Use after a plan has been written and before execution begins.
163
+ This is the quality gate between planning and implementation.
137
164
 
138
- ## The Process
165
+ ## The process
139
166
 
140
- ### Step 1: Identify Plan Files
141
- Locate plan files in `.planning/phases/` or `docs/plans/`.
167
+ ### Step 1: Locate plan files
168
+ Find plan files in `.planning/phases/` or `docs/plans/`.
142
169
 
143
- ### Step 2: Review Dimensions
144
- Check structure, TDD compliance, code quality, right-sized engineering, task granularity.
170
+ ### Step 2: Review dimensions
171
+ Check each dimension: structure completeness, TDD compliance,
172
+ code quality standards, right-sized engineering, task granularity.
145
173
 
146
- ### Step 3: Report Verdict
147
- READY or NEEDS REVISION with specific issues.
174
+ ### Step 3: Report verdict
175
+ Deliver READY or NEEDS REVISION with specific issues and locations.
148
176
 
149
- ## Output Format
177
+ ## Output format
150
178
 
151
- | Dimension | Status |
152
- |-----------|--------|
153
- | Structure | PASS/FAIL |
154
- | TDD | PASS/FAIL |
155
- | Code quality | PASS/FAIL |
156
-
157
- ## Red Flags - STOP
158
-
159
- - Any placeholder text ("implement later")
160
- - Missing TDD steps for production code
161
- - Magic values in code blocks
162
-
163
- ## Rationalization Prevention
164
-
165
- | Excuse | Reality |
166
- |--------|---------|
167
- | "The plan is high-level" | Plans without complete code produce inconsistent implementations |
168
- | "TDD makes it too long" | TDD in plan prevents skipping TDD during execution |
179
+ | Dimension | Status | Notes |
180
+ |-----------|--------|-------|
181
+ | Structure | PASS/FAIL | [specific finding] |
182
+ | TDD | PASS/FAIL | [specific finding] |
183
+ | Code quality | PASS/FAIL | [specific finding] |
169
184
  ```
170
185
 
171
- ### Low Freedom (Critical/Exact)
186
+ ### Low freedom (exact sequence)
172
187
 
173
- Best for fragile operations where consistency is critical.
188
+ For fragile operations where deviation causes silent failures. States precisely what to do, in what order, with validation at each step.
174
189
 
175
190
  ```markdown
176
191
  ---
177
192
  name: filling-pdf-forms
178
- description: "Fills PDF forms using pdf-lib JavaScript library with exact field mapping. Use when populating PDF forms programmatically. Triggers: 'fill PDF form', 'populate form', 'form filling'."
193
+ description: >-
194
+ Fills PDF forms using pdf-lib with exact field mapping and validation.
195
+ Use when populating PDF forms programmatically.
196
+ Triggers: 'fill PDF form', 'populate form', 'form filling'.
179
197
  allowed-tools: Bash(node *), Read
180
198
  ---
181
199
 
182
- # Filling PDF Forms
200
+ # Filling PDF forms
183
201
 
184
- ## MANDATORY PROTOCOL
202
+ **Core principle:** Extract field names first, then map, then fill.
203
+ Guessing field names produces silently empty forms.
185
204
 
186
- Before filling ANY form:
187
- 1. [ ] Read `${CLAUDE_SKILL_DIR}/FORMS.md` for field mapping reference
188
- 2. [ ] Extract field names: `node ${CLAUDE_SKILL_DIR}/scripts/extract_fields.js input.pdf`
189
- 3. [ ] Match extracted fields against the mapping
205
+ ## Before filling any form
206
+
207
+ 1. Read `${CLAUDE_SKILL_DIR}/FORMS.md` for the field mapping reference
208
+ 2. Extract field names: `node ${CLAUDE_SKILL_DIR}/scripts/extract_fields.js input.pdf`
209
+ 3. Match extracted fields against the mapping before writing any fill code
190
210
 
191
211
  ## Workflow
192
212
 
193
- ### Step 1: Extract Fields
213
+ ### Step 1: Extract fields
194
214
  ```bash
195
215
  node ${CLAUDE_SKILL_DIR}/scripts/extract_fields.js "$0"
196
216
  ```
197
217
 
198
- ### Step 2: Generate Fill Script
199
- Use the field mapping from FORMS.md. Every field must be explicitly set.
218
+ ### Step 2: Generate fill script
219
+ Use the field mapping from FORMS.md. Set every field explicitly.
200
220
 
201
- ### Step 3: Execute and Validate
221
+ ### Step 3: Execute and validate
202
222
  ```bash
203
223
  node fill_script.js && node ${CLAUDE_SKILL_DIR}/scripts/validate_fill.js output.pdf
204
224
  ```
205
225
 
206
- ### Feedback Loop
207
- If validation fails -> read error output -> fix field mapping -> re-execute -> re-validate.
208
-
209
- ## Critical Rules
210
-
211
- **NEVER guess field names.** Always extract first.
212
- **WHY:** Wrong field names silently produce empty forms.
226
+ ### If validation fails
227
+ Read error output, fix the field mapping, re-execute, re-validate.
228
+ Do not proceed with a partially filled form.
213
229
  ```
214
230
 
215
231
  ---
216
232
 
217
- ## Validation Checklist
233
+ ## Validation checklist
218
234
 
219
- Source: [Best Practices Checklist](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices)
235
+ Source: [Claude Code Skills](https://platform.claude.com/docs/en/claude-code/skills)
220
236
 
221
- ### Core Quality
222
- - [ ] Description is specific, includes key terms, and is in **third person**
223
- - [ ] Description includes both what the Skill does and when to use it
224
- - [ ] SKILL.md body is **under 500 lines**
225
- - [ ] Additional details are in separate files (if needed)
226
- - [ ] No time-sensitive information (or clearly marked as legacy)
237
+ ### Structure
238
+ - [ ] SKILL.md in correct location (matches `name` directory)
239
+ - [ ] Valid YAML frontmatter with required fields
240
+ - [ ] Body under 500 lines
241
+ - [ ] Heavy content in separate reference files
242
+
243
+ ### Description quality
244
+ - [ ] Third person ("Analyzes..." not "Analyze...")
245
+ - [ ] Includes what it does and when to use it
246
+ - [ ] Contains trigger phrases matching natural user language
247
+ - [ ] Under 1024 characters
248
+ - [ ] No XML tags in description
249
+
250
+ ### Content quality
251
+ - [ ] Core principle stated (one sentence)
252
+ - [ ] Steps are sequential and numbered
253
+ - [ ] States desired behavior in positive terms
254
+ - [ ] Motivation provided for constraints (why, not just what)
255
+ - [ ] Examples are concrete with specific inputs and outputs
256
+ - [ ] No time-sensitive claims (or clearly dated)
227
257
  - [ ] Consistent terminology throughout
228
- - [ ] Examples are concrete, not abstract
229
- - [ ] File references are **one level deep** from SKILL.md
230
- - [ ] Files >100 lines have a **table of contents**
231
- - [ ] Workflows have clear steps
232
- - [ ] All file paths use **forward slashes**
233
-
234
- ### Code and Scripts
235
- - [ ] Scripts solve problems rather than punt to Claude
236
- - [ ] Error handling is explicit and helpful
237
- - [ ] No "voodoo constants" (all values justified)
238
- - [ ] Required packages listed and verified as available
239
- - [ ] MCP tools use **fully qualified names** (`ServerName:tool_name`)
240
- - [ ] Validation/verification steps for critical operations
241
- - [ ] Feedback loops included for quality-critical tasks
242
-
243
- ### Testing
244
- - [ ] At least 3 evaluation scenarios created
245
- - [ ] Tested with representative real tasks
246
- - [ ] If multi-model: tested with Haiku, Sonnet, and Opus
258
+ - [ ] File references are one level deep from SKILL.md
259
+ - [ ] Files over 100 lines have a table of contents
260
+
261
+ ### Technical correctness
262
+ - [ ] `allowed-tools` specified if skill needs specific tools
263
+ - [ ] `argument-hint` included if skill accepts arguments
264
+ - [ ] `paths` set if skill applies only to certain file types
265
+ - [ ] String substitutions use correct syntax
266
+ - [ ] Script references use `${CLAUDE_SKILL_DIR}` for portability
267
+ - [ ] MCP tools use fully qualified names (`ServerName:tool_name`)
268
+
269
+ ### Testing readiness
270
+ - [ ] At least 3 evaluation scenarios identified
271
+ - [ ] Covers a typical case, an edge case, and a decline/clarify case
272
+ - [ ] Golden rule: a colleague could follow this skill without extra context
273
+
274
+ ---
275
+
276
+ ## Evaluation loop
277
+
278
+ For skill drafts that need iteration:
279
+
280
+ 1. Trigger the skill with 2-3 representative user requests.
281
+ 2. Note failure modes (missed triggers, wrong output format, overstepped scope).
282
+ 3. Tighten trigger phrases, add examples, or adjust degree of freedom for the failure class only.
283
+
284
+ Anthropic's **self-correction chaining** pattern extends this: generate a draft, have Claude review it against the validation checklist, then refine based on the review.