Pipeline stage-0 prompt refiner. Runs FIRST — before skills-selector and smart-dispatch — turning a raw idea, pasted draft, or the current chat into a definitive, production-grade prompt (Anthropic prompt-engineering best practices), then hands the refined prompt + an Execution Map (agents, skills, models, effort, time & token estimate) to the routers so they pick the best skills/models with sharpened context. When no file path is given, the input IS the chat/pasted text and the output is returned inline (processed naturally), not forced to a file. Use when the user invokes /senior-prompt-engineer, says "refine my prompt", "improve this prompt", "turn this idea into a prompt", "rewrite idea.md to prompt.md", "definitive prompt", "professional prompt", or pastes a draft prompt/idea to be hardened. Cross-CLI: Claude, Codex, Gemini, OpenCode, Antigravity (agy), lemon-code (lemon).
How this skill is triggered — by the user, by Claude, or both
Slash command
/senior-prompt-engineer:senior-prompt-engineerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
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.
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.
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). In one line, classify the task intent (build-code, refactor, design-ui, fix-bug, research, content, data, ops…) and the target executor (this CLI's agent, an API call, another LLM CLI). 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.List explicitly: Assumptions (ask if a load-bearing one is uncertain), Ambiguities (name them, don't silently pick), 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).
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).
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: <build-code | refactor | design-ui | fix-bug | research | content | data | ops | docs | git-op | debug | test | 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>]
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.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.Guides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Synthesizes the current conversation into a structured spec (PRD) and publishes it to the project issue tracker with a ready-for-agent label, without interviewing the user.
npx claudepluginhub andersonlimahw/lemon-ai-hub --plugin senior-prompt-engineer