AgentSkillsCN

opus-prompting

为Claude Opus 4.5的逐字指令执行行为量身定制提示词。 涵盖系统提示词优化、从早期Claude版本迁移、调试意外输出,以及代理型工作流模式。当您需要为Opus定制提示词、调整3.x/4.0版本的提示词,或设计自主代理的指令时,可使用此技能。

SKILL.md
--- frontmatter
name: opus-prompting
description: |
  Tune prompts specifically for Claude Opus 4.5's literal instruction-following behavior.
  Covers system prompt optimization, migration from earlier Claude versions, debugging
  unexpected outputs, and agentic workflow patterns. Apply when crafting Opus prompts,
  adapting 3.x/4.0 prompts, or designing autonomous agent instructions.

Opus 4.5 Prompting

Opus 4.5 behaves differently from earlier Claude models—more literal, more responsive to system prompts. This skill provides patterns for optimizing prompts accordingly.

Key Behavioral Changes

BehaviorImplication
Literal instruction followingBe explicit about desired behaviors
Sensitive to "think" wordUse consider, evaluate, reflect instead
Highly responsive to system promptDial back aggressive language
Tool trigger sensitivityReplace MUST use with Use when...
Context awarenessModel tracks remaining token budget

Quick Migration Checklist

When upgrading prompts from Claude 3.7/4.0:

  1. Remove aggressive language (CRITICAL, MUST, NEVER, ALWAYS)
  2. Replace think step by step with consider or evaluate
  3. Add context/motivation ("because..." explanations)
  4. Match prompt formatting to desired output style
  5. Remove over-specified examples (trust the model)
  6. Use gentler tool invocation language
  7. Add XML tags for agent workflows (<current-state>, <blocked>, <workflow>)

Reference Files

FileUse When
patterns.mdOptimizing any prompt—comprehensive transformation rules and examples
agentic-patterns.mdBuilding agents, MCPs, long-horizon workflows with Opus 4.5

Utility Script

The scripts/analyze-prompt.py script analyzes prompts for deprecated patterns:

bash
echo "Your prompt text" | python3 scripts/analyze-prompt.py

Configure thresholds in scripts/config.json:

  • min_words: Minimum words to trigger analysis (default: 1)
  • enabled: Enable/disable the analyzer (default: true)

Pattern Categories

The patterns.md reference covers:

  1. Aggressive language — Soften MUST, NEVER, CRITICAL
  2. Think variants — Replace when extended thinking disabled
  3. Tool invocation — Prevent over-triggering
  4. Formatting — Match prompt style to output style
  5. Context/motivation — Add "because..." explanations
  6. Over-specification — Trust the model more
  7. Verbosity — Optimize for conciseness
  8. XML structure — Use semantic tags for agent workflows

Agentic Best Practices

The agentic-patterns.md reference covers:

  1. Context management — Progress summaries at 20% remaining
  2. Sub-agent delegation — Preserve main context
  3. Tool design — Avoid over-triggering in descriptions
  4. State tracking — JSON for structured, text for notes
  5. Long-horizon workflows — Incremental progress patterns
  6. Parallel execution — When to parallelize vs sequence
  7. Error handling — Fail fast, document blockers