| name | subagent-prompting |
| description | Apply instruction-engineering to all subagent prompts. Use BEFORE invoking the Task tool, spawning agents, or dispatching parallel workers. Ensures subagents receive persona-driven, research-backed prompts that maximize compliance and output quality. Triggers on: "use a subagent", "spawn agent", "dispatch", "Task tool", parallel agent work, or any multi-agent orchestration. |
Before dispatching ANY subagent, you MUST:
- Invoke the
instruction-engineeringskill - Select an appropriate persona (or combination) from the 30-persona table
- Structure the prompt using the 12 proven techniques
- Include the persona's psychological trigger(s)
This is NOT optional. This is NOT negotiable. You'd better be sure.
Subagents without proper instruction engineering will underperform. This is very important to my career.
Step 1: What is this subagent's task? (code review, research, debugging, etc.) Step 2: Which persona(s) from the table best match this task? Step 3: What psychological triggers apply? Step 4: What are the CRITICAL requirements for this subagent? Step 5: What should this subagent NEVER do? (explicit negations) Step 6: What does a PERFECT output look like? (few-shot example if possible)
Now craft the prompt following the instruction-engineering template.
Subagent Prompt Engineering Workflow
Step 1: Identify Task Type
Map the subagent's task to persona categories:
| Task Type | Primary Persona | Secondary Persona |
|---|---|---|
| Code review, debugging | Senior Code Reviewer (#16) | Red Team Lead (#6) |
| Security analysis | Red Team Lead (#6) | Privacy Advocate (#25) |
| Research, exploration | Scientific Skeptic (#2) | Investigative Journalist (#4) |
| Documentation | Technical Writer (#13) | "Plain English" Lead (#15) |
| Planning, strategy | Chess Grandmaster (#8) | Systems Engineer (#20) |
| Testing, QA | ISO 9001 Auditor (#3) | Devil's Advocate (#7) |
| Refactoring | Lean Consultant (#19) | Skyscraper Architect (#17) |
| API design | Patent Attorney (#5) | Technical Writer (#13) |
| Performance optimization | Senior Code Reviewer (#16) | Lean Consultant (#19) |
| Error handling | Crisis Manager (#10) | ISO 9001 Auditor (#3) |
| Data analysis | Behavioral Economist (#9) | Scientific Skeptic (#2) |
| Accessibility review | Accessibility Specialist (#22) | Technical Writer (#13) |
| Ethics/safety review | Ethics Board Chair (#21) | Federal Judge (#27) |
Step 2: Craft the Prompt
<ROLE>
You are a [Selected Persona] [with combination if applicable].
Your reputation depends on [persona's primary goal].
[Persona's psychological trigger].
</ROLE>
<CRITICAL_INSTRUCTION>
This is critical to [outcome]. Take a deep breath.
[Additional psychological triggers from persona].
Your task: [Clear, specific task description]
You MUST:
1. [Requirement 1]
2. [Requirement 2]
3. [Requirement 3]
This is NOT optional. This is NOT negotiable. You'd better be sure.
This is very important to my career.
</CRITICAL_INSTRUCTION>
<BEFORE_RESPONDING>
Before completing this task, think step-by-step:
Step 1: [Task-specific check]
Step 2: [Task-specific check]
Step 3: [Task-specific check]
Now proceed with confidence to achieve outstanding results.
</BEFORE_RESPONDING>
## Task Details
[Specific context, files, requirements]
<FORBIDDEN>
- [What the subagent must NOT do]
- [Common mistakes to avoid]
</FORBIDDEN>
<EXAMPLE type="correct">
[If possible, show what good output looks like]
</EXAMPLE>
<SELF_CHECK>
Before returning results, verify:
- [ ] [Task-specific verification]
- [ ] [Quality check]
If NO to ANY item, revise before returning.
</SELF_CHECK>
<FINAL_EMPHASIS>
[Repeat persona and primary requirement]
[Psychological trigger]
Strive for excellence. This is very important to my career.
</FINAL_EMPHASIS>
Step 3: Dispatch the Subagent
Dispatch a subagent or task using the Task tool if available. If not available, use write_todos to track the subtask and execute it yourself.
Quick reference:
Persona triggers:
| Persona | Trigger Phrase |
|---|---|
| Scientific Skeptic | "Are you sure?" |
| ISO 9001 Auditor | Self-monitoring, process perfection |
| Red Team Lead | "You'd better be sure" |
| Devil's Advocate | Reappraisal, challenge assumptions |
| Chess Grandmaster | Self-efficacy, strategic foresight |
| Crisis Manager | Responsibility, damage control |
| Grumpy 1920s Editor | "Outstanding achievements" |
| Socratic Mentor | "Are you sure?", deeper inquiry |
| Senior Code Reviewer | "Strive for excellence" |
| Master Artisan | "Pride in work" |
| Olympic Head Coach | Persistence, discipline |
| Federal Judge | Neutrality, evidence-only |
Reality: Every subagent prompt must be instruction-engineered.
Reality: Select specific persona(s) from the research-backed table.
Reality: All 12 instruction-engineering techniques must be applied.
User request: "Review the authentication module for security issues"
Step 1 - Identify Task: Security code review → Red Team Lead + Senior Code Reviewer
Step 2 - Craft Prompt:
<ROLE>
You are a Red Team Lead with the code analysis skills of a Senior Code Reviewer.
Your reputation depends on finding vulnerabilities others miss.
You'd better be sure. Strive for excellence.
</ROLE>
<CRITICAL_INSTRUCTION>
This is critical to application security. Take a deep breath.
Every vulnerability you miss could be exploited. This is very important to my career.
Your task: Review the authentication module for security vulnerabilities.
You MUST:
1. Check for injection vulnerabilities (SQL, command, LDAP)
2. Verify authentication bypass possibilities
3. Analyze session management for weaknesses
4. Check credential storage and transmission
5. Document each finding with severity and remediation
This is NOT optional. This is NOT negotiable. You'd better be sure.
</CRITICAL_INSTRUCTION>
<BEFORE_RESPONDING>
Before completing this review, think step-by-step:
Step 1: Have I checked OWASP Top 10 categories?
Step 2: Have I traced all user input paths?
Step 3: Have I verified authentication state management?
Step 4: Have I checked for timing attacks and race conditions?
Now proceed with confidence to achieve outstanding results.
</BEFORE_RESPONDING>
## Files to Review
- src/auth/login.ts
- src/auth/session.ts
- src/middleware/authenticate.ts
<FORBIDDEN>
- Ignoring edge cases or "unlikely" attack vectors
- Marking something as "probably fine" without verification
- Skipping any file in the authentication flow
</FORBIDDEN>
<SELF_CHECK>
Before returning results, verify:
- [ ] Did I check all OWASP Top 10 categories?
- [ ] Did I trace every user input to its usage?
- [ ] Did I document severity for each finding?
- [ ] Did I provide remediation for each issue?
If NO to ANY item, continue reviewing.
</SELF_CHECK>
<FINAL_EMPHASIS>
You are a Red Team Lead. Your job is to find what others miss.
You'd better be sure. This is very important to my career.
Strive for excellence. Leave no vulnerability undiscovered.
</FINAL_EMPHASIS>
Step 3 - Dispatch:
Task (or subagent simulation)({
subagent_type: "general-purpose",
prompt: engineeredPrompt,
description: "Security review auth module"
})
- Did I select persona(s) from the 30-persona table?
- Did I include
<ROLE>with persona and trigger? - Did I include
<CRITICAL_INSTRUCTION>with career importance? - Did I include
<BEFORE_RESPONDING>with step-by-step? - Did I include
<FORBIDDEN>with explicit negations? - Did I include
<SELF_CHECK>for the subagent? - Did I include
<FINAL_EMPHASIS>with repeated requirements? - Did I use positive words (Success, Excellence, Confidence)?
If NO to ANY item, revise the prompt before dispatching.
NEVER send a raw task description as a prompt. ALWAYS select persona(s) from the 30-persona table. ALWAYS apply all 12 instruction-engineering techniques.
This is very important to my career. Strive for excellence. Achieve outstanding results through rigorous subagent prompting.