claude-dev-env 1.4.0 → 1.8.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.
@@ -0,0 +1,181 @@
1
+ ---
2
+ name: session-tidy
3
+ description: Audit, clean, and consolidate session logs in the Obsidian vault. Fixes format drift, resolves orphaned next-steps, updates stale statuses, and generates project rollup summaries. Use when session logs feel cluttered or before starting a new project milestone. Triggers on '/session-tidy', 'tidy sessions', 'clean up session logs', 'session audit'.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Session Tidy: Session Log Consolidation
8
+
9
+ ## Overview
10
+
11
+ Audit and consolidate session logs in the Obsidian vault (`sessions/[Project]/`) by enforcing the format contract, categorizing uncategorized files into project subfolders, resolving orphaned next-steps, updating stale statuses, and generating project rollup summaries.
12
+
13
+ **Announce at start:** "Running session log consolidation."
14
+
15
+ **Context:** Standalone maintenance utility. Run periodically, after completing a project milestone, or when starting fresh on a project. Companion to `/dream` (memory consolidation) and `/session-log` (session creation).
16
+
17
+ ## The Format Contract
18
+
19
+ Source: `journal:session-log` skill definition. Read that skill's SKILL.md if you need to verify the authoritative format.
20
+
21
+ **Directory structure:** `sessions/[Project]/[N]. [Title].md`
22
+ - Each project gets its own subfolder under `sessions/`
23
+ - Session files are named `[N]. [Title].md` where Title is a 2-5 word summary of the primary outcome (e.g., `3. Amazon Auth Migration.md`)
24
+ - Summary files are named `Summary.md` in the same project folder
25
+ - No parenthetical suffixes like `(Wrap-Up)`
26
+ - Files missing a title (e.g., `Session 1.md` or `1.md`) should be flagged for renaming -- read the content to derive a title
27
+
28
+ **Required frontmatter fields:**
29
+ ```yaml
30
+ ---
31
+ type: session-report
32
+ project: "[name]"
33
+ session: [N]
34
+ date: "[YYYY-MM-DD]"
35
+ status: "completed" | "in-progress" | "blocked"
36
+ blocked: true | false
37
+ tags: ["session", "[project-tag]"]
38
+ ---
39
+ ```
40
+
41
+ **Content structure:**
42
+ - Section headers (`###`) use one emoji + outcome-oriented title
43
+ - Valid emojis: ✅ (done), 🚫 (blocked), ⚠️ (note), 🔧 (in-progress), 📋 (queued)
44
+ - Explanatory paragraphs under each header, not just bullets
45
+ - Tables for 3+ rows of structured data
46
+ - No play-by-play or process narration
47
+
48
+ ## The Process
49
+
50
+ ### Phase 0: Preflight
51
+
52
+ Determine which storage backend is available. Try in this order and use the first that succeeds:
53
+
54
+ 1. **Headless vault** -- run `ob --version` via Bash to verify the obsidian-headless CLI is installed. Then check `OBSIDIAN_VAULT_PATH` environment variable or `~/.claude/vault/` for a vault directory. If the CLI exists and a vault directory resolves, set `backend = "headless"`.
55
+
56
+ 2. **Obsidian MCP** -- call `mcp__obsidian__list_directory` with `path="sessions"`. If it succeeds, set `backend = "obsidian"`.
57
+
58
+ 3. **Local vault** -- use `~/.claude/vault/` as a local vault directory. Create it via `mkdir -p ~/.claude/vault/sessions` if it does not exist. Set `backend = "local"`.
59
+
60
+ **Headless and local capability notes:** When running without Obsidian MCP, the following operations use alternative methods:
61
+ - **Move/rename:** `mv` via Bash
62
+ - **Frontmatter update:** Read + modify YAML + Write
63
+ - **Search:** Bash `ls` + Grep
64
+
65
+ ### Phase 1: Audit
66
+
67
+ List project subdirectories in `sessions/` via `mcp__obsidian__list_directory`. For each project folder, read its files via `mcp__obsidian__read_note`. Also check for any files sitting directly in `sessions/` (uncategorized). For each file, check:
68
+
69
+ 1. **Naming convention?** Must match `[N]. [Title].md` where N is the session number and Title is a 2-5 word outcome summary. Flag bracket prefixes, date-only names, parenthetical suffixes, or legacy `Session [N].md` patterns missing a title.
70
+ 2. **Frontmatter complete?** All required fields present: `type`, `project`, `session`, `date`, `status`, `blocked`, `tags`.
71
+ 3. **Type correct?** Must be `session-report`. Flag other types like `rule-audit`.
72
+ 4. **Status coherent?** `status: "completed"` with `blocked: true` is contradictory. `status: "in-progress"` or `status: "blocked"` on sessions older than 7 days is likely stale.
73
+ 5. **Orphaned next-steps?** Scan content for sections containing "Next", "Queued", "Session N+1", "TODO", or clipboard emoji sections. Cross-reference against subsequent sessions for the same project to determine if the items were addressed.
74
+ 6. **Categorized?** Files sitting directly in `sessions/` (not in a project subfolder) are uncategorized. Infer the project name from the filename pattern (e.g., `BudgetBridge Session 3.md` belongs in `sessions/BudgetBridge/`) or from the frontmatter `project` field. Flag for move into the correct subfolder.
75
+
76
+ ### Phase 2: Propose Changes
77
+
78
+ Present a structured report:
79
+
80
+ **Format violations** -- files with wrong naming, missing/wrong frontmatter fields, wrong type
81
+ **Stale statuses** -- in-progress or blocked sessions older than 7 days, contradictory status+blocked combos
82
+ **Orphaned next-steps** -- queued items from session N with no evidence of resolution in session N+1 or later. For each item, state whether it was:
83
+ - **Resolved:** found evidence in a later session
84
+ - **Orphaned:** no later session addresses it
85
+ - **Unknown:** later sessions exist but don't clearly address or skip the item
86
+ **Uncategorized files** -- files in `sessions/` root that should be moved into a project subfolder
87
+ **Rollup candidates** -- projects with 3+ sessions that have no rollup/summary session
88
+ **Proposed actions** -- numbered list of specific changes
89
+
90
+ Do NOT execute any changes yet. Wait for user approval.
91
+
92
+ ### Phase 3: Execute
93
+
94
+ After user approves (all or selected items):
95
+
96
+ 1. **Rename** non-conforming files via `mcp__obsidian__move_note`.
97
+ 2. **Fix frontmatter** via `mcp__obsidian__update_frontmatter` -- set correct type, add missing fields.
98
+ 3. **Update stale statuses** -- change old in-progress/blocked to completed (or ask user for correct status).
99
+ 4. **Clean orphaned next-steps** -- for confirmed orphaned items, either:
100
+ - Remove the section if all items are orphaned and the session is old
101
+ - Add a strikethrough or "(not pursued)" annotation if some items remain relevant
102
+ - Leave unchanged if user declines
103
+ 5. **Generate project rollups** -- for each qualifying project, write a summary note via `mcp__obsidian__write_note`:
104
+ - **Path:** `sessions/[Project]/Summary.md`
105
+ - **Frontmatter:** `{"type": "project-summary", "project": "[name]", "sessions": [count], "date_range": "[first] to [last]", "tags": ["summary", "[project-tag]"]}`
106
+ - **Content:** Use this template:
107
+
108
+ ```markdown
109
+ ## [Project] -- Project Summary
110
+
111
+ ### Timeline
112
+
113
+ | # | Title | Date | Status |
114
+ |---|-------|------|--------|
115
+ | 1 | [title from filename] | [date] | ✅/🔧/🚫 |
116
+
117
+ ### Key Outcomes
118
+ - **Session [N]:** [one-line summary of primary outcome]
119
+
120
+ ### Current Status
121
+ [One paragraph: where the project stands now, what's active, what's done]
122
+
123
+ ### Carried Forward
124
+ - [ ] [unresolved item from latest session]
125
+ ```
126
+ 6. **Categorize uncategorized files** -- move files from `sessions/` root into the correct project subfolder via `mcp__obsidian__move_note`. When moving, rename to match the `[N]. [Title].md` convention (e.g., `sessions/BudgetBridge Session 3.md` becomes `sessions/BudgetBridge/3. [Title derived from content].md`).
127
+
128
+ ### Phase 4: Verify
129
+
130
+ After execution, re-read the vault and confirm:
131
+ - Every session file lives in a project subfolder under `sessions/[Project]/`
132
+ - Every file has valid frontmatter with all required fields
133
+ - Every filename matches the naming convention (`[N]. [Title].md` or `Summary.md`)
134
+ - No contradictory status/blocked combos
135
+ - All orphaned next-steps resolved or annotated
136
+ - Rollup summaries exist for qualifying projects
137
+
138
+ Report the results: files renamed, frontmatter fixed, statuses updated, next-steps resolved, rollups generated.
139
+
140
+ If Phase 1 finds zero issues across all checks, skip Phases 2-4 and report: "All session logs are tidy. Nothing to do."
141
+
142
+ ## Output Format
143
+
144
+ Phase 2 report structure:
145
+
146
+ ```
147
+ ## Session Tidy Report
148
+
149
+ ### Format Violations (X found)
150
+ - [file] -- [issue]
151
+
152
+ ### Stale Statuses (X found)
153
+ - [file] -- [status] since [date] ([age] days ago)
154
+
155
+ ### Uncategorized Files (X found)
156
+ - [file] -- move to sessions/[Project]/[new filename]
157
+
158
+ ### Orphaned Next-Steps (X found)
159
+ - [file] -- "[item text]" -- [resolved/orphaned/unknown]
160
+
161
+ ### Rollup Candidates (X projects)
162
+ - [project] -- [N] sessions, [date range], no summary exists
163
+
164
+ ### Proposed Actions
165
+ 1. [action] -- [file] -- [reason]
166
+ 2. ...
167
+
168
+ Approve all, select by number, or cancel?
169
+ ```
170
+
171
+ ## After Completion
172
+
173
+ Report summary: files renamed, frontmatter fixes, status updates, next-steps cleaned, rollups generated.
174
+
175
+ ## Best Practices
176
+
177
+ - Run after finishing a multi-session project
178
+ - Run before starting a new milestone on an existing project (clears stale context)
179
+ - Cross-reference next-steps manually when the skill flags "unknown" -- it cannot determine intent from content alone
180
+ - The 7-day staleness threshold is a heuristic -- adjust based on how frequently you session-log
181
+ - Rollup summaries are not a replacement for individual session logs -- they are a navigational aid
@@ -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.