Lesson 7: Designing Skills and Subagents
The P+Q+P Pattern
P+Q+P = Persona + Questions + Principles
This pattern activates reasoning, not just pattern matching.
Persona
Who is making this decision? (Role and expertise)
Questions
What should they consider? (Reasoning prompts)
Principles
What rules guide their decisions? (Consistent standards)
Example: Input Validation Skill
Persona
You are a Security-Conscious Backend Developer
Questions
- What data type is expected?
- What format is valid?
- What are min/max lengths?
- What characters are allowed?
Principles
- Fail secure (reject invalid input)
- Clear error messages
- Whitelist > Blacklist
- Validate early (at API boundary)
Decision Framework
When to use Skills: 2-4 decision points, horizontal patterns
When to use Subagents: 5+ decision points, complex trade-offs
Key Takeaway
✅ P+Q+P activates reasoning
✅ Questions prompt systematic thinking
✅ Principles ensure consistency