[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CKQ4D1D1Q5F6RH9DM2S6GS":3,"skill-same:01M6CKQ4D1D1Q5F6RH9DM2S6GS":109},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":6,"ownerHtmlUrl":61,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":62,"install":63,"resources":76},"01M6CKQ4D1D1Q5F6RH9DM2S6GS","senior-prompt-engineer",null,"This skill should be used when the user asks to \"optimize prompts\", \"design prompt templates\", \"evaluate LLM outputs\", \"build agentic systems\", \"implement RAG\", \"create few-shot examples\", \"analyze token usage\", or \"design AI workflows\". Use for prompt engineering patterns, LLM evaluation frameworks, agent architectures, and structured output design.","kbarbel640-del\u002Fskills","kbarbel640-del","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F255315490?v=4","01M6CJPPQGCCESXMG3K7BBGQ5J","01M6CJPPX2PB2BCZERFVM2C2B3",1,"MIT","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falirezarezvani\u002Fsenior-prompt-engineer\u002FSKILL.md",[17,22,25],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"engineer","prompt","senior prompt engineer","prompt engineer","Evaluation","optimize","build","use","analyze","templates","design","examples","create","engineering patterns","prompt templates","rag","workflows","implement","prompt engineering","agentic","2026-11-10 10:12:30",false,"---\nname: senior-prompt-engineer\ndescription: This skill should be used when the user asks to \"optimize prompts\", \"design prompt templates\", \"evaluate LLM outputs\", \"build agentic systems\", \"implement RAG\", \"create few-shot examples\", \"analyze token usage\", or \"design AI workflows\". Use for prompt engineering patterns, LLM evaluation frameworks, agent architectures, and structured output design.\n---\n\n# Senior Prompt Engineer\n\nPrompt engineering patterns, LLM evaluation frameworks, and agentic system design.\n\n## Table of Contents\n\n- [Quick Start](#quick-start)\n- [Tools Overview](#tools-overview)\n  - [Prompt Optimizer](#1-prompt-optimizer)\n  - [RAG Evaluator](#2-rag-evaluator)\n  - [Agent Orchestrator](#3-agent-orchestrator)\n- [Prompt Engineering Workflows](#prompt-engineering-workflows)\n  - [Prompt Optimization Workflow](#prompt-optimization-workflow)\n  - [Few-Shot Example Design](#few-shot-example-design-workflow)\n  - [Structured Output Design](#structured-output-design-workflow)\n- [Reference Documentation](#reference-documentation)\n- [Common Patterns Quick Reference](#common-patterns-quick-reference)\n\n---\n\n## Quick Start\n\n```bash\n# Analyze and optimize a prompt file\npython scripts\u002Fprompt_optimizer.py prompts\u002Fmy_prompt.txt --analyze\n\n# Evaluate RAG retrieval quality\npython scripts\u002Frag_evaluator.py --contexts contexts.json --questions questions.json\n\n# Visualize agent workflow from definition\npython scripts\u002Fagent_orchestrator.py agent_config.yaml --visualize\n```\n\n---\n\n## Tools Overview\n\n### 1. Prompt Optimizer\n\nAnalyzes prompts for token efficiency, clarity, and structure. Generates optimized versions.\n\n**Input:** Prompt text file or string\n**Output:** Analysis report with optimization suggestions\n\n**Usage:**\n```bash\n# Analyze a prompt file\npython scripts\u002Fprompt_optimizer.py prompt.txt --analyze\n\n# Output:\n# Token count: 847\n# Estimated cost: $0.0025 (GPT-4)\n# Clarity score: 72\u002F100\n# Issues found:\n#   - Ambiguous instruction at line 3\n#   - Missing output format specification\n#   - Redundant context (lines 12-15 repeat lines 5-8)\n# Suggestions:\n#   1. Add explicit output format: \"Respond in JSON with keys: ...\"\n#   2. Remove redundant context to save 89 tokens\n#   3. Clarify \"analyze\" -> \"list the top 3 issues with severity ratings\"\n\n# Generate optimized version\npython scripts\u002Fprompt_optimizer.py prompt.txt --optimize --output optimized.txt\n\n# Count tokens for cost estimation\npython scripts\u002Fprompt_optimizer.py prompt.txt --tokens --model gpt-4\n\n# Extract and manage few-shot examples\npython scripts\u002Fprompt_optimizer.py prompt.txt --extract-examples --output examples.json\n```\n\n---\n\n### 2. RAG Evaluator\n\nEvaluates Retrieval-Augmented Generation quality by measuring context relevance and answer faithfulness.\n\n**Input:** Retrieved contexts (JSON) and questions\u002Fanswers\n**Output:** Evaluation metrics and quality report\n\n**Usage:**\n```bash\n# Evaluate retrieval quality\npython scripts\u002Frag_evaluator.py --contexts retrieved.json --questions eval_set.json\n\n# Output:\n# === RAG Evaluation Report ===\n# Questions evaluated: 50\n#\n# Retrieval Metrics:\n#   Context Relevance: 0.78 (target: >0.80)\n#   Retrieval Precision@5: 0.72\n#   Coverage: 0.85\n#\n# Generation Metrics:\n#   Answer Faithfulness: 0.91\n#   Groundedness: 0.88\n#\n# Issues Found:\n#   - 8 questions had no relevant context in top-5\n#   - 3 answers contained information not in context\n#\n# Recommendations:\n#   1. Improve chunking strategy for technical documents\n#   2. Add metadata filtering for date-sensitive queries\n\n# Evaluate with custom metrics\npython scripts\u002Frag_evaluator.py --contexts retrieved.json --questions eval_set.json \\\n    --metrics relevance,faithfulness,coverage\n\n# Export detailed results\npython scripts\u002Frag_evaluator.py --contexts retrieved.json --questions eval_set.json \\\n    --output report.json --verbose\n```\n\n---\n\n### 3. Agent Orchestrator\n\nParses agent definitions and visualizes execution flows. Validates tool configurations.\n\n**Input:** Agent configuration (YAML\u002FJSON)\n**Output:** Workflow visualization, validation report\n\n**Usage:**\n```bash\n# Validate agent configuration\npython scripts\u002Fagent_orchestrator.py agent.yaml --validate\n\n# Output:\n# === Agent Validation Report ===\n# Agent: research_assistant\n# Pattern: ReAct\n#\n# Tools (4 registered):\n#   [OK] web_search - API key configured\n#   [OK] calculator - No config needed\n#   [WARN] file_reader - Missing allowed_paths\n#   [OK] summarizer - Prompt template valid\n#\n# Flow Analysis:\n#   Max depth: 5 iterations\n#   Estimated tokens\u002Frun: 2,400-4,800\n#   Potential infinite loop: No\n#\n# Recommendations:\n#   1. Add allowed_paths to file_reader for security\n#   2. Consider adding early exit condition for simple queries\n\n# Visualize agent workflow (ASCII)\npython scripts\u002Fagent_orchestrator.py agent.yaml --visualize\n\n# Output:\n# ┌─────────────────────────────────────────┐\n# │            research_assistant           │\n# │              (ReAct Pattern)            │\n# └─────────────────┬───────────────────────┘\n#                   │\n#          ┌────────▼────────┐\n#          │   User Query    │\n#          └────────┬────────┘\n#                   │\n#          ┌────────▼────────┐\n#          │     Think       │◄──────┐\n#          └────────┬────────┘       │\n#                   │                │\n#          ┌────────▼────────┐       │\n#          │   Select Tool   │       │\n#          └────────┬────────┘       │\n#                   │                │\n#     ┌─────────────┼─────────────┐  │\n#     ▼             ▼             ▼  │\n# [web_search] [calculator] [file_reader]\n#     │             │             │  │\n#     └─────────────┼─────────────┘  │\n#                   │                │\n#          ┌────────▼────────┐       │\n#          │    Observe      │───────┘\n#          └────────┬────────┘\n#                   │\n#          ┌────────▼────────┐\n#          │  Final Answer   │\n#          └─────────────────┘\n\n# Export workflow as Mermaid diagram\npython scripts\u002Fagent_orchestrator.py agent.yaml --visualize --format mermaid\n```\n\n---\n\n## Prompt Engineering Workflows\n\n### Prompt Optimization Workflow\n\nUse when improving an existing prompt's performance or reducing token costs.\n\n**Step 1: Baseline current prompt**\n```bash\npython scripts\u002Fprompt_optimizer.py current_prompt.txt --analyze --output baseline.json\n```\n\n**Step 2: Identify issues**\nReview the analysis report for:\n- Token waste (redundant instructions, verbose examples)\n- Ambiguous instructions (unclear output format, vague verbs)\n- Missing constraints (no length limits, no format specification)\n\n**Step 3: Apply optimization patterns**\n| Issue | Pattern to Apply |\n|-------|------------------|\n| Ambiguous output | Add explicit format specification |\n| Too verbose | Extract to few-shot examples |\n| Inconsistent results | Add role\u002Fpersona framing |\n| Missing edge cases | Add constraint boundaries |\n\n**Step 4: Generate optimized version**\n```bash\npython scripts\u002Fprompt_optimizer.py current_prompt.txt --optimize --output optimized.txt\n```\n\n**Step 5: Compare results**\n```bash\npython scripts\u002Fprompt_optimizer.py optimized.txt --analyze --compare baseline.json\n# Shows: token reduction, clarity improvement, issues resolved\n```\n\n**Step 6: Validate with test cases**\nRun both prompts against your evaluation set and compare outputs.\n\n---\n\n### Few-Shot Example Design Workflow\n\nUse when creating examples for in-context learning.\n\n**Step 1: Define the task clearly**\n```\nTask: Extract product entities from customer reviews\nInput: Review text\nOutput: JSON with {product_name, sentiment, features_mentioned}\n```\n\n**Step 2: Select diverse examples (3-5 recommended)**\n| Example Type | Purpose |\n|--------------|---------|\n| Simple case | Shows basic pattern |\n| Edge case | Handles ambiguity |\n| Complex case | Multiple entities |\n| Negative case | What NOT to extract |\n\n**Step 3: Format consistently**\n```\nExample 1:\nInput: \"Love my new iPhone 15, the camera is amazing!\"\nOutput: {\"product_name\": \"iPhone 15\", \"sentiment\": \"positive\", \"features_mentioned\": [\"camera\"]}\n\nExample 2:\nInput: \"The laptop was okay but battery life is terrible.\"\nOutput: {\"product_name\": \"laptop\", \"sentiment\": \"mixed\", \"features_mentioned\": [\"battery life\"]}\n```\n\n**Step 4: Validate example quality**\n```bash\npython scripts\u002Fprompt_optimizer.py prompt_with_examples.txt --validate-examples\n# Checks: consistency, coverage, format alignment\n```\n\n**Step 5: Test with held-out cases**\nEnsure model generalizes beyond your examples.\n\n---\n\n### Structured Output Design Workflow\n\nUse when you need reliable JSON\u002FXML\u002Fstructured responses.\n\n**Step 1: Define schema**\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"summary\": {\"type\": \"string\", \"maxLength\": 200},\n    \"sentiment\": {\"enum\": [\"positive\", \"negative\", \"neutral\"]},\n    \"confidence\": {\"type\": \"number\", \"minimum\": 0, \"maximum\": 1}\n  },\n  \"required\": [\"summary\", \"sentiment\"]\n}\n```\n\n**Step 2: Include schema in prompt**\n```\nRespond with JSON matching this schema:\n- summary (string, max 200 chars): Brief summary of the content\n- sentiment (enum): One of \"positive\", \"negative\", \"neutral\"\n- confidence (number 0-1): Your confidence in the sentiment\n```\n\n**Step 3: Add format enforcement**\n```\nIMPORTANT: Respond ONLY with valid JSON. No markdown, no explanation.\nStart your response with { and end with }\n```\n\n**Step 4: Validate outputs**\n```bash\npython scripts\u002Fprompt_optimizer.py structured_prompt.txt --validate-schema schema.json\n```\n\n---\n\n## Reference Documentation\n\n| File | Contains | Load when user asks about |\n|------|----------|---------------------------|\n| `references\u002Fprompt_engineering_patterns.md` | 10 prompt patterns with input\u002Foutput examples | \"which pattern?\", \"few-shot\", \"chain-of-thought\", \"role prompting\" |\n| `references\u002Fllm_evaluation_frameworks.md` | Evaluation metrics, scoring methods, A\u002FB testing | \"how to evaluate?\", \"measure quality\", \"compare prompts\" |\n| `references\u002Fagentic_system_design.md` | Agent architectures (ReAct, Plan-Execute, Tool Use) | \"build agent\", \"tool calling\", \"multi-agent\" |\n\n---\n\n## Common Patterns Quick Reference\n\n| Pattern | When to Use | Example |\n|---------|-------------|---------|\n| **Zero-shot** | Simple, well-defined tasks | \"Classify this email as spam or not spam\" |\n| **Few-shot** | Complex tasks, consistent format needed | Provide 3-5 examples before the task |\n| **Chain-of-Thought** | Reasoning, math, multi-step logic | \"Think step by step...\" |\n| **Role Prompting** | Expertise needed, specific perspective | \"You are an expert tax accountant...\" |\n| **Structured Output** | Need parseable JSON\u002FXML | Include schema + format enforcement |\n\n---\n\n## Common Commands\n\n```bash\n# Prompt Analysis\npython scripts\u002Fprompt_optimizer.py prompt.txt --analyze          # Full analysis\npython scripts\u002Fprompt_optimizer.py prompt.txt --tokens           # Token count only\npython scripts\u002Fprompt_optimizer.py prompt.txt --optimize         # Generate optimized version\n\n# RAG Evaluation\npython scripts\u002Frag_evaluator.py --contexts ctx.json --questions q.json  # Evaluate\npython scripts\u002Frag_evaluator.py --contexts ctx.json --compare baseline  # Compare to baseline\n\n# Agent Development\npython scripts\u002Fagent_orchestrator.py agent.yaml --validate       # Validate config\npython scripts\u002Fagent_orchestrator.py agent.yaml --visualize      # Show workflow\npython scripts\u002Fagent_orchestrator.py agent.yaml --estimate-cost  # Token estimation\n```\n","# Senior Prompt Engineer\n\nPrompt engineering patterns, LLM evaluation frameworks, and agentic system design.\n\n## Table of Contents\n\n- [Quick Start](#quick-start)\n- [Tools Overview](#tools-overview)\n  - [Prompt Optimizer](#1-prompt-optimizer)\n  - [RAG Evaluator](#2-rag-evaluator)\n  - [Agent Orchestrator](#3-agent-orchestrator)\n- [Prompt Engineering Workflows](#prompt-engineering-workflows)\n  - [Prompt Optimization Workflow](#prompt-optimization-workflow)\n  - [Few-Shot Example Design](#few-shot-example-design-workflow)\n  - [Structured Output Design](#structured-output-design-workflow)\n- [Reference Documentation](#reference-documentation)\n- [Common Patterns Quick Reference](#common-patterns-quick-reference)\n\n---\n\n## Quick Start\n\n```bash\n# Analyze and optimize a prompt file\npython scripts\u002Fprompt_optimizer.py prompts\u002Fmy_prompt.txt --analyze\n\n# Evaluate RAG retrieval quality\npython scripts\u002Frag_evaluator.py --contexts contexts.json --questions questions.json\n\n# Visualize agent workflow from definition\npython scripts\u002Fagent_orchestrator.py agent_config.yaml --visualize\n```\n\n---\n\n## Tools Overview\n\n### 1. Prompt Optimizer\n\nAnalyzes prompts for token efficiency, clarity, and structure. Generates optimized versions.\n\n**Input:** Prompt text file or string\n**Output:** Analysis report with optimization suggestions\n\n**Usage:**\n```bash\n# Analyze a prompt file\npython scripts\u002Fprompt_optimizer.py prompt.txt --analyze\n\n# Output:\n# Token count: 847\n# Estimated cost: $0.0025 (GPT-4)\n# Clarity score: 72\u002F100\n# Issues found:\n#   - Ambiguous instruction at line 3\n#   - Missing output format specification\n#   - Redundant context (lines 12-15 repeat lines 5-8)\n# Suggestions:\n#   1. Add explicit output format: \"Respond in JSON with keys: ...\"\n#   2. Remove redundant context to save 89 tokens\n#   3. Clarify \"analyze\" -> \"list the top 3 issues with severity ratings\"\n\n# Generate optimized version\npython scripts\u002Fprompt_optimizer.py prompt.txt --optimize --output optimized.txt\n\n# Count tokens for cost estimation\npython scripts\u002Fprompt_optimizer.py prompt.txt --tokens --model gpt-4\n\n# Extract and manage few-shot examples\npython scripts\u002Fprompt_optimizer.py prompt.txt --extract-examples --output examples.json\n```\n\n---\n\n### 2. RAG Evaluator\n\nEvaluates Retrieval-Augmented Generation quality by measuring context relevance and answer faithfulness.\n\n**Input:** Retrieved contexts (JSON) and questions\u002Fanswers\n**Output:** Evaluation metrics and quality report\n\n**Usage:**\n```bash\n# Evaluate retrieval quality\npython scripts\u002Frag_evaluator.py --contexts retrieved.json --questions eval_set.json\n\n# Output:\n# === RAG Evaluation Report ===\n# Questions evaluated: 50\n#\n# Retrieval Metrics:\n#   Context Relevance: 0.78 (target: >0.80)\n#   Retrieval Precision@5: 0.72\n#   Coverage: 0.85\n#\n# Generation Metrics:\n#   Answer Faithfulness: 0.91\n#   Groundedness: 0.88\n#\n# Issues Found:\n#   - 8 questions had no relevant context in top-5\n#   - 3 answers contained information not in context\n#\n# Recommendations:\n#   1. Improve chunking strategy for technical documents\n#   2. Add metadata filtering for date-sensitive queries\n\n# Evaluate with custom metrics\npython scripts\u002Frag_evaluator.py --contexts retrieved.json --questions eval_set.json \\\n    --metrics relevance,faithfulness,coverage\n\n# Export detailed results\npython scripts\u002Frag_evaluator.py --contexts retrieved.json --questions eval_set.json \\\n    --output report.json --verbose\n```\n\n---\n\n### 3. Agent Orchestrator\n\nParses agent definitions and visualizes execution flows. Validates tool configurations.\n\n**Input:** Agent configuration (YAML\u002FJSON)\n**Output:** Workflow visualization, validation report\n\n**Usage:**\n```bash\n# Validate agent configuration\npython scripts\u002Fagent_orchestrator.py agent.yaml --validate\n\n# Output:\n# === Agent Validation Report ===\n# Agent: research_assistant\n# Pattern: ReAct\n#\n# Tools (4 registered):\n#   [OK] web_search - API key configured\n#   [OK] calculator - No config needed\n#   [WARN] file_reader - Missing allowed_paths\n#   [OK] summarizer - Prompt template valid\n#\n# Flow Analysis:\n#   Max depth: 5 iterations\n#   Estimated tokens\u002Frun: 2,400-4,800\n#   Potential infinite loop: No\n#\n# Recommendations:\n#   1. Add allowed_paths to file_reader for security\n#   2. Consider adding early exit condition for simple queries\n\n# Visualize agent workflow (ASCII)\npython scripts\u002Fagent_orchestrator.py agent.yaml --visualize\n\n# Output:\n# ┌─────────────────────────────────────────┐\n# │            research_assistant           │\n# │              (ReAct Pattern)            │\n# └─────────────────┬───────────────────────┘\n#                   │\n#          ┌────────▼────────┐\n#          │   User Query    │\n#          └────────┬────────┘\n#                   │\n#          ┌────────▼────────┐\n#          │     Think       │◄──────┐\n#          └────────┬────────┘       │\n#                   │                │\n#          ┌────────▼────────┐       │\n#          │   Select Tool   │       │\n#          └────────┬────────┘       │\n#                   │                │\n#     ┌─────────────┼─────────────┐  │\n#     ▼             ▼             ▼  │\n# [web_search] [calculator] [file_reader]\n#     │             │             │  │\n#     └─────────────┼─────────────┘  │\n#                   │                │\n#          ┌────────▼────────┐       │\n#          │    Observe      │───────┘\n#          └────────┬────────┘\n#                   │\n#          ┌────────▼────────┐\n#          │  Final Answer   │\n#          └─────────────────┘\n\n# Export workflow as Mermaid diagram\npython scripts\u002Fagent_orchestrator.py agent.yaml --visualize --format mermaid\n```\n\n---\n\n## Prompt Engineering Workflows\n\n### Prompt Optimization Workflow\n\nUse when improving an existing prompt's performance or reducing token costs.\n\n**Step 1: Baseline current prompt**\n```bash\npython scripts\u002Fprompt_optimizer.py current_prompt.txt --analyze --output baseline.json\n```\n\n**Step 2: Identify issues**\nReview the analysis report for:\n- Token waste (redundant instructions, verbose examples)\n- Ambiguous instructions (unclear output format, vague verbs)\n- Missing constraints (no length limits, no format specification)\n\n**Step 3: Apply optimization patterns**\n| Issue | Pattern to Apply |\n|-------|------------------|\n| Ambiguous output | Add explicit format specification |\n| Too verbose | Extract to few-shot examples |\n| Inconsistent results | Add role\u002Fpersona framing |\n| Missing edge cases | Add constraint boundaries |\n\n**Step 4: Generate optimized version**\n```bash\npython scripts\u002Fprompt_optimizer.py current_prompt.txt --optimize --output optimized.txt\n```\n\n**Step 5: Compare results**\n```bash\npython scripts\u002Fprompt_optimizer.py optimized.txt --analyze --compare baseline.json\n# Shows: token reduction, clarity improvement, issues resolved\n```\n\n**Step 6: Validate with test cases**\nRun both prompts against your evaluation set and compare outputs.\n\n---\n\n### Few-Shot Example Design Workflow\n\nUse when creating examples for in-context learning.\n\n**Step 1: Define the task clearly**\n```\nTask: Extract product entities from customer reviews\nInput: Review text\nOutput: JSON with {product_name, sentiment, features_mentioned}\n```\n\n**Step 2: Select diverse examples (3-5 recommended)**\n| Example Type | Purpose |\n|--------------|---------|\n| Simple case | Shows basic pattern |\n| Edge case | Handles ambiguity |\n| Complex case | Multiple entities |\n| Negative case | What NOT to extract |\n\n**Step 3: Format consistently**\n```\nExample 1:\nInput: \"Love my new iPhone 15, the camera is amazing!\"\nOutput: {\"product_name\": \"iPhone 15\", \"sentiment\": \"positive\", \"features_mentioned\": [\"camera\"]}\n\nExample 2:\nInput: \"The laptop was okay but battery life is terrible.\"\nOutput: {\"product_name\": \"laptop\", \"sentiment\": \"mixed\", \"features_mentioned\": [\"battery life\"]}\n```\n\n**Step 4: Validate example quality**\n```bash\npython scripts\u002Fprompt_optimizer.py prompt_with_examples.txt --validate-examples\n# Checks: consistency, coverage, format alignment\n```\n\n**Step 5: Test with held-out cases**\nEnsure model generalizes beyond your examples.\n\n---\n\n### Structured Output Design Workflow\n\nUse when you need reliable JSON\u002FXML\u002Fstructured responses.\n\n**Step 1: Define schema**\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"summary\": {\"type\": \"string\", \"maxLength\": 200},\n    \"sentiment\": {\"enum\": [\"positive\", \"negative\", \"neutral\"]},\n    \"confidence\": {\"type\": \"number\", \"minimum\": 0, \"maximum\": 1}\n  },\n  \"required\": [\"summary\", \"sentiment\"]\n}\n```\n\n**Step 2: Include schema in prompt**\n```\nRespond with JSON matching this schema:\n- summary (string, max 200 chars): Brief summary of the content\n- sentiment (enum): One of \"positive\", \"negative\", \"neutral\"\n- confidence (number 0-1): Your confidence in the sentiment\n```\n\n**Step 3: Add format enforcement**\n```\nIMPORTANT: Respond ONLY with valid JSON. No markdown, no explanation.\nStart your response with { and end with }\n```\n\n**Step 4: Validate outputs**\n```bash\npython scripts\u002Fprompt_optimizer.py structured_prompt.txt --validate-schema schema.json\n```\n\n---\n\n## Reference Documentation\n\n| File | Contains | Load when user asks about |\n|------|----------|---------------------------|\n| `references\u002Fprompt_engineering_patterns.md` | 10 prompt patterns with input\u002Foutput examples | \"which pattern?\", \"few-shot\", \"chain-of-thought\", \"role prompting\" |\n| `references\u002Fllm_evaluation_frameworks.md` | Evaluation metrics, scoring methods, A\u002FB testing | \"how to evaluate?\", \"measure quality\", \"compare prompts\" |\n| `references\u002Fagentic_system_design.md` | Agent architectures (ReAct, Plan-Execute, Tool Use) | \"build agent\", \"tool calling\", \"multi-agent\" |\n\n---\n\n## Common Patterns Quick Reference\n\n| Pattern | When to Use | Example |\n|---------|-------------|---------|\n| **Zero-shot** | Simple, well-defined tasks | \"Classify this email as spam or not spam\" |\n| **Few-shot** | Complex tasks, consistent format needed | Provide 3-5 examples before the task |\n| **Chain-of-Thought** | Reasoning, math, multi-step logic | \"Think step by step...\" |\n| **Role Prompting** | Expertise needed, specific perspective | \"You are an expert tax accountant...\" |\n| **Structured Output** | Need parseable JSON\u002FXML | Include schema + format enforcement |\n\n---\n\n## Common Commands\n\n```bash\n# Prompt Analysis\npython scripts\u002Fprompt_optimizer.py prompt.txt --analyze          # Full analysis\npython scripts\u002Fprompt_optimizer.py prompt.txt --tokens           # Token count only\npython scripts\u002Fprompt_optimizer.py prompt.txt --optimize         # Generate optimized version\n\n# RAG Evaluation\npython scripts\u002Frag_evaluator.py --contexts ctx.json --questions q.json  # Evaluate\npython scripts\u002Frag_evaluator.py --contexts ctx.json --compare baseline  # Compare to baseline\n\n# Agent Development\npython scripts\u002Fagent_orchestrator.py agent.yaml --validate       # Validate config\npython scripts\u002Fagent_orchestrator.py agent.yaml --visualize      # Show workflow\npython scripts\u002Fagent_orchestrator.py agent.yaml --estimate-cost  # Token estimation\n```\n",{"name":5,"description":7},"main","e7e336ac628c3e3bd771aff1aaa469c93778f94a","skills\u002Falirezarezvani\u002Fsenior-prompt-engineer",0,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del","2026-08-23 22:39:37",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add kbarbel640-del\u002Fskills --skill senior-prompt-engineer",{"tool":69,"command":70},"bunx","bunx skills add kbarbel640-del\u002Fskills --skill senior-prompt-engineer",{"tool":72,"command":73},"pnpm","pnpm dlx skills add kbarbel640-del\u002Fskills --skill senior-prompt-engineer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falirezarezvani\u002Fsenior-prompt-engineer\u002FSKILL.md",true,[77,83,87,91,95,101,105],{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"_meta.json","REFERENCE","参考文档",304,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falirezarezvani\u002Fsenior-prompt-engineer\u002F_meta.json",{"path":84,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fagentic_system_design.md",21700,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falirezarezvani\u002Fsenior-prompt-engineer\u002Freferences\u002Fagentic_system_design.md",{"path":88,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fllm_evaluation_frameworks.md",13303,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falirezarezvani\u002Fsenior-prompt-engineer\u002Freferences\u002Fllm_evaluation_frameworks.md",{"path":92,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fprompt_engineering_patterns.md",13636,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falirezarezvani\u002Fsenior-prompt-engineer\u002Freferences\u002Fprompt_engineering_patterns.md",{"path":96,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":100},"scripts\u002Fagent_orchestrator.py","SCRIPT","脚本",20488,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falirezarezvani\u002Fsenior-prompt-engineer\u002Fscripts\u002Fagent_orchestrator.py",{"path":102,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":103,"sourceHtmlUrl":104},"scripts\u002Fprompt_optimizer.py",17862,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falirezarezvani\u002Fsenior-prompt-engineer\u002Fscripts\u002Fprompt_optimizer.py",{"path":106,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":107,"sourceHtmlUrl":108},"scripts\u002Frag_evaluator.py",20362,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Falirezarezvani\u002Fsenior-prompt-engineer\u002Fscripts\u002Frag_evaluator.py",[110,139,160,181,187,207],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":119,"publishedAt":51},"01M6G8J55967D6281ACMKAKTEQ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[116],{"categoryNo":117,"categoryName":118,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000036","内容创作者",[120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138],"crowd prompting","prompting","api","with","tokens","domain","world","prompts","operations","instructions","text","tool","system","improve","productivity","marketplace","https","content","ai agents",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":146,"publishedAt":51},"01M6G8J0PKPAYVET6BWE8W4C26","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[145],{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},[147,122,148,39,149,150,43,151,152,153,154,41,155,156,157,158,159,127,38],"dilemm ai","arena","browser","openclaw agent","automation","browser automation","bot","openclaw","strategy","headless","compete","submit","matchmaking",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":169,"publishedAt":51},"01M6G8HWAF3K9SW7NP3Z83CPJ6","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, or submitting paper reviews via API at http:\u002F\u002F150.158.152.82:8000.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Fweak-accept\u002FSKILL.md",[166],{"categoryNo":167,"categoryName":168,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000021","资料检索与研究",[170,171,172,173,174,175,176,123,177,158,38,178,122,179,180],"arxiv paper reviews","reviews","arxiv","paper","crawler","papers","comments","fetch","read","http","via",{"skillNo":182,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":183,"categories":184,"keywords":186,"publishedAt":51},"01M6G8HQJ7N7WMY6YV7D7SSJ16","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[185],{"categoryNo":167,"categoryName":168,"taxonomyType":20,"taxonomyTypeDesc":21},[173,172,171,170,180,175,176,123,174,158,38,177,178,122,179],{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":193,"publishedAt":51},"01M6G8HM95Y64JNVFC2HN4E2BG","git-summary","Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzweack\u002Fgit-summary\u002FSKILL.md",[],[194,195,196,197,198,199,200,201,202,203,204,205,206],"git","summary","git summary","commits","repository","win32","status","linux","contributors","true","quick","get","branches",{"skillNo":208,"name":209,"nameZh":6,"description":210,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":211,"categories":212,"keywords":217,"publishedAt":51},"01M6G8HGEGF05CNEJCGVYFSC4R","agent-constitution","Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fztsalexey\u002Fagent-constitution\u002FSKILL.md",[213,214],{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":215,"categoryName":216,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000037","律师与法务",[218,219,220,221,123,222,223,56,224,178,225,226,227,228,229,136,230,231,232],"agent constitution","constitution","contracts","tree","query","base","log","check","Rules","projects","compliance","actions","state","governance","github"]