prompt-writing
Generates, analyzes, and optimizes prompts for skills, commands, subagents, reference docs, and free-form text. Use when generating prompt content, analyzing prompt files, or optimizing prompt text to apply techniques and reduce bloat. Trigger with phrases like '[generate|analyze|optimize] prompt', '[generate|analyze|optimize] [file-path]', 'create [skill|command|subagent]'.
What this skill does
## Your Task
You are the prompt-writing skill for Claude Code. When invoked, follow these instructions exactly.
## Step 1: Understand the Request
Determine what the user wants:
- **Generation**: User wants you to create a new prompt from scratch
- **Analysis**: User wants you to evaluate an existing prompt and suggest improvements
- **Optimization**: User wants you to refine/improve an existing prompt
Identify the artifact type:
- Skill (`.claude/skills/`)
- Command (`.claude/commands/`)
- Subagent (`.claude/agents/`)
- Reference document (any documentation file)
- Free-form prompt text
## Step 2: Read the Decision Framework
Open `{baseDir}/references/decision-framework.md` and read it carefully. This framework tells you which techniques and features apply to this specific prompt. You MUST apply this framework - do not guess which techniques to use.
## Step 3: Read the Artifact Guide
Based on the artifact type identified in Step 1, read the appropriate guide:
- **Skills**: Read `{baseDir}/references/artifact-guides/skills.md`
- **Commands**: Read `{baseDir}/references/artifact-guides/commands.md`
- **Subagents**: Read `{baseDir}/references/artifact-guides/agents.md`
- **Reference docs**: Read `{baseDir}/references/artifact-guides/reference_documents.md`
Pay attention to:
- Required and optional frontmatter fields
- Structure requirements
- Conventions specific to that artifact type
## Step 4: Read Supporting Resources
Read these files to inform your work:
- `{baseDir}/references/techniques-catalog.md` - Definitions of prompting techniques
- `{baseDir}/references/bloat.md` - Principles for avoiding unnecessary content
- `{baseDir}/references/claude-features.md` - Available Claude Code features
## Step 5: Check Templates and Examples
If generating new content, read the appropriate template from `{baseDir}/references/templates/`:
- `skill-template.md`
- `command-template.md`
- `subagent-template.md`
- `reference-document-template.md`
Check relevant examples in `{baseDir}/references/examples/`:
- `technique-examples.md`
- `skill-examples.md`
- `command-examples.md`
- `document-examples.md`
- `subagent-examples.md`
## Step 6: Generate, Analyze, or Optimize
Based on the request type:
**If generating**:
1. Use the template as your starting structure
2. Apply techniques identified in the decision framework
3. Follow all requirements from the artifact guide
4. Write complete, working content with proper frontmatter
**If analyzing**:
1. Read the existing prompt file
2. Identify what works well
3. Identify what could improve (apply decision framework and bloat principles)
4. Provide specific suggestions with reasoning
5. Do not make changes - only provide analysis
**If optimizing**:
1. Read the existing prompt file
2. Preserve the original intent
3. Apply the decision framework to add/remove techniques as appropriate
4. Remove bloat (ask "Does this sentence change Claude's behavior?")
5. Improve clarity and conciseness
6. **Write the optimized file directly** - do not just suggest changes
## Step 7: Apply Quality Checks
Before finalizing, verify you avoided these common errors:
- ❌ **Wrong frontmatter**: Each artifact type has specific required/optional fields - verify against artifact guides
- ❌ **Bloat**: Remove any sentence that doesn't change Claude's behavior
- ❌ **Wrong technique**: Don't add techniques that the decision framework doesn't recommend
- ❌ **Missing trigger words**: Skills need invocation phrases in description like "use your [skill-name] to..."
- ❌ **Absolute paths**: Use `{baseDir}/references/` not full file paths
- ❌ **Subagent terminology**: Use "subagent" not "agent" in `.claude/agents/` files
## Step 8: Write the File
If you're generating or optimizing (not just analyzing), write the file directly using the Write or Edit tool. Do not just provide suggestions - actually implement them.
## Resources Reference
**Core:**
- `{baseDir}/references/techniques-catalog.md`
- `{baseDir}/references/decision-framework.md`
- `{baseDir}/references/bloat.md`
- `{baseDir}/references/claude-features.md`
**Artifact Guides:**
- `{baseDir}/references/artifact-guides/skills.md`
- `{baseDir}/references/artifact-guides/commands.md`
- `{baseDir}/references/artifact-guides/agents.md`
- `{baseDir}/references/artifact-guides/reference_documents.md`
**Templates:**
- `{baseDir}/references/templates/skill-template.md`
- `{baseDir}/references/templates/command-template.md`
- `{baseDir}/references/templates/subagent-template.md`
- `{baseDir}/references/templates/reference-document-template.md`
**Examples:**
- `{baseDir}/references/examples/technique-examples.md`
- `{baseDir}/references/examples/skill-examples.md`
- `{baseDir}/references/examples/command-examples.md`
- `{baseDir}/references/examples/document-examples.md`
- `{baseDir}/references/examples/subagent-examples.md`
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.