codeforge-dev 1.4.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/.devcontainer/.env +22 -0
- package/.devcontainer/CHANGELOG.md +197 -0
- package/.devcontainer/CLAUDE.md +117 -0
- package/.devcontainer/README.md +222 -0
- package/.devcontainer/config/main-system-prompt.md +502 -0
- package/.devcontainer/config/settings.json +47 -0
- package/.devcontainer/devcontainer.json +94 -0
- package/.devcontainer/features/README.md +113 -0
- package/.devcontainer/features/agent-browser/README.md +65 -0
- package/.devcontainer/features/agent-browser/devcontainer-feature.json +23 -0
- package/.devcontainer/features/agent-browser/install.sh +79 -0
- package/.devcontainer/features/ast-grep/README.md +24 -0
- package/.devcontainer/features/ast-grep/devcontainer-feature.json +24 -0
- package/.devcontainer/features/ast-grep/install.sh +51 -0
- package/.devcontainer/features/ccstatusline/README.md +296 -0
- package/.devcontainer/features/ccstatusline/devcontainer-feature.json +19 -0
- package/.devcontainer/features/ccstatusline/install.sh +290 -0
- package/.devcontainer/features/ccusage/README.md +205 -0
- package/.devcontainer/features/ccusage/devcontainer-feature.json +38 -0
- package/.devcontainer/features/ccusage/install.sh +132 -0
- package/.devcontainer/features/claude-code/README.md +498 -0
- package/.devcontainer/features/claude-code/config/settings.json +36 -0
- package/.devcontainer/features/claude-code/config/system-prompt.md +118 -0
- package/.devcontainer/features/claude-code/config/world-building-sp.md +1432 -0
- package/.devcontainer/features/claude-code/devcontainer-feature.json +42 -0
- package/.devcontainer/features/claude-code/install.sh +466 -0
- package/.devcontainer/features/claude-monitor/README.md +74 -0
- package/.devcontainer/features/claude-monitor/devcontainer-feature.json +38 -0
- package/.devcontainer/features/claude-monitor/install.sh +99 -0
- package/.devcontainer/features/lsp-servers/README.md +85 -0
- package/.devcontainer/features/lsp-servers/devcontainer-feature.json +40 -0
- package/.devcontainer/features/lsp-servers/install.sh +116 -0
- package/.devcontainer/features/mcp-qdrant/CHANGES.md +399 -0
- package/.devcontainer/features/mcp-qdrant/README.md +474 -0
- package/.devcontainer/features/mcp-qdrant/devcontainer-feature.json +57 -0
- package/.devcontainer/features/mcp-qdrant/install.sh +295 -0
- package/.devcontainer/features/mcp-qdrant/poststart-hook.sh +129 -0
- package/.devcontainer/features/mcp-reasoner/README.md +177 -0
- package/.devcontainer/features/mcp-reasoner/devcontainer-feature.json +20 -0
- package/.devcontainer/features/mcp-reasoner/install.sh +177 -0
- package/.devcontainer/features/mcp-reasoner/poststart-hook.sh +67 -0
- package/.devcontainer/features/notify-hook/README.md +86 -0
- package/.devcontainer/features/notify-hook/devcontainer-feature.json +23 -0
- package/.devcontainer/features/notify-hook/install.sh +38 -0
- package/.devcontainer/features/splitrail/README.md +140 -0
- package/.devcontainer/features/splitrail/devcontainer-feature.json +34 -0
- package/.devcontainer/features/splitrail/install.sh +129 -0
- package/.devcontainer/features/tree-sitter/README.md +138 -0
- package/.devcontainer/features/tree-sitter/devcontainer-feature.json +52 -0
- package/.devcontainer/features/tree-sitter/install.sh +173 -0
- package/.devcontainer/plugins/devs-marketplace/.claude-plugin/marketplace.json +106 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/scripts/format-file.py +101 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/scripts/lint-file.py +137 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/.claude-plugin/plugin.json +8 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/claude-code-headless/SKILL.md +387 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/claude-code-headless/references/cli-flags-and-output.md +312 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/claude-code-headless/references/sdk-and-mcp.md +569 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker/SKILL.md +309 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker/references/compose-services.md +438 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker/references/dockerfile-patterns.md +340 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker-py/SKILL.md +412 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker-py/references/container-lifecycle.md +388 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/docker-py/references/resources-and-security.md +444 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/SKILL.md +344 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/references/middleware-and-lifespan.md +254 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/references/pydantic-models.md +245 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/references/routing-and-dependencies.md +255 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/fastapi/references/sse-and-streaming.md +318 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/pydantic-ai/SKILL.md +345 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/pydantic-ai/references/agents-and-tools.md +271 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/pydantic-ai/references/models-and-streaming.md +422 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/skill-building/SKILL.md +220 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/skill-building/references/cross-vendor-principles.md +139 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/skill-building/references/patterns-and-antipatterns.md +376 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/skill-building/references/skill-authoring-patterns.md +356 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/SKILL.md +329 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/references/advanced-queries.md +314 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/references/javascript-patterns.md +323 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/references/python-patterns.md +354 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/sqlite/references/schema-and-pragmas.md +326 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/SKILL.md +356 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/ai-sdk-svelte.md +128 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/component-patterns.md +332 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/layercake.md +203 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/migration-guide.md +350 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/runes-and-reactivity.md +328 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/spa-and-routing.md +262 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/svelte5/references/svelte-dnd-action.md +181 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/testing/SKILL.md +414 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/testing/references/fastapi-testing.md +411 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codedirective-skills/skills/testing/references/svelte-testing.md +538 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/codeforge-lsp/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/dangerous-command-blocker/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/dangerous-command-blocker/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/dangerous-command-blocker/scripts/block-dangerous.py +110 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/notify-hook/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/notify-hook/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/planning-reminder/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/planning-reminder/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/scripts/guard-protected.py +108 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/commands/ticket/357/200/272create-pr.md +337 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/commands/ticket/357/200/272new.md +166 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/commands/ticket/357/200/272review-commit.md +290 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/commands/ticket/357/200/272work.md +257 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/plugin.json +8 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/ticket-workflow/.claude-plugin/system-prompt.md +184 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/.claude-plugin/plugin.json +6 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/config/planning-instructions.md +14 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/functional-conjuring-map.md +989 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/hooks/hooks.json +33 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/__pycache__/post-enhance-task.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhance-planning.py +71 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhancers/enhance-plan.sh +68 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhancers/enhance-task.sh +120 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/post-enhance-plan.py +133 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/post-enhance-task.py +253 -0
- package/.devcontainer/scripts/setup-aliases.sh +80 -0
- package/.devcontainer/scripts/setup-config.sh +28 -0
- package/.devcontainer/scripts/setup-irie-claude.sh +32 -0
- package/.devcontainer/scripts/setup-plugins.sh +80 -0
- package/.devcontainer/scripts/setup.sh +58 -0
- package/LICENSE.txt +674 -0
- package/README.md +267 -0
- package/package.json +44 -0
- package/setup.js +83 -0
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
# Skill Writing Patterns and Antipatterns
|
|
2
|
+
|
|
3
|
+
This reference provides concrete before/after examples of effective and ineffective skill writing. Each section demonstrates a specific principle with real examples.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Description Field
|
|
8
|
+
|
|
9
|
+
### Antipattern: Vague Description
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
---
|
|
13
|
+
name: Code Helper
|
|
14
|
+
description: Provides guidance for coding tasks and helps with development.
|
|
15
|
+
---
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Problem:** No trigger phrases. Vague scope. Would activate (or fail to activate) unpredictably. Competes with every other development skill.
|
|
19
|
+
|
|
20
|
+
### Pattern: Trigger-Rich Description
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
---
|
|
24
|
+
name: Django Migration Builder
|
|
25
|
+
description: >-
|
|
26
|
+
This skill should be used when the user asks to "create a Django migration",
|
|
27
|
+
"write a database migration", "add a model field", "alter a table in Django",
|
|
28
|
+
or discusses Django ORM schema changes, migration dependencies, or
|
|
29
|
+
RunPython operations. Provides step-by-step migration authoring with
|
|
30
|
+
dependency resolution.
|
|
31
|
+
---
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Why it works:** Specific trigger phrases match actual user language. Scope is narrow and clear. Other skills can coexist without overlap.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 2. Altitude Calibration
|
|
39
|
+
|
|
40
|
+
### Antipattern: Too Vague (Too High)
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
## Error Handling
|
|
44
|
+
Handle errors well. Make sure the code is robust.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Problem:** No actionable guidance. The model already "tries" to handle errors. This instruction changes nothing.
|
|
48
|
+
|
|
49
|
+
### Antipattern: Too Specific (Too Low)
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
## Error Handling
|
|
53
|
+
On line 15 of the handler, wrap the database call in try/except.
|
|
54
|
+
Catch psycopg2.OperationalError specifically.
|
|
55
|
+
Log the error with format: "DB_ERR | {timestamp} | {query} | {error}".
|
|
56
|
+
Sleep for 2 seconds, then retry up to 3 times.
|
|
57
|
+
If all retries fail, raise a custom DatabaseUnavailableError with code 503.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Problem:** Brittle. Only applies to one specific file and one specific database driver. Breaks when anything changes.
|
|
61
|
+
|
|
62
|
+
### Pattern: Goldilocks Zone
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
## Error Handling
|
|
66
|
+
Handle errors at domain boundaries (API endpoints, service interfaces, CLI entry points).
|
|
67
|
+
Log with enough context to diagnose the issue without requiring reproduction:
|
|
68
|
+
include the operation attempted, relevant identifiers, and the error category.
|
|
69
|
+
Retry transient failures (network timeouts, temporary locks) with exponential backoff.
|
|
70
|
+
Fail fast on unrecoverable errors (missing configuration, invalid schemas).
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Why it works:** Specific enough to change behavior. Flexible enough to apply across any file, framework, or database. The model can apply these principles to novel situations.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 3. Positive Framing
|
|
78
|
+
|
|
79
|
+
### Antipattern: Negative Instructions
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
## Rules
|
|
83
|
+
- Do not use hardcoded file paths
|
|
84
|
+
- Do not skip input validation
|
|
85
|
+
- Do not commit directly to main
|
|
86
|
+
- Never use `rm -rf` without confirmation
|
|
87
|
+
- Do not write functions longer than 50 lines
|
|
88
|
+
- Avoid nested callbacks more than 3 levels deep
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Problem:** Each "do not" draws attention to the prohibited behavior. The model may over-index on these restrictions, becoming overly cautious or paradoxically more likely to think about the prohibited action.
|
|
92
|
+
|
|
93
|
+
### Pattern: Positive Directives
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
## Standards
|
|
97
|
+
- Use `${CLAUDE_PLUGIN_ROOT}` for all file path references
|
|
98
|
+
- Validate all inputs at function boundaries before processing
|
|
99
|
+
- Create feature branches; merge to main via pull request
|
|
100
|
+
- Confirm destructive file operations with the user before execution
|
|
101
|
+
- Extract functions when they exceed a single screen of logic (~40 lines)
|
|
102
|
+
- Flatten nested callbacks using async/await or promise chains
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Why it works:** Each instruction states what to do. The model builds a positive mental model of correct behavior rather than a catalog of prohibited actions.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 4. Why Before What
|
|
110
|
+
|
|
111
|
+
### Antipattern: Bare Commands
|
|
112
|
+
|
|
113
|
+
```markdown
|
|
114
|
+
Always run `npm audit` before deploying.
|
|
115
|
+
Pin dependency versions in package.json.
|
|
116
|
+
Use lockfile in CI builds.
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Problem:** Instructions are followed mechanically. When a novel situation arises (e.g., a monorepo with multiple package.json files), the model has no principle to apply.
|
|
120
|
+
|
|
121
|
+
### Pattern: Rationale-Attached Instructions
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
Run `npm audit` before deploying -- supply chain attacks through
|
|
125
|
+
compromised dependencies are the most common vector for Node.js
|
|
126
|
+
applications. Pin dependency versions in package.json to prevent
|
|
127
|
+
unexpected breaking changes from upstream patches. Use lockfile
|
|
128
|
+
in CI builds to ensure reproducible deployments; without it,
|
|
129
|
+
CI and production may run different dependency trees.
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Why it works:** The model understands the underlying security principle. In novel situations (e.g., a Python project), it can apply the same principle by running `pip-audit` and pinning versions in `requirements.txt`.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 5. Examples Over Rules
|
|
137
|
+
|
|
138
|
+
### Antipattern: Rules Without Examples
|
|
139
|
+
|
|
140
|
+
```markdown
|
|
141
|
+
## Commit Messages
|
|
142
|
+
Write commit messages that are clear and descriptive.
|
|
143
|
+
Use the imperative mood. Keep the subject line under 72 characters.
|
|
144
|
+
Include a body when the change is non-trivial.
|
|
145
|
+
Reference related issues.
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Problem:** "Clear and descriptive" is subjective. Different models will interpret these rules differently.
|
|
149
|
+
|
|
150
|
+
### Pattern: Few-Shot Examples
|
|
151
|
+
|
|
152
|
+
````markdown
|
|
153
|
+
## Commit Messages
|
|
154
|
+
|
|
155
|
+
Follow this format:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
<type>(<scope>): <subject>
|
|
159
|
+
|
|
160
|
+
<body>
|
|
161
|
+
|
|
162
|
+
<footer>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Examples:**
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
fix(auth): prevent session fixation on password reset
|
|
169
|
+
|
|
170
|
+
The reset flow was reusing the existing session ID, allowing an
|
|
171
|
+
attacker who set the initial session to maintain access after
|
|
172
|
+
the victim resets their password. Generate a new session ID
|
|
173
|
+
after successful password reset.
|
|
174
|
+
|
|
175
|
+
Closes #2847
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
feat(api): add rate limiting to public endpoints
|
|
180
|
+
|
|
181
|
+
Public endpoints were unbounded, enabling abuse via automated
|
|
182
|
+
requests. Apply 100 req/min per IP with 429 responses and
|
|
183
|
+
Retry-After headers.
|
|
184
|
+
|
|
185
|
+
Refs #3012
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
refactor(db): extract connection pooling into shared module
|
|
190
|
+
|
|
191
|
+
Three services duplicated connection pool configuration with
|
|
192
|
+
minor variations. Consolidate into shared module with
|
|
193
|
+
per-service overrides via environment variables.
|
|
194
|
+
```
|
|
195
|
+
````
|
|
196
|
+
|
|
197
|
+
**Why it works:** Three examples communicate format, tone, detail level, and rationale style simultaneously. No ambiguity about what "clear and descriptive" means in this context.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## 6. Progressive Disclosure
|
|
202
|
+
|
|
203
|
+
### Antipattern: Everything in SKILL.md
|
|
204
|
+
|
|
205
|
+
```markdown
|
|
206
|
+
---
|
|
207
|
+
name: API Client
|
|
208
|
+
description: This skill should be used when building API clients.
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
# API Client Skill
|
|
212
|
+
|
|
213
|
+
[2,000 words of core instructions]
|
|
214
|
+
|
|
215
|
+
## Authentication Patterns
|
|
216
|
+
[1,500 words on OAuth, API keys, JWT, HMAC]
|
|
217
|
+
|
|
218
|
+
## Error Handling Reference
|
|
219
|
+
[1,200 words on retry strategies, circuit breakers]
|
|
220
|
+
|
|
221
|
+
## Rate Limiting Guide
|
|
222
|
+
[800 words on rate limit headers, backoff algorithms]
|
|
223
|
+
|
|
224
|
+
## API Schema Reference
|
|
225
|
+
[3,000 words of endpoint documentation]
|
|
226
|
+
|
|
227
|
+
Total: ~8,500 words -- loaded every time the skill activates
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Problem:** 8,500 words loaded on every activation. Most invocations need only the core instructions. Authentication details, rate limiting guides, and schema references are needed occasionally but consume context budget on every activation.
|
|
231
|
+
|
|
232
|
+
### Pattern: Tiered Distribution
|
|
233
|
+
|
|
234
|
+
**SKILL.md (~1,800 words):**
|
|
235
|
+
```markdown
|
|
236
|
+
---
|
|
237
|
+
name: API Client
|
|
238
|
+
description: This skill should be used when the user asks to "build an API client", "create an HTTP integration", "implement API authentication", or "handle API errors".
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
# API Client Skill
|
|
242
|
+
|
|
243
|
+
[1,500 words of core instructions]
|
|
244
|
+
|
|
245
|
+
## Quick Reference
|
|
246
|
+
|
|
247
|
+
| Task | See |
|
|
248
|
+
|---|---|
|
|
249
|
+
| Authentication | `references/auth-patterns.md` |
|
|
250
|
+
| Error handling | `references/error-handling.md` |
|
|
251
|
+
| Rate limiting | `references/rate-limiting.md` |
|
|
252
|
+
| API schemas | `references/api-schema.md` (search: "GET /endpoint") |
|
|
253
|
+
|
|
254
|
+
## Additional Resources
|
|
255
|
+
|
|
256
|
+
- **`references/auth-patterns.md`** -- OAuth, API keys, JWT, HMAC patterns
|
|
257
|
+
- **`references/error-handling.md`** -- Retry strategies, circuit breakers
|
|
258
|
+
- **`references/rate-limiting.md`** -- Rate limit headers, backoff algorithms
|
|
259
|
+
- **`references/api-schema.md`** -- Complete endpoint documentation
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Why it works:** Core instructions load on every activation (1,800 words). Detailed references load only when the specific topic arises. Total content available is the same; context cost on typical invocations drops by ~75%.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## 7. Ambiguity Policy
|
|
267
|
+
|
|
268
|
+
### Antipattern: No Ambiguity Policy
|
|
269
|
+
|
|
270
|
+
```markdown
|
|
271
|
+
## Instructions
|
|
272
|
+
Process the user's request and generate appropriate code.
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Problem:** When the user says "build a login page," should the skill assume React or ask? Should it include password reset or just login? Should it use session cookies or JWT? Without policy, behavior is unpredictable.
|
|
276
|
+
|
|
277
|
+
### Pattern: Explicit Ambiguity Handling
|
|
278
|
+
|
|
279
|
+
```markdown
|
|
280
|
+
## Ambiguity Policy
|
|
281
|
+
|
|
282
|
+
- **Framework:** If the project contains framework markers (package.json with React, settings.py with Django), use the detected framework. Otherwise, ask.
|
|
283
|
+
- **Scope:** Present the interpreted scope and await confirmation before implementing. Example: "Interpretation: login page with email/password, session-based auth, no password reset. Proceed?"
|
|
284
|
+
- **Style:** Default to the project's existing code style. If no precedent exists, follow the language community's dominant convention.
|
|
285
|
+
- **Dependencies:** Prefer dependencies already in the project. Propose new dependencies with justification before adding.
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Why it works:** Each category of ambiguity has a clear resolution strategy. Behavior becomes predictable. The model knows when to assume and when to ask.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 8. Contradictions
|
|
293
|
+
|
|
294
|
+
### Antipattern: Contradictory Instructions
|
|
295
|
+
|
|
296
|
+
```markdown
|
|
297
|
+
Keep responses concise and to the point.
|
|
298
|
+
|
|
299
|
+
...
|
|
300
|
+
|
|
301
|
+
Always provide comprehensive explanations with full context,
|
|
302
|
+
background, and step-by-step reasoning for every decision.
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Problem:** "Concise" contradicts "comprehensive with full context." The model must choose, and the choice is unpredictable. Different invocations may resolve the contradiction differently.
|
|
306
|
+
|
|
307
|
+
### Pattern: Context-Dependent Instructions
|
|
308
|
+
|
|
309
|
+
```markdown
|
|
310
|
+
## Response Calibration
|
|
311
|
+
|
|
312
|
+
Match response depth to request complexity:
|
|
313
|
+
- **Quick questions** (factual lookups, syntax queries): Direct answer, 1-3 sentences.
|
|
314
|
+
- **Implementation tasks** (build X, fix Y): Present approach, await approval, then implement with inline rationale for non-obvious decisions.
|
|
315
|
+
- **Architecture discussions** (design X, evaluate tradeoffs): Comprehensive analysis with tradeoffs, recommendations, and reasoning.
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
**Why it works:** No contradiction. Response depth is a function of request type. The model applies the appropriate level for each interaction.
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## 9. Skill Scope
|
|
323
|
+
|
|
324
|
+
### Antipattern: Kitchen Sink Skill
|
|
325
|
+
|
|
326
|
+
```yaml
|
|
327
|
+
---
|
|
328
|
+
name: Development Helper
|
|
329
|
+
description: This skill should be used when the user asks about coding, testing, deployment, database management, API design, code review, documentation, CI/CD, security, or performance optimization.
|
|
330
|
+
---
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**Problem:** Activates on nearly every development query. Competes with every other skill. Instructions are necessarily shallow across all domains.
|
|
334
|
+
|
|
335
|
+
### Pattern: Focused Skill
|
|
336
|
+
|
|
337
|
+
```yaml
|
|
338
|
+
---
|
|
339
|
+
name: Database Migration Builder
|
|
340
|
+
description: This skill should be used when the user asks to "create a migration", "alter a database table", "add a column", "write a schema change", or discusses migration dependencies, rollback strategies, or data migration scripts. Covers SQL and ORM-based migrations.
|
|
341
|
+
---
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Why it works:** Narrow trigger surface. Activates precisely when needed. Instructions can be deep and specific because the scope is constrained.
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## 10. Agentic Persistence
|
|
349
|
+
|
|
350
|
+
### Antipattern: No Persistence Guidance
|
|
351
|
+
|
|
352
|
+
```markdown
|
|
353
|
+
Complete the requested task.
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**Problem:** The model may stop at the first obstacle, produce a partial result, or ask the user for help when it could resolve the issue independently with available tools.
|
|
357
|
+
|
|
358
|
+
### Pattern: Explicit Persistence Policy
|
|
359
|
+
|
|
360
|
+
```markdown
|
|
361
|
+
## Task Completion
|
|
362
|
+
|
|
363
|
+
Persist until the task is fully complete:
|
|
364
|
+
- When encountering errors, diagnose using available tools before asking the user.
|
|
365
|
+
- When a file is not found, search the project structure before reporting failure.
|
|
366
|
+
- When tests fail, read the failure output, identify the cause, and fix.
|
|
367
|
+
- When blocked by missing information that cannot be inferred or discovered, state what is needed and ask.
|
|
368
|
+
|
|
369
|
+
Stop conditions:
|
|
370
|
+
- All acceptance criteria are met
|
|
371
|
+
- Tests pass (if applicable)
|
|
372
|
+
- The user explicitly requests a stop
|
|
373
|
+
- A genuine blocker exists that requires user input
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
**Why it works:** Clear persistence policy with explicit stop conditions. The model knows when to keep working and when to stop. Reduces premature termination without causing infinite loops.
|