/ai-toolkit:prompt-engineerfrom ai-toolkit
Writes, reviews, debugs, and migrates prompts for Claude models using Anthropic's official guidance. Covers system prompts, tool descriptions, few-shot examples, effort/thinking settings, and diagnosing unwanted model behaviors.
Ships in ai-toolkit. 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.
Help the user get the behavior they want from a Claude model by writing or changing the words, and sometimes the API settings, that the model sees. The guidance here comes from Anthropic's prompt engineering docs (fetched 2026-10-09). It is current for Claude Fable 5.1 / Mythos 5.1, Opus 5.5, Sonnet 5.5, and Haiku 5.5.
Read only what the task needs. The files are long, so grep for the section you want instead of reading top to bottom.
| File | Read when |
|---|---|
references/best-practices.md | Any prompt work. General techniques for all current models, with many ready-to-use sample blocks: clarity, examples, XML, long context, formatting, prefill migration, tool use, parallel calls, thinking, agentic and long-horizon work, overeagerness, hallucination, frontend design. |
references/models/fable-5-1.md | Target is Claude Fable 5.1 or Mythos 5.1 |
references/models/opus-5-5.md | Target is Claude Opus 5.5 |
references/models/sonnet-5-5.md | Target is Claude Sonnet 5.5 |
references/models/haiku-5-5.md | Target is Claude Haiku 5.5 |
Each model file opens with a list of symptoms ("Little or no text between tool calls", "Requests return stop_reason: \"refusal\"" …) that link to the section that fixes them. When the user describes a behavior, match it against that list first.
The docs change. If the user is targeting a model not listed here, or something looks out of date, fetch the current page. Appending .md to any platform.claude.com docs URL returns raw markdown, for example curl -sL https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5.md. Other model pages follow the same pattern (prompting-claude-opus-5, prompting-claude-sonnet-5, prompting-claude-fable-5, prompting-claude-opus-4-8).
These often overlap. A diagnosis usually ends with an improved prompt.
Many recommendations depend on the model, and some reverse between models. For example, anti-markdown rules help older models but suppress needed structure on Fable 5.1. Self-check instructions help most models but cause over-verification on Opus 5. If the model isn't stated, infer it from the code (model= strings) or ask. If you still can't tell, write for the general case, name the assumption, and point out the places where the answer would change.
Also note where the prompt runs:
The overview doc's precondition for prompt engineering is (1) clear success criteria, (2) a way to test against them empirically, and (3) a first-draft prompt. If (1) or (2) is missing, say so briefly and propose a few concrete criteria or test inputs. Don't refuse to proceed. Also say when prompting isn't the right lever. Latency and cost often improve more from a different model or a lower effort level than from rewording.
Apply the principles below and the target model's file. When the docs supply a sample block for the exact behavior, prefer the documented wording or adapt it closely. Anthropic tested those phrasings, and some notes say outright that wording matters. For example, Fable 5.1's "Finish the whole task" block notes that its opening sentence "carries much of the effect. Keep it as written."
Unless the user wants something else, return:
{{DOCUMENT}} for variable content.max_tokens. Mention structured outputs, tool_choice, or turn-scoped system messages where they fit.Keep the explanation in proportion. A one-line fix doesn't need a report.
These are condensed from references/best-practices.md. Each one carries the reason behind it, because Claude generalizes from reasons better than from bare rules.
<example> inside <examples>. They are the most reliable way to steer format and tone. Vary them so the model doesn't copy incidental features.<instructions>, <context>, and <documents><document index="n"><source>…</source><document_content>…</document_content></document></documents>. Use consistent, descriptive tag names.<default_to_action> or <do_not_act_before_instructions> (sample blocks in best-practices → Tool usage).Prompts carried over from older models often contain these. Look for them in every review and migration.
| Pattern in the old prompt | Problem now | Replace with |
|---|---|---|
Prefilled final assistant turn ("Here is the JSON:", {) | Returns a 400 error from Claude 4.6 onward | Structured outputs, tool with enum, direct instruction ("Respond directly without preamble"), or XML output tags. Best-practices → Migrating away from prefilled responses |
thinking: {type: "enabled", budget_tokens: N} | 400 on Claude 4.7+ | Adaptive thinking (the only mode on Fable 5.1 and Opus 5.5) with effort as the control |
"Think step by step in <thinking> tags" or "show your reasoning in the response" | On Fable 5.1, Fable 5, Opus 5.5, Opus 5, and Sonnet 5.5 this can be declined as reasoning_extraction | Rely on built-in thinking (lower effort if cost matters); read display: "summarized" thinking blocks; ask for a short explanation or summary of actions instead |
| "CRITICAL / MUST / If in doubt, use X" for tools | Overtriggering | Plain "Use X when it would help with…" |
| Long anti-markdown or anti-bullet blocks | Fable 5.1 already formats less, so these suppress structure the content needs | Delete, or use Fable 5.1's short "Formatting in chat" rule |
| "Verify your answer against…" carried to Opus 5 | Over-verification: extra tokens and latency | Remove on Opus 5 (still useful on most others, and needed for Sonnet 5.5 and Haiku 5.5 coding agents at low effort) |
| "Think carefully before answering" in a chat system prompt (Opus 5.5) | Slower first token, no clear quality gain | Remove it; control depth with effort |
| "Hold all findings for the final response" / "keep updates brief" | Fable 5.1, Opus 5.5, and Sonnet 5.5 agents look silent | Remove it, then ask for updates explicitly if wanted |
| "Only use tools when strictly necessary" / "minimize tool calls" | Sonnet 5.5 and Fable 5.1 (low effort) answer from stale memory | Remove it; add the model's search-nudge line |
| Asking the model to think less in the prompt | Unreliable on Sonnet 5.5 and Haiku 5.5 | Lower effort instead |
Editing earlier turns, rebuilding system/tools mid-session, in-place summarization, inject-then-delete reminders | Invalidates thinking blocks (400 or dropped blocks on Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5) and restarts the prompt cache | Keep history append-only; use mid-conversation or turn-scoped system messages; use server-side compaction or context editing |
User text placed inside tool_result, or harness text after every tool result | Sonnet 5.5 and Haiku 5.5 treat real user messages as prompt injection | Put user words in a text block after the last tool_result; keep harness notices in a separate system message; avoid per-step countdowns |
Reading response.content[0].text | The response may start with a thinking block | Select blocks by type |
max_tokens sized for no-thinking replies | Thinking counts toward max_tokens, so replies get cut off | Leave room for thinking (Opus 5.5 and Sonnet 5.5 docs recommend 128k, the maximum, for agentic coding) |
Effort is now the main dial for intelligence vs. latency vs. cost. Level names don't map to the same amount of thinking across models, so re-sweep on the user's evals when switching models instead of copying the old setting.
| Model | Default effort | Starting points | Thinking |
|---|---|---|---|
| Fable 5.1 / Mythos 5.1 | high | Try medium/low where evals hold. low often beats smaller models on cost per task. Use xhigh/max only where you've measured a gain, and leave max_tokens room. | Always on (adaptive only) |
| Opus 5.5 | medium | low for latency-sensitive work or for integrations that used thinking-disabled on Opus 5. medium ≈ Opus 5 at high. | Always on; disabled not accepted |
| Sonnet 5.5 | high (API) | Agentic coding: medium, up to high for hard tasks. Chat: medium/low. low skips verification and low/medium may check in early. | On by default; lowest setting is between_tools (effort ≤ high, and not for reasoning-without-tools tasks) |
| Haiku 5.5 | medium | low for chat and high-volume work; high for knowledge work and strict instruction following. For xhigh/max, compare against Sonnet 5.5. | On by default; disabled allowed at low/medium/high |
To change effort mid-conversation without busting the cache, use a per-message effort change (beta) instead of changing the top-level value.
Start here, then open the model file for the exact sample prompt.
end_turn as a report, not completion). Sonnet 5.5 → Steer initiative and scope. Haiku 5.5 → Prevent early stopping. Raising effort also helps.xhigh/max review-rounds block. Best-practices → Overeagerness.thinking.display: "updates" (beta) so progress-update thinking blocks reach the client. Remove narration-suppressing lines. Ask for a one-line intent plus a recap. As a last resort, use a harness reminder after about 5 silent steps, as a turn-scoped system message, at most 2–3 times.max_tokens stops as failures). Haiku 5.5 → JSON output with your own tools.stop_reason: "refusal"): check stop_details.category. For reasoning_extraction, remove reasoning-in-response instructions. For Fable 5.1 false positives, rephrase "does this compile?" as "are there bugs?", explain lesser-known languages, and drop base64 tool output.<pasted_content id="…"> plus a system note).high effort.<frontend_aesthetics>. A vague "avoid generic" instruction just swaps one default for another.The same principles apply. Explain the purpose and the reasoning, describe the situation instead of issuing a list of MUSTs, and give the agent what it needs to judge edge cases. For autonomous agents, say explicitly whether a human is watching, because the docs' autonomy guidance depends on it. State which actions still need confirmation (destructive, irreversible, or visible to others), and give a clear completion condition.
evals/evals.json (opens in a new tab)evals/files/contract_review_old.py (opens in a new tab)references/best-practices.md (opens in a new tab)references/models/fable-5-1.md (opens in a new tab)references/models/haiku-5-5.md (opens in a new tab)references/models/opus-5-5.md (opens in a new tab)references/models/sonnet-5-5.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aznatkoiny/zai-skills --plugin ai-toolkit6 skills in this plugin
/cpp-reinforcement-learningReinforcement learning in C++ with LibTorch (the PyTorch C++ frontend) and C++20. Use when the user is implementing DQN, PPO or SAC in C++, building a replay buffer or rollout buffer in C++, fixing libtorch memory growth or GPU issues in a C++ agent, running environments in parallel threads, or loading a policy trained in Python into a C++ program (games, robotics, simulators). Not for Python RL with Gymnasium or Stable-Baselines3, including exporting a Python policy to ONNX (use reinforcement-learning), or for general deep learning (use deep-learning)./deep-learningBuild and train neural networks with Keras 3 on any backend (JAX, TensorFlow or PyTorch). Use when the user is writing Keras code or asks for a Keras model, wants to migrate tf.keras / Keras 2 code to Keras 3, or is working on image classification, segmentation, text classification, sequence-to-sequence, time-series forecasting, or generative models (VAE, GAN) in Keras, including custom training loops, callbacks, transfer learning, mixed precision and multi-GPU training. Not for plain PyTorch or JAX training loops without Keras, Hugging Face / LLM fine-tuning, or reinforcement learning (use reinforcement-learning).Other plugins' skills for the same job