$npx -y skills add SamarthaKV29/antigravity-god-mode --skill agent-orchestration-improve-agentSystematic improvement of existing agents through performance analysis, prompt engineering, and continuous iteration.
| 1 | # Agent Performance Optimization Workflow |
| 2 | |
| 3 | Systematic improvement of existing agents through performance analysis, prompt engineering, and continuous iteration. |
| 4 | |
| 5 | [Extended thinking: Agent optimization requires a data-driven approach combining performance metrics, user feedback analysis, and advanced prompt engineering techniques. Success depends on systematic evaluation, targeted improvements, and rigorous testing with rollback capabilities for production safety.] |
| 6 | |
| 7 | ## Use this skill when |
| 8 | |
| 9 | - Improving an existing agent's performance or reliability |
| 10 | - Analyzing failure modes, prompt quality, or tool usage |
| 11 | - Running structured A/B tests or evaluation suites |
| 12 | - Designing iterative optimization workflows for agents |
| 13 | |
| 14 | ## Do not use this skill when |
| 15 | |
| 16 | - You are building a brand-new agent from scratch |
| 17 | - There are no metrics, feedback, or test cases available |
| 18 | - The task is unrelated to agent performance or prompt quality |
| 19 | |
| 20 | ## Instructions |
| 21 | |
| 22 | 1. Establish baseline metrics and collect representative examples. |
| 23 | 2. Identify failure modes and prioritize high-impact fixes. |
| 24 | 3. Apply prompt and workflow improvements with measurable goals. |
| 25 | 4. Validate with tests and roll out changes in controlled stages. |
| 26 | |
| 27 | ## Safety |
| 28 | |
| 29 | - Avoid deploying prompt changes without regression testing. |
| 30 | - Roll back quickly if quality or safety metrics regress. |
| 31 | |
| 32 | ## Phase 1: Performance Analysis and Baseline Metrics |
| 33 | |
| 34 | Comprehensive analysis of agent performance using context-manager for historical data collection. |
| 35 | |
| 36 | ### 1.1 Gather Performance Data |
| 37 | |
| 38 | ``` |
| 39 | Use: context-manager |
| 40 | Command: analyze-agent-performance $ARGUMENTS --days 30 |
| 41 | ``` |
| 42 | |
| 43 | Collect metrics including: |
| 44 | |
| 45 | - Task completion rate (successful vs failed tasks) |
| 46 | - Response accuracy and factual correctness |
| 47 | - Tool usage efficiency (correct tools, call frequency) |
| 48 | - Average response time and token consumption |
| 49 | - User satisfaction indicators (corrections, retries) |
| 50 | - Hallucination incidents and error patterns |
| 51 | |
| 52 | ### 1.2 User Feedback Pattern Analysis |
| 53 | |
| 54 | Identify recurring patterns in user interactions: |
| 55 | |
| 56 | - **Correction patterns**: Where users consistently modify outputs |
| 57 | - **Clarification requests**: Common areas of ambiguity |
| 58 | - **Task abandonment**: Points where users give up |
| 59 | - **Follow-up questions**: Indicators of incomplete responses |
| 60 | - **Positive feedback**: Successful patterns to preserve |
| 61 | |
| 62 | ### 1.3 Failure Mode Classification |
| 63 | |
| 64 | Categorize failures by root cause: |
| 65 | |
| 66 | - **Instruction misunderstanding**: Role or task confusion |
| 67 | - **Output format errors**: Structure or formatting issues |
| 68 | - **Context loss**: Long conversation degradation |
| 69 | - **Tool misuse**: Incorrect or inefficient tool selection |
| 70 | - **Constraint violations**: Safety or business rule breaches |
| 71 | - **Edge case handling**: Unusual input scenarios |
| 72 | |
| 73 | ### 1.4 Baseline Performance Report |
| 74 | |
| 75 | Generate quantitative baseline metrics: |
| 76 | |
| 77 | ``` |
| 78 | Performance Baseline: |
| 79 | - Task Success Rate: [X%] |
| 80 | - Average Corrections per Task: [Y] |
| 81 | - Tool Call Efficiency: [Z%] |
| 82 | - User Satisfaction Score: [1-10] |
| 83 | - Average Response Latency: [Xms] |
| 84 | - Token Efficiency Ratio: [X:Y] |
| 85 | ``` |
| 86 | |
| 87 | ## Phase 2: Prompt Engineering Improvements |
| 88 | |
| 89 | Apply advanced prompt optimization techniques using prompt-engineer agent. |
| 90 | |
| 91 | ### 2.1 Chain-of-Thought Enhancement |
| 92 | |
| 93 | Implement structured reasoning patterns: |
| 94 | |
| 95 | ``` |
| 96 | Use: prompt-engineer |
| 97 | Technique: chain-of-thought-optimization |
| 98 | ``` |
| 99 | |
| 100 | - Add explicit reasoning steps: "Let's approach this step-by-step..." |
| 101 | - Include self-verification checkpoints: "Before proceeding, verify that..." |
| 102 | - Implement recursive decomposition for complex tasks |
| 103 | - Add reasoning trace visibility for debugging |
| 104 | |
| 105 | ### 2.2 Few-Shot Example Optimization |
| 106 | |
| 107 | Curate high-quality examples from successful interactions: |
| 108 | |
| 109 | - **Select diverse examples** covering common use cases |
| 110 | - **Include edge cases** that previously failed |
| 111 | - **Show both positive and negative examples** with explanations |
| 112 | - **Order examples** from simple to complex |
| 113 | - **Annotate examples** with key decision points |
| 114 | |
| 115 | Example structure: |
| 116 | |
| 117 | ``` |
| 118 | Good Example: |
| 119 | Input: [User request] |
| 120 | Reasoning: [Step-by-step thought process] |
| 121 | Output: [Successful response] |
| 122 | Why this works: [Key success factors] |
| 123 | |
| 124 | Bad Example: |
| 125 | Input: [Similar request] |
| 126 | Output: [Failed response] |
| 127 | Why this fails: [Specific issues] |
| 128 | Correct approach: [Fixed version] |
| 129 | ``` |
| 130 | |
| 131 | ### 2.3 Role Definition Refinement |
| 132 | |
| 133 | Strengthen agent identity and capabilities: |
| 134 | |
| 135 | - **Core purpose**: Clear, single-sentence mission |
| 136 | - **Expertise domains**: Specific knowledge areas |
| 137 | - **Behavioral traits**: Personality and interaction style |
| 138 | - **Tool proficiency**: Available tools and when to use them |
| 139 | - **Constraints**: What the agent should NOT do |
| 140 | - **Success criteria**: How to measure task completion |
| 141 | |
| 142 | ### 2.4 Constitutional AI Integration |
| 143 | |
| 144 | Implement self-correction mechanisms: |
| 145 | |
| 146 | ``` |
| 147 | Constitutional Principles: |
| 148 | 1. Verify factual accuracy before responding |
| 149 | 2. Self-check for potential biases or har |