/platform:context-engineeringfrom platform
Guides designing prompts, system prompts, and context windows for Claude using Anthropic's official prompt engineering techniques. Useful for API calls, agent instructions, and chain-of-thought reasoning.
Ships in platform. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Context engineering is the practice of designing the entire context window—system prompts, examples, structure, instructions, and data—to maximize Claude's performance. This skill distills Anthropic's official prompt engineering documentation into actionable guidance.
Apply techniques in order of effectiveness. Not all tasks require all techniques.
| Priority | Technique | Best For |
|---|---|---|
| 1 | Be clear and direct | All tasks |
| 2 | Use examples (multishot) | Format consistency, complex patterns |
| 3 | Chain of thought | Math, logic, analysis, complex reasoning |
| 4 | XML tags | Multi-part prompts, structured I/O |
| 5 | Role prompting | Domain expertise, tone adjustment |
| 6 | Prefill response | Output format control, character consistency |
| 7 | Chain prompts | Multi-step workflows, error isolation |
| 8 | Long context tips | Documents >20K tokens |
| 9 | Extended thinking | Complex STEM, constraint optimization |
Think of Claude as a brilliant new employee who needs explicit instructions.
The Golden Rule: Show the prompt to a colleague with minimal context. If they're confused, Claude will be too.
Key Practices:
Instructions:
Data to process: {{FEEDBACK_DATA}}
Examples dramatically improve accuracy, consistency, and quality.
Best Practices:
<example> tags (nest within <examples> if multiple)Now analyze: {{FEEDBACK}}
Encourage Claude to break down problems step-by-step for complex reasoning tasks.
When to Use:
When to Avoid:
Complexity Levels:
| Level | Approach | Example |
|---|---|---|
| Basic | "Think step-by-step" | Quick, less guided |
| Guided | Outline specific steps | More control over reasoning |
| Structured | Use <thinking> and <answer> tags | Easy to parse, separates reasoning from output |
Program info: {{PROGRAM_DETAILS}} Donor info: {{DONOR_DETAILS}}
Think before writing in tags:
Then write the email in tags.
Use XML tags to structure prompts with multiple components.
Benefits:
Best Practices:
<outer><inner></inner></outer><contract> tags..."<instructions>, <context>, <examples>, <data>)See references/xml-tags.md for detailed patterns.
Use the system parameter to set Claude's role and dramatically improve domain performance.
Benefits:
Best Practices:
system parameter, task in user turnGuide outputs by prefilling the Assistant message.
Use Cases:
{ for JSON)Constraints:
<character_maintenance> user: What do you deduce about this shoe? assistant: [Sherlock Holmes] </character_maintenance>
Break complex tasks into sequential subtasks for better accuracy.
When to Chain:
Benefits:
Patterns:
For prompts with substantial data (20K+ tokens):
Key Practices:
Put data at the top: Place long documents above queries/instructions (up to 30% quality improvement)
Structure with XML: Wrap documents with metadata
<documents>
<document index="1">
<source>annual_report.pdf</source>
<document_content>{{CONTENT}}</document_content>
</document>
</documents>
See references/long-context.md for detailed patterns.
For complex problems requiring deep reasoning:
Best Practices:
Best Use Cases:
See references/extended-thinking.md for detailed patterns.
| Goal | Technique |
|---|---|
| JSON output | Prefill with { |
| Specific structure | Provide example in <example> tags |
| No preamble | Prefill or explicit instruction |
| Consistent format | Multishot examples |
| Problem | Solution |
|---|---|
| Misses instructions | Number steps, be explicit |
| Inconsistent format | Add examples |
| Wrong reasoning | Add CoT with structured output |
| Misses context | Add role prompting |
| Drops steps | Chain into separate prompts |
When optimizing or compressing an existing prompt, apply these checks after every structural change:
| Pitfall | Check |
|---|---|
| Stale cross-references | After renaming or renumbering steps, search for ALL references to old labels (jump targets, "see Step X", resume points) and update them |
| Over-abstraction | If the model needs exact values to execute (specific keys, field names, command arguments), keep them literal even if they look repetitive. A generic placeholder the model cannot expand is worse than duplication |
| Lost preconditions | When merging or removing steps, verify that any precondition checks or guards in the removed step are preserved elsewhere |
| Dropped qualifiers | Single modifiers like only, when appropriate, unless X, if it affects Y, must, never, always are load-bearing constraints that look like filler during compression. For every modifier deleted, confirm the constraint it carried is preserved or that dropping it is the intended behavior change |
| Silent behavior changes | Diff the before/after and confirm every deleted line is either redundant or relocated, not dropped |
Validation Pass (run before declaring a refactor done):
| Tag | Purpose |
|---|---|
<instructions> | Task directives |
<context> | Background information |
<example> / <examples> | Few-shot demonstrations |
<data> / <document> | Input content |
<thinking> | Chain of thought reasoning |
<answer> / <output> | Final response |
<constraints> | Limitations or requirements |
For detailed guidance on specific techniques:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/claude-code-expertThis skill should be used when working with Claude Code infrastructure including agents, skills, slash commands, hooks, plugins, settings.json, or CLAUDE.md files. Triggers on YAML frontmatter, .claude/ directory files, Task tool configuration, or hook debugging. Do NOT use for creating NEW skills from scratch - use claude-creator instead./skill-creatorGuide for creating NEW skills from scratch. This skill should be used when users want to create a new skill or scaffold a skill directory. Triggers on "create a skill", "new skill", or "scaffold skill". Do NOT use for updating existing skills - use claude-code-expert instead./upload-artifactnpx claudepluginhub closedloop-ai/claude-plugins --plugin platformOther plugins' skills for the same job