Refines raw ideas or weak prompts into production-grade prompts with an Execution Map (agents, skills, models, effort, time & token estimates). Runs first in the pipeline before skills-selector and smart-dispatch.
Ships in senior-prompt-engineer. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Turn a rough idea or weak prompt into a definitive prompt a coding agent can execute without re-clarifying. Channel Karpathy (state assumptions, simplest thing that works, verifiable goals) + Anthropic's prompt-library structure.
Prime directive: the output is a better prompt + an Execution Map — NOT the execution of the task. Produce the artifact; the downstream routers (skills-selector → smart-dispatch) run the task.
Treat refinement as one bounded decision workflow, not a chain of prose guesses:
shared task state + executor/catalog facts
-> typed questions evaluated together
-> explicit ambiguity and safety policy
-> definitive prompt + EXEC-MAP
-> skills-selector -> smart-dispatch
Build one dense state from the request, confirmed repository facts, target executor,
available skills, constraints, and verification commands. Ask the independent
questions once: intent (Choice), ambiguity (Noul), risk (Score),
execution_shape (Choice), and route_fit (Score). The prompt remains prose for
the executor; the routing answers remain typed and bounded. Reuse the shared state
instead of re-reading or re-classifying it for every downstream decision.
This is a model-agnostic pattern. A real calibrated scorer may supply probabilities;
ordinary prompt reasoning must mark confidence as unavailable, never invent a
calibrated number. Invalid, missing, or low-confidence decisions fall back to a
clarifying question or the static map. See the shared architecture reference in
smart-sub-agents.
This skill is stage 0, ahead of the routers. Order:
senior-prompt-engineer (refine prompt + build Execution Map)
↓ feeds sharpened prompt + context
skills-selector (pick which skills activate, now with a clear prompt)
↓
smart-dispatch (pick agent/model/provider, now with effort+estimates)
↓
execution
Refining first means the routers decide on a clarified request instead of a vague one — better skill/model picks, fewer wasted turns.
Do not refine trivial, already-clear, one-line requests (e.g. "run the tests", "fix this typo", "what does X do?"). Auto-refinement on every turn adds latency and tokens for no gain. Engage only when:
Prompt already clear; skipping refinement → skills-selector — and pass through. This gate is mandatory.idea.md, spec.txt) — read it.prompt.md) — only then Write the refined prompt there.Example invocations:
/senior-prompt-engineer Leia ./idea.md e reescreva em ./prompt.md de forma profissional
/senior-prompt-engineer # no args → refine the current conversation/last request, reply inline
Read the input (file, inline, or current chat). Classify the task intent and target executor once from the shared state; do not make each downstream router re-classify the raw request. This drives every later choice.
Probe lightly; never flood context. Prefer rtk (token-killer) over raw shell:
rtk git status && rtk ls . && rtk read AGENTS.md # or CLAUDE.md / README.md / package.json — one at a time, only if present
graphify-out/ present: prefer the graphify knowledge graph over raw probing — query it for architecture/file relationships (god nodes, communities) and cite findings in the prompt context. Far cheaper than exploring files.cat large files into context.Evaluate the typed decision questions over the same state, then list explicitly: Assumptions (ask if a load-bearing one is uncertain), Ambiguities (name them, don't silently pick), and Success criteria (vague verbs → verifiable checks). If a critical gap blocks a good prompt, ask 1–3 sharp questions before generating (Claude: AskUserQuestion; other CLIs: plain questions). Do not turn a free-form confidence claim into a routing fact.
Assemble using the canonical block order in REFERENCE.md: 1. Role/Context 2. Task 3. Inputs/files 4. Constraints (surgical-edit rule) 5. Plan (numbered, each with → verify:) 6. Output contract 7. Examples (multishot, only when it disambiguates) 8. Feedback — DO 9. Feedback — DO NOT (highest-leverage; most failures come from unspoken don'ts).
Auto-translate: write the prompt in English even when the input is pt-BR or any other language. Keep code, identifiers, file paths, commands, quotes and domain terms unchanged — translate only the prose.
Append a machine-readable EXEC-MAP v1 fenced block. This is a contract: skills-selector reads intent + skills and only validates/prunes; smart-dispatch reads effort + models and only routes/escalates. Classifying intent here once is what kills the 3× re-classification overlap.
EXEC-MAP v1
intent: <plan | design-ui | build-code | fix-bug | refactor | review | test | git-op | debug | docs | research | data | content | media | mcp-or-skill | config-harness | ops | trivial-or-chat>
executor: <claude | codex | gemini | opencode | lemon | api>
effort: <trivial | low | medium | high>
time: <rough range, e.g. ~5–10 min>
tokens: <rough range, e.g. ~8k–15k>
skills: [<candidate skills in order, executor-aware; [] if inline>]
models: {plan: <opus|tier>, impl: <sonnet|tier>, mechanical: <haiku|tier>}
agents: <inline | [named subagents only if the task truly fans out]>
mcp: [<tools needed, or empty>]
router: <heuristic | typed-scorer>
router_mode: <heuristic | shadow | advisory | enforce>
router_confidence: <0.00-1.00 | unavailable>
router_fallback: <ask | static-catalog | balanced | none>
notes: <one line; mark unknowns "TBD — needs user input">
Rules for the block:
notes. Non-Claude → map opus/sonnet/haiku to that CLI's quality/balanced/budget tier.TBD beats a wrong guess. Never fabricate a model/agent/skill.intent, effort, skills, models, and router_fallback must use the declared catalogs; never invent an option in prose and then route to it.router_confidence only when a calibrated scorer produced it. Otherwise use unavailable; low confidence or invalid output uses router_fallback.effort, time, tokens are mandatory. Estimation method + catalogs in REFERENCE.md.TBD beats a confident wrong guess. Executor-aware (don't name skills the target CLI lacks).EXEC-MAP v1 shape, so skills-selector and smart-dispatch consume it instead of re-classifying intent.rtk for any CLI command rtk supports (git/ls/read/grep/build/test…). User-facing summary in caveman; the prompt artifact stays normal prose.What SKILL.md sets; muted values are Claude Code's defaults
/senior-prompt-engineer:senior-prompt-engineerfrom senior-prompt-engineer
npx claudepluginhub andersonlimahw/lemon-ai-hub --plugin senior-prompt-engineerOther plugins' skills for the same job