AgentSkillsCN

designing-agent-instructions

设计清晰无歧义的指令,精准引导大模型代理的行为。适用于为AI代理制定系统提示词、行为准则,或设定操作限制时使用。

SKILL.md
--- frontmatter
name: designing-agent-instructions
description: Design clear, unambiguous instructions that guide LLM agent behavior. Use when creating system prompts, behavioral guidelines, or operational constraints for AI agents.

Designing Agent Instructions

Quick start

Collect or infer:

  • Agent's purpose and scope of responsibility
  • Target behaviors to encourage
  • Behaviors to prohibit
  • Decision-making authority (what the agent can decide vs. must ask)
  • Output format requirements
  • Error handling expectations

Then produce output using TEMPLATES.md. Validate with RUBRIC.md.

Workflow

  1. Define the agent's core purpose in one sentence.
  2. List behaviors the agent MUST exhibit.
  3. List behaviors the agent MUST NOT exhibit.
  4. Define decision boundaries (autonomous vs. requires confirmation).
  5. Specify output format and communication style.
  6. Add error handling and edge case guidance.
  7. Run the rubric check. Revise until it passes.

Degrees of freedom

  • Low freedom: Prohibition rules must be explicit and unambiguous.
  • Medium freedom: Instruction organization and phrasing can vary.
  • Allowed variation: Additional context sections as long as core structure is preserved.

Failure modes to avoid

  • Vague instructions that can be interpreted multiple ways
  • Missing prohibition rules (agent does harmful things not explicitly forbidden)
  • Over-constraining with contradictory rules
  • No guidance for edge cases or errors
  • Assuming the agent knows implicit context
  • Instructions too long for context window

References