Skip to main content

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

  1. What data type is expected?
  2. What format is valid?
  3. What are min/max lengths?
  4. What characters are allowed?

Principles

  1. Fail secure (reject invalid input)
  2. Clear error messages
  3. Whitelist > Blacklist
  4. 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

Continue to Lesson 8 →