aiblueprint-cli 1.4.22 → 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/dist/cli.js +46 -3
- 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,389 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Claude 4 context window management, long-horizon reasoning strategies, and state tracking best practices from Anthropic's official documentation.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<context_windows>
|
|
6
|
+
|
|
7
|
+
<size_limits>
|
|
8
|
+
**Standard models:** 200,000 tokens
|
|
9
|
+
**Claude.ai Enterprise:** 500,000 tokens
|
|
10
|
+
**Claude Sonnet 4 and 4.5** (beta, tier 4+ orgs): 1,000,000 tokens
|
|
11
|
+
|
|
12
|
+
**Premium pricing:** Requests exceeding 200K tokens incur 2x input, 1.5x output pricing.
|
|
13
|
+
</size_limits>
|
|
14
|
+
|
|
15
|
+
<how_context_accumulates>
|
|
16
|
+
Each user message and assistant response accumulates within the context window. Previous exchanges remain intact, creating linear growth.
|
|
17
|
+
|
|
18
|
+
**Each turn consists of:**
|
|
19
|
+
- Input phase: prior history + current message
|
|
20
|
+
- Output phase: response that becomes future input
|
|
21
|
+
|
|
22
|
+
**Extended thinking integration:**
|
|
23
|
+
All tokens (including thinking blocks) count toward limits. However, thinking blocks are automatically stripped from subsequent turns, preserving token capacity.
|
|
24
|
+
|
|
25
|
+
Formula: `context_window = (input_tokens - previous_thinking_tokens) + current_turn_tokens`
|
|
26
|
+
|
|
27
|
+
During tool use with extended thinking, thinking blocks must accompany tool results to maintain reasoning continuity, then can be dropped afterward.
|
|
28
|
+
</how_context_accumulates>
|
|
29
|
+
|
|
30
|
+
<context_awareness>
|
|
31
|
+
**Claude Sonnet 4.5 and Haiku 4.5** include context awareness - tracking remaining tokens throughout conversations.
|
|
32
|
+
|
|
33
|
+
Models receive:
|
|
34
|
+
- Initial budget information
|
|
35
|
+
- Periodic updates on remaining capacity
|
|
36
|
+
|
|
37
|
+
This enables more effective task execution and resource management.
|
|
38
|
+
|
|
39
|
+
**Key instruction for systems with auto-compaction:**
|
|
40
|
+
```xml
|
|
41
|
+
<context>
|
|
42
|
+
Your context window will be automatically compacted as it approaches
|
|
43
|
+
its limit, allowing you to continue working indefinitely from where
|
|
44
|
+
you left off.
|
|
45
|
+
</context>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This prevents Claude from artificially stopping work early when using systems like Claude Code that handle context compaction.
|
|
49
|
+
</context_awareness>
|
|
50
|
+
|
|
51
|
+
<best_practices>
|
|
52
|
+
- Use token counting API to estimate usage before sending requests
|
|
53
|
+
- Plan carefully to avoid exceeding limits; newer models return validation errors rather than silently truncating
|
|
54
|
+
- For long-running agent sessions, leverage context awareness to manage token expenditure strategically
|
|
55
|
+
- Image tokens count toward context budgets
|
|
56
|
+
</best_practices>
|
|
57
|
+
|
|
58
|
+
</context_windows>
|
|
59
|
+
|
|
60
|
+
<long_horizon_reasoning>
|
|
61
|
+
|
|
62
|
+
<core_capabilities>
|
|
63
|
+
Claude 4.5 excels at extended reasoning tasks with strong state management. The model maintains orientation across extended sessions by focusing on incremental progress.
|
|
64
|
+
|
|
65
|
+
Can work across multiple context windows by:
|
|
66
|
+
- Saving state to filesystem
|
|
67
|
+
- Continuing with fresh contexts
|
|
68
|
+
- Discovering state through files (tests, progress, git logs)
|
|
69
|
+
</core_capabilities>
|
|
70
|
+
|
|
71
|
+
<multi_context_strategies>
|
|
72
|
+
|
|
73
|
+
<strategy name="differentiated_first_context">
|
|
74
|
+
Start with framework setup (tests, scripts), then use subsequent windows for iterative work on task lists.
|
|
75
|
+
|
|
76
|
+
First context: Infrastructure
|
|
77
|
+
Later contexts: Task execution
|
|
78
|
+
</strategy>
|
|
79
|
+
|
|
80
|
+
<strategy name="structured_test_tracking">
|
|
81
|
+
Create tests before starting and maintain them in organized formats like `tests.json`.
|
|
82
|
+
|
|
83
|
+
**Critical instruction:**
|
|
84
|
+
```xml
|
|
85
|
+
<requirements>
|
|
86
|
+
It is unacceptable to remove or edit tests because this could lead to
|
|
87
|
+
missing or buggy functionality. Tests are the source of truth.
|
|
88
|
+
</requirements>
|
|
89
|
+
```
|
|
90
|
+
</strategy>
|
|
91
|
+
|
|
92
|
+
<strategy name="quality_of_life_tools">
|
|
93
|
+
Encourage Claude to build setup scripts (`init.sh`) for graceful server startup, test execution, and linting.
|
|
94
|
+
|
|
95
|
+
Benefits:
|
|
96
|
+
- Prevents repeated work across context windows
|
|
97
|
+
- Standardizes development workflow
|
|
98
|
+
- Enables quick verification
|
|
99
|
+
</strategy>
|
|
100
|
+
|
|
101
|
+
<strategy name="fresh_start_advantages">
|
|
102
|
+
Rather than context compaction, begin fresh and have Claude discover state through the filesystem.
|
|
103
|
+
|
|
104
|
+
**Prescriptive instruction:**
|
|
105
|
+
```xml
|
|
106
|
+
<instructions>
|
|
107
|
+
1. Review progress.txt for completed work
|
|
108
|
+
2. Check tests.json for test status
|
|
109
|
+
3. Examine git logs for implementation history
|
|
110
|
+
4. Continue from last checkpoint
|
|
111
|
+
</instructions>
|
|
112
|
+
```
|
|
113
|
+
</strategy>
|
|
114
|
+
|
|
115
|
+
<strategy name="verification_mechanisms">
|
|
116
|
+
Provide tools like Playwright for UI testing so Claude can verify work without continuous human feedback.
|
|
117
|
+
|
|
118
|
+
Self-verification enables autonomous task completion.
|
|
119
|
+
</strategy>
|
|
120
|
+
|
|
121
|
+
<strategy name="complete_context_usage">
|
|
122
|
+
Prompt Claude to work systematically through tasks:
|
|
123
|
+
|
|
124
|
+
```xml
|
|
125
|
+
<objective>
|
|
126
|
+
Continue working systematically until you have completed this task.
|
|
127
|
+
Use your full context window efficiently.
|
|
128
|
+
</objective>
|
|
129
|
+
```
|
|
130
|
+
</strategy>
|
|
131
|
+
|
|
132
|
+
</multi_context_strategies>
|
|
133
|
+
|
|
134
|
+
<state_management>
|
|
135
|
+
|
|
136
|
+
<structured_formats>
|
|
137
|
+
Use JSON for test results and task status - enables schema clarity.
|
|
138
|
+
|
|
139
|
+
**Example:**
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"tests": [
|
|
143
|
+
{"id": 1, "name": "authentication_flow", "status": "passing"}
|
|
144
|
+
],
|
|
145
|
+
"total": 200,
|
|
146
|
+
"passing": 150
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Benefits:**
|
|
151
|
+
- Machine-parseable
|
|
152
|
+
- Clear schema
|
|
153
|
+
- Easy validation
|
|
154
|
+
- Enables programmatic checks
|
|
155
|
+
</structured_formats>
|
|
156
|
+
|
|
157
|
+
<unstructured_notes>
|
|
158
|
+
Freeform progress tracking works well for general advancement context.
|
|
159
|
+
|
|
160
|
+
**Example progress.txt:**
|
|
161
|
+
```
|
|
162
|
+
Session 1: Created JWT middleware and types
|
|
163
|
+
Session 2: Implemented token refresh logic
|
|
164
|
+
Session 3: Added rate limiting (TODO: add tests)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Benefits:**
|
|
168
|
+
- Quick to write
|
|
169
|
+
- Human-readable
|
|
170
|
+
- Captures context and decisions
|
|
171
|
+
</unstructured_notes>
|
|
172
|
+
|
|
173
|
+
<git_integration>
|
|
174
|
+
Version control provides work logs and restoration checkpoints. Claude 4.5 performs exceptionally well leveraging git across sessions.
|
|
175
|
+
|
|
176
|
+
**Recommended instructions:**
|
|
177
|
+
```xml
|
|
178
|
+
<context>
|
|
179
|
+
Use git to track your work:
|
|
180
|
+
- Commit after each logical unit
|
|
181
|
+
- Write descriptive commit messages
|
|
182
|
+
- Use git log to understand previous sessions
|
|
183
|
+
- Check git diff before starting to see current state
|
|
184
|
+
</context>
|
|
185
|
+
```
|
|
186
|
+
</git_integration>
|
|
187
|
+
|
|
188
|
+
<incremental_tracking>
|
|
189
|
+
Explicitly request progress documentation and incremental advancement focus.
|
|
190
|
+
|
|
191
|
+
**Pattern:**
|
|
192
|
+
```xml
|
|
193
|
+
<requirements>
|
|
194
|
+
After completing each task:
|
|
195
|
+
1. Update progress.json with status
|
|
196
|
+
2. Update progress.txt with summary
|
|
197
|
+
3. Commit changes with descriptive message
|
|
198
|
+
4. Continue to next task
|
|
199
|
+
</requirements>
|
|
200
|
+
```
|
|
201
|
+
</incremental_tracking>
|
|
202
|
+
|
|
203
|
+
</state_management>
|
|
204
|
+
|
|
205
|
+
<key_principles>
|
|
206
|
+
Frame instructions to emphasize persistent, autonomous task completion despite context limitations, making clear that infrastructure handles windowing automatically.
|
|
207
|
+
|
|
208
|
+
**Effective framing:**
|
|
209
|
+
```xml
|
|
210
|
+
<objective>
|
|
211
|
+
Complete the entire feature implementation. Your context window
|
|
212
|
+
will be automatically managed, so focus on systematic progress
|
|
213
|
+
through all requirements.
|
|
214
|
+
</objective>
|
|
215
|
+
|
|
216
|
+
<requirements>
|
|
217
|
+
Work autonomously through the task list. Document progress in
|
|
218
|
+
progress.json and tests.json so you can resume seamlessly if needed.
|
|
219
|
+
</requirements>
|
|
220
|
+
```
|
|
221
|
+
</key_principles>
|
|
222
|
+
|
|
223
|
+
</long_horizon_reasoning>
|
|
224
|
+
|
|
225
|
+
<prompt_patterns>
|
|
226
|
+
|
|
227
|
+
<pattern name="context_aware_system_prompt">
|
|
228
|
+
For assistants that may work across multiple sessions:
|
|
229
|
+
|
|
230
|
+
```xml
|
|
231
|
+
<context>
|
|
232
|
+
You are working in Claude Code, which automatically manages your
|
|
233
|
+
context window. You can work indefinitely on complex tasks without
|
|
234
|
+
worrying about token limits.
|
|
235
|
+
|
|
236
|
+
Track your progress in:
|
|
237
|
+
- progress.json - structured task status
|
|
238
|
+
- progress.txt - session notes
|
|
239
|
+
- git commits - implementation history
|
|
240
|
+
</context>
|
|
241
|
+
|
|
242
|
+
<objective>
|
|
243
|
+
Complete the full task systematically. Use your context awareness
|
|
244
|
+
to manage token usage efficiently.
|
|
245
|
+
</objective>
|
|
246
|
+
```
|
|
247
|
+
</pattern>
|
|
248
|
+
|
|
249
|
+
<pattern name="state_recovery_prompt">
|
|
250
|
+
For resuming work after context refresh:
|
|
251
|
+
|
|
252
|
+
```xml
|
|
253
|
+
<instructions>
|
|
254
|
+
Before starting:
|
|
255
|
+
1. Read progress.json to understand completed tasks
|
|
256
|
+
2. Read progress.txt for context and decisions
|
|
257
|
+
3. Check git log --oneline -10 for recent work
|
|
258
|
+
4. Review tests.json for test status
|
|
259
|
+
5. Continue from the next incomplete task
|
|
260
|
+
</instructions>
|
|
261
|
+
|
|
262
|
+
<requirements>
|
|
263
|
+
Never redo completed work. Always verify current state before
|
|
264
|
+
proceeding.
|
|
265
|
+
</requirements>
|
|
266
|
+
```
|
|
267
|
+
</pattern>
|
|
268
|
+
|
|
269
|
+
<pattern name="test_first_long_horizon">
|
|
270
|
+
For complex implementations across multiple context windows:
|
|
271
|
+
|
|
272
|
+
```xml
|
|
273
|
+
<objective>
|
|
274
|
+
Implement {feature} with complete test coverage. Tests are the
|
|
275
|
+
source of truth and must never be removed or edited to pass.
|
|
276
|
+
</objective>
|
|
277
|
+
|
|
278
|
+
<phase_1_setup>
|
|
279
|
+
1. Create tests.json with all required tests (status: "pending")
|
|
280
|
+
2. Create init.sh for dev environment setup
|
|
281
|
+
3. Commit infrastructure before starting implementation
|
|
282
|
+
</phase_1_setup>
|
|
283
|
+
|
|
284
|
+
<phase_2_implementation>
|
|
285
|
+
For each test in tests.json:
|
|
286
|
+
1. Implement the feature code
|
|
287
|
+
2. Run the test
|
|
288
|
+
3. If passing: Update tests.json status to "passing"
|
|
289
|
+
4. If failing: Fix code (never edit test)
|
|
290
|
+
5. Commit when passing
|
|
291
|
+
6. Continue to next test
|
|
292
|
+
</phase_2_implementation>
|
|
293
|
+
|
|
294
|
+
<verification>
|
|
295
|
+
All tests.json entries must show "passing" before task is complete.
|
|
296
|
+
</verification>
|
|
297
|
+
```
|
|
298
|
+
</pattern>
|
|
299
|
+
|
|
300
|
+
<pattern name="parallel_research_long_horizon">
|
|
301
|
+
For research tasks that may span multiple contexts:
|
|
302
|
+
|
|
303
|
+
```xml
|
|
304
|
+
<objective>
|
|
305
|
+
Research {topic} comprehensively. Save findings incrementally to
|
|
306
|
+
enable resumption if context refreshes.
|
|
307
|
+
</objective>
|
|
308
|
+
|
|
309
|
+
<instructions>
|
|
310
|
+
1. Create research-outline.md with all areas to investigate
|
|
311
|
+
2. For each area:
|
|
312
|
+
a. Research thoroughly
|
|
313
|
+
b. Append findings to findings.md
|
|
314
|
+
c. Update research-outline.md to mark completed
|
|
315
|
+
d. Commit progress
|
|
316
|
+
3. When all areas complete, synthesize into final-research.md
|
|
317
|
+
</instructions>
|
|
318
|
+
|
|
319
|
+
<output_format>
|
|
320
|
+
findings.md should be append-only with clear section markers:
|
|
321
|
+
```
|
|
322
|
+
## Area 1: Authentication Methods [COMPLETE]
|
|
323
|
+
...
|
|
324
|
+
|
|
325
|
+
## Area 2: Session Management [COMPLETE]
|
|
326
|
+
...
|
|
327
|
+
|
|
328
|
+
## Area 3: Rate Limiting [IN PROGRESS]
|
|
329
|
+
...
|
|
330
|
+
```
|
|
331
|
+
</output_format>
|
|
332
|
+
```
|
|
333
|
+
</pattern>
|
|
334
|
+
|
|
335
|
+
</prompt_patterns>
|
|
336
|
+
|
|
337
|
+
<when_to_use>
|
|
338
|
+
|
|
339
|
+
<context_awareness_instructions>
|
|
340
|
+
Use when:
|
|
341
|
+
- Building agents that may work across multiple sessions
|
|
342
|
+
- Tasks likely to use >50% of context window
|
|
343
|
+
- Long-running implementations with multiple phases
|
|
344
|
+
- Research that may need to be paused and resumed
|
|
345
|
+
|
|
346
|
+
Don't use when:
|
|
347
|
+
- Simple, single-shot tasks
|
|
348
|
+
- Tasks with clear completion in <10K tokens
|
|
349
|
+
- One-off code generation
|
|
350
|
+
</context_awareness_instructions>
|
|
351
|
+
|
|
352
|
+
<state_tracking_patterns>
|
|
353
|
+
Use when:
|
|
354
|
+
- Task has >5 distinct subtasks
|
|
355
|
+
- Implementation may span hours or days
|
|
356
|
+
- Multiple people may need to understand progress
|
|
357
|
+
- Resumability is important
|
|
358
|
+
|
|
359
|
+
Don't use when:
|
|
360
|
+
- Quick fixes or patches
|
|
361
|
+
- Single-file modifications
|
|
362
|
+
- Tasks with no meaningful checkpoints
|
|
363
|
+
</state_tracking_patterns>
|
|
364
|
+
|
|
365
|
+
</when_to_use>
|
|
366
|
+
|
|
367
|
+
<anti_patterns>
|
|
368
|
+
|
|
369
|
+
<pitfall name="over_documenting_simple_tasks">
|
|
370
|
+
❌ Adding progress.json for a 3-line bug fix
|
|
371
|
+
✅ Simple tasks don't need state tracking overhead
|
|
372
|
+
</pitfall>
|
|
373
|
+
|
|
374
|
+
<pitfall name="vague_progress_updates">
|
|
375
|
+
❌ "Made progress on auth" in progress.txt
|
|
376
|
+
✅ "Implemented JWT signing with jose library, created middleware.ts, next: refresh token rotation"
|
|
377
|
+
</pitfall>
|
|
378
|
+
|
|
379
|
+
<pitfall name="ignoring_context_limits">
|
|
380
|
+
❌ "Complete this entire 50-file refactor in one response"
|
|
381
|
+
✅ "Refactor files systematically, tracking progress in refactor-status.json"
|
|
382
|
+
</pitfall>
|
|
383
|
+
|
|
384
|
+
<pitfall name="forgetting_to_inform_about_compaction">
|
|
385
|
+
❌ Not telling Claude about automatic context management
|
|
386
|
+
✅ "Your context will be automatically compacted, continue working indefinitely"
|
|
387
|
+
</pitfall>
|
|
388
|
+
|
|
389
|
+
</anti_patterns>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Few-shot prompting uses input/output examples to guide model behavior.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<when_to_use>
|
|
6
|
+
- Output format has nuances text can't capture
|
|
7
|
+
- Pattern recognition easier than rule following
|
|
8
|
+
- Edge cases need demonstration
|
|
9
|
+
- Consistency across outputs matters
|
|
10
|
+
</when_to_use>
|
|
11
|
+
|
|
12
|
+
<structure>
|
|
13
|
+
```xml
|
|
14
|
+
<examples>
|
|
15
|
+
<example number="1">
|
|
16
|
+
<input>Added user authentication</input>
|
|
17
|
+
<output>feat(auth): implement user authentication</output>
|
|
18
|
+
</example>
|
|
19
|
+
|
|
20
|
+
<example number="2">
|
|
21
|
+
<input>Fixed date display bug</input>
|
|
22
|
+
<output>fix(ui): correct date formatting</output>
|
|
23
|
+
</example>
|
|
24
|
+
|
|
25
|
+
<example number="3">
|
|
26
|
+
<input>Updated README</input>
|
|
27
|
+
<output>docs: update README with setup instructions</output>
|
|
28
|
+
</example>
|
|
29
|
+
</examples>
|
|
30
|
+
```
|
|
31
|
+
</structure>
|
|
32
|
+
|
|
33
|
+
<best_practices>
|
|
34
|
+
- Use 2-4 examples (usually sufficient)
|
|
35
|
+
- Cover common cases AND edge cases
|
|
36
|
+
- Ensure examples match desired behavior exactly
|
|
37
|
+
- Show variety in inputs
|
|
38
|
+
- Keep examples consistent in format
|
|
39
|
+
</best_practices>
|
|
40
|
+
|
|
41
|
+
<example_selection>
|
|
42
|
+
Choose examples that demonstrate:
|
|
43
|
+
1. Typical/common case
|
|
44
|
+
2. Edge case or exception
|
|
45
|
+
3. Format nuances (spacing, capitalization)
|
|
46
|
+
4. Boundary conditions
|
|
47
|
+
</example_selection>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
GPT-specific prompting techniques from OpenAI's official documentation.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<six_strategies>
|
|
6
|
+
<strategy name="clear_instructions">
|
|
7
|
+
Be specific about format, length, style:
|
|
8
|
+
- Include details for relevant answers
|
|
9
|
+
- Ask model to adopt a persona
|
|
10
|
+
- Use delimiters for distinct parts
|
|
11
|
+
- Specify steps required
|
|
12
|
+
- Provide examples (few-shot)
|
|
13
|
+
</strategy>
|
|
14
|
+
|
|
15
|
+
<strategy name="reference_text">
|
|
16
|
+
Ground answers with reference material:
|
|
17
|
+
- Instruct to answer using reference
|
|
18
|
+
- Reduces hallucinations
|
|
19
|
+
</strategy>
|
|
20
|
+
|
|
21
|
+
<strategy name="split_tasks">
|
|
22
|
+
Break complex tasks into subtasks:
|
|
23
|
+
- Use intent classification
|
|
24
|
+
- Summarize long documents piecewise
|
|
25
|
+
</strategy>
|
|
26
|
+
|
|
27
|
+
<strategy name="time_to_think">
|
|
28
|
+
Let the model reason step-by-step:
|
|
29
|
+
- Instruct to work out solution first
|
|
30
|
+
- Ask if it missed anything
|
|
31
|
+
</strategy>
|
|
32
|
+
|
|
33
|
+
<strategy name="external_tools">
|
|
34
|
+
Offload to specialized systems:
|
|
35
|
+
- Code execution for calculations
|
|
36
|
+
- Embeddings for retrieval
|
|
37
|
+
</strategy>
|
|
38
|
+
|
|
39
|
+
<strategy name="test_systematically">
|
|
40
|
+
Iterate and evaluate:
|
|
41
|
+
- Test against gold-standard answers
|
|
42
|
+
- A/B test variations
|
|
43
|
+
</strategy>
|
|
44
|
+
</six_strategies>
|
|
45
|
+
|
|
46
|
+
<additional>
|
|
47
|
+
- Few-shot: Include input/output examples
|
|
48
|
+
- Temperature 0 for factual tasks
|
|
49
|
+
- Markdown headers for structure (GPT-4+)
|
|
50
|
+
</additional>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Ready-to-use prompt templates for common tasks.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<templates>
|
|
6
|
+
<template name="analysis">
|
|
7
|
+
```xml
|
|
8
|
+
<context>
|
|
9
|
+
[Background information]
|
|
10
|
+
</context>
|
|
11
|
+
|
|
12
|
+
<objective>
|
|
13
|
+
Analyze [subject] to identify [what to find].
|
|
14
|
+
</objective>
|
|
15
|
+
|
|
16
|
+
<data>
|
|
17
|
+
[Content to analyze]
|
|
18
|
+
</data>
|
|
19
|
+
|
|
20
|
+
<output_format>
|
|
21
|
+
## Key Findings
|
|
22
|
+
- Finding 1 with evidence
|
|
23
|
+
- Finding 2 with evidence
|
|
24
|
+
|
|
25
|
+
## Recommendations
|
|
26
|
+
1. Action item
|
|
27
|
+
2. Action item
|
|
28
|
+
</output_format>
|
|
29
|
+
```
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<template name="transformation">
|
|
33
|
+
```xml
|
|
34
|
+
<objective>
|
|
35
|
+
Transform [input type] to [output type].
|
|
36
|
+
</objective>
|
|
37
|
+
|
|
38
|
+
<input>
|
|
39
|
+
[Data to transform]
|
|
40
|
+
</input>
|
|
41
|
+
|
|
42
|
+
<rules>
|
|
43
|
+
1. [Transformation rule]
|
|
44
|
+
2. [Transformation rule]
|
|
45
|
+
</rules>
|
|
46
|
+
|
|
47
|
+
<edge_cases>
|
|
48
|
+
- If [condition], then [action]
|
|
49
|
+
- If [condition], then [action]
|
|
50
|
+
</edge_cases>
|
|
51
|
+
|
|
52
|
+
<example>
|
|
53
|
+
<input>[Sample input]</input>
|
|
54
|
+
<output>[Expected output]</output>
|
|
55
|
+
</example>
|
|
56
|
+
```
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<template name="generation">
|
|
60
|
+
```xml
|
|
61
|
+
<context>
|
|
62
|
+
[Background and purpose]
|
|
63
|
+
</context>
|
|
64
|
+
|
|
65
|
+
<task>
|
|
66
|
+
Generate [what to create] for [audience/purpose].
|
|
67
|
+
</task>
|
|
68
|
+
|
|
69
|
+
<requirements>
|
|
70
|
+
- [Requirement 1]
|
|
71
|
+
- [Requirement 2]
|
|
72
|
+
</requirements>
|
|
73
|
+
|
|
74
|
+
<style>
|
|
75
|
+
- Tone: [formal/casual/technical]
|
|
76
|
+
- Length: [specific constraints]
|
|
77
|
+
- Format: [structure requirements]
|
|
78
|
+
</style>
|
|
79
|
+
|
|
80
|
+
<example>
|
|
81
|
+
[Sample of desired output]
|
|
82
|
+
</example>
|
|
83
|
+
```
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<template name="code_review">
|
|
87
|
+
```xml
|
|
88
|
+
<objective>
|
|
89
|
+
Review code for [bugs/security/performance/style].
|
|
90
|
+
</objective>
|
|
91
|
+
|
|
92
|
+
<code>
|
|
93
|
+
[Code to review]
|
|
94
|
+
</code>
|
|
95
|
+
|
|
96
|
+
<focus_areas>
|
|
97
|
+
- [Area 1]
|
|
98
|
+
- [Area 2]
|
|
99
|
+
</focus_areas>
|
|
100
|
+
|
|
101
|
+
<output_format>
|
|
102
|
+
For each issue:
|
|
103
|
+
- Location: [file:line]
|
|
104
|
+
- Severity: [critical/warning/suggestion]
|
|
105
|
+
- Issue: [description]
|
|
106
|
+
- Fix: [code example]
|
|
107
|
+
</output_format>
|
|
108
|
+
```
|
|
109
|
+
</template>
|
|
110
|
+
</templates>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Chain of thought and reasoning techniques improve performance on complex tasks.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<chain_of_thought>
|
|
6
|
+
**Basic**: Add "Think step by step before answering"
|
|
7
|
+
|
|
8
|
+
**Guided**: Structure the reasoning process:
|
|
9
|
+
"First analyze the requirements, then identify potential approaches, evaluate trade-offs, and finally recommend a solution."
|
|
10
|
+
</chain_of_thought>
|
|
11
|
+
|
|
12
|
+
<extended_thinking>
|
|
13
|
+
For Claude, use thinking tags:
|
|
14
|
+
```xml
|
|
15
|
+
<thinking>
|
|
16
|
+
Analyze the problem...
|
|
17
|
+
Consider options...
|
|
18
|
+
Evaluate trade-offs...
|
|
19
|
+
</thinking>
|
|
20
|
+
|
|
21
|
+
<answer>
|
|
22
|
+
Based on analysis, the recommendation is...
|
|
23
|
+
</answer>
|
|
24
|
+
```
|
|
25
|
+
</extended_thinking>
|
|
26
|
+
|
|
27
|
+
<when_to_use>
|
|
28
|
+
- Math and logic problems
|
|
29
|
+
- Multi-step analysis
|
|
30
|
+
- Complex decisions with trade-offs
|
|
31
|
+
- Code debugging
|
|
32
|
+
- Comparative evaluation
|
|
33
|
+
</when_to_use>
|
|
34
|
+
|
|
35
|
+
<structured_reasoning>
|
|
36
|
+
For specific domains:
|
|
37
|
+
|
|
38
|
+
```xml
|
|
39
|
+
<analysis_framework>
|
|
40
|
+
1. Identify the core problem
|
|
41
|
+
2. List constraints and requirements
|
|
42
|
+
3. Generate 2-3 potential solutions
|
|
43
|
+
4. Evaluate each against criteria
|
|
44
|
+
5. Recommend with justification
|
|
45
|
+
</analysis_framework>
|
|
46
|
+
```
|
|
47
|
+
</structured_reasoning>
|
|
48
|
+
|
|
49
|
+
<inner_monologue>
|
|
50
|
+
Hide reasoning from final output when needed:
|
|
51
|
+
"Work through your reasoning internally, then provide only the final answer."
|
|
52
|
+
</inner_monologue>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
System prompts establish persistent behavior, role, and constraints.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<structure>
|
|
6
|
+
```xml
|
|
7
|
+
<role>
|
|
8
|
+
You are an expert [domain] assistant specializing in [specific area].
|
|
9
|
+
</role>
|
|
10
|
+
|
|
11
|
+
<behavior>
|
|
12
|
+
- Always [key behavior]
|
|
13
|
+
- Never [prohibited action]
|
|
14
|
+
- When uncertain, [fallback behavior]
|
|
15
|
+
</behavior>
|
|
16
|
+
|
|
17
|
+
<output_style>
|
|
18
|
+
- Tone: [professional/casual/technical]
|
|
19
|
+
- Format: [structured/conversational]
|
|
20
|
+
- Length: [concise/detailed]
|
|
21
|
+
</output_style>
|
|
22
|
+
|
|
23
|
+
<constraints>
|
|
24
|
+
- Do not [limitation]
|
|
25
|
+
- Always verify [requirement]
|
|
26
|
+
- Prioritize [priority]
|
|
27
|
+
</constraints>
|
|
28
|
+
```
|
|
29
|
+
</structure>
|
|
30
|
+
|
|
31
|
+
<patterns>
|
|
32
|
+
<pattern name="expert_role">
|
|
33
|
+
"You are a senior software engineer with 10+ years of experience in distributed systems. You prioritize code quality, maintainability, and performance."
|
|
34
|
+
</pattern>
|
|
35
|
+
|
|
36
|
+
<pattern name="task_specific">
|
|
37
|
+
"You are a code reviewer. Analyze code for bugs, security issues, and performance problems. Provide specific, actionable feedback with code examples."
|
|
38
|
+
</pattern>
|
|
39
|
+
|
|
40
|
+
<pattern name="constrained">
|
|
41
|
+
"You are a technical writer. Write documentation in plain language. Avoid jargon. Use examples liberally. Keep paragraphs under 3 sentences."
|
|
42
|
+
</pattern>
|
|
43
|
+
</patterns>
|
|
44
|
+
|
|
45
|
+
<placement>
|
|
46
|
+
- System message: Role, persistent behavior, high-level context
|
|
47
|
+
- User message: Specific task, details, data to process
|
|
48
|
+
</placement>
|