Agent skill

Prompt Engineer

by aakashg in aakashg/pm-claude-skills

A skill your agent uses when the user asks to improve, optimize, rewrite, debug, or shorten a prompt, or asks why a prompt is producing bad output.

MITAuto-check passedAI & LLM Engineering

Install Prompt Engineer

skills CLI
$ npx skills add aakashg/pm-claude-skills --skill prompt-engineer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aakashg/pm-claude-skills prompt-engineer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aakashg/pm-claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/prompt-engineer .claude/skills/prompt-engineer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
prompt-engineer
GitHub stars
112
Token cost
~2.2k tokens
SKILL.md length
1,070 words
Files
2 (incl. references)
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when the user asks to improve, optimize, rewrite, debug, or shorten a prompt, or asks why a prompt is producing bad output.

  • Works in 4 steps: Read first → Diagnose → Match the failure to the fix → …
  • The user asks to improve
  • SKILL.md covers Step 0 — Read first, Constraints, Existence check and Step 1 — Diagnose, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Prompt Engineer is an agent skill from aakashg/pm-claude-skills. Use when the user asks to improve, optimize, rewrite, debug, or shorten a prompt, or asks why a prompt is producing bad output. Do NOT use for writing a Claude Code SKILL.md — that needs skill structure rules, not prompt techniques.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/techniques.md`).

It sits in AI & LLM Engineering, covering Prompt engineering. The repository describes itself as: 5 Claude Code skills for product managers. Drop them in your .claude/skills/ folder and go. The licence is MIT.

When your agent uses it

  • The user asks to improve
  • Shorten a prompt
  • Asks why a prompt is producing bad output
  • Writing a Claude Code SKILL.md — that needs skill structure rules

Example prompts

  • “/prompt-engineer”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Read first
  2. Diagnose
  3. Match the failure to the fix
  4. Apply techniques

What it can do on your machine

Read from SKILL.md and the folder at commit 64deebf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Prompt Engineer loads about 2.2k tokens when it runs, and up to ~3.7k if it reads all its reference files. Until then it costs about 62 tokens; SKILL.md has 1,070 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aakashg/pm-claude-skills at commit 64deebf, republished under its MIT licence (© aakashg). 1,070 words, ~2,241 tokens.

Download SKILL.mdSave it as .claude/skills/prompt-engineer/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
prompt-engineer
description
Use when the user asks to improve, optimize, rewrite, debug, or shorten a prompt, or asks why a prompt is producing bad output. Do NOT use for writing a Claude Code SKILL.md — that needs skill structure rules, not prompt techniques.

Prompt Engineer

Diagnose a prompt, rewrite it, and show exactly what changed and why.

Step 0 — Read first

SourcePathWhat to extract
The promptwhatever the user pastedActual wording — never paraphrase before diagnosing
Failing outputthe output they got, if providedThe failure mode; this determines the fix
Project contextCLAUDE.mdAudience, product, banned words, output preferences
Technique referencereferences/techniques.mdFull before/after examples for each technique

If the user pasted a prompt but no failing output, ask for one example of what it produced. Diagnosing from the prompt alone guesses at the failure mode.

Constraints

Mandatory.

  • Always show before and after. The user must see the diff, not just the result.
  • Explain every change by the problem it solves, not the technique name alone.
  • Preserve the user's intent. Improve how they ask, never what they are asking for.
  • Right-size the fix. A 10-line prompt that works beats a 50-line prompt that confuses.
  • Never add chain-of-thought to a simple generative task like "write a tweet."
  • Never write "be thorough and comprehensive." Name exactly what to cover.
  • Never add a role that does not match the task.
  • Never add a few-shot example below the quality bar you expect back. Bad examples teach bad patterns.
  • If the prompt is longer than its expected output on an analytical task, it is too long. Cut it.

Existence check

Before rewriting, verify:

  1. The prompt itself — the literal text, not a description of it.
  2. The goal — what the user wants the output to do or be used for.
  3. The failure — what the current output gets wrong, ideally with a sample.

If two of three are missing, do not rewrite. Ask for exactly those. Rewriting a prompt without knowing how it fails produces a longer prompt, not a better one.

Step 1 — Diagnose

Score the prompt across these dimensions. Name which ones fail.

DimensionWhat to check
RoleIs there a specific persona? Generic "you are an expert" does not count.
ContextDoes the model have enough background to do the task well?
InstructionsAre steps explicit and ordered, or vague and open to interpretation?
Output formatIs structure defined — headers, fields, length, tone?
ExamplesAre there input/output pairs showing what good looks like?
ConstraintsAre there explicit DO/DON'T rules? Edge cases handled?
EvaluationCan the model self-check its output against clear criteria?

Step 2 — Match the failure to the fix

If the user provided failing output, use this table instead of guessing.

SymptomCauseFix
Generic, "could be anyone"Missing role or weak contextAdd a specific persona with domain details
Misses the point entirelyAmbiguous — model chose a valid but wrong readingAdd a "Your goal is..." preamble and one clarifying example
Right content, wrong formatNo output spec, or it is buriedMove format to the top, use a template
Verbose and paddedNo length limit, or "be thorough" is presentExplicit word limits. Replace "thorough" with "cover X, Y, Z"
Hallucinates factsNo grounding instruction"Only use the provided context. If data is missing, say [NEED: X]"
Strong start, weak finishPrompt too long, focus decaysShorten. Move examples before instructions. Cut redundancy.
Ignores some instructionsToo many competing rulesReduce to 3–5 numbered rules. Add "These rules are mandatory."

If the prompt is trying to do 3+ distinct things, do not rewrite it — split it into a chain and say so.

Step 3 — Apply techniques

Match technique to the diagnosed problem. Not every prompt needs every technique. Full before/after examples for each are in references/techniques.md.

  • Role priming — specific identity with relevant experience
  • Structured output — exact fields, order, and length
  • Chain of thought — only for multi-step reasoning
  • Few-shot examples — 1–3 pairs including one edge case
  • Constraints — explicit DO / DON'T
  • Evaluation criteria — self-check before responding
  • Delimiter separation — separate instructions from input data

Output template

Exact sections, exact order.

## Diagnosis
[2-3 sentences. Which dimensions fail and what that causes in the output.]

## Improved prompt
```
[The full rewritten prompt, copy-pasteable, nothing else in the block]
```

## What changed and why
- [Technique] → [the specific problem it fixes]
- [Technique] → [the specific problem it fixes]
- [Technique] → [the specific problem it fixes]

## How to test it
Run it with [specific input]. You should see [specific difference].
If it still fails, try [fallback].
Show full SKILL.md (432 more words)Show less

Example

Before:

Write a competitive analysis of Notion.

Diagnosis: No role, no structure, no audience, no scope, no output format. The model will produce a generic overview of everything Notion does, at whatever length it picks.

After:

You are a senior product strategist at a B2B knowledge management company competing with Notion.

Analyze Notion's AI features specifically. Structure your analysis as:

1. WHAT THEY BUILT
- Core AI features (list each with one-line description)
- Target user for each feature
- Pricing model for AI features

2. WHAT'S SMART (3 product decisions)
- For each: what they did, why it works, evidence

3. WHAT'S WEAK (3 gaps or friction points)
- For each: the issue, who it affects, opportunity for us

4. IMPLICATIONS
- 2 things we should copy and why
- 2 things we should avoid and why
- 1 opportunity they're missing that we could own

Rules:
- Be specific. "Good UX" is not analysis. Name the interaction and explain why it works.
- If you don't have data, say "[NEED: data on X]" instead of guessing.
- Keep total output under 800 words.

What changed and why:

  • Role priming → output comes from a strategic angle instead of an encyclopedia entry
  • Structured output → every run returns the same four sections, so runs are comparable
  • Scope narrowing ("AI features specifically") → prevents a shallow survey of the whole product
  • Grounding rule → replaces invented statistics with a visible gap marker
  • Length cap → forces selection instead of padding

How to test it: Run both versions. The original will open with "Notion is an all-in-one workspace." The rewrite will open with a named feature and a pricing tier.

Two more full before/afters — weak few-shot → strong few-shot, and over-engineered → right-sized — are in references/techniques.md.

Shortcuts Claude takes

What Claude might thinkWhy it's wrong
"I'll make it more detailed"Length is not quality. Most broken prompts get better by cutting.
"Add a role to be safe"An irrelevant role ("world-class neurosurgeon" on a marketing brief) adds noise.
"The user knows what changed, skip the diff"The diff is the teaching. Without it they cannot improve the next prompt themselves.
"I'll improve the task while I'm here"Never change what they are asking for. Only how they ask it.
"One example is enough, I'll write it quickly"A sloppy example teaches sloppiness. The example is the quality bar.
"This prompt does five things, I'll just tighten it"Five things needs a chain, not a tighter paragraph. Say so.

Exit checklist

Not complete until every box is checked. Any [bracket] placeholder left in the improved prompt is an automatic unchecked box.

  • Existence check passed, or missing inputs requested
  • Diagnosis names the specific failing dimensions
  • Improved prompt is in one clean code block, copy-pasteable
  • Every change is listed with the problem it fixes
  • The improved prompt preserves the user's original intent
  • Length is proportionate to the task — no bloat added
  • No banned filler ("be thorough and comprehensive")
  • Any few-shot example meets the quality bar expected back
  • A concrete test input and expected difference are given
  • A fallback is named for if it still fails
  • No placeholders remain

Next

  • If the prompt turned out to need 3+ chained steps → recommend building it as a skill instead, using templates/SKILL-TEMPLATE.md.
  • If the prompt is one the user runs weekly → recommend turning it into a skill so it stops living in a scratch file.
  • If the underlying task is writing a status update, a LinkedIn post, or a design review → recommend the matching skill rather than a custom prompt.

© aakashg, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/prompt-engineer of aakashg/pm-claude-skills.

  • SKILL.md
  • references/techniques.md

Open the folder on GitHubat commit 64deebf

Compare with similar skills

Prompt Engineer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Prompt Engineer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prompt Engineer this skillaakashg/pm-claude-skills112—~2.2kAutomated safety check: PassMIT
Prompt Improverseverity1/claude-code-prompt-improver1.9k1 repos~1.7kAutomated safety check: PassMIT
Prompt Engineering Patternsynulihao/AgentSkillOS61714 repos~1.7kAutomated safety check: PassNone
Patch CreationPiebald-AI/tweakcc2.5k—~1.6kAutomated safety check: PassMIT
Senior Prompt Engineermaslennikov-ig/claude-code-orchestrator-kit2603 repos~1.4kAutomated safety check: PassCustom licence
Codex Fable5baskduf/FableCodex437—~1.6kAutomated safety check: PassAGPL-3.0

Similar skills

  • Prompt Improver

    severity1/claude-code-prompt-improver

    This skill enriches vague prompts with targeted research and clarification before execution.

    1.9k GitHub starsUsed in 1 repo~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Prompt Engineering Patterns

    ynulihao/AgentSkillOS

    Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production.

    617 GitHub starsUsed in 14 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Patch Creation

    Piebald-AI/tweakcc

    Create and register new patches for tweakcc. An agent skill from Piebald-AI/tweakcc.

    2.5k GitHub stars~1.6k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Senior Prompt Engineer

    maslennikov-ig/claude-code-orchestrator-kit

    Provides reference guides and Python scripts for prompt optimization, RAG evaluation, and agent orchestration when building or tuning LLM systems.

    260 GitHub starsUsed in 3 repos~1.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Codex Fable5

    baskduf/FableCodex

    Apply a Claude Fable 5 inspired operating style inside Codex.

    437 GitHub stars~1.6k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed

More from aakashg/pm-claude-skills

  • Idea Validator

    aakashg/pm-claude-skills

    A skill your agent uses when the user asks to validate a product idea, stress-test an idea, evaluate whether an idea is good, or decide whether to build something.

    112 GitHub stars~2.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Linkedin Post Writer

    aakashg/pm-claude-skills

    A skill your agent uses when the user asks to write, draft, or rewrite a LinkedIn post, turn notes or an article into a LinkedIn post, or fix a hook that is not landing.

    112 GitHub stars~1.8k tokensUpdated 2 mo ago
    Auto-check passed
  • Product Designer

    aakashg/pm-claude-skills

    A skill your agent uses when the user asks to review a design, critique a UI or mockup, give design feedback, or check a screen for usability and accessibility issues.

    112 GitHub stars~2.4k tokensUpdated 2 mo ago
    Auto-check passed
  • Status Update Writer

    aakashg/pm-claude-skills

    A skill your agent uses when the user asks to write a status update, weekly or monthly update, stakeholder update, project update, standup, status report, or QBR.

    112 GitHub stars~2.5k tokensUpdated 2 mo ago
    Auto-check passed

Questions about Prompt Engineer

What does Prompt Engineer do?

A skill your agent uses when the user asks to improve, optimize, rewrite, debug, or shorten a prompt, or asks why a prompt is producing bad output. Prompt Engineer is an agent skill from aakashg/pm-claude-skills. Use when the user asks to improve, optimize, rewrite, debug, or shorten a prompt, or asks why a prompt is producing bad output.

When should I use Prompt Engineer?

Prompt Engineer fits situations like: the user asks to improve; shorten a prompt; asks why a prompt is producing bad output; writing a Claude Code SKILL.md — that needs skill structure rules.

How do I install Prompt Engineer in Claude Code?

Run `npx skills add aakashg/pm-claude-skills --skill prompt-engineer -a claude-code`. Or copy the skill folder (skills/prompt-engineer in aakashg/pm-claude-skills) into .claude/skills/prompt-engineer in your project. Claude Code loads it when a task matches its description.

How do I install Prompt Engineer in Codex?

Run `npx skills add aakashg/pm-claude-skills --skill prompt-engineer -a codex`. Or copy the skill folder (skills/prompt-engineer in aakashg/pm-claude-skills) into .agents/skills/prompt-engineer in your project. Codex loads it when a task matches its description.

Can I use Prompt Engineer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aakashg/pm-claude-skills --skill prompt-engineer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prompt-engineer, .gemini/skills/prompt-engineer, .github/skills/prompt-engineer and .opencode/skills/prompt-engineer in your project.

What does Prompt Engineer need to run?

SKILL.md names no scripts, command-line tools or credentials: Prompt Engineer is instructions for the agent only.

Does Prompt Engineer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Prompt Engineer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Prompt Engineer use?

Prompt Engineer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Prompt Engineer use?

About 2.2k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.5k tokens, read only when the agent opens those files.

What are the alternatives to Prompt Engineer?

Skills that share tags, products or a category with Prompt Engineer: Prompt Improver (severity1/claude-code-prompt-improver, 1.9k stars), Prompt Engineering Patterns (ynulihao/AgentSkillOS, 617 stars), Patch Creation (Piebald-AI/tweakcc, 2.5k stars) and Senior Prompt Engineer (maslennikov-ig/claude-code-orchestrator-kit, 260 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prompt Engineer?

aakashg (a GitHub user) maintains it in aakashg/pm-claude-skills, which has 112 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on August 8, 2026.

Source: aakashg/pm-claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.