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.
- package/agents/project-context-loader.md +1 -1
- package/bin/install.mjs +76 -0
- package/docs/PR_DESCRIPTION_GUIDE.md +95 -0
- package/hooks/blocking/block-main-commit.py +13 -1
- package/hooks/blocking/pr-description-enforcer.py +68 -43
- package/hooks/hooks.json +0 -20
- package/hooks/validation/mypy_validator.py +35 -0
- package/hooks/workflow/auto-formatter.py +40 -1
- package/package.json +8 -2
- package/skills/npm-creator/SKILL.md +7 -3
- package/skills/skill-writer/REFERENCE.md +160 -122
- package/skills/skill-writer/SKILL.md +131 -197
- package/LICENSE +0 -21
- package/README.md +0 -247
- package/hooks/blocking/docker-settings-guard.py +0 -44
- package/hooks/blocking/parallel-task-blocker.py +0 -69
- package/hooks/blocking/pyautogui-scroll-blocker.py +0 -74
- package/hooks/session/bulk-edit-reminder.py +0 -30
- package/hooks/session/code-rules-reminder.py +0 -97
- package/hooks/session/compact-context-reinject.py +0 -39
- package/hooks/session/hook-structure-context.py +0 -140
- package/hooks/validation/code-style-validator.py +0 -145
- package/hooks/validation/e2e-test-validator.py +0 -142
- package/skills/agent-prompt/SKILL.md +0 -102
- package/skills/prompt-generator/REFERENCE.md +0 -150
- package/skills/prompt-generator/SKILL.md +0 -154
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
# Skill
|
|
1
|
+
# Skill writer -- reference
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Canonical resources
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
67
|
+
| `` !`command` `` | Dynamic context injection -- shell command runs before Claude sees content |
|
|
49
68
|
|
|
50
|
-
### Permission
|
|
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
|
|
78
|
+
## Progressive disclosure architecture
|
|
60
79
|
|
|
61
|
-
Source: [
|
|
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
|
|
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
|
-
###
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
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
|
|
100
|
+
## Content templates by degree of freedom
|
|
80
101
|
|
|
81
|
-
### High
|
|
102
|
+
### High freedom (advisory)
|
|
82
103
|
|
|
83
|
-
|
|
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:
|
|
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
|
|
115
|
+
# Analyzing data
|
|
92
116
|
|
|
93
|
-
|
|
117
|
+
**Core principle:** Let the data structure guide the analysis approach.
|
|
94
118
|
|
|
95
|
-
|
|
119
|
+
## When this skill applies
|
|
96
120
|
|
|
97
|
-
|
|
121
|
+
Trigger when the user has tabular data and wants statistical insight,
|
|
122
|
+
trend identification, or visualization.
|
|
98
123
|
|
|
99
|
-
##
|
|
124
|
+
## Goals
|
|
100
125
|
|
|
101
|
-
1.
|
|
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
|
-
##
|
|
131
|
+
## Output format
|
|
107
132
|
|
|
108
|
-
|
|
109
|
-
|
|
133
|
+
Summary with key findings first, then supporting tables and charts.
|
|
134
|
+
Explain statistical choices so the user can evaluate appropriateness.
|
|
110
135
|
|
|
111
|
-
##
|
|
136
|
+
## Examples
|
|
112
137
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
|
143
|
+
### Medium freedom (structured workflow)
|
|
119
144
|
|
|
120
|
-
|
|
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:
|
|
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
|
|
129
|
-
|
|
130
|
-
## Overview
|
|
156
|
+
# Reviewing plans
|
|
131
157
|
|
|
132
|
-
**Core principle:** Bad plans produce bad code.
|
|
158
|
+
**Core principle:** Bad plans produce bad code. Validate before executing.
|
|
133
159
|
|
|
134
|
-
|
|
160
|
+
## When this skill applies
|
|
135
161
|
|
|
136
|
-
|
|
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
|
|
165
|
+
## The process
|
|
139
166
|
|
|
140
|
-
### Step 1:
|
|
141
|
-
|
|
167
|
+
### Step 1: Locate plan files
|
|
168
|
+
Find plan files in `.planning/phases/` or `docs/plans/`.
|
|
142
169
|
|
|
143
|
-
### Step 2: Review
|
|
144
|
-
Check structure, TDD compliance,
|
|
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
|
|
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
|
|
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
|
|
186
|
+
### Low freedom (exact sequence)
|
|
172
187
|
|
|
173
|
-
|
|
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:
|
|
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
|
|
200
|
+
# Filling PDF forms
|
|
183
201
|
|
|
184
|
-
|
|
202
|
+
**Core principle:** Extract field names first, then map, then fill.
|
|
203
|
+
Guessing field names produces silently empty forms.
|
|
185
204
|
|
|
186
|
-
Before filling
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
|
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
|
|
199
|
-
Use the field mapping from FORMS.md.
|
|
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
|
|
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
|
-
###
|
|
207
|
-
|
|
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
|
|
233
|
+
## Validation checklist
|
|
218
234
|
|
|
219
|
-
Source: [
|
|
235
|
+
Source: [Claude Code Skills](https://platform.claude.com/docs/en/claude-code/skills)
|
|
220
236
|
|
|
221
|
-
###
|
|
222
|
-
- [ ]
|
|
223
|
-
- [ ]
|
|
224
|
-
- [ ]
|
|
225
|
-
- [ ]
|
|
226
|
-
|
|
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
|
-
- [ ]
|
|
229
|
-
- [ ]
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
- [ ]
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
- [ ]
|
|
236
|
-
- [ ]
|
|
237
|
-
- [ ]
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
- [ ]
|
|
241
|
-
- [ ]
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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.
|