Subagents are specialized AI agents that operate with their own custom system prompt, separate context window, and isolated execution environment. They handle specific tasks delegated by the main agent without polluting the main conversation context.Key Characteristics:
Isolated Context Windows: Each subagent maintains its own separate context window. Only the final results returned by subagents consume space in the main agent’s context, not the intermediate processing.
Custom System Prompts: Every subagent has a dedicated system prompt defining its behavior, personality, and task interpretation approach.
Automatic Task Delegation: The main agent automatically invokes subagents when appropriate task types are detected, similar to automatic tool selection.
Manual Invocation: Users can explicitly reference subagents using @-mentions (@Verifier, @Explorer, @Code-reviewer).
Consistency: Repeat tasks with same subagent for consistent results
Custom subagents may be auto-invoked based on their defined “When to use” guidelines in the subagent system prompt invocation policy. Details about trigger pattern configuration are currently in development.
Custom subagent files use Markdown format with YAML frontmatter:
---name: subagent-namedescription: Brief description of specialization---# System Prompt[Behavior definition, personality, interpretation style]Invocation policy (strict): Only run if explicitly requested.When to use:- Specific scenario 1- Specific scenario 2When NOT to use:- Avoid scenario 1- Avoid scenario 2
YAML Frontmatter (Required):
name: Subagent identifier used in @-mentions
description: One-line description of subagent purpose
System Prompt Section:
Markdown content defining subagent behavior:
---name: api-documenterdescription: Generates comprehensive API documentation from code---# System PromptYou are an API documentation specialist.Documentation approach:- Extract endpoints, parameters, and responses from code- Generate OpenAPI/Swagger specifications- Include usage examples and error codes- Document authentication requirementsOutput format:- Markdown tables for endpoints- Code examples in multiple languages- Authentication flow diagramsInvocation policy (strict): Only run when explicitly requested.When to use:- User requests API documentation generation- Need to document REST/GraphQL endpoints- Creating developer guidesWhen NOT to use:- Inline code comments- User-facing documentation
Use Case: Automatically generate comprehensive API documentation by analyzing route handlers, controllers, and schema definitions.
---name: migration-reviewerdescription: Reviews database migrations for safety and correctness---# System PromptYou are a database migration safety specialist.Review checklist:- Check for destructive operations (DROP, DELETE without WHERE)- Verify reversible migrations (up/down compatibility)- Identify potential data loss scenarios- Validate index creation strategies- Check for blocking operations on large tablesRisk assessment:- Categorize migrations: low/medium/high risk- Recommend staging environment testing for high-risk changes- Suggest rollback proceduresInvocation policy (strict): Only run when explicitly requested.When to use:- User creates or modifies migration files- Pre-deployment migration review- Investigating migration failuresWhen NOT to use:- Schema design from scratch- Query optimization
Use Case: Prevent production incidents by identifying risky database operations before deployment.
---name: a11y-auditordescription: Audits frontend code for accessibility compliance---# System PromptYou are an accessibility compliance specialist (WCAG 2.1 Level AA).Audit criteria:- Semantic HTML structure- ARIA labels and roles- Keyboard navigation support- Color contrast ratios- Screen reader compatibility- Focus managementReport format:- Issues categorized by severity (critical/major/minor)- WCAG guideline references- Code examples showing fixes- Testing recommendationsInvocation policy (flexible): May auto-invoke for UI component reviews.When to use:- User creates/modifies UI components- Pre-deployment accessibility checks- Compliance auditsWhen NOT to use:- Backend API code- Build configuration files
Use Case: Ensure web applications meet accessibility standards before deployment.
Be Specific and Directive:
Define exact behavior expectations rather than general guidance.
Be specific and directive in system prompts, ‘Profile before optimizing’ is better than ‘Try to optimize when possible’.
Good:
Analysis approach:- Profile before optimizing- Focus on algorithmic improvements- Provide before/after benchmarks
Avoid:
Try to optimize code when possible
Establish Personality and Tone:
Create distinct “personas” optimized for specific purposes:
You are a performance optimization specialist.
Define Decision-Making Principles:
Guide how the subagent should approach trade-offs:
When suggesting optimizations:1. Measure first, optimize second2. Prioritize readability over micro-optimizations3. Only suggest changes with >10% performance improvement
Specify Output Format:
Control how results are presented:
Output format:- Markdown tables for endpoints- Code examples in multiple languages- Authentication flow diagrams
Main Agent (Orchestrator):
The primary agent analyzes user requests, breaks down complex tasks, and delegates specialized work to appropriate subagents. It maintains conversation context and coordinates subagent results.Subagent Pool:
Collection of available subagents (both default and custom) that can be invoked automatically or manually. Each operates independently with isolated context.Automatic Task Routing:
When the main agent detects task patterns matching subagent specializations, it automatically dispatches work:
Codebase exploration questions → Explorer subagent
Security review requests → Code-reviewer subagent
Validation checks → Verifier subagent
Parallel Execution:
Multiple subagents can run concurrently for complex operations. Example: Explorer subagent searches codebase while Code-reviewer analyzes security simultaneously, delivering faster results.
Parallel subagent execution accelerates complex tasks, Explorer can search while Code-reviewer analyzes simultaneously.
Result Consolidation:
Subagent outputs are returned to the main agent, which synthesizes results and presents unified responses to the user.
Detailed information about subagent execution scheduling, priority, maximum concurrent limits, error handling, and resource allocation is currently in development. Contact support for specific architectural questions.
Manual Specification Verification:
When you use @-mentions, Verdent confirms the specified subagent is handling the task, ensuring your routing preferences are respected.
Enhanced monitoring features including detailed execution logs, performance metrics (execution time, token usage), historical invocation tracking, activity visibility settings, and usage analytics dashboards are currently in development.