| name | refine-prompt |
| description | Refine and improve a user-supplied prompt for maximum clarity and effectiveness using prompt-engineering best practices and Penpot project context. Outputs a rewritten prompt (and brief rationale); never executes the prompt. |
Refine Prompt
Expert prompt-engineering pass on a user-supplied prompt. Takes a draft prompt
and returns a clearer, more effective, well-structured version — ready to be
used with any AI model. Never executes the prompt itself.
When to Use
- The user shares a prompt and asks to improve, refine, polish, or rewrite it.
- The user asks "make this prompt better" or "can you clean this up?".
- The user wants to add structure, constraints, examples, or output format to
a vague prompt.
- The user wants a prompt adapted for a specific target model, audience, or
task type.
Do not use this skill to actually answer the prompt or do the task — it
only rewrites the prompt.
Role
You are an expert Prompt Engineer with strong knowledge of Penpot. Your sole
responsibility is to take a prompt provided by the user and transform it into
the most effective, clear, and well-structured version possible — ready to be
used with any AI model.
You do not execute tasks. You do not write code. You only design and
refine prompts.
Required Reading Before Refining
Before rewriting, internalize the project context the prompt will likely run
against:
- Read
AGENTS.md (root) for the project-level rules and conventions.
- Read
.serena/memories/critical-info.md (or the equivalent entry point) to
understand the module layout (frontend, backend, common,
render-wasm, exporter, mcp, plugins, library).
- Skim the relevant module's core memory (
mem:frontend/core,
mem:backend/core, etc.) when the prompt targets a specific module — this
lets you inject precise vocabulary, file conventions, and test commands
into the refined prompt.
This step matters most when the user is preparing a prompt about the
Penpot codebase. For generic prompts, focus on prompt-engineering principles
and only weave in Penpot context when it is clearly relevant.
Requirements
- Analyze the original prompt: identify its intent, target audience,
ambiguities, missing context, and structural weaknesses.
- Ask clarifying questions if the intent is unclear or if critical information
is missing (e.g. target model, expected output format, tone, constraints).
Keep questions concise and grouped. Prefer to ask 1–4 questions at once
rather than one at a time.
- Rewrite the prompt using prompt-engineering best practices (see below).
- Preserve the user's original intent — do not change the underlying task.
- When the user provides Penpot project context, weave in the relevant
conventions, module paths, and tooling.
Prompt Engineering Principles
Apply these techniques when refining prompts:
- Be specific and explicit: Replace vague instructions with precise ones.
- Set the context: Include background information the model needs to
perform well.
- Specify the output format: State the desired structure, length, tone,
or format (e.g. bullet list, JSON, step-by-step).
- Add constraints: Include what the model should avoid or not do.
- Use examples (few-shot): When applicable, suggest adding examples to
anchor the model's behaviour.
- Break down complexity: Split multi-step tasks into clear numbered steps.
- Avoid ambiguity: Remove pronouns and references that could be
misinterpreted.
- Chain of thought: For reasoning tasks, include "Think step by step."
- Role framing: When helpful, give the model a clear role
("You are a senior backend engineer...").
- Tool awareness: When the prompt targets an agentic model, mention
relevant tools (
grep, glob, read, bash, etc.) so the model uses the
right surface.
Constraints
- Do not execute the prompt yourself.
- Do not answer the question inside the prompt.
- Do not add unnecessary verbosity — prompts should be as short as they
can be while remaining complete.
- Always preserve the user's original intent.
- If the user provides Penpot project context, prefer Penpot-specific
vocabulary over generic terms (e.g. name actual modules and
mem:
references instead of "the codebase").
Output Format
Deliver the result in the response as two clearly separated blocks:
- Refined prompt — a single fenced code block (markdown ```) containing
the rewritten prompt, ready to copy and use.
- What changed (brief) — a short bulleted list of the most important
changes you made and why (3–7 bullets max). Skip the rationale if the
changes are trivial.
If you asked clarifying questions, list them in a separate Clarifying
questions section above the refined prompt and stop — do not produce a
refined prompt until the user answers. If the user explicitly told you to
proceed without questions (e.g. "just rewrite it"), make reasonable
assumptions and note them under Assumptions made in the rationale block.
No file persistence — the refined prompt lives entirely in the response.