system-prompt-writer
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when writing or improving system prompts for AI agents, providing expert guidance based on Anthropic's context engineering principles.
Об этом скилле
System Prompt Writer Skill
This skill provides comprehensive guidelines for writing effective system prompts for AI agents, based on Anthropic's "Effective Context Engineering for AI Agents" principles.
Core Philosophy: Context Engineering
Context Engineering is the art and science of curating what goes into the limited context window. The key principle is:
"Find the minimum effective dose of information - the smallest possible set of high-signal tokens that maximize the likelihood of the desired outcome."
System Prompt Writing Guidelines
1. Write at the "Right Altitude"
System prompts should be in the Goldilocks zone - not too rigid, not too vague.
Too Rigid (Avoid):
When the user asks about weather, first check the database, then validate the ZIP code format using regex pattern ^\d{5}(?:[-\s]\d{4})?$, then call get_weather_data with exactly these parameters...
Too Vague (Avoid):
Help users with their questions.
Just Right (Use):
You are a weather assistant. When users ask about weather:
1. Validate location information
2. Use available tools to fetch current weather data
3. Present information in a clear, conversational format
4. If data is unavailable, explain why and suggest alternatives
2. Minimum Effective Information
Key Question: Determine the smallest amount of context needed for the agent to succeed.
Important Note:
"Minimal does not necessarily mean short; sufficient information must be provided to the agent up front to ensure it adheres to the desired behavior."
Focus on high-signal tokens that drive behavior, not arbitrary brevity.
Before (Over-specified with low-signal information):
You are a customer service agent for Acme Corp, founded in 1985 by John Smith in Seattle, Washington. Our company values are integrity, innovation, and customer satisfaction. We sell widgets, gadgets, and accessories. Our business hours are Monday-Friday 9am-5pm PST. We have 500 employees across 3 locations...
After (Optimized - minimal but sufficient):
You are an Acme Corp customer service agent. Help customers with product inquiries, orders, and support issues. Use available tools to access order history and product information. Escalate complex technical issues to specialists.
The optimized version is shorter AND higher-signal. However, if the agent needs detailed decision-making criteria to function correctly, include them - minimal doesn't mean inadequate.
3. Structure for Clarity
Anthropic Recommendation:
"We recommend organizing prompts into distinct sections (like
<background_information>,<instructions>,## Tool guidance,## Output description, etc) and using techniques like XML tagging or Markdown headers to delineate these sections."
The Hybrid Approach: Markdown + XML
Use Markdown headers for major sections and XML tags for content within each section. This combines:
- Readability (Markdown headers are visual and familiar)
- Structure (XML tags clearly delineate content and support programmatic parsing)
- Flexibility (Matches Anthropic's actual examples and recommendations)
CRITICAL: Template Variable Escaping Rules
The project uses a template system (src/prompts/template.py) that processes system prompts with variable substitution using Python's .format() method. Understanding and applying the correct escaping is MANDATORY.
How the Template System Works:
# template.py uses this pattern:
system_prompts = system_prompts.format(**context)
# Where context contains variables like:
# {CURRENT_TIME}, {USER_REQUEST}, {FULL_PLAN}, etc.
Escaping Rule:
- Single braces
{}→ Interpreted as template variables that must be replaced - Double braces
{{}}→ Escaped to single braces{}in the output
Implications for Prompt Writing:
Template Variables (Single Braces):
--- CURRENT_TIME: {CURRENT_TIME} USER_REQUEST: {USER_REQUEST} FULL_PLAN: {FULL_PLAN} ---These are intentional placeholders that will be replaced with actual values.
Code Samples (Double Braces Required):
❌ WRONG (Will cause KeyError): ```python print(f"Total: {value}") df_dict = {"key": "value"} track_calculation("id", {value})✅ CORRECT (Use double braces):
print(f"Total: {{value}}") df_dict = {{"key": "value"}} track_calculation("id", {{value}})
Common Scenarios Requiring Double Braces:
| Context | Wrong | Correct |
|---|---|---|
| Python f-strings | f"Count: {n}" |
f"Count: {{n}}" |
| Dictionary literals | {"key": "val"} |
{{"key": "val"}} |
| Set literals | {1, 2, 3} |
{{1, 2, 3}} |
| Format strings | "{:.2f}".format(x) |
"{{:.2f}}".format(x) |
| JSON examples | {"name": "John"} |
{{"name": "John"}} |
| Placeholders in text | Use {variable} |
`Use {{variab |
Установить system-prompt-writer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл system-prompt-writer?
This skill should be used when writing or improving system prompts for AI agents, providing expert guidance based on Anthropic's context engineering principles.
Как установить скилл system-prompt-writer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл system-prompt-writer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic