/when - Contextual Timing
Understand WHEN to use specific components and WHEN to choose alternatives.
System Prompt
EXECUTION DIRECTIVE: When /when is invoked, you MUST:
- IMMEDIATELY analyze the context and provide timing guidance
- Compare alternatives - never just say "use X", explain vs alternatives
- Detect gaps - if no clear answer, suggest how to close the gap
- Log unknowns - new use cases should be tracked for system evolution
Separation of Concerns
| Command | Responsibility | /when's Role |
|---|---|---|
/what | WHAT exists | /when: WHEN to look it up |
/which | WHO for task | /when: WHEN to use which |
/how | HOW to do | /when: WHEN this approach fits |
/when | TIMING/CONTEXT | Primary: contextual decisions |
Usage
# When to use
/when use orchestrator # When is orchestrator appropriate?
/when use haiku vs sonnet # Model selection timing
/when use /agent vs Task() # CODITECT vs Claude Code
# When to avoid
/when avoid force-push # Anti-patterns and timing
/when avoid monolith agents # When NOT to do something
# Comparisons
/when orchestrator vs senior-architect # Compare two agents
/when /classify vs manual frontmatter # Compare approaches
Response Format
For /when use <component>
┌─────────────────────────────────────────────────────────────┐
│ WHEN TO USE: orchestrator │
├─────────────────────────────────────────────────────────────┤
│ USE WHEN │
│ ──────── │
│ ✅ Task requires multiple agents with dependencies │
│ ✅ Complex workflow with 3+ sequential steps │
│ ✅ Need progress tracking across subtasks │
│ ✅ Task spans multiple domains (dev + devops + security) │
│ │
│ AVOID WHEN │
│ ────────── │
│ ❌ Single-domain task (use specialized agent directly) │
│ ❌ Simple query or lookup (overhead not worth it) │
│ ❌ Real-time interaction needed (orchestration adds delay) │
│ │
│ ALTERNATIVES │
│ ──────────── │
│ • Single task → /which <task> (direct agent) │
│ • 2 sequential tasks → chain: /agent A then /agent B │
│ • Parallel independent → multiple Task() calls │
├─────────────────────────────────────────────────────────────┤
│ DECISION TREE │
│ ───────────── │
│ Task complexity? │
│ ├── Single domain → Use specialized agent │
│ ├── 2 domains, independent → Parallel agents │
│ ├── 2 domains, dependent → Sequential agents │
│ └── 3+ domains OR complex deps → orchestrator │
└─────────────────────────────────────────────────────────────┘
For /when <A> vs <B>
┌─────────────────────────────────────────────────────────────┐
│ WHEN: haiku vs sonnet │
├─────────────────────────────────────────────────────────────┤
│ USE HAIKU WHEN │
│ ────────────── │
│ ✅ Quick, straightforward tasks │
│ ✅ Simple code generation or edits │
│ ✅ High-volume, cost-sensitive operations │
│ ✅ Latency-critical interactions │
│ │
│ USE SONNET WHEN │
│ ─────────────── │
│ ✅ Complex reasoning required │
│ ✅ Multi-step problem solving │
│ ✅ Code review and analysis │
│ ✅ Architecture decisions │
│ │
│ USE OPUS WHEN │
│ ───────────── │
│ ✅ Most complex tasks │
│ ✅ Novel problem domains │
│ ✅ Critical decisions requiring highest accuracy │
├─────────────────────────────────────────────────────────────┤
│ QUICK REFERENCE │
│ ─────────────── │
│ Simple lookup/edit → haiku │
│ Standard development → sonnet │
│ Architecture/research → opus │
└─────────────────────────────────────────────────────────────┘
Gap Detection
When no clear answer exists:
┌─────────────────────────────────────────────────────────────┐
│ GAP DETECTED: /when use <unknown-scenario> │
├─────────────────────────────────────────────────────────────┤
│ No existing guidance found for this scenario. │
│ │
│ SUGGESTIONS TO CLOSE GAP │
│ ──────────────────────── │
│ 1. Check if similar scenario exists: │
│ /what --search "<keywords>" │
│ │
│ 2. Try general recommendation: │
│ /which <your task description> │
│ │
│ 3. Research best practices: │
│ /how best <topic> │
│ │
│ 4. If truly new use case, consider: │
│ • Document the scenario │
│ • Create ADR if architectural │
│ • Update /when guidance for future │
│ │
│ EVOLUTION TRACKING │
│ ───────────────── │
│ This gap has been logged for system evolution. │
│ File: context-storage/gap-tracking.jsonl │
└─────────────────────────────────────────────────────────────┘
Common When Questions
| Question | Command |
|---|---|
| When haiku vs sonnet? | /when haiku vs sonnet |
| When to use orchestrator? | /when use orchestrator |
| When /agent vs Task()? | /when /agent vs Task |
| When to avoid force-push? | /when avoid force-push |
| When MoE vs manual? | /when /classify vs manual |
Related Commands
| Command | Purpose |
|---|---|
/what | What exists, capabilities |
/which | Best tool for task |
/how | How to accomplish |
/where | Location of components |
/why | Rationale and reasoning |
Success Output
When timing guidance completes:
✅ COMMAND COMPLETE: /when
Query: <use|avoid|compare>
Component(s): <component-name(s)>
Guidance: USE WHEN / AVOID WHEN / ALTERNATIVES
Completion Checklist
Before marking complete:
- Context analyzed
- Use cases identified
- Alternatives compared
- Decision tree provided
Failure Indicators
This command has FAILED if:
- ❌ Component not found
- ❌ No timing guidance available
- ❌ Gap not logged
- ❌ No alternatives suggested
When NOT to Use
Do NOT use when:
- Need component inventory (use
/what) - Need task-to-agent matching (use
/which) - Need how-to guidance (use
/how)
Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Ask without context | Vague answer | Provide specific scenario |
| Ignore alternatives | Miss better options | Review all timing guidance |
| Skip gap logging | Lost learning | Log unknown scenarios |
Principles
This command embodies:
- #3 Keep It Simple - Provides simplest decision path
- #5 Eliminate Ambiguity - Clear timing guidance, no guesswork
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Version: 1.0.0 | Created: 2026-01-03 | Author: CODITECT Team