aiblueprint-cli 1.4.23 → 1.4.24
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-code-config/skills/git-commit/SKILL.md +42 -0
- package/claude-code-config/{commands/git/create-pr.md → skills/git-create-pr/SKILL.md} +12 -18
- package/claude-code-config/skills/git-fix-pr-comments/SKILL.md +51 -0
- package/claude-code-config/skills/git-merge/SKILL.md +68 -0
- package/claude-code-config/skills/{claude-memory → meta-claude-memory}/SKILL.md +7 -2
- package/claude-code-config/skills/meta-claude-memory/references/rules-directory-guide.md +298 -0
- package/claude-code-config/skills/meta-prompt-creator/SKILL.md +285 -0
- package/claude-code-config/skills/meta-prompt-creator/references/anthropic-best-practices.md +126 -0
- package/claude-code-config/skills/meta-prompt-creator/references/anti-patterns.md +57 -0
- package/claude-code-config/skills/meta-prompt-creator/references/clarity-principles.md +54 -0
- package/claude-code-config/skills/meta-prompt-creator/references/context-management.md +389 -0
- package/claude-code-config/skills/meta-prompt-creator/references/few-shot-patterns.md +47 -0
- package/claude-code-config/skills/meta-prompt-creator/references/openai-best-practices.md +50 -0
- package/claude-code-config/skills/meta-prompt-creator/references/prompt-templates.md +110 -0
- package/claude-code-config/skills/meta-prompt-creator/references/reasoning-techniques.md +52 -0
- package/claude-code-config/skills/meta-prompt-creator/references/system-prompt-patterns.md +48 -0
- package/claude-code-config/skills/meta-prompt-creator/references/xml-structure.md +36 -0
- package/claude-code-config/skills/meta-skill-creator/LICENSE.txt +202 -0
- package/claude-code-config/skills/meta-skill-creator/SKILL.md +421 -0
- package/claude-code-config/skills/meta-skill-creator/package.json +5 -0
- package/claude-code-config/skills/meta-skill-creator/references/output-patterns.md +82 -0
- package/claude-code-config/skills/meta-skill-creator/references/progressive-disclosure-patterns.md +374 -0
- package/claude-code-config/skills/meta-skill-creator/references/prompting-integration.md +363 -0
- package/claude-code-config/skills/meta-skill-creator/references/real-world-examples.md +513 -0
- package/claude-code-config/skills/meta-skill-creator/references/script-patterns.md +385 -0
- package/claude-code-config/skills/meta-skill-creator/references/workflows.md +28 -0
- package/claude-code-config/skills/meta-skill-creator/references/xml-tag-guide.md +606 -0
- package/claude-code-config/skills/meta-skill-creator/scripts/init-skill.ts +214 -0
- package/claude-code-config/skills/meta-skill-creator/scripts/package-skill.ts +146 -0
- package/claude-code-config/skills/meta-skill-creator/scripts/validate.ts +138 -0
- package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/SKILL.md +41 -15
- package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-00-init.md +2 -3
- package/claude-code-config/skills/utils-fix-errors/SKILL.md +61 -0
- package/claude-code-config/skills/utils-fix-grammar/SKILL.md +59 -0
- package/claude-code-config/skills/utils-oneshot/SKILL.md +56 -0
- package/claude-code-config/skills/workflow-apex/SKILL.md +303 -0
- package/claude-code-config/skills/workflow-apex/scripts/setup-templates.sh +134 -0
- package/claude-code-config/skills/workflow-apex/scripts/update-progress.sh +80 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00-init.md +288 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00b-branch.md +126 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00b-economy.md +244 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00b-interactive.md +153 -0
- package/claude-code-config/skills/workflow-apex/steps/step-01-analyze.md +361 -0
- package/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +264 -0
- package/claude-code-config/skills/workflow-apex/steps/step-03-execute.md +239 -0
- package/claude-code-config/skills/workflow-apex/steps/step-04-validate.md +264 -0
- package/claude-code-config/skills/workflow-apex/steps/step-05-examine.md +294 -0
- package/claude-code-config/skills/workflow-apex/steps/step-06-resolve.md +237 -0
- package/claude-code-config/skills/workflow-apex/steps/step-07-tests.md +250 -0
- package/claude-code-config/skills/workflow-apex/steps/step-08-run-tests.md +308 -0
- package/claude-code-config/skills/workflow-apex/steps/step-09-finish.md +193 -0
- package/claude-code-config/skills/workflow-apex/templates/00-context.md +51 -0
- package/claude-code-config/skills/workflow-apex/templates/01-analyze.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/02-plan.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/03-execute.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/04-validate.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/05-examine.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/06-resolve.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/07-tests.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/08-run-tests.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/09-finish.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/README.md +195 -0
- package/claude-code-config/skills/workflow-apex/templates/step-complete.md +7 -0
- package/package.json +1 -1
- package/claude-code-config/commands/explore.md +0 -90
- package/claude-code-config/commands/git/commit.md +0 -60
- package/claude-code-config/commands/git/fix-pr-comments.md +0 -59
- package/claude-code-config/commands/oneshot.md +0 -57
- package/claude-code-config/skills/create-slash-commands/SKILL.md +0 -1110
- package/claude-code-config/skills/create-slash-commands/references/arguments.md +0 -273
- package/claude-code-config/skills/create-slash-commands/references/patterns.md +0 -947
- package/claude-code-config/skills/create-slash-commands/references/prompt-examples.md +0 -656
- package/claude-code-config/skills/create-slash-commands/references/tool-restrictions.md +0 -389
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/comprehensive-example.md +0 -0
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/project-patterns.md +0 -0
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/prompting-techniques.md +0 -0
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/section-templates.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/context-management.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/debugging-agents.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/error-handling-and-recovery.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/evaluation-and-testing.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/orchestration-patterns.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/subagents.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/writing-subagent-prompts.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/SKILL.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/scripts/setup.sh +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-01-interactive-prd.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-02-create-stories.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-03-finish.md +0 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Executable code patterns for skill scripts including error handling, package dependencies, and best practices.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<when_to_use_scripts>
|
|
6
|
+
Even if Claude could write a script, pre-made scripts offer advantages:
|
|
7
|
+
|
|
8
|
+
- More reliable than generated code
|
|
9
|
+
- Save tokens (no need to include code in context)
|
|
10
|
+
- Save time (no code generation required)
|
|
11
|
+
- Ensure consistency across uses
|
|
12
|
+
|
|
13
|
+
<execution_vs_reference>
|
|
14
|
+
Make clear whether Claude should:
|
|
15
|
+
|
|
16
|
+
- **Execute the script** (most common): "Run `analyze_form.py` to extract fields"
|
|
17
|
+
- **Read it as reference** (for complex logic): "See `analyze_form.py` for the extraction algorithm"
|
|
18
|
+
|
|
19
|
+
For most utility scripts, execution is preferred.
|
|
20
|
+
</execution_vs_reference>
|
|
21
|
+
|
|
22
|
+
<how_scripts_work>
|
|
23
|
+
When Claude executes a script via bash:
|
|
24
|
+
|
|
25
|
+
1. Script code never enters context window
|
|
26
|
+
2. Only script output consumes tokens
|
|
27
|
+
3. Far more efficient than having Claude generate equivalent code
|
|
28
|
+
</how_scripts_work>
|
|
29
|
+
</when_to_use_scripts>
|
|
30
|
+
|
|
31
|
+
<directory_organization>
|
|
32
|
+
<best_practice>
|
|
33
|
+
Place all executable scripts in a `scripts/` subdirectory within the skill folder:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
skill-name/
|
|
37
|
+
├── SKILL.md
|
|
38
|
+
├── scripts/
|
|
39
|
+
│ ├── main_utility.py
|
|
40
|
+
│ ├── helper_script.py
|
|
41
|
+
│ └── validator.py
|
|
42
|
+
└── references/
|
|
43
|
+
└── api-docs.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Benefits**:
|
|
47
|
+
- Keeps skill root clean and organized
|
|
48
|
+
- Clear separation between documentation and executable code
|
|
49
|
+
- Consistent pattern across all skills
|
|
50
|
+
- Easy to reference: `python scripts/script_name.py`
|
|
51
|
+
</best_practice>
|
|
52
|
+
|
|
53
|
+
<reference_pattern>
|
|
54
|
+
In SKILL.md, reference scripts using the `scripts/` path:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
python ~/.claude/skills/skill-name/scripts/analyze.py input.har
|
|
58
|
+
```
|
|
59
|
+
</reference_pattern>
|
|
60
|
+
</directory_organization>
|
|
61
|
+
|
|
62
|
+
<documentation_pattern>
|
|
63
|
+
<example>
|
|
64
|
+
In SKILL.md:
|
|
65
|
+
|
|
66
|
+
```xml
|
|
67
|
+
<utility_scripts>
|
|
68
|
+
**analyze_form.py**: Extract all form fields from PDF
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python scripts/analyze_form.py input.pdf > fields.json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Output format:
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"field_name": { "type": "text", "x": 100, "y": 200 },
|
|
78
|
+
"signature": { "type": "sig", "x": 150, "y": 500 }
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**validate_boxes.py**: Check for overlapping bounding boxes
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
python scripts/validate_boxes.py fields.json
|
|
86
|
+
# Returns: "OK" or lists conflicts
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**fill_form.py**: Apply field values to PDF
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
python scripts/fill_form.py input.pdf fields.json output.pdf
|
|
93
|
+
```
|
|
94
|
+
</utility_scripts>
|
|
95
|
+
```
|
|
96
|
+
</example>
|
|
97
|
+
</documentation_pattern>
|
|
98
|
+
|
|
99
|
+
<error_handling>
|
|
100
|
+
<solve_dont_punt>
|
|
101
|
+
Handle error conditions rather than punting to Claude.
|
|
102
|
+
|
|
103
|
+
<good_example>
|
|
104
|
+
```python
|
|
105
|
+
def process_file(path):
|
|
106
|
+
"""Process a file, creating it if it doesn't exist."""
|
|
107
|
+
try:
|
|
108
|
+
with open(path) as f:
|
|
109
|
+
return f.read()
|
|
110
|
+
except FileNotFoundError:
|
|
111
|
+
print(f"File {path} not found, creating default")
|
|
112
|
+
with open(path, 'w') as f:
|
|
113
|
+
f.write('')
|
|
114
|
+
return ''
|
|
115
|
+
except PermissionError:
|
|
116
|
+
print(f"Cannot access {path}, using default")
|
|
117
|
+
return ''
|
|
118
|
+
```
|
|
119
|
+
</good_example>
|
|
120
|
+
|
|
121
|
+
<bad_example>
|
|
122
|
+
```python
|
|
123
|
+
def process_file(path):
|
|
124
|
+
# Just fail and let Claude figure it out
|
|
125
|
+
return open(path).read()
|
|
126
|
+
```
|
|
127
|
+
</bad_example>
|
|
128
|
+
</solve_dont_punt>
|
|
129
|
+
|
|
130
|
+
<graceful_degradation>
|
|
131
|
+
**Principle**: Scripts should handle edge cases and fail gracefully with helpful error messages.
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
def validate_config(config_path):
|
|
135
|
+
"""Validate configuration file."""
|
|
136
|
+
if not os.path.exists(config_path):
|
|
137
|
+
print(f"ERROR: Config file not found: {config_path}")
|
|
138
|
+
print("Create it with: cp config.example.json {config_path}")
|
|
139
|
+
sys.exit(1)
|
|
140
|
+
|
|
141
|
+
try:
|
|
142
|
+
with open(config_path) as f:
|
|
143
|
+
config = json.load(f)
|
|
144
|
+
except json.JSONDecodeError as e:
|
|
145
|
+
print(f"ERROR: Invalid JSON in {config_path}")
|
|
146
|
+
print(f"Line {e.lineno}: {e.msg}")
|
|
147
|
+
sys.exit(1)
|
|
148
|
+
|
|
149
|
+
return config
|
|
150
|
+
```
|
|
151
|
+
</graceful_degradation>
|
|
152
|
+
</error_handling>
|
|
153
|
+
|
|
154
|
+
<configuration_values>
|
|
155
|
+
<document_constants>
|
|
156
|
+
Document configuration parameters to avoid "voodoo constants":
|
|
157
|
+
|
|
158
|
+
<good_example>
|
|
159
|
+
```python
|
|
160
|
+
# HTTP requests typically complete within 30 seconds
|
|
161
|
+
REQUEST_TIMEOUT = 30
|
|
162
|
+
|
|
163
|
+
# Three retries balances reliability vs speed
|
|
164
|
+
MAX_RETRIES = 3
|
|
165
|
+
|
|
166
|
+
# Rate limit: 100 requests per minute
|
|
167
|
+
RATE_LIMIT = 100
|
|
168
|
+
RATE_WINDOW = 60 # seconds
|
|
169
|
+
```
|
|
170
|
+
</good_example>
|
|
171
|
+
|
|
172
|
+
<bad_example>
|
|
173
|
+
```python
|
|
174
|
+
TIMEOUT = 47 # Why 47?
|
|
175
|
+
RETRIES = 5 # Why 5?
|
|
176
|
+
```
|
|
177
|
+
</bad_example>
|
|
178
|
+
</document_constants>
|
|
179
|
+
</configuration_values>
|
|
180
|
+
|
|
181
|
+
<package_dependencies>
|
|
182
|
+
<runtime_constraints>
|
|
183
|
+
Skills run in code execution environment with platform-specific limitations:
|
|
184
|
+
|
|
185
|
+
- **claude.ai**: Can install packages from npm and PyPI
|
|
186
|
+
- **Anthropic API**: No network access and no runtime package installation
|
|
187
|
+
</runtime_constraints>
|
|
188
|
+
|
|
189
|
+
<guidance>
|
|
190
|
+
List required packages in your SKILL.md and verify they're available.
|
|
191
|
+
|
|
192
|
+
<good_example>
|
|
193
|
+
In SKILL.md:
|
|
194
|
+
|
|
195
|
+
```xml
|
|
196
|
+
<requirements>
|
|
197
|
+
Install required package: `pip install pypdf`
|
|
198
|
+
|
|
199
|
+
Then use it:
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
from pypdf import PdfReader
|
|
203
|
+
reader = PdfReader("file.pdf")
|
|
204
|
+
```
|
|
205
|
+
</requirements>
|
|
206
|
+
```
|
|
207
|
+
</good_example>
|
|
208
|
+
|
|
209
|
+
<bad_example>
|
|
210
|
+
"Use the pdf library to process the file."
|
|
211
|
+
</bad_example>
|
|
212
|
+
</guidance>
|
|
213
|
+
</package_dependencies>
|
|
214
|
+
|
|
215
|
+
<script_templates>
|
|
216
|
+
<setup_script>
|
|
217
|
+
**Purpose**: Initialize project structure atomically
|
|
218
|
+
|
|
219
|
+
**Pattern**:
|
|
220
|
+
```bash
|
|
221
|
+
#!/bin/bash
|
|
222
|
+
# Setup Script - Creates all required files
|
|
223
|
+
# Usage: ./setup.sh <project-path> [options]
|
|
224
|
+
|
|
225
|
+
set -e # Exit on error
|
|
226
|
+
|
|
227
|
+
PROJECT_PATH="${1:-.}"
|
|
228
|
+
OPTION="${2:-default}"
|
|
229
|
+
|
|
230
|
+
# Resolve absolute path
|
|
231
|
+
PROJECT_PATH=$(cd "$PROJECT_PATH" && pwd)
|
|
232
|
+
OUTPUT_DIR="$PROJECT_PATH/output"
|
|
233
|
+
|
|
234
|
+
echo "🚀 Setting up project in: $PROJECT_PATH"
|
|
235
|
+
|
|
236
|
+
# Create directory structure
|
|
237
|
+
mkdir -p "$OUTPUT_DIR"
|
|
238
|
+
|
|
239
|
+
# Create files with heredocs
|
|
240
|
+
cat > "$OUTPUT_DIR/config.json" << 'EOF'
|
|
241
|
+
{
|
|
242
|
+
"version": "1.0.0",
|
|
243
|
+
"created": "$(date +%Y-%m-%d)"
|
|
244
|
+
}
|
|
245
|
+
EOF
|
|
246
|
+
|
|
247
|
+
chmod +x "$OUTPUT_DIR/script.sh"
|
|
248
|
+
echo "✅ Setup complete"
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Key features**:
|
|
252
|
+
- Set -e for error handling
|
|
253
|
+
- Default values for arguments
|
|
254
|
+
- Absolute path resolution
|
|
255
|
+
- Heredocs for file creation
|
|
256
|
+
- Clear user feedback
|
|
257
|
+
</setup_script>
|
|
258
|
+
|
|
259
|
+
<validation_script>
|
|
260
|
+
**Purpose**: Validate data or configuration
|
|
261
|
+
|
|
262
|
+
**Pattern**:
|
|
263
|
+
```python
|
|
264
|
+
#!/usr/bin/env python3
|
|
265
|
+
"""Validate configuration file."""
|
|
266
|
+
import sys
|
|
267
|
+
import json
|
|
268
|
+
from pathlib import Path
|
|
269
|
+
|
|
270
|
+
def validate_config(config_path: Path) -> bool:
|
|
271
|
+
"""Validate configuration file structure."""
|
|
272
|
+
if not config_path.exists():
|
|
273
|
+
print(f"❌ Config not found: {config_path}")
|
|
274
|
+
return False
|
|
275
|
+
|
|
276
|
+
try:
|
|
277
|
+
with open(config_path) as f:
|
|
278
|
+
config = json.load(f)
|
|
279
|
+
except json.JSONDecodeError as e:
|
|
280
|
+
print(f"❌ Invalid JSON: Line {e.lineno}: {e.msg}")
|
|
281
|
+
return False
|
|
282
|
+
|
|
283
|
+
# Validate required fields
|
|
284
|
+
required = ["name", "version"]
|
|
285
|
+
missing = [field for field in required if field not in config]
|
|
286
|
+
|
|
287
|
+
if missing:
|
|
288
|
+
print(f"❌ Missing required fields: {', '.join(missing)}")
|
|
289
|
+
return False
|
|
290
|
+
|
|
291
|
+
print("✅ Configuration valid")
|
|
292
|
+
return True
|
|
293
|
+
|
|
294
|
+
if __name__ == "__main__":
|
|
295
|
+
if len(sys.argv) < 2:
|
|
296
|
+
print("Usage: validate_config.py <config-file>")
|
|
297
|
+
sys.exit(1)
|
|
298
|
+
|
|
299
|
+
config_path = Path(sys.argv[1])
|
|
300
|
+
success = validate_config(config_path)
|
|
301
|
+
sys.exit(0 if success else 1)
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Key features**:
|
|
305
|
+
- Type hints for clarity
|
|
306
|
+
- Comprehensive error messages
|
|
307
|
+
- Exit codes for success/failure
|
|
308
|
+
- Usage instructions
|
|
309
|
+
</validation_script>
|
|
310
|
+
|
|
311
|
+
<transformation_script>
|
|
312
|
+
**Purpose**: Transform data from one format to another
|
|
313
|
+
|
|
314
|
+
**Pattern**:
|
|
315
|
+
```python
|
|
316
|
+
#!/usr/bin/env python3
|
|
317
|
+
"""Transform markdown to JSON structure."""
|
|
318
|
+
import sys
|
|
319
|
+
import json
|
|
320
|
+
import re
|
|
321
|
+
from pathlib import Path
|
|
322
|
+
|
|
323
|
+
def parse_markdown(content: str) -> dict:
|
|
324
|
+
"""Parse markdown and extract structure."""
|
|
325
|
+
sections = {}
|
|
326
|
+
current_section = None
|
|
327
|
+
|
|
328
|
+
for line in content.split('\n'):
|
|
329
|
+
if line.startswith('## '):
|
|
330
|
+
current_section = line[3:].strip()
|
|
331
|
+
sections[current_section] = []
|
|
332
|
+
elif current_section and line.strip():
|
|
333
|
+
sections[current_section].append(line.strip())
|
|
334
|
+
|
|
335
|
+
return sections
|
|
336
|
+
|
|
337
|
+
def transform(input_path: Path, output_path: Path):
|
|
338
|
+
"""Transform markdown file to JSON."""
|
|
339
|
+
with open(input_path) as f:
|
|
340
|
+
content = f.read()
|
|
341
|
+
|
|
342
|
+
structure = parse_markdown(content)
|
|
343
|
+
|
|
344
|
+
with open(output_path, 'w') as f:
|
|
345
|
+
json.dump(structure, f, indent=2)
|
|
346
|
+
|
|
347
|
+
print(f"✅ Transformed {input_path} → {output_path}")
|
|
348
|
+
|
|
349
|
+
if __name__ == "__main__":
|
|
350
|
+
if len(sys.argv) < 3:
|
|
351
|
+
print("Usage: transform.py <input.md> <output.json>")
|
|
352
|
+
sys.exit(1)
|
|
353
|
+
|
|
354
|
+
transform(Path(sys.argv[1]), Path(sys.argv[2]))
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**Key features**:
|
|
358
|
+
- Clear transformation logic
|
|
359
|
+
- Path objects for file handling
|
|
360
|
+
- Success feedback
|
|
361
|
+
</transformation_script>
|
|
362
|
+
</script_templates>
|
|
363
|
+
|
|
364
|
+
<best_practices>
|
|
365
|
+
- Use `set -e` in bash scripts to exit on error
|
|
366
|
+
- Provide default values for arguments
|
|
367
|
+
- Use absolute paths to avoid directory confusion
|
|
368
|
+
- Include usage instructions in script docstring
|
|
369
|
+
- Return meaningful exit codes (0 for success, 1+ for errors)
|
|
370
|
+
- Print clear success/error messages with emojis
|
|
371
|
+
- Document configuration values
|
|
372
|
+
- Handle errors gracefully
|
|
373
|
+
- Use type hints in Python scripts
|
|
374
|
+
- Make scripts idempotent (safe to run multiple times)
|
|
375
|
+
</best_practices>
|
|
376
|
+
|
|
377
|
+
<anti_patterns>
|
|
378
|
+
- ❌ Hardcoded paths without configuration
|
|
379
|
+
- ❌ Silent failures without error messages
|
|
380
|
+
- ❌ Magic numbers without documentation
|
|
381
|
+
- ❌ Assuming files exist without checking
|
|
382
|
+
- ❌ No usage instructions
|
|
383
|
+
- ❌ Platform-specific commands without alternatives
|
|
384
|
+
- ❌ Scripts that fail on re-run (not idempotent)
|
|
385
|
+
</anti_patterns>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Workflow Patterns
|
|
2
|
+
|
|
3
|
+
## Sequential Workflows
|
|
4
|
+
|
|
5
|
+
For complex tasks, break operations into clear, sequential steps. It is often helpful to give Claude an overview of the process towards the beginning of SKILL.md:
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
Filling a PDF form involves these steps:
|
|
9
|
+
|
|
10
|
+
1. Analyze the form (run analyze_form.py)
|
|
11
|
+
2. Create field mapping (edit fields.json)
|
|
12
|
+
3. Validate mapping (run validate_fields.py)
|
|
13
|
+
4. Fill the form (run fill_form.py)
|
|
14
|
+
5. Verify output (run verify_output.py)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Conditional Workflows
|
|
18
|
+
|
|
19
|
+
For tasks with branching logic, guide Claude through decision points:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
1. Determine the modification type:
|
|
23
|
+
**Creating new content?** → Follow "Creation workflow" below
|
|
24
|
+
**Editing existing content?** → Follow "Editing workflow" below
|
|
25
|
+
|
|
26
|
+
2. Creation workflow: [steps]
|
|
27
|
+
3. Editing workflow: [steps]
|
|
28
|
+
```
|