claude-all-hands 1.0.1 → 1.0.2
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/.claude/agents/code-simplifier.md +52 -0
- package/.claude/agents/curator.md +189 -245
- package/.claude/agents/documentor.md +147 -0
- package/.claude/agents/planner.md +123 -166
- package/.claude/agents/researcher.md +58 -41
- package/.claude/agents/surveyor.md +81 -0
- package/.claude/agents/worker.md +74 -0
- package/.claude/commands/audit-docs.md +94 -0
- package/.claude/commands/continue.md +120 -0
- package/.claude/commands/create-docs.md +100 -0
- package/.claude/commands/create-skill.md +107 -0
- package/.claude/commands/create-specialist.md +111 -0
- package/.claude/commands/curator-audit.md +4 -0
- package/.claude/commands/debug.md +183 -0
- package/.claude/commands/plan.md +199 -102
- package/.claude/commands/validate.md +11 -0
- package/.claude/commands/whats-next.md +106 -134
- package/.claude/envoy/envoy +11 -14
- package/.claude/envoy/package-lock.json +1388 -0
- package/.claude/envoy/package.json +29 -0
- package/.claude/envoy/src/cli.ts +126 -0
- package/.claude/envoy/src/commands/base.ts +216 -0
- package/.claude/envoy/src/commands/gemini.ts +999 -0
- package/.claude/envoy/src/commands/git.ts +639 -0
- package/.claude/envoy/src/commands/index.ts +73 -0
- package/.claude/envoy/src/commands/knowledge.ts +187 -0
- package/.claude/envoy/src/commands/perplexity.ts +129 -0
- package/.claude/envoy/src/commands/plan/core.ts +134 -0
- package/.claude/envoy/src/commands/plan/findings.ts +446 -0
- package/.claude/envoy/src/commands/plan/gates.ts +672 -0
- package/.claude/envoy/src/commands/plan/index.ts +135 -0
- package/.claude/envoy/src/commands/plan/lifecycle.ts +648 -0
- package/.claude/envoy/src/commands/plan/plan-file.ts +138 -0
- package/.claude/envoy/src/commands/plan/prompts.ts +285 -0
- package/.claude/envoy/src/commands/plan/protocols.ts +166 -0
- package/.claude/envoy/src/commands/repomix.ts +99 -0
- package/.claude/envoy/src/commands/tavily.ts +220 -0
- package/.claude/envoy/src/commands/xai.ts +168 -0
- package/.claude/envoy/src/lib/design.ts +41 -0
- package/.claude/envoy/src/lib/feedback-schemas.ts +154 -0
- package/.claude/envoy/src/lib/findings.ts +215 -0
- package/.claude/envoy/src/lib/gates.ts +572 -0
- package/.claude/envoy/src/lib/git.ts +132 -0
- package/.claude/envoy/src/lib/index.ts +188 -0
- package/.claude/envoy/src/lib/knowledge.ts +594 -0
- package/.claude/envoy/src/lib/markdown.ts +75 -0
- package/.claude/envoy/src/lib/observability.ts +262 -0
- package/.claude/envoy/src/lib/paths.ts +130 -0
- package/.claude/envoy/src/lib/plan-io.ts +117 -0
- package/.claude/envoy/src/lib/prompts.ts +231 -0
- package/.claude/envoy/src/lib/protocols.ts +314 -0
- package/.claude/envoy/src/lib/repomix.ts +133 -0
- package/.claude/envoy/src/lib/retry.ts +138 -0
- package/.claude/envoy/src/lib/watcher.ts +167 -0
- package/.claude/envoy/tsconfig.json +21 -0
- package/.claude/hooks/scripts/scan_agents.py +62 -0
- package/.claude/hooks/scripts/scan_commands.py +50 -0
- package/.claude/hooks/scripts/scan_skills.py +46 -70
- package/.claude/hooks/scripts/validate_artifacts.py +128 -0
- package/.claude/hooks/startup.sh +26 -24
- package/.claude/protocols/bug-discovery.yaml +55 -0
- package/.claude/protocols/debugging.yaml +51 -0
- package/.claude/protocols/discovery.yaml +53 -0
- package/.claude/protocols/implementation.yaml +84 -0
- package/.claude/settings.json +37 -97
- package/.claude/skills/brainstorming/SKILL.md +54 -0
- package/.claude/skills/commands-development/SKILL.md +630 -0
- package/.claude/skills/commands-development/references/arguments.md +252 -0
- package/.claude/skills/commands-development/references/patterns.md +796 -0
- package/.claude/skills/commands-development/references/tool-restrictions.md +376 -0
- package/.claude/skills/discovery-mode/SKILL.md +108 -0
- package/.claude/skills/hooks-development/SKILL.md +332 -0
- package/.claude/skills/hooks-development/references/command-vs-prompt.md +269 -0
- package/.claude/skills/hooks-development/references/examples.md +658 -0
- package/.claude/skills/hooks-development/references/hook-types.md +463 -0
- package/.claude/skills/hooks-development/references/input-output-schemas.md +469 -0
- package/.claude/skills/hooks-development/references/matchers.md +470 -0
- package/.claude/skills/hooks-development/references/troubleshooting.md +587 -0
- package/.claude/skills/implementation-mode/SKILL.md +171 -0
- package/.claude/skills/research-tools/SKILL.md +35 -33
- package/.claude/skills/skills-development/SKILL.md +192 -0
- package/.claude/skills/skills-development/references/api-security.md +226 -0
- package/.claude/skills/skills-development/references/be-clear-and-direct.md +531 -0
- package/.claude/skills/skills-development/references/common-patterns.md +595 -0
- package/.claude/skills/skills-development/references/core-principles.md +437 -0
- package/.claude/skills/skills-development/references/executable-code.md +175 -0
- package/.claude/skills/skills-development/references/iteration-and-testing.md +474 -0
- package/.claude/skills/skills-development/references/recommended-structure.md +168 -0
- package/.claude/skills/skills-development/references/skill-structure.md +372 -0
- package/.claude/skills/skills-development/references/use-xml-tags.md +466 -0
- package/.claude/skills/skills-development/references/using-scripts.md +113 -0
- package/.claude/skills/skills-development/references/using-templates.md +112 -0
- package/.claude/skills/skills-development/references/workflows-and-validation.md +510 -0
- package/.claude/skills/skills-development/templates/router-skill.md +73 -0
- package/.claude/skills/skills-development/templates/simple-skill.md +33 -0
- package/.claude/skills/skills-development/workflows/add-reference.md +96 -0
- package/.claude/skills/skills-development/workflows/add-script.md +93 -0
- package/.claude/skills/skills-development/workflows/add-template.md +74 -0
- package/.claude/skills/skills-development/workflows/add-workflow.md +120 -0
- package/.claude/skills/skills-development/workflows/audit-skill.md +138 -0
- package/.claude/skills/skills-development/workflows/create-domain-expertise-skill.md +605 -0
- package/.claude/skills/skills-development/workflows/create-new-skill.md +191 -0
- package/.claude/skills/skills-development/workflows/get-guidance.md +121 -0
- package/.claude/skills/skills-development/workflows/upgrade-to-router.md +161 -0
- package/.claude/skills/skills-development/workflows/verify-skill.md +204 -0
- package/.claude/skills/subagents-development/SKILL.md +325 -0
- package/.claude/skills/subagents-development/references/context-management.md +567 -0
- package/.claude/skills/subagents-development/references/debugging-agents.md +714 -0
- package/.claude/skills/subagents-development/references/error-handling-and-recovery.md +502 -0
- package/.claude/skills/subagents-development/references/evaluation-and-testing.md +374 -0
- package/.claude/skills/subagents-development/references/orchestration-patterns.md +591 -0
- package/.claude/skills/subagents-development/references/subagents.md +508 -0
- package/.claude/skills/subagents-development/references/writing-subagent-prompts.md +517 -0
- package/.claude/statusline.sh +24 -0
- package/bin/cli.js +110 -72
- package/package.json +1 -1
- package/.claude/agents/explorer.md +0 -62
- package/.claude/agents/parallel-worker.md +0 -121
- package/.claude/commands/curation-fix.md +0 -92
- package/.claude/commands/new-branch.md +0 -36
- package/.claude/commands/parallel-discovery.md +0 -69
- package/.claude/commands/parallel-orchestration.md +0 -99
- package/.claude/commands/plan-checkpoint.md +0 -37
- package/.claude/envoy/commands/__init__.py +0 -1
- package/.claude/envoy/commands/base.py +0 -95
- package/.claude/envoy/commands/parallel.py +0 -439
- package/.claude/envoy/commands/perplexity.py +0 -86
- package/.claude/envoy/commands/plans.py +0 -451
- package/.claude/envoy/commands/tavily.py +0 -156
- package/.claude/envoy/commands/vertex.py +0 -358
- package/.claude/envoy/commands/xai.py +0 -124
- package/.claude/envoy/envoy.py +0 -122
- package/.claude/envoy/pyrightconfig.json +0 -4
- package/.claude/envoy/requirements.txt +0 -2
- package/.claude/hooks/capture-queries.sh +0 -3
- package/.claude/hooks/scripts/enforce_planning.py +0 -118
- package/.claude/hooks/scripts/enforce_rg.py +0 -34
- package/.claude/hooks/scripts/validate_skill.py +0 -81
- package/.claude/skills/claude-envoy-curation/SKILL.md +0 -162
- package/.claude/skills/claude-envoy-usage/SKILL.md +0 -46
- package/.claude/skills/command-development/SKILL.md +0 -206
- package/.claude/skills/command-development/examples/simple-commands.md +0 -212
- package/.claude/skills/command-development/references/frontmatter-reference.md +0 -221
- package/.claude/skills/hook-development/SKILL.md +0 -127
- package/.claude/skills/hook-development/examples/command-hooks.md +0 -301
- package/.claude/skills/hook-development/examples/prompt-hooks.md +0 -114
- package/.claude/skills/hook-development/references/event-reference.md +0 -226
- package/.claude/skills/repomix-extraction/SKILL.md +0 -91
- package/.claude/skills/skill-development/SKILL.md +0 -168
- package/.claude/skills/skill-development/examples/complete-skill-examples.md +0 -281
- package/.claude/skills/skill-development/references/progressive-disclosure.md +0 -141
- package/.claude/skills/skill-development/references/writing-style.md +0 -180
- package/.claude/skills/skill-development/scripts/validate-skill.sh +0 -144
- package/.claude/skills/specialist-builder/SKILL.md +0 -327
- package/.claude/skills/specialist-builder/docs/agent-catalog.md +0 -28
- package/.claude/skills/specialist-builder/examples/complete-agent-examples.md +0 -206
- package/.claude/skills/specialist-builder/references/system-prompt-patterns.md +0 -281
- package/.claude/skills/specialist-builder/references/triggering-examples.md +0 -162
- package/.claude/skills/specialist-builder/scripts/validate-agent.sh +0 -137
- /package/.claude/{envoy/claude-envoy.py → skills/claude-envoy-patterns/SKILL.md} +0 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
This reference covers patterns for complex workflows, validation loops, and feedback cycles in skill authoring. All patterns use pure XML structure.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<complex_workflows>
|
|
6
|
+
<principle>
|
|
7
|
+
Break complex operations into clear, sequential steps. For particularly complex workflows, provide a checklist.
|
|
8
|
+
</principle>
|
|
9
|
+
|
|
10
|
+
<pdf_forms_example>
|
|
11
|
+
```xml
|
|
12
|
+
<objective>
|
|
13
|
+
Fill PDF forms with validated data from JSON field mappings.
|
|
14
|
+
</objective>
|
|
15
|
+
|
|
16
|
+
<workflow>
|
|
17
|
+
Copy this checklist and check off items as you complete them:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Task Progress:
|
|
21
|
+
- [ ] Step 1: Analyze the form (run analyze_form.py)
|
|
22
|
+
- [ ] Step 2: Create field mapping (edit fields.json)
|
|
23
|
+
- [ ] Step 3: Validate mapping (run validate_fields.py)
|
|
24
|
+
- [ ] Step 4: Fill the form (run fill_form.py)
|
|
25
|
+
- [ ] Step 5: Verify output (run verify_output.py)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
<step_1>
|
|
29
|
+
**Analyze the form**
|
|
30
|
+
|
|
31
|
+
Run: `python scripts/analyze_form.py input.pdf`
|
|
32
|
+
|
|
33
|
+
This extracts form fields and their locations, saving to `fields.json`.
|
|
34
|
+
</step_1>
|
|
35
|
+
|
|
36
|
+
<step_2>
|
|
37
|
+
**Create field mapping**
|
|
38
|
+
|
|
39
|
+
Edit `fields.json` to add values for each field.
|
|
40
|
+
</step_2>
|
|
41
|
+
|
|
42
|
+
<step_3>
|
|
43
|
+
**Validate mapping**
|
|
44
|
+
|
|
45
|
+
Run: `python scripts/validate_fields.py fields.json`
|
|
46
|
+
|
|
47
|
+
Fix any validation errors before continuing.
|
|
48
|
+
</step_3>
|
|
49
|
+
|
|
50
|
+
<step_4>
|
|
51
|
+
**Fill the form**
|
|
52
|
+
|
|
53
|
+
Run: `python scripts/fill_form.py input.pdf fields.json output.pdf`
|
|
54
|
+
</step_4>
|
|
55
|
+
|
|
56
|
+
<step_5>
|
|
57
|
+
**Verify output**
|
|
58
|
+
|
|
59
|
+
Run: `python scripts/verify_output.py output.pdf`
|
|
60
|
+
|
|
61
|
+
If verification fails, return to Step 2.
|
|
62
|
+
</step_5>
|
|
63
|
+
</workflow>
|
|
64
|
+
```
|
|
65
|
+
</pdf_forms_example>
|
|
66
|
+
|
|
67
|
+
<when_to_use>
|
|
68
|
+
Use checklist pattern when:
|
|
69
|
+
- Workflow has 5+ sequential steps
|
|
70
|
+
- Steps must be completed in order
|
|
71
|
+
- Progress tracking helps prevent errors
|
|
72
|
+
- Easy resumption after interruption is valuable
|
|
73
|
+
</when_to_use>
|
|
74
|
+
</complex_workflows>
|
|
75
|
+
|
|
76
|
+
<feedback_loops>
|
|
77
|
+
<validate_fix_repeat_pattern>
|
|
78
|
+
<principle>
|
|
79
|
+
Run validator → fix errors → repeat. This pattern greatly improves output quality.
|
|
80
|
+
</principle>
|
|
81
|
+
|
|
82
|
+
<document_editing_example>
|
|
83
|
+
```xml
|
|
84
|
+
<objective>
|
|
85
|
+
Edit OOXML documents with XML validation at each step.
|
|
86
|
+
</objective>
|
|
87
|
+
|
|
88
|
+
<editing_process>
|
|
89
|
+
<step_1>
|
|
90
|
+
Make your edits to `word/document.xml`
|
|
91
|
+
</step_1>
|
|
92
|
+
|
|
93
|
+
<step_2>
|
|
94
|
+
**Validate immediately**: `python ooxml/scripts/validate.py unpacked_dir/`
|
|
95
|
+
</step_2>
|
|
96
|
+
|
|
97
|
+
<step_3>
|
|
98
|
+
If validation fails:
|
|
99
|
+
- Review the error message carefully
|
|
100
|
+
- Fix the issues in the XML
|
|
101
|
+
- Run validation again
|
|
102
|
+
</step_3>
|
|
103
|
+
|
|
104
|
+
<step_4>
|
|
105
|
+
**Only proceed when validation passes**
|
|
106
|
+
</step_4>
|
|
107
|
+
|
|
108
|
+
<step_5>
|
|
109
|
+
Rebuild: `python ooxml/scripts/pack.py unpacked_dir/ output.docx`
|
|
110
|
+
</step_5>
|
|
111
|
+
|
|
112
|
+
<step_6>
|
|
113
|
+
Test the output document
|
|
114
|
+
</step_6>
|
|
115
|
+
</editing_process>
|
|
116
|
+
|
|
117
|
+
<validation>
|
|
118
|
+
Never skip validation. Catching errors early prevents corrupted output files.
|
|
119
|
+
</validation>
|
|
120
|
+
```
|
|
121
|
+
</document_editing_example>
|
|
122
|
+
|
|
123
|
+
<why_it_works>
|
|
124
|
+
- Catches errors early before changes are applied
|
|
125
|
+
- Machine-verifiable with objective verification
|
|
126
|
+
- Plan can be iterated without touching originals
|
|
127
|
+
- Reduces total iteration cycles
|
|
128
|
+
</why_it_works>
|
|
129
|
+
</validate_fix_repeat_pattern>
|
|
130
|
+
|
|
131
|
+
<plan_validate_execute_pattern>
|
|
132
|
+
<principle>
|
|
133
|
+
When Claude performs complex, open-ended tasks, create a plan in a structured format, validate it, then execute.
|
|
134
|
+
|
|
135
|
+
Workflow: analyze → **create plan file** → **validate plan** → execute → verify
|
|
136
|
+
</principle>
|
|
137
|
+
|
|
138
|
+
<batch_update_example>
|
|
139
|
+
```xml
|
|
140
|
+
<objective>
|
|
141
|
+
Apply batch updates to spreadsheet with plan validation.
|
|
142
|
+
</objective>
|
|
143
|
+
|
|
144
|
+
<workflow>
|
|
145
|
+
<plan_phase>
|
|
146
|
+
<step_1>
|
|
147
|
+
Analyze the spreadsheet and requirements
|
|
148
|
+
</step_1>
|
|
149
|
+
|
|
150
|
+
<step_2>
|
|
151
|
+
Create `changes.json` with all planned updates
|
|
152
|
+
</step_2>
|
|
153
|
+
</plan_phase>
|
|
154
|
+
|
|
155
|
+
<validation_phase>
|
|
156
|
+
<step_3>
|
|
157
|
+
Validate the plan: `python scripts/validate_changes.py changes.json`
|
|
158
|
+
</step_3>
|
|
159
|
+
|
|
160
|
+
<step_4>
|
|
161
|
+
If validation fails:
|
|
162
|
+
- Review error messages
|
|
163
|
+
- Fix issues in changes.json
|
|
164
|
+
- Validate again
|
|
165
|
+
</step_4>
|
|
166
|
+
|
|
167
|
+
<step_5>
|
|
168
|
+
Only proceed when validation passes
|
|
169
|
+
</step_5>
|
|
170
|
+
</validation_phase>
|
|
171
|
+
|
|
172
|
+
<execution_phase>
|
|
173
|
+
<step_6>
|
|
174
|
+
Apply changes: `python scripts/apply_changes.py changes.json`
|
|
175
|
+
</step_6>
|
|
176
|
+
|
|
177
|
+
<step_7>
|
|
178
|
+
Verify output
|
|
179
|
+
</step_7>
|
|
180
|
+
</execution_phase>
|
|
181
|
+
</workflow>
|
|
182
|
+
|
|
183
|
+
<success_criteria>
|
|
184
|
+
- Plan validation passes with zero errors
|
|
185
|
+
- All changes applied successfully
|
|
186
|
+
- Output verification confirms expected results
|
|
187
|
+
</success_criteria>
|
|
188
|
+
```
|
|
189
|
+
</batch_update_example>
|
|
190
|
+
|
|
191
|
+
<implementation_tip>
|
|
192
|
+
Make validation scripts verbose with specific error messages:
|
|
193
|
+
|
|
194
|
+
**Good error message**:
|
|
195
|
+
"Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
|
|
196
|
+
|
|
197
|
+
**Bad error message**:
|
|
198
|
+
"Invalid field"
|
|
199
|
+
|
|
200
|
+
Specific errors help Claude fix issues without guessing.
|
|
201
|
+
</implementation_tip>
|
|
202
|
+
|
|
203
|
+
<when_to_use>
|
|
204
|
+
Use plan-validate-execute when:
|
|
205
|
+
- Operations are complex and error-prone
|
|
206
|
+
- Changes are irreversible or difficult to undo
|
|
207
|
+
- Planning can be validated independently
|
|
208
|
+
- Catching errors early saves significant time
|
|
209
|
+
</when_to_use>
|
|
210
|
+
</plan_validate_execute_pattern>
|
|
211
|
+
</feedback_loops>
|
|
212
|
+
|
|
213
|
+
<conditional_workflows>
|
|
214
|
+
<principle>
|
|
215
|
+
Guide Claude through decision points with clear branching logic.
|
|
216
|
+
</principle>
|
|
217
|
+
|
|
218
|
+
<document_modification_example>
|
|
219
|
+
```xml
|
|
220
|
+
<objective>
|
|
221
|
+
Modify DOCX files using appropriate method based on task type.
|
|
222
|
+
</objective>
|
|
223
|
+
|
|
224
|
+
<workflow>
|
|
225
|
+
<decision_point_1>
|
|
226
|
+
Determine the modification type:
|
|
227
|
+
|
|
228
|
+
**Creating new content?** → Follow "Creation workflow"
|
|
229
|
+
**Editing existing content?** → Follow "Editing workflow"
|
|
230
|
+
</decision_point_1>
|
|
231
|
+
|
|
232
|
+
<creation_workflow>
|
|
233
|
+
<objective>Build documents from scratch</objective>
|
|
234
|
+
|
|
235
|
+
<steps>
|
|
236
|
+
1. Use docx-js library
|
|
237
|
+
2. Build document from scratch
|
|
238
|
+
3. Export to .docx format
|
|
239
|
+
</steps>
|
|
240
|
+
</creation_workflow>
|
|
241
|
+
|
|
242
|
+
<editing_workflow>
|
|
243
|
+
<objective>Modify existing documents</objective>
|
|
244
|
+
|
|
245
|
+
<steps>
|
|
246
|
+
1. Unpack existing document
|
|
247
|
+
2. Modify XML directly
|
|
248
|
+
3. Validate after each change
|
|
249
|
+
4. Repack when complete
|
|
250
|
+
</steps>
|
|
251
|
+
</editing_workflow>
|
|
252
|
+
</workflow>
|
|
253
|
+
|
|
254
|
+
<success_criteria>
|
|
255
|
+
- Correct workflow chosen based on task type
|
|
256
|
+
- All steps in chosen workflow completed
|
|
257
|
+
- Output file validated and verified
|
|
258
|
+
</success_criteria>
|
|
259
|
+
```
|
|
260
|
+
</document_modification_example>
|
|
261
|
+
|
|
262
|
+
<when_to_use>
|
|
263
|
+
Use conditional workflows when:
|
|
264
|
+
- Different task types require different approaches
|
|
265
|
+
- Decision points are clear and well-defined
|
|
266
|
+
- Workflows are mutually exclusive
|
|
267
|
+
- Guiding Claude to correct path improves outcomes
|
|
268
|
+
</when_to_use>
|
|
269
|
+
</conditional_workflows>
|
|
270
|
+
|
|
271
|
+
<validation_scripts>
|
|
272
|
+
<principles>
|
|
273
|
+
Validation scripts are force multipliers. They catch errors that Claude might miss and provide actionable feedback for fixing issues.
|
|
274
|
+
</principles>
|
|
275
|
+
|
|
276
|
+
<characteristics_of_good_validation>
|
|
277
|
+
<verbose_errors>
|
|
278
|
+
**Good**: "Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
|
|
279
|
+
|
|
280
|
+
**Bad**: "Invalid field"
|
|
281
|
+
|
|
282
|
+
Verbose errors help Claude fix issues in one iteration instead of multiple rounds of guessing.
|
|
283
|
+
</verbose_errors>
|
|
284
|
+
|
|
285
|
+
<specific_feedback>
|
|
286
|
+
**Good**: "Line 47: Expected closing tag `</paragraph>` but found `</section>`"
|
|
287
|
+
|
|
288
|
+
**Bad**: "XML syntax error"
|
|
289
|
+
|
|
290
|
+
Specific feedback pinpoints exact location and nature of the problem.
|
|
291
|
+
</specific_feedback>
|
|
292
|
+
|
|
293
|
+
<actionable_suggestions>
|
|
294
|
+
**Good**: "Required field 'customer_name' is missing. Add: {\"customer_name\": \"value\"}"
|
|
295
|
+
|
|
296
|
+
**Bad**: "Missing required field"
|
|
297
|
+
|
|
298
|
+
Actionable suggestions show Claude exactly what to fix.
|
|
299
|
+
</actionable_suggestions>
|
|
300
|
+
|
|
301
|
+
<available_options>
|
|
302
|
+
When validation fails, show available valid options:
|
|
303
|
+
|
|
304
|
+
**Good**: "Invalid status 'pending_review'. Valid statuses: active, paused, archived"
|
|
305
|
+
|
|
306
|
+
**Bad**: "Invalid status"
|
|
307
|
+
|
|
308
|
+
Showing valid options eliminates guesswork.
|
|
309
|
+
</available_options>
|
|
310
|
+
</characteristics_of_good_validation>
|
|
311
|
+
|
|
312
|
+
<implementation_pattern>
|
|
313
|
+
```xml
|
|
314
|
+
<validation>
|
|
315
|
+
After making changes, validate immediately:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
python scripts/validate.py output_dir/
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
If validation fails, fix errors before continuing. Validation errors include:
|
|
322
|
+
|
|
323
|
+
- **Field not found**: "Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
|
|
324
|
+
- **Type mismatch**: "Field 'order_total' expects number, got string"
|
|
325
|
+
- **Missing required field**: "Required field 'customer_name' is missing"
|
|
326
|
+
- **Invalid value**: "Invalid status 'pending_review'. Valid statuses: active, paused, archived"
|
|
327
|
+
|
|
328
|
+
Only proceed when validation passes with zero errors.
|
|
329
|
+
</validation>
|
|
330
|
+
```
|
|
331
|
+
</implementation_pattern>
|
|
332
|
+
|
|
333
|
+
<benefits>
|
|
334
|
+
- Catches errors before they propagate
|
|
335
|
+
- Reduces iteration cycles
|
|
336
|
+
- Provides learning feedback
|
|
337
|
+
- Makes debugging deterministic
|
|
338
|
+
- Enables confident execution
|
|
339
|
+
</benefits>
|
|
340
|
+
</validation_scripts>
|
|
341
|
+
|
|
342
|
+
<iterative_refinement>
|
|
343
|
+
<principle>
|
|
344
|
+
Many workflows benefit from iteration: generate → validate → refine → validate → finalize.
|
|
345
|
+
</principle>
|
|
346
|
+
|
|
347
|
+
<implementation_example>
|
|
348
|
+
```xml
|
|
349
|
+
<objective>
|
|
350
|
+
Generate reports with iterative quality improvement.
|
|
351
|
+
</objective>
|
|
352
|
+
|
|
353
|
+
<workflow>
|
|
354
|
+
<iteration_1>
|
|
355
|
+
**Generate initial draft**
|
|
356
|
+
|
|
357
|
+
Create report based on data and requirements.
|
|
358
|
+
</iteration_1>
|
|
359
|
+
|
|
360
|
+
<iteration_2>
|
|
361
|
+
**Validate draft**
|
|
362
|
+
|
|
363
|
+
Run: `python scripts/validate_report.py draft.md`
|
|
364
|
+
|
|
365
|
+
Fix any structural issues, missing sections, or data errors.
|
|
366
|
+
</iteration_2>
|
|
367
|
+
|
|
368
|
+
<iteration_3>
|
|
369
|
+
**Refine content**
|
|
370
|
+
|
|
371
|
+
Improve clarity, add supporting data, enhance visualizations.
|
|
372
|
+
</iteration_3>
|
|
373
|
+
|
|
374
|
+
<iteration_4>
|
|
375
|
+
**Final validation**
|
|
376
|
+
|
|
377
|
+
Run: `python scripts/validate_report.py final.md`
|
|
378
|
+
|
|
379
|
+
Ensure all quality criteria met.
|
|
380
|
+
</iteration_4>
|
|
381
|
+
|
|
382
|
+
<iteration_5>
|
|
383
|
+
**Finalize**
|
|
384
|
+
|
|
385
|
+
Export to final format and deliver.
|
|
386
|
+
</iteration_5>
|
|
387
|
+
</workflow>
|
|
388
|
+
|
|
389
|
+
<success_criteria>
|
|
390
|
+
- Final validation passes with zero errors
|
|
391
|
+
- All quality criteria met
|
|
392
|
+
- Report ready for delivery
|
|
393
|
+
</success_criteria>
|
|
394
|
+
```
|
|
395
|
+
</implementation_example>
|
|
396
|
+
|
|
397
|
+
<when_to_use>
|
|
398
|
+
Use iterative refinement when:
|
|
399
|
+
- Quality improves with multiple passes
|
|
400
|
+
- Validation provides actionable feedback
|
|
401
|
+
- Time permits iteration
|
|
402
|
+
- Perfect output matters more than speed
|
|
403
|
+
</when_to_use>
|
|
404
|
+
</iterative_refinement>
|
|
405
|
+
|
|
406
|
+
<checkpoint_pattern>
|
|
407
|
+
<principle>
|
|
408
|
+
For long workflows, add checkpoints where Claude can pause and verify progress before continuing.
|
|
409
|
+
</principle>
|
|
410
|
+
|
|
411
|
+
<implementation_example>
|
|
412
|
+
```xml
|
|
413
|
+
<workflow>
|
|
414
|
+
<phase_1>
|
|
415
|
+
**Data collection** (Steps 1-3)
|
|
416
|
+
|
|
417
|
+
1. Extract data from source
|
|
418
|
+
2. Transform to target format
|
|
419
|
+
3. **CHECKPOINT**: Verify data completeness
|
|
420
|
+
|
|
421
|
+
Only continue if checkpoint passes.
|
|
422
|
+
</phase_1>
|
|
423
|
+
|
|
424
|
+
<phase_2>
|
|
425
|
+
**Data processing** (Steps 4-6)
|
|
426
|
+
|
|
427
|
+
4. Apply business rules
|
|
428
|
+
5. Validate transformations
|
|
429
|
+
6. **CHECKPOINT**: Verify processing accuracy
|
|
430
|
+
|
|
431
|
+
Only continue if checkpoint passes.
|
|
432
|
+
</phase_2>
|
|
433
|
+
|
|
434
|
+
<phase_3>
|
|
435
|
+
**Output generation** (Steps 7-9)
|
|
436
|
+
|
|
437
|
+
7. Generate output files
|
|
438
|
+
8. Validate output format
|
|
439
|
+
9. **CHECKPOINT**: Verify final output
|
|
440
|
+
|
|
441
|
+
Proceed to delivery only if checkpoint passes.
|
|
442
|
+
</phase_3>
|
|
443
|
+
</workflow>
|
|
444
|
+
|
|
445
|
+
<checkpoint_validation>
|
|
446
|
+
At each checkpoint:
|
|
447
|
+
1. Run validation script
|
|
448
|
+
2. Review output for correctness
|
|
449
|
+
3. Verify no errors or warnings
|
|
450
|
+
4. Only proceed when validation passes
|
|
451
|
+
</checkpoint_validation>
|
|
452
|
+
```
|
|
453
|
+
</implementation_example>
|
|
454
|
+
|
|
455
|
+
<benefits>
|
|
456
|
+
- Prevents cascading errors
|
|
457
|
+
- Easier to diagnose issues
|
|
458
|
+
- Clear progress indicators
|
|
459
|
+
- Natural pause points for review
|
|
460
|
+
- Reduces wasted work from early errors
|
|
461
|
+
</benefits>
|
|
462
|
+
</checkpoint_pattern>
|
|
463
|
+
|
|
464
|
+
<error_recovery>
|
|
465
|
+
<principle>
|
|
466
|
+
Design workflows with clear error recovery paths. Claude should know what to do when things go wrong.
|
|
467
|
+
</principle>
|
|
468
|
+
|
|
469
|
+
<implementation_example>
|
|
470
|
+
```xml
|
|
471
|
+
<workflow>
|
|
472
|
+
<normal_path>
|
|
473
|
+
1. Process input file
|
|
474
|
+
2. Validate output
|
|
475
|
+
3. Save results
|
|
476
|
+
</normal_path>
|
|
477
|
+
|
|
478
|
+
<error_recovery>
|
|
479
|
+
**If validation fails in step 2:**
|
|
480
|
+
- Review validation errors
|
|
481
|
+
- Check if input file is corrupted → Return to step 1 with different input
|
|
482
|
+
- Check if processing logic failed → Fix logic, return to step 1
|
|
483
|
+
- Check if output format wrong → Fix format, return to step 2
|
|
484
|
+
|
|
485
|
+
**If save fails in step 3:**
|
|
486
|
+
- Check disk space
|
|
487
|
+
- Check file permissions
|
|
488
|
+
- Check file path validity
|
|
489
|
+
- Retry save with corrected conditions
|
|
490
|
+
</error_recovery>
|
|
491
|
+
|
|
492
|
+
<escalation>
|
|
493
|
+
**If error persists after 3 attempts:**
|
|
494
|
+
- Document the error with full context
|
|
495
|
+
- Save partial results if available
|
|
496
|
+
- Report issue to user with diagnostic information
|
|
497
|
+
</escalation>
|
|
498
|
+
</workflow>
|
|
499
|
+
```
|
|
500
|
+
</implementation_example>
|
|
501
|
+
|
|
502
|
+
<when_to_use>
|
|
503
|
+
Include error recovery when:
|
|
504
|
+
- Workflows interact with external systems
|
|
505
|
+
- File operations could fail
|
|
506
|
+
- Network calls could timeout
|
|
507
|
+
- User input could be invalid
|
|
508
|
+
- Errors are recoverable
|
|
509
|
+
</when_to_use>
|
|
510
|
+
</error_recovery>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: {{SKILL_NAME}}
|
|
3
|
+
description: {{What it does}} Use when {{trigger conditions}}.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<essential_principles>
|
|
7
|
+
## {{Core Concept}}
|
|
8
|
+
|
|
9
|
+
{{Principles that ALWAYS apply, regardless of which workflow runs}}
|
|
10
|
+
|
|
11
|
+
### 1. {{First principle}}
|
|
12
|
+
{{Explanation}}
|
|
13
|
+
|
|
14
|
+
### 2. {{Second principle}}
|
|
15
|
+
{{Explanation}}
|
|
16
|
+
|
|
17
|
+
### 3. {{Third principle}}
|
|
18
|
+
{{Explanation}}
|
|
19
|
+
</essential_principles>
|
|
20
|
+
|
|
21
|
+
<intake>
|
|
22
|
+
**Ask the user:**
|
|
23
|
+
|
|
24
|
+
What would you like to do?
|
|
25
|
+
1. {{First option}}
|
|
26
|
+
2. {{Second option}}
|
|
27
|
+
3. {{Third option}}
|
|
28
|
+
|
|
29
|
+
**Wait for response before proceeding.**
|
|
30
|
+
</intake>
|
|
31
|
+
|
|
32
|
+
<routing>
|
|
33
|
+
| Response | Workflow |
|
|
34
|
+
|----------|----------|
|
|
35
|
+
| 1, "{{keywords}}" | `workflows/{{first-workflow}}.md` |
|
|
36
|
+
| 2, "{{keywords}}" | `workflows/{{second-workflow}}.md` |
|
|
37
|
+
| 3, "{{keywords}}" | `workflows/{{third-workflow}}.md` |
|
|
38
|
+
|
|
39
|
+
**After reading the workflow, follow it exactly.**
|
|
40
|
+
</routing>
|
|
41
|
+
|
|
42
|
+
<quick_reference>
|
|
43
|
+
## {{Skill Name}} Quick Reference
|
|
44
|
+
|
|
45
|
+
{{Brief reference information always useful to have visible}}
|
|
46
|
+
</quick_reference>
|
|
47
|
+
|
|
48
|
+
<reference_index>
|
|
49
|
+
## Domain Knowledge
|
|
50
|
+
|
|
51
|
+
All in `references/`:
|
|
52
|
+
- {{reference-1.md}} - {{purpose}}
|
|
53
|
+
- {{reference-2.md}} - {{purpose}}
|
|
54
|
+
</reference_index>
|
|
55
|
+
|
|
56
|
+
<workflows_index>
|
|
57
|
+
## Workflows
|
|
58
|
+
|
|
59
|
+
All in `workflows/`:
|
|
60
|
+
|
|
61
|
+
| Workflow | Purpose |
|
|
62
|
+
|----------|---------|
|
|
63
|
+
| {{first-workflow}}.md | {{purpose}} |
|
|
64
|
+
| {{second-workflow}}.md | {{purpose}} |
|
|
65
|
+
| {{third-workflow}}.md | {{purpose}} |
|
|
66
|
+
</workflows_index>
|
|
67
|
+
|
|
68
|
+
<success_criteria>
|
|
69
|
+
A well-executed {{skill name}}:
|
|
70
|
+
- {{First criterion}}
|
|
71
|
+
- {{Second criterion}}
|
|
72
|
+
- {{Third criterion}}
|
|
73
|
+
</success_criteria>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: {{SKILL_NAME}}
|
|
3
|
+
description: {{What it does}} Use when {{trigger conditions}}.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<objective>
|
|
7
|
+
{{Clear statement of what this skill accomplishes}}
|
|
8
|
+
</objective>
|
|
9
|
+
|
|
10
|
+
<quick_start>
|
|
11
|
+
{{Immediate actionable guidance - what Claude should do first}}
|
|
12
|
+
</quick_start>
|
|
13
|
+
|
|
14
|
+
<process>
|
|
15
|
+
## Step 1: {{First action}}
|
|
16
|
+
|
|
17
|
+
{{Instructions for step 1}}
|
|
18
|
+
|
|
19
|
+
## Step 2: {{Second action}}
|
|
20
|
+
|
|
21
|
+
{{Instructions for step 2}}
|
|
22
|
+
|
|
23
|
+
## Step 3: {{Third action}}
|
|
24
|
+
|
|
25
|
+
{{Instructions for step 3}}
|
|
26
|
+
</process>
|
|
27
|
+
|
|
28
|
+
<success_criteria>
|
|
29
|
+
{{Skill name}} is complete when:
|
|
30
|
+
- [ ] {{First success criterion}}
|
|
31
|
+
- [ ] {{Second success criterion}}
|
|
32
|
+
- [ ] {{Third success criterion}}
|
|
33
|
+
</success_criteria>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Workflow: Add a Reference to Existing Skill
|
|
2
|
+
|
|
3
|
+
<required_reading>
|
|
4
|
+
**Read these reference files NOW:**
|
|
5
|
+
1. references/recommended-structure.md
|
|
6
|
+
2. references/skill-structure.md
|
|
7
|
+
</required_reading>
|
|
8
|
+
|
|
9
|
+
<process>
|
|
10
|
+
## Step 1: Select the Skill
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
ls ~/.claude/skills/
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Present numbered list, ask: "Which skill needs a new reference?"
|
|
17
|
+
|
|
18
|
+
## Step 2: Analyze Current Structure
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
cat ~/.claude/skills/{skill-name}/SKILL.md
|
|
22
|
+
ls ~/.claude/skills/{skill-name}/references/ 2>/dev/null
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Determine:
|
|
26
|
+
- **Has references/ folder?** → Good, can add directly
|
|
27
|
+
- **Simple skill?** → May need to create references/ first
|
|
28
|
+
- **What references exist?** → Understand the knowledge landscape
|
|
29
|
+
|
|
30
|
+
Report current references to user.
|
|
31
|
+
|
|
32
|
+
## Step 3: Gather Reference Requirements
|
|
33
|
+
|
|
34
|
+
Ask:
|
|
35
|
+
- What knowledge should this reference contain?
|
|
36
|
+
- Which workflows will use it?
|
|
37
|
+
- Is this reusable across workflows or specific to one?
|
|
38
|
+
|
|
39
|
+
**If specific to one workflow** → Consider putting it inline in that workflow instead.
|
|
40
|
+
|
|
41
|
+
## Step 4: Create the Reference File
|
|
42
|
+
|
|
43
|
+
Create `references/{reference-name}.md`:
|
|
44
|
+
|
|
45
|
+
Use semantic XML tags to structure the content:
|
|
46
|
+
```xml
|
|
47
|
+
<overview>
|
|
48
|
+
Brief description of what this reference covers
|
|
49
|
+
</overview>
|
|
50
|
+
|
|
51
|
+
<patterns>
|
|
52
|
+
## Common Patterns
|
|
53
|
+
[Reusable patterns, examples, code snippets]
|
|
54
|
+
</patterns>
|
|
55
|
+
|
|
56
|
+
<guidelines>
|
|
57
|
+
## Guidelines
|
|
58
|
+
[Best practices, rules, constraints]
|
|
59
|
+
</guidelines>
|
|
60
|
+
|
|
61
|
+
<examples>
|
|
62
|
+
## Examples
|
|
63
|
+
[Concrete examples with explanation]
|
|
64
|
+
</examples>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Step 5: Update SKILL.md
|
|
68
|
+
|
|
69
|
+
Add the new reference to `<reference_index>`:
|
|
70
|
+
```markdown
|
|
71
|
+
**Category:** existing.md, new-reference.md
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Step 6: Update Workflows That Need It
|
|
75
|
+
|
|
76
|
+
For each workflow that should use this reference:
|
|
77
|
+
|
|
78
|
+
1. Read the workflow file
|
|
79
|
+
2. Add to its `<required_reading>` section
|
|
80
|
+
3. Verify the workflow still makes sense with this addition
|
|
81
|
+
|
|
82
|
+
## Step 7: Verify
|
|
83
|
+
|
|
84
|
+
- [ ] Reference file exists and is well-structured
|
|
85
|
+
- [ ] Reference is in SKILL.md reference_index
|
|
86
|
+
- [ ] Relevant workflows have it in required_reading
|
|
87
|
+
- [ ] No broken references
|
|
88
|
+
</process>
|
|
89
|
+
|
|
90
|
+
<success_criteria>
|
|
91
|
+
Reference addition is complete when:
|
|
92
|
+
- [ ] Reference file created with useful content
|
|
93
|
+
- [ ] Added to reference_index in SKILL.md
|
|
94
|
+
- [ ] Relevant workflows updated to read it
|
|
95
|
+
- [ ] Content is reusable (not workflow-specific)
|
|
96
|
+
</success_criteria>
|