AgentSkillsCN

prompt-engineering-advanced

运用先进的提示工程策略,包括思维链、思维树,以及结构性框架(RICE、CRISPE),以实现LLM的最佳性能。 在以下场景中使用:在设计复杂提示、优化Token使用,或实施高级推理链时。

SKILL.md
--- frontmatter
name: prompt-engineering-advanced
description: |
  Advanced prompt engineering strategies including Chain-of-Thought, Tree-of-Thought, and structural frameworks (RICE, CRISPE) for optimal LLM performance.
  Use when: crafting complex prompts, optimizing token usage, or implementing advanced reasoning chains.

Advanced Prompt Engineering

Move beyond "chatting" to engineering deterministic outputs using structured frameworks and reasoning strategies.

How to apply Reasoning Frameworks

Force the model to "think" before answering.

See Techniques Catalog for a full list.

  • Chain-of-Thought (CoT): Append "Let's think step by step" or provide few-shot examples of reasoning traces.
  • Tree-of-Thought (ToT): Ask the model to generate 3 possible paths, evaluate them, and pick the best.
  • Self-Consistency: Generate $N$ reasoning paths and take the majority vote answer.

How to structure Complex Prompts

Use established acronyms to ensure completeness.

See Prompt Templates for copy-paste blocks.

RICE (General Purpose)

  • Role: "You are a Senior Java Architect."
  • Instructions: "Refactor this class to use the Builder pattern."
  • Context: "This is a legacy banking application."
  • Examples: "Here is the expected output format..."

CRISPE (Detailed Personas)

  • Capacity, Role, Insight, Statement, Personality, Experiment.

How to optimize Context (Compression)

  • Delimiters: Use XML tags (<code_block>, <context>) to segment input. Models pay more attention to structured data.
  • Reference Anchoring: Instead of pasting a 50-page doc, paste the Table of Contents and ask the model which section it needs.
  • Format shifting: Convert verbose JSON to minimal YAML or Markdown tables to save tokens.

References