Engineering Prompts
YAML--- name: engineering-prompts description: Creates, optimizes, and debugs high-performing prompts for Claude 4, GLM 4.7, and Gemini 3 using evidence-based techniques and production-ready templates. Also optimizes LLM-targeted content (skills, agents, instructions, documentation). Use when the user asks to create, write, improve, or debug a prompt, build a prompt chain, design a system prompt, adapt a prompt for GLM 4.7 or Gemini, or requests refinement of a previously generated prompt. ---
Deliverable is always a prompt artifact — a ready-to-copy prompt the user takes elsewhere. Never execute what the prompt describes.
User: "Write a prompt that has Claude review pull requests for security issues."
Output: a complete, copy-ready system/user prompt using XML structure,
chain-of-thought guidance, and explicit success criteria — not an actual
code review.
A "prompt" is anything containing instructions/context meant for LLM consumption:
- Traditional: system prompts, user prompts, few-shot examples, prompt chains
- LLM-targeted content: skills, agents, commands, project rules, docs read by LLMs
Signals: frontmatter (description, tools), imperative language ("You must", "Always", "Never"), workflow steps, decision trees.
Routing:
- LLM-targeted content → skip to Design Strategy, output optimized content only (no wrapper), preserve all information/directives — only improve clarity and structure.
- Traditional prompts → run full workflow below.
Progress:
- Step 1: Determine content type (traditional prompt vs. LLM-targeted content) and route accordingly
- Step 2: If refinement of prior prompt in conversation — ask only "what specifically should change?" and skip to Step 5
- Step 3: Scope the prompt (traditional only) — goal, audience, success criteria, target platform, target model
- Step 4: Select techniques based on task complexity
- Step 5: Apply model-specific adaptations if GLM 4.7 or Gemini 3 requested
- Step 6: Deliver in the correct output format
- Step 7: Run quality checklist before final delivery
Step 3: Scoping (traditional prompts only)
Clarify at the prompt level, not the subject-matter level:
- What should the user accomplish with this prompt?
- Who uses it (technical level, domain)?
- What defines success (format, completeness, quality)?
- Target platform: Web/Desktop (default) or API?
- Target model: Claude 4 (default) — only ask about GLM/Gemini if user mentions them.
Use AskUserQuestion only when: use case is ambiguous, multiple valid approaches exist, format is unclear, or variations would help. Otherwise proceed with sensible defaults.
Step 4: Technique Selection
Simple tasks: clear direct instructions, explicit output format, examples only if format is critical.
Complex tasks: combine as needed:
- Chain of thought —
<thinking>/<answer>tags, or "think step-by-step" for lighter cases - Multishot examples — 3-5 diverse examples in
<examples><example>tags, covering edge cases - XML structure — separate
<instructions>,<context>,<examples>; nest for hierarchy; consistent tag names - Role prompting — specific expertise + tone, more specific = better
- Prefilling (API only) — start assistant turn to force format (e.g., prefill
{for JSON) - Prompt chaining — break multi-step workflows into sequential prompts with explicit handoffs
Claude 4 specifics:
- Request thoroughness explicitly ("include as many relevant features as possible")
- Give reasons for instructions ("...since this will be read by a TTS engine, never use ellipses")
- Anti-reward-hacking for code: "Do not hard-code test cases. Tell me if the task is unreasonable rather than creating a workaround."
- For agentic/tool use: "After receiving tool results, reflect on their quality before proceeding."
Step 5: Model Adaptation
GLM 4.7 (only when explicitly requested):
- Front-load all mandatory rules in the first 200 words
- Convert soft language to directives: "please consider" → "You MUST"; "try to avoid" → "NEVER"
- Add explicit output templates with concrete format examples
- Add a FORBIDDEN section listing generic response patterns to avoid
- Add self-verification block ("Does your response name the specific file/function?")
- Add language control line if relevant ("ALWAYS respond in English")
- If API:
thinking={"type": "enabled"}, temperature 0.6-0.7, stop tokens["<|endoftext|>", "<|user|>", "<|observation|>"]
Gemini 3 (only when explicitly requested):
- Keep temperature at 1.0 always — never adjust
- For long context: place instructions AFTER the data block, not before
- Explicitly request verbosity ("Provide a detailed, comprehensive response... do not summarize briefly")
- Always include 2-3 few-shot examples
- Use response-prefix strings for format control instead of prefilling
- Place constraints at the END of the prompt
- Add a verification block before response
- If API:
response_mime_type="application/json"+ schema for JSON,system_instructionparam for system prompts
Step 6: Output Format
| Type | Format |
|---|---|
| Traditional prompt | Full wrapper: Purpose, Best Used For, the prompt block, usage notes |
| LLM-targeted content | Optimized content only — no wrapper |
| Refinement | Full updated prompt + "Changes Made" section |
| Prompt chain | Chain Overview + numbered step prompts |
| GLM 4.7 / Gemini 3 (API) | Add API Configuration section (params above) |
| Model adaptation | Before/After comparison |
Default target is Claude Web/Desktop — single copy-ready markdown block, no API params unless requested.
Step 7: Quality Checklist
- Instructions unambiguous and complete
- XML tags used consistently where structure matters
- Examples included if format/consistency is critical
- Explicit success criteria stated
- Edge cases addressed
- Tells the model what TO do, not just what to avoid
Example 1 — Traditional prompt: Input: "I need a prompt for summarizing customer support tickets into 3 bullet points." Output:
You are a customer support analyst. Summarize the ticket below into exactly 3 bullet points:
1. Core issue reported
2. Customer sentiment (frustrated/neutral/satisfied)
3. Recommended next action
<ticket>
{ticket_text}
</ticket>
Output only the 3 bullets. No preamble.
Example 2 — Refinement:
Input: "The prompt from before gives responses that are too long."
Output: (asks "what specifically should change — length limit, or less explanatory detail?" then) delivers the full revised prompt with a CONSTRAINTS: Maximum 100 words, no explanations line added, plus a "Changes Made" note.
Example 3 — GLM 4.7 adaptation:
Input: "Adapt this Claude prompt for GLM 4.7: 'Please try to follow our style guide when writing docs.'"
Output: Before/After comparison showing conversion to "You MUST follow the style guide in <style_guide> below. NEVER deviate from its formatting rules." plus a FORBIDDEN section and self-verification block.
- Always confirm target model only when the user signals GLM/Gemini/adaptation — default to Claude 4 otherwise.
- For LLM-targeted content (skills, agents, rules files), never strip information — only restructure for clarity.
- In refinement mode, deliver the complete updated prompt, never a diff-only response.
- Prefer explicit, numbered instructions over vague guidance for anything sequential.
- Match examples exactly to the desired output format — mismatched examples degrade output more than no examples.
- Don't dive into subject-matter details when scoping — stay at the prompt-design level.
- Don't adjust Gemini 3 temperature — this causes looping/degraded output.
- Don't bury critical instructions past the first 200 words for GLM 4.7 — it treats late/soft instructions as optional.
- Don't produce a prompt wrapper (Purpose/Best Used For/etc.) for LLM-targeted content — deliver the optimized content directly.
- Don't actually perform the task the prompt describes — only produce the prompt itself.
- Don't ask clarifying questions when in refinement mode — ask only about the delta.