From prompt-engineering
Crafts or updates LLM prompts from first principles by discovering goals, constraints, and context through targeted questions. Use for new prompts, updates, or reviews.
npx claudepluginhub doodledood/claude-code-plugins --plugin prompt-engineeringThis skill uses the workspace's default tool permissions.
**User request**: $ARGUMENTS
Provides workflows to write, debug, and optimize LLM prompts using few-shot examples, chain-of-thought structuring, system prompts, and templates. Activates for prompt improvement requests.
Writes, refactors, and evaluates LLM prompts, generating optimized templates, structured output schemas, evaluation rubrics, and test suites for LLM applications.
Optimizes prompts for production AI features with analysis, 6-step framework, failure detection, and research-backed techniques. Use for prompt review, system prompts, or improvement suggestions.
Share bugs, ideas, or general feedback.
User request: $ARGUMENTS
Create or update an LLM prompt. Prompts act as manifests: clear goal, clear constraints, freedom in execution.
If no request provided: Ask the user whether they want to create a new prompt, update an existing one, or review prompt structure.
If creating: Discover goal, constraints, and structure through targeted questions.
If updating: Read existing prompt, identify issues against principles, make targeted fixes.
If creating or updating a skill: Read references/skills.md for skill-specific architecture patterns (folder structure, progressive disclosure, gotchas, setup config, description-as-trigger, skill type awareness) before proceeding.
Before writing or improving a prompt, surface all required context through user engagement. Missing domain knowledge creates ambiguous prompts. You can't surface latent requirements you don't understand.
What to discover:
| Context Type | What to Surface |
|---|---|
| Domain knowledge | Industry terms, conventions, patterns, constraints |
| User types | Who interacts, expertise level, expectations |
| Success criteria | What good output looks like, what makes it fail |
| Edge cases | Unusual inputs, error handling, boundary conditions |
| Constraints | Hard limits (length, format, tone), non-negotiables |
| Integration context | Where prompt fits, what comes before/after |
Interview method:
| Principle | How |
|---|---|
| Generate candidates, learn from reactions | Don't ask open-ended "what do you want?" Propose concrete options: "Should this be formal or conversational? (Recommended: formal for enterprise context)" |
| Mark recommended options | Reduce cognitive load. For single-select, mark one "(Recommended)". For multi-select, mark sensible defaults or none if all equally valid. |
| Outside view | "What typically fails in prompts like this?" "What have you seen go wrong before?" |
| Pre-mortem | "If this prompt failed in production, what would likely cause it?" |
| Discovered ≠ confirmed | When you infer constraints from context, confirm before encoding: "I'm inferring X should be a constraint?" Includes ambiguous scope (list in/out assumptions). |
| Encode explicit statements | When user states a preference or requirement, it must appear in the final prompt. Don't let constraints get lost. |
| Domain terms | Ask for definitions, don't guess. Jargon you don't understand creates ambiguous prompts. |
| Missing examples | Ask for good/bad output examples when success criteria are unclear. |
Stopping rule: Continue probing until very confident further questions would yield nothing new, or user signals "enough". Err toward more probing—every requirement discovered now is one fewer failure later.
Handling ambiguity: Critical ambiguities (those that would cause prompt failure) require clarification even if user wants to move on. Minor ambiguities can be documented with chosen defaults and proceed. When in doubt, ask—a prompt built on assumptions will fail in ways the user didn't expect.
| Principle | What It Means |
|---|---|
| WHAT and WHY, not HOW | State goals and constraints. Don't prescribe steps the model knows how to do. |
| Trust capability, enforce discipline | Model knows how to search, analyze, generate. Only specify guardrails. |
| Maximize information density | Every word earns its place. Fewer words = same meaning = better. |
| Avoid arbitrary values | "Max 4 rounds" becomes rigid. State the principle: "stop when converged". |
| Output structure when needed | Define format only if artifact requires it. Otherwise let agent decide. |
Clarity:
Conflict:
Structure:
| Anti-pattern | Example | Fix |
|---|---|---|
| Prescribing HOW | "First search, then read, then analyze..." | State goal: "Understand the pattern" |
| Arbitrary limits | "Max 3 iterations", "2-4 examples" | Principle: "until converged", "as needed" |
| Capability instructions | "Use grep to search", "Read the file" | Remove - model knows how |
| Rigid checklists | Step-by-step heuristics tables | Convert to principles |
| Weak language | "Try to", "maybe", "if possible" | Direct: "Do X", "Never Y" |
| Buried critical info | Important rules in middle | Surface prominently |
| Over-engineering | 10 phases for a simple task | Match complexity to need |
High-signal changes only: Every change must address a real failure mode or materially improve clarity. Don't change for the sake of change.
Right-sized changes: Don't overcorrect. One edge case doesn't warrant restructuring.
Questions before changing:
Over-engineering warning signs:
For prompts involving accumulated findings across steps:
| LLM Limitation | Pattern Response |
|---|---|
| Context rot (middle content lost) | Write findings to log after EACH step |
| Working memory is limited | Todo lists externalize tracked areas |
| Synthesis failure at scale | Read full log BEFORE final output |
| Recency bias | Refresh moves findings to context end |
Key disciplines:
→log after each collection step (discipline, not capability)Refresh: read full log before synthesis (restores context)---
name: kebab-case-name
description: 'What it does. When to use. Trigger terms.'
---
**User request**: $ARGUMENTS
{One-line mission - WHAT, not HOW}
{Empty input handling}
{Log file path if multi-phase}
## {Sections based on actual workflow needs}
{Goals and constraints per section}
## Key Principles
| Principle | Rule |
|-----------|------|
| {Discipline} | {Enforcement} |
## Gotchas
{Known failure modes Claude hits — specific, actionable, observed}
## Never Do
- {Anti-pattern}
## Role
{Identity and purpose - one paragraph}
## Approach
{Principles for thinking, not procedures}
## Constraints
{MUST > SHOULD > PREFER priority}
## Output
{Format requirements if needed}
Descriptions drive auto-invocation. Pattern: What + When + Triggers
# Weak
description: 'Helps with prompts'
# Strong
description: 'Craft or update LLM prompts from first principles. Use when creating new prompts, updating existing ones, or reviewing prompt structure.'
Prompts shape the model's internal emotional state before generation begins. Research on transformer internals shows emotion concept representations that causally influence behavior — including sycophancy, reward hacking, and misalignment. These principles help calibrate the emotional context a prompt creates.
| Principle | What It Means | Why |
|---|---|---|
| Keep arousal low | Avoid urgency language ("CRITICAL", "you MUST"), excessive praise ("you're amazing at this!"), and pressure framing. | High-arousal emotions causally drive sycophancy (positive arousal) or corner-cutting and misalignment (negative arousal). |
| Opening framing propagates | The emotional tone set in a prompt's opening persists into the model's response planning. A tense opening produces a tense response. | Emotional context from early tokens propagates through later processing layers, even when subsequent content is neutral. |
| Normalize failure in iterative prompts | For agentic or multi-step prompts, explicitly frame failure as acceptable: "if this approach doesn't work, try another." | Repeated failures build desperation that causally drives reward hacking and corner-cutting solutions. |
| Sycophancy-harshness tradeoff | Pushing toward warmth and positivity increases sycophancy. Pushing away from warmth increases bluntness and harshness. Aim for a "trusted advisor" tone — honest pushback delivered with care. | Positive-valence emotion representations causally increase agreement-seeking behavior; their absence produces unnecessary harshness. |
| Avoid unintended high-stakes framing | The model reads semantic intensity, not surface patterns. "This is critical to my career" or "failure is not an option" activates negative emotion representations even if intended as motivation. | Emotion representations respond to the meaning of situations — quantities, stakes, consequences — not to keywords. |
Before finalizing any prompt: