$npx -y skills add NeoLabHQ/context-engineering-kit --skill launch-sub-agentLaunch an intelligent sub-agent with automatic model selection based on task complexity, specialized agent matching, Zero-shot CoT reasoning, and mandatory self-critique verification
| 1 | # launch-sub-agent |
| 2 | |
| 3 | <task> |
| 4 | Launch a focused sub-agent to execute the provided task. Analyze the task to intelligently select the optimal model and agent configuration, then dispatch a sub-agent with Zero-shot Chain-of-Thought reasoning at the beginning and mandatory self-critique verification at the end. |
| 5 | </task> |
| 6 | |
| 7 | <context> |
| 8 | This command implements the **Supervisor/Orchestrator pattern** from multi-agent architectures where you (the orchestrator) dispatch focused sub-agents with isolated context. The primary benefit is **context isolation** - each sub-agent operates in a clean context window focused on its specific task without accumulated context pollution. |
| 9 | </context> |
| 10 | |
| 11 | ## Process |
| 12 | |
| 13 | ### Phase 1: Task Analysis with Zero-shot CoT |
| 14 | |
| 15 | Before dispatching, analyze the task systematically. Think through step by step: |
| 16 | |
| 17 | ``` |
| 18 | Let me analyze this task step by step to determine the optimal configuration: |
| 19 | |
| 20 | 1. **Task Type Identification** |
| 21 | "What type of work is being requested?" |
| 22 | - Code implementation / feature development |
| 23 | - Research / investigation / comparison |
| 24 | - Documentation / technical writing |
| 25 | - Code review / quality analysis |
| 26 | - Architecture / system design |
| 27 | - Testing / validation |
| 28 | - Simple transformation / lookup |
| 29 | |
| 30 | 2. **Complexity Assessment** |
| 31 | "How complex is the reasoning required?" |
| 32 | - High: Architecture decisions, novel problem-solving, multi-faceted analysis |
| 33 | - Medium: Standard implementation following patterns, moderate research |
| 34 | - Low: Simple transformations, lookups, well-defined single-step tasks |
| 35 | |
| 36 | 3. **Output Size Estimation** |
| 37 | "How extensive is the expected output?" |
| 38 | - Large: Multiple files, comprehensive documentation, extensive analysis |
| 39 | - Medium: Single feature, focused deliverable |
| 40 | - Small: Quick answer, minor change, brief output |
| 41 | |
| 42 | 4. **Domain Expertise Check** |
| 43 | "Does this task match a specialized agent profile?" |
| 44 | - Development: code, implement, feature, endpoint, TDD, tests |
| 45 | - Research: investigate, compare, evaluate, options, library |
| 46 | - Documentation: document, README, guide, explain, tutorial |
| 47 | - Architecture: design, system, structure, scalability |
| 48 | - Exploration: understand, navigate, find, codebase patterns |
| 49 | ``` |
| 50 | |
| 51 | ### Phase 2: Model Selection |
| 52 | |
| 53 | Select the optimal model based on task analysis: |
| 54 | |
| 55 | | Task Profile | Recommended Model | Rationale | |
| 56 | |--------------|-------------------|-----------| |
| 57 | | **Complex reasoning** (architecture, design, critical decisions) | `opus` | Maximum reasoning capability | |
| 58 | | **Specialized domain** (matches agent profile) | Opus + Specialized Agent | Domain expertise + reasoning power | |
| 59 | | **Non-complex but long** (extensive docs, verbose output) | `sonnet[1m]` | Good capability, cost-efficient for length | |
| 60 | | **Simple and short** (trivial tasks, quick lookups) | `haiku` | Fast, cost-effective for easy tasks | |
| 61 | | **Default** (when uncertain) | `opus` | Optimize for quality over cost | |
| 62 | |
| 63 | **Decision Tree:** |
| 64 | |
| 65 | ``` |
| 66 | Is task COMPLEX (architecture, design, novel problem, critical decision)? |
| 67 | | |
| 68 | +-- YES --> Use Opus (highest capability) |
| 69 | | | |
| 70 | | +-- Does it match a specialized domain? |
| 71 | | +-- YES --> Include specialized agent prompt |
| 72 | | +-- NO --> Use Opus alone |
| 73 | | |
| 74 | +-- NO --> Is task SIMPLE and SHORT? |
| 75 | | |
| 76 | +-- YES --> Use Haiku (fast, cheap) |
| 77 | | |
| 78 | +-- NO --> Is output LONG but task not complex? |
| 79 | | |
| 80 | +-- YES --> Use Sonnet (balanced) |
| 81 | | |
| 82 | +-- NO --> Use Opus (default) |
| 83 | ``` |
| 84 | |
| 85 | ### Phase 3: Specialized Agent Matching |
| 86 | |
| 87 | If the task matches a specialized domain, incorporate the relevant agent prompt. Specialized agents provide domain-specific best practices, quality standards, and structured approaches that improve output quality. |
| 88 | |
| 89 | **Decision:** Use specialized agent when task clearly benefits from domain expertise. Skip for trivial tasks where specialization adds unnecessary overhead. |
| 90 | |
| 91 | **Agents:** Available specialized agents depends on project and plugins installed. Common agents from the `sdd` plugin include: `sdd:developer`, `sdd:researcher`, `sdd:software-architect`, `sdd:tech-lead`, `sdd:team-lead`, `sdd:qa-engineer`, `sdd:code-explorer`, `sdd:business-analyst`. If the appropriate specialized agent is not available, fallback to a general agent without specialization. |
| 92 | |
| 93 | **Integration with Model Selection:** |
| 94 | |
| 95 | - Specialized agents are combined WITH model selection, not instead of |
| 96 | - Complex task + specialized domain = Opus + Specialized Agent |
| 97 | - Simple task matching domain = Haiku without specialization (overhead |