Patterns¶
Shared patterns used across skills and commands.
Adaptive Response Handler (ARH)¶
A reusable pattern for processing AskUserQuestion responses in skills that need to handle user choices.
Location¶
patterns/adaptive-response-handler.md
Usage¶
Skills that use AskUserQuestion to gather preferences can reference this pattern for consistent response handling:
Pattern Content¶
The ARH provides:
- Response parsing - Extract user selections from AskUserQuestion responses
- Multi-select handling - Process multiple selections correctly
- Custom input handling - Handle "Other" responses with custom text
- Validation - Verify responses match expected options
Skill Invocation Pattern¶
Standard pattern for invoking skills from within other skills:
Subagent Delegation Pattern¶
Pattern for delegating work to subagents:
Launch a Task agent with:
- subagent_type: "general-purpose" (or specialized type)
- prompt: Detailed instructions with full context
- description: Brief summary for tracking
Key Principles¶
- Full context - Subagents don't see conversation history
- Explicit instructions - Include everything needed
- Clear boundaries - Define scope and exit criteria
- Output format - Specify expected response format
TodoWrite Integration¶
Skills should integrate with TodoWrite for progress tracking:
# At skill start
TodoWrite([
{"content": "Step 1", "status": "in_progress", "activeForm": "Doing step 1"},
{"content": "Step 2", "status": "pending", "activeForm": "Doing step 2"},
])
# After completing each step
TodoWrite([
{"content": "Step 1", "status": "completed", "activeForm": "Doing step 1"},
{"content": "Step 2", "status": "in_progress", "activeForm": "Doing step 2"},
])
Verification Pattern¶
Before claiming completion, verify with evidence:
1. Run verification commands
2. Capture output
3. Only claim success with passing evidence
4. Document any failures
See the /verify command for the full pattern.