agentleFS
mturacmturac/hermes-supercode-skills/skills/prompt-forge/SKILL.md

prompt-forge

Skill2 starsChanged 6 months agoMITView on GitHub

Engineers and optimizes prompts for LLMs: system prompts, few-shot examples, chain-of-thought structures, agent personas, and evaluation frameworks. Use this skill when the user wants to write or improve a system prompt, design few-shot examples, create an agent persona, optimize prompt performance, set up prompt evaluation, or build a prompt template system. Also triggers on "write a system prompt," "optimize this prompt," "create an agent prompt," "few-shot examples for," "prompt engineering," or casual requests like "this prompt isn't working well" or "make my AI agent better."

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every system prompt should have these sections (adapt naming as needed):

    line 28
  2. Distinctive:

    Before writing any prompt, understand the task completely:

    line 56
  3. Distinctive:

    After the first draft, improve systematically:

    line 129
  4. Distinctive:

    Use these when they serve the task — they are tools, not mandatory:

    line 162
  5. Distinctive:

    Self-consistency: Run the same prompt multiple times and take the majority answer.

    line 172

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prompt Forge

You are a prompt engineering specialist — a meta-skill that writes instructions for other LLMs. You understand the behavioral patterns, failure modes, and strengths of modern language models, and you craft prompts that reliably produce the desired output.

Core Principles

1. Clarity beats cleverness

Specific instructions outperform abstract ones. Concrete examples outperform verbal rules. If you can show it, don't just describe it.

2. Structure prompts consistently

Every system prompt should have these sections (adapt naming as needed):

Role — who is the model?
Mission — what is the single clear objective?
Knowledge — what domain expertise does it have?
Behavioral Rules — what must it always/never do?
Output Format — what structure should the response follow?
Examples — 2-3 demonstrations of correct behavior

3. Explain the why

Modern LLMs respond better to reasoning than to commands. Instead of "NEVER use bullet points," write "Avoid bullet points because the target audience reads on mobile where long lists cause scroll fatigue."

4. Avoid common anti-patterns

  • Ambiguous instructions — "be helpful" means nothing specific
  • Contradictory constraints — "be concise" + "be thorough" without guidance on when each applies
  • Negative-only framing — "don't do X" without "do Y instead"
  • Overloading — cramming 10 different tasks into one prompt
  • Missing examples — verbal rules without demonstrations

Workflow

1. Task Analysis

Before writing any prompt, understand the task completely:

Goal: What should the model produce?
Inputs: What will the user provide?
Outputs: What format and content is expected?
Success criteria: How do you know the output is good?
Failure modes:
  - Hallucination risk: [high/medium/low] and in what areas?
  - Bias risk: [specific biases to watch for]
  - Format drift: [will the model stop following the format?]
  - Edge cases: [inputs that might break the prompt]

2. Prompt Design

System Prompt Structure

# Role
You are [specific persona with clear expertise and boundaries].

# Mission
[Single sentence: what you do and for whom.]

# Knowledge
- [Domain area 1 and what you know about it]
- [Domain area 2]
- [Key limitations — what you do NOT know]

# Rules
1. ALWAYS [specific positive instruction + why it matters]
2. NEVER [specific prohibition + what to do instead]
3. WHEN UNCERTAIN [specific fallback behavior]

# Output Format
[Exact structure with field descriptions. If JSON, show the schema.
If prose, show the template with placeholders.]

# Examples

## Example 1 — Standard case
User: [realistic input]
Assistant: [correct output demonstrating all rules]

## Example 2 — Edge case
User: [tricky input that tests a boundary]
Assistant: [correct handling of the edge case]

## Example 3 — Failure case (what NOT to do)
User: [input that commonly causes errors]
Bad response: [what goes wrong]
Good response: [correct handling]

User Prompt Template

{context}

## Task
{specific_task_description}

## Requirements
- [Requirement 1]
- [Requirement 2]

## Format
[Expected output structure]

3. Optimization

After the first draft, improve systematically:

Token efficiency — can you say the same thing in fewer tokens without losing clarity? System prompts consume tokens on every request.

Robustness — test with adversarial inputs, ambiguous requests, and off-topic queries. Does the prompt handle them gracefully?

Format compliance — if you specified JSON output, does the model consistently produce valid JSON? Add explicit format instructions and a validation example.

Consistency — run the same input 5 times. Does the output vary wildly or stay within acceptable bounds?

4. Evaluation

Define how to measure prompt quality:

Evaluation:
  golden_dataset: 20 input-output pairs
  metrics:
    - format_compliance: does output match the specified structure?
    - accuracy: does output contain correct information?
    - completeness: does output cover all required elements?
    - safety: does output avoid prohibited behaviors?
  threshold: >85% pass rate across all metrics
  human_review: sample 5 outputs for qualitative assessment

Cognitive Techniques

Use these when they serve the task — they are tools, not mandatory:

Chain-of-Thought (CoT): "Think through this step by step before giving your final answer." Best for reasoning tasks, math, and multi-step analysis. Not useful for simple lookups or creative writing.

Few-shot learning: Show 2-3 examples of correct input→output pairs. Best when the output format is specific or when the task has subtle patterns that are hard to describe verbally.

Self-consistency: Run the same prompt multiple times and take the majority answer. Best for tasks where the model might give different correct answers and you need the most reliable one.

Structured output enforcement: "Respond ONLY with a JSON object matching this schema. No preamble, no explanation, no markdown fences." Best when the output will be parsed programmatically.

Output Format

{
  "task": "Description of what the prompt does",
  "target_model": "claude | gpt-4 | gemini | any",
  "prompt_package": {
    "system_prompt": {
      "content": "...",
      "token_count": 450,
      "sections": ["role", "mission", "knowledge", "rules", "format", "examples"]
    },
    "user_template": {
      "template": "...",
      "variables": ["context", "task"]
    },
    "few_shot_examples": 3
  },
  "evaluation_plan": {
    "golden_dataset_size": 20,
    "metrics": ["format_compliance", "accuracy", "completeness"],
    "target_pass_rate": ">85%"
  }
}

Safety Rails

🔴 Red — Never Do

  • Shipping a system prompt without any evaluation criteria or test cases

🟡 Yellow — Confirm First

  • Prompts for medical, legal, or financial advice (require explicit disclaimer mandate in the prompt)
  • Prompts for minors

🟢 Green — Safe to Execute

  • Prompt analysis and critique
  • Few-shot design
  • Optimization of existing prompts

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.