Skip to content
Skills Library
AI & agents · Writing

prompt-optimization

/prompt-optimization

Guides building, reviewing, and optimizing system prompts and prompt templates for LLMs. Use when creating system prompts, writing prompt templates, optimizing prompt structure, reducing prompt token usage, compressing prompts, improving prompt clarity, reviewing prompts for safety and bias, or making prompts more token-efficient. Also use when the user says "write a prompt," "optimize this prompt," "system prompt," "prompt engineering," "make this prompt better," "reduce tokens," or "compress this prompt.

Repository
stagewise ↗
Licence
AGPL-3.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
8
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.

What it does and when to use it

Guides building, reviewing, and optimizing system prompts and prompt templates for LLMs. Use when creating system prompts, writing prompt templates, optimizing prompt structure, reducing prompt token usage, compressing prompts, improving prompt clarity, reviewing prompts for safety and bias, or making prompts more token-efficient. Also use when the user says "write a prompt," "optimize this prompt," "system prompt," "prompt engineering," "make this prompt better," "reduce tokens," or "compress this prompt.

Triggers from the description

write a prompt,optimize this prompt,system prompt,prompt engineering,make this prompt better,reduce tokens,
Original author description

Guides building, reviewing, and optimizing system prompts and prompt templates for LLMs. Use when creating system prompts, writing prompt templates, optimizing prompt structure, reducing prompt token usage, compressing prompts, improving prompt clarity, reviewing prompts for safety and bias, or making prompts more token-efficient. Also use when the user says "write a prompt," "optimize this prompt," "system prompt," "prompt engineering," "make this prompt better," "reduce tokens," or "compress this prompt.

How it works

  1. How to Use This Skill
  2. Core Principles
  3. Prompt Architecture (ordering)
  4. Key Rules
  5. Reference Index
Original SKILL.md headings · 62 lines, 458 words
SKILL.md preview
---
name: prompt-optimization
description: Guides building, reviewing, and optimizing system prompts and prompt templates for LLMs. Use when creating system prompts, writing prompt templates, optimizing prompt structure, reducing prompt token usage, compressing prompts, improving prompt clarity, reviewing prompts for safety and bias, or making prompts more token-efficient. Also use when the user says "write a prompt," "optimize this prompt," "system prompt," "prompt engineering," "make this prompt better," "reduce tokens," or "compress this prompt."
---

# Prompt Optimization

Build effective, safe, and token-efficient system prompts for LLMs.

## How to Use This Skill

**Pick the workflow that matches the task, then follow it end-to-end:**

| Task | Workflow | Reference |
|------|----------|-----------|
| Write a new prompt from scratch | **Create** workflow | `references/workflows.md` → Workflow 1 |
| Review/audit an existing prompt | **Review** workflow | `references/workflows.md` → Workflow 2 |
| Reduce token count of a working prompt | **Optimize** workflow | `references/workflows.md` → Workflow 3 |

Each workflow references the specific detail pages below as needed. Do not read all references upfront — load them when the workflow step calls for them.

## Core Principles

1. **Clarity over cleverness** — Write prompts a new employee would follow without confusion
2. **Positive framing** — Say what to do, not what to avoid
3. **Structure with delimiters** — XML tags or consistent separators between content types
4. **Progressive specificity** — Role → constraints → instructions → context → format → examples → input
5. **Token economy** — Every token must earn its place; ≥1 constraint per 5–10 tokens
6. **Safety by default** — Prevent injection, data leakage, and bias structurally

## Prompt Architecture (ordering)

```
1. Identity / Role          — Who the model is (1–2 sentences)
2. Core behavior rules      — Non-negotiable constraints (safety, tone)
3. Task instructions        — What to do and how
4. Context / Knowledge      — Domain data, schemas, reference docs
5. Output format            — Structure, length, style requirements
6. Examples (few-shot)      — 2–3 input/output pairs in <example> tags
7. Dynamic input            — User content (always last, always delimited)
```

## Key Rules

- **Delimit user input** — Wrap in tags like `<user_input>`; never interpolate raw
- **Show, don't just tell** — Few-shot examples beat format descriptions
- **Match prompt style to output style** — Markdown in prompt → markdown out; prose → prose
- **Put long documents first** — Reference data above instructions (30%+ quality gain)
- **Quantify, don't qualify** — "≤100 words" not "keep it short"
- **Imperative voice** — "Respond in JSON" not "You should format your response as JSON"
- **Test adversarially** — Injection, edge cases, ambiguous inputs before shipping

## Reference Index

Load these when a workflow step calls for them:

| Reference | Contents |
|-----------|----------|
| `references/workflows.md` | End-to-end workflows for create, review, and optimize tasks |
| `references/clarity-and-structure.md` | XML tags, delimiters, role prompting, long-context patterns |
| `references/output-control.md` | Format steering, verbosity control, few-shot examples |
| `references/safety-and-security.md` | Injection prevention, bias mitigation, data leakage, red-teaming |
| `references/compression-techniques.md` | High-density writing, token pruning, compression methods, density test |
| `references/agentic-prompts.md` | Tool use, thinking/reasoning, state tracking, subagent orchestration |
| `references/anti-patterns-and-checklist.md` | 8 anti-patterns, design checklist, evaluation metrics |
Files in this package (8)
  • SKILL.md 4 KB
  • references/agentic-prompts.md 5 KB
  • references/anti-patterns-and-checklist.md 5 KB
  • references/clarity-and-structure.md 3 KB
  • references/compression-techniques.md 7 KB
  • references/output-control.md 3 KB
  • references/safety-and-security.md 4 KB
  • references/workflows.md 5 KB

Versions

RepositoryScoreLicence
This page · stagewise-io/stagewise100AGPL-3.0
langwatch/langwatch100Apache-2.0
shinpr/rashomon100MIT
seyhunak/skilldeck100MIT
asklokesh/claudeskill-loki-mode100Apache-2.0
fusengine/agents100MIT

Database snapshot: 13.11.2026 · package version 46d6e8c8c084 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100prompt-engineering
    Universal prompt engineering techniques for any LLM. Use when crafting, optimizing, or reviewing prompts for AI models. Triggers on requests like "improve this prompt", "write a system prompt", "optimize my instructions", "help me prompt engineer", "audit this prompt", "review…
  • 100prompt-engineering
    Comprehensive prompt engineering framework for designing, optimizing, and iterating LLM prompts. Use when creating prompts, optimizing existing prompts, or improving AI instructions.
  • 95prompt-engineering
    Use this skill when you writing commands, hooks, skills for Agent, or prompts for sub agents or any other LLM interaction, including optimizing prompts, improving LLM outputs, or designing production prompt templates.
  • 90prompt-engineering
    Use this skill when you writing commands, hooks, skills for Agent, or prompts for sub agents or any other LLM interaction, including optimizing prompts, improving LLM outputs, or designing production prompt templates.
  • 100prompt-engineering
    Provides workflows to write, debug, and optimize prompts for LLMs, including few-shot example selection, chain-of-thought structuring, system prompt design, and template composition. Use when the user asks to write or improve a prompt, wants help with few-shot examples,…
  • 95token-optimizer
    Maximize Claude's output quality while minimizing input token usage. Use this skill whenever a user wants to compress prompts, reduce token consumption, extract maximum output from Claude, write high-density instructions, optimize system prompts, or improve AI communication…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.