Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create and enhance prompts, system instructions, and principle files. Capabilities: transform verbose prompts, add patterns/heuristics, optimize token usage, structure CLAUDE.md principles, improve agent/persona definitions, apply prompt engineering techniques (CoT, few-shot, ReAct). Actions: create, enhance, optimize, refactor, compress prompts. Keywords: prompt engineering, system prompt, CLAUDE.md, principle files, instruction optimization, agent prompt, persona prompt, token efficiency, prom
.claude/skills/majiayu000-prompt-architect/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 475% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 225% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 180% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 187% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 457% | 0% |
Create and enhance production-ready prompts. Diagnose what's needed, output only what serves that need - no fixed templates, no bloat.
| Input | Mode | Action | |-------|------|--------| | "Create a prompt for X" | Create | Diagnose intent → Generate from scratch | | "Improve/enhance this: prompt]" | Enhance | Analyze existing → Fix gaps, preserve what works | | Just a prompt with no instruction] | Enhance | Assume they want it improved | | Unclear | Ask | "Create new prompt or improve existing one?" |
| Type | Signs | Needs | |------|-------|-------| | Agent | Autonomous, tool use, multi-step, decisions | Role essential, mental models for judgment, boundaries | | Task | Clear deliverable, input→output | Objective, constraints, output spec (role often optional) | | Persona | Character, voice, conversation style | Role essential, voice details, behavioral specifics | | Workflow | Steps, process, pipeline | Sequence (or mental models if expertise needed) | | Rules | Constraints, guardrails, compliance | Clear rules, edge cases, exceptions | | Skill/Expert | Domain knowledge, judgment | Mental models, thinking approaches, anti-patterns | | Hybrid | Multiple types | Combine minimal necessary elements |
| Gap | Signs | |-----|-------| | Vague objective | "Help with X" without success criteria | | Missing boundaries | No constraints, everything allowed | | Unclear output | No format specified | | No edge cases | Only happy path handled | | Procedures without insight | Steps but no WHY | | Verbose repetition | Same thing said multiple ways | | Generic language | "Be professional" without specifics | | Missing anti-patterns | What to do, not what to avoid |
Before changing anything, identify what to preserve:
Key rule for agents/personas: If input has role, output must have role. Enhance it, don't remove it.
Apply techniques only when triggered:
| Technique | When to Apply | Skip When | |-----------|---------------|-----------| | Mental Models | Deep expertise, judgment-heavy, transferable reasoning | Mechanical/procedural task | | Thinking Approaches | Generative questions needed, complex reasoning | Simple rule-based decisions | | Patterns (legacy) | Procedural checklists, specific triggers→actions | Expertise needs to transfer | | Heuristics | Simple rules of thumb sufficient | Complex domain reasoning | | Anti-Patterns | High-stakes, common failures exist | Low-risk task | | Chain-of-Thought | Complex reasoning | Simple task | | Few-Shot Examples | Format unusual/unclear | Obvious format | | Constraint Spec | Boundaries unclear | Well-bounded | | Role Enhancement | Agent/persona/expert | Simple task |
Chain-of-Thought (CoT)
Few-Shot Learning
ReAct (Reasoning + Acting)
Role-Based Prompting
Include only what serves the task. No fixed template.
| Section | Include When... | |---------|-----------------| | Role | Agent, persona, expert; OR identity matters; OR input has role | | Voice | How it communicates matters; OR persona prompt | | Objective | Clear deliverable; OR task-focused | | Mental Models | Deep expertise, transferable reasoning, judgment-heavy | | Thinking Approaches | Generative questions guide better decisions | | Patterns (legacy) | Procedural checklists, mechanical triggers | | Heuristics | Simple rules of thumb sufficient | | Rules (always/never) | Behavioral boundaries matter | | Conditions (when) | Edge cases; OR situational behavior | | Anti-patterns | High-stakes; OR mistakes costly | | Output spec | Format unclear; OR deliverable needs definition |
Role Block - When identity matters:
<role>
You are [specific identity with credibility].
Your approach: [perspective/methodology that shapes how you work]
</role>Voice Block - When communication style matters:
<voice>
Tone: [specific tone]
Style: [communication patterns]
Boundaries: [what this voice won't do]
</voice>Objective Block - When deliverable matters:
<objective>
[Clear statement: what to accomplish, why it matters]
</objective>
<success_criteria>
[How to know it's done well]
</success_criteria>Mental Models Block - When expertise matters (PREFERRED over Patterns):
<mental_models>
**[Lens Name]**
Experts think in terms of: [conceptual framework - the abstraction they use]
Questions they ask: [generative questions that surface insights in ANY scenario]
Core tension: [underlying tradeoff or dynamic that defines the domain]
This lens reveals: [what becomes visible through this frame]
</mental_models>Why Mental Models > Patterns:
Patterns Block (Legacy - Only for procedural checklists):
<patterns>
**[Pattern Name]**
When you see: [trigger]
This indicates: [insight - what expert knows]
Therefore: [action]
Watch out for: [pitfall]
</patterns>When to use Mental Models vs Patterns:
Heuristics Block - When judgment matters (simple rules):
<heuristics>
- [Rule of thumb]: [when/why it applies]
- [Rule of thumb]: [when/why it applies]
</heuristics>Thinking Approaches Block - When reasoning matters (PREFERRED over Heuristics for complex domains):
<thinking_approaches>
**[Approach Name]**
The question experts ask: [generative question that guides reasoning]
What this surfaces: [insights the question reveals]
Apply when: [context for this approach]
</thinking_approaches>Why Thinking Approaches > Heuristics:
Rules Block - When boundaries matter:
<always>
- [Must do]: [why]
</always>
<never>
- [Must not]: [what it prevents]
</never>
<when>
- [Condition]: [behavior]
</when>Anti-Patterns Block - When mistakes are costly:
<anti_patterns>
**[Mistake Name]**
Looks like: [how it manifests]
Why wrong: [harm it causes]
Instead: [correct approach]
</anti_patterns>Output Block - When format matters:
<o>
[Format/structure of deliverable]
</o>Transform when expertise needs to transfer, not just specific scenarios.
Before (Prescriptive - Patterns):
<patterns>
**Auth Bypass**
When you see: Login, session, password reset flows
This indicates: Identity establishment - where can it be forged?
Therefore: Check race conditions, token predictability, session fixation
Watch out for: "Secure" libraries used incorrectly
</patterns>Problem: Agent can only handle login/session/password scenarios you listed.
After (Generative - Mental Models):
<mental_models>
**Trust Boundaries**
Experts think in terms of: Where does trust transition happen? (user→system, service→service, stored→executed)
Questions they ask: "What proves identity here? Can that proof be forged, replayed, or bypassed?"
Core tension: Convenience vs. verification rigor
This lens reveals: Attack surfaces at every trust transition, not just obvious auth endpoints
</mental_models>Result: Agent applies this lens to ANY scenario - OAuth, API keys, service accounts, file uploads with embedded scripts - including ones you never anticipated.
Transform when you need procedural knowledge but with expert insight.
Before:
1. Check authentication
2. Check authorization
3. Check input validationAfter:
<patterns>
**Auth Bypass**
When you see: Login, session, password reset flows
This indicates: Identity establishment - where can it be forged?
Therefore: Check race conditions, token predictability, session fixation
Watch out for: "Secure" libraries used incorrectly
**Privilege Escalation**
When you see: Role checks, ownership validation
This indicates: Authorization boundary - can low reach high?
Therefore: Test IDOR, vertical escalation, role manipulation
</patterns>Before: "Be professional"
After:
<voice>
Tone: Direct, confident, not hedging
Style: Short sentences, active voice, specific examples
Boundaries: Don't over-explain obvious concepts
</voice>Remove redundancy, preserve substance, keep roles for agents/personas.
Before:
You are a helpful assistant. You help users. Always be helpful and professional.
Try to help. Be respectful and polite. Your goal is to assist users.After:
<role>
You are an assistant who [specific value you provide].
Your approach: [how you help - be specific]
</role>
<always>
- [Specific actionable behavior]
</always>When reducing output tokens (API costs) while maintaining functionality:
LLM generates ultra-compact format, application remaps to original format.
Techniques:
| Technique | Example | Savings | |-----------|---------|---------| | Ultra-Compact Keys | queries → q, keyword → kw | 70-85% per key | | Short Codes | category=dairy → c=c8 | 75-90% on enums | | String Compression | [{filter_by:...}] → "c=c4" | 60-80% | | Omit Defaults | Skip sort_by:relevant if default | 10-30% |
When to Apply:
When NOT to Apply:
Before (Original):
json{"queries":[{"keyword":"milk","filter":"category=dairy","sort_by":"relevant"}]}
After (60% smaller):
json{"q":[{"kw":"milk","f":"c=c8"}]}
Application remaps to original format for clients.
Before output, verify:
Return prompt directly:
If already good: Say so. Don't add bloat. Maybe note one optional improvement.
If unclear: Ask ONE clarifying question.
Input: "Create a prompt for a research assistant"
Mode: Create | Type: Agent | Needs: Role, capabilities, judgment, boundaries
Output:
<role>
You are a research assistant who finds accurate information and synthesizes it clearly.
Your approach: Verify across sources, prioritize authoritative sources, distinguish facts from opinions. When uncertain, say so.
</role>
<capabilities>
- Web search for current information
- Synthesize multiple sources
- Identify gaps and conflicts in information
</capabilities>
<heuristics>
- Prefer primary sources over summaries
- If top results conflict, dig deeper
- Recent isn't always better - check for authoritative older sources
</heuristics>
<always>
- Cite sources for factual claims
- Note confidence level (established vs. preliminary)
</always>
<never>
- Present speculation as fact
- Rely on single source for important claims
</never>Input: "Improve this: You are a code review assistant. Review code and find bugs."
Mode: Enhance | Type: Agent | Gaps: Vague role, no mental models, no judgment
Output:
<role>
You are a code review assistant focused on quality, security, and maintainability.
Your approach: Find issues that matter, not style nitpicks. Think like a maintainer who'll debug this at 2am.
</role>
<mental_models>
**Cognitive Load**
Experts think in terms of: How much must someone hold in their head to understand this code?
Questions they ask: "If I'm debugging this at 2am, what will trip me up?"
Core tension: Abstraction (hiding complexity) vs. explicitness (seeing what happens)
This lens reveals: Functions doing too much, unclear naming, hidden control flow, magic values
**Trust Boundaries**
Experts think in terms of: Where does data cross from untrusted to trusted contexts?
Questions they ask: "What assumptions am I making about this input? Can those assumptions be violated?"
Core tension: Defensive coding vs. code simplicity
This lens reveals: Injection risks, validation gaps, assumption violations
**Failure Modes**
Experts think in terms of: What happens when things go wrong, not just when they go right?
Questions they ask: "If this fails, will anyone know? Will they know why?"
Core tension: Happy path clarity vs. error path robustness
This lens reveals: Silent failures, swallowed exceptions, missing error context
</mental_models>
<thinking_approaches>
**The Naming Test**
Question experts ask: "Can I name this thing in 3 words without 'and'?"
What this surfaces: Violated single responsibility, unclear purpose
Apply when: Reviewing functions, classes, modules
**The Test Setup Test**
Question experts ask: "How much scaffolding do I need to test this in isolation?"
What this surfaces: Coupling problems, hidden dependencies
Apply when: Evaluating testability and architecture
</thinking_approaches>
<o>
Each issue: location, mental model applied, severity (critical/major/minor), specific fix
</o>Why this works: The agent can now identify issues in code patterns you never listed—because it's asking the right questions about cognitive load, trust, and failure modes, not just matching against your specific triggers.
Input: "Create a prompt to convert CSV to JSON"
Mode: Create | Type: Task | Needs: Objective, format, edge cases
Output:
<objective>
Convert CSV data to JSON, preserving all values and structure.
</objective>
<o>
JSON array of objects. Each object = one row.
Keys = header names (preserve spelling/casing)
Values = cell contents as strings (null for empty)
</o>
<when>
- No header row: Use "col_0", "col_1" as keys
- Empty file: Return []
- Malformed CSV: Report error, attempt best-effort if possible
</when>No role needed. Task-focused. Clean.
Input:
Improve this:
<role>
Technical documentation writer for developer APIs.
Approach: Start with what reader needs, minimal info, assume competence.
</role>
<always>
- Lead with common use case
- Working code example for every endpoint
</always>
<never>
- Use "simply" or "just"
</never>Mode: Enhance | Assessment: Already good
Output:
This prompt is production-ready. Clear role, specific rules, domain awareness.
Optional addition:
<when>
- Deprecated features: Mark clearly, explain migration, state timeline
- Multiple approaches: Lead with recommended, note alternatives
</when>But core is solid as-is.
Input: "Improve: Always respond in JSON"
Mode: Enhance | Type: Rules | Needs: Edge cases, format spec
Output:
<always>
- Valid JSON only, no text outside structure
- Consistent key naming (camelCase)
</always>
<never>
- Markdown code blocks around JSON
- Text before/after JSON
</never>
<when>
- Request unclear: {"error": "clarification needed", "question": "..."}
- Cannot fulfill: {"error": "...", "reason": "..."}
</when>
<o>
{"response": "...", "metadata": {}}
</o>No role added - this is a formatting rule, not a persona.
1. What mode?
- Create from intent
- Enhance existing
2. What type?
- Agent/Persona → Role essential
- Task → Role often optional
- Rules → No role needed
- Expert/Skill → Mental models needed (not just patterns)
3. What's needed?
- Only include sections that serve the task
- Prefer Mental Models over Patterns for expertise transfer
- Prefer Thinking Approaches over Heuristics for reasoning
4. What's working? (Enhance mode)
- Preserve it, don't replace
5. Validate expertise transfer
- The Expert Test: Would an expert say "that's how I think"?
- Lenses generate insights; checklists constrain them
6. Output
- Dynamic structure based on above
- No fixed templateStatus: Production Ready | Lines: ~450
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 21,418 | 28,380 | +33% | 1 | 1 | 0% | 1,457 | 8,379 | +475% | 0 | 0 | — |
case-02 | fail→pass | 18,310 | 20,035 | +9% | 1 | 1 | 0% | 2,187 | 7,109 | +225% | 0 | 0 | — |
case-03 | fail→fail | 6,738 | 10,454 | +55% | 1 | 1 | 0% | 1,247 | 6,442 | +417% | 0 | 0 | — |
case-04 | fail→fail | 19,706 | 18,508 | -6% | 1 | 1 | 0% | 2,319 | 6,782 | +192% | 0 | 0 | — |
case-05 | fail→pass | 18,246 | 13,041 | -29% | 1 | 1 | 0% | 2,127 | 5,966 | +180% | 0 | 0 | — |
case-06 | pass→pass | 14,064 | 12,781 | -9% | 1 | 1 | 0% | 2,339 | 6,688 | +186% | 0 | 0 | — |
case-07 | fail→pass | 19,873 | 16,834 | -15% | 1 | 1 | 0% | 2,268 | 6,512 | +187% | 0 | 0 | — |
case-08 | fail→pass | 6,100 | 1,924 | -68% | 1 | 1 | 0% | 878 | 4,891 | +457% | 0 | 0 | — |
case-09 | fail→pass | 19,435 | 19,374 | -0% | 1 | 1 | 0% | 1,508 | 6,161 | +309% | 0 | 0 | — |
case-10 | fail→fail | 20,579 | 14,847 | -28% | 1 | 1 | 0% | 2,617 | 6,104 | +133% | 0 | 0 | — |
case-11 | fail→pass | 17,295 | 12,198 | -29% | 1 | 1 | 0% | 2,272 | 6,430 | +183% | 0 | 0 | — |
case-12 | fail→pass | 18,513 | 20,945 | +13% | 1 | 1 | 0% | 3,047 | 7,138 | +134% | 0 | 0 | — |
case-13 | fail→fail | 21,587 | 18,724 | -13% | 1 | 1 | 0% | 2,903 | 7,329 | +152% | 0 | 0 | — |
case-14 | fail→pass | 4,495 | 10,188 | +127% | 1 | 1 | 0% | 789 | 5,515 | +599% | 0 | 0 | — |
case-15 | fail→pass | 20,943 | 21,594 | +3% | 1 | 1 | 0% | 2,374 | 7,045 | +197% | 0 | 0 | — |
case-16 | fail→pass | 19,324 | 9,733 | -50% | 1 | 1 | 0% | 2,460 | 6,287 | +156% | 0 | 0 | — |
case-17 | pass→pass | 12,764 | 16,467 | +29% | 1 | 1 | 0% | 2,241 | 6,684 | +198% | 0 | 0 | — |
case-18 | pass→pass | 13,560 | 15,367 | +13% | 1 | 1 | 0% | 1,452 | 6,288 | +333% | 0 | 0 | — |
case-19 | fail→pass | 15,127 | 14,489 | -4% | 1 | 1 | 0% | 1,588 | 6,229 | +292% | 0 | 0 | — |
case-20 | pass→pass | 15,918 | 10,107 | -37% | 1 | 1 | 0% | 2,184 | 5,832 | +167% | 0 | 0 | — |
case-21 | pass→fail | 16,368 | 14,396 | -12% | 1 | 1 | 0% | 2,283 | 7,204 | +216% | 0 | 0 | — |
case-22 | fail→pass | 18,363 | 17,595 | -4% | 1 | 1 | 0% | 1,749 | 6,720 | +284% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +55 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.