What You’ll Learn
How to customize and extend Verdent for VS Code using three powerful extensibility methods: custom subagents, rule systems, and MCP integration.Extensibility Overview
Verdent for VS Code provides three primary methods to extend its capabilities and customize behavior:- Custom Subagents - Create specialized AI agents for domain-specific tasks
- Rules System - Guide behavior through user_rules.md, AGENTS.md, and plan_rules.md
- MCP Integration - Connect external tools and services via Model Context Protocol
Method 1: Custom Subagents
Overview
Custom subagents are specialized AI agents with dedicated system prompts, invocation policies, and task-specific expertise. They extend Verdent’s built-in subagents (@Verifier, @Explorer, @Code-reviewer) with project-specific capabilities.
Storage Location: ~/.verdent/subagents/
Creating Custom Subagents
File Structure:- Settings → Subagents
- “Create new subagent”
- Define name, description, system prompt
- Configure invocation policy
- Save to
~/.verdent/subagents/
- Navigate to
~/.verdent/subagents/ - Create markdown file (e.g.,
security-reviewer.md) - Add YAML frontmatter
- Write system prompt and usage guidelines
Use Cases for Custom Subagents
Domain-Specific Expertise:- Financial calculations: Tax compliance, financial regulations
- Healthcare HIPAA compliance: Patient data handling standards
- Cryptography: Security implementation best practices
- Code style enforcers: Team coding standards beyond linter rules
- Documentation consistency: Ensure docs follow team templates
- Dependency auditors: Monitor third-party packages against approved lists
- React performance optimizers: Identify unnecessary re-renders
- SQL query optimizers: Analyze and improve database performance
- Docker configuration reviewers: Validate containerization practices
- Test coverage analyzers: Identify untested code paths
- Error handling reviewers: Ensure comprehensive exception handling
- Logging standards enforcers: Verify logging practices
Example: API Documentation Generator
Example: Database Migration Reviewer
Invocation Policies
Strict Policy:- Subagent only runs when explicitly requested via @-mention
- User maintains full control over invocation
- Best for specialized, occasional-use subagents
- Allows automatic invocation based on task pattern detection
- Main agent routes matching tasks automatically
- Best for frequently-used, well-defined subagents
Method 2: Rules System
Overview
Rule files are Markdown documents that guide Verdent’s behavior, output formatting, and decision-making without code changes. Three rule types provide comprehensive customization:| Rule Type | Scope | Priority | Storage |
|---|---|---|---|
| user_rules.md | Global across all projects | Medium | ~/.verdent/user_rules.md |
| AGENTS.md | Project-specific (team) | Highest | Project root directory |
| plan_rules.md | Plan Mode formatting | Independent | ~/.verdent/plan_rules.md |
Rule Precedence
When conflicts occur:- AGENTS.md (highest) - Project rules override user preferences
- user_rules.md (medium) - Applied when no project conflict
- Default behavior (lowest) - Verdent’s built-in defaults
user_rules.md (Global Preferences)
Purpose: Personal coding style and preferences across all projects Example:AGENTS.md (Project Rules)
Purpose: Team-wide coding standards and project-specific conventions Example:plan_rules.md (Plan Customization)
Purpose: Control Plan Mode output format and detail level Example:Rule Writing Best Practices
Be Specific and Directive:- Group related rules under section headers
- Separate concerns (style, testing, documentation, security)
- Use consistent structure across files
- Place important rules first in each section
- Use emphasis for non-negotiable standards:
**NEVER** commit credentials - Focus on bug prevention and security
- Start new conversation to verify rule application
- Refine rules based on actual agent behavior
- Update as project evolves
Method 3: MCP Integration
Overview
Model Context Protocol (MCP) extends Verdent by connecting external tools, data sources, and services. MCP servers act as bridges between Verdent and external systems. Configuration:~/.verdent/mcp.json via Settings → MCP Servers
MCP Capabilities
External System Access:- Database query tools (PostgreSQL, MySQL, MongoDB)
- Cloud service APIs (AWS, Azure, GCP)
- Project management (Jira, Linear, Asana)
- CI/CD pipelines (Jenkins, GitHub Actions)
- Monitoring services (Datadog, New Relic)
- Internal API integrations
- Legacy system bridges
- Specialized data sources
- Workflow automation tools
MCP vs. Custom Subagents vs. Rules
| Need | Best Method | Why |
|---|---|---|
| Specialized AI analysis | Custom Subagent | Requires AI reasoning with custom context |
| Coding standards enforcement | Rules (AGENTS.md) | Simple behavior guidance |
| External database access | MCP Integration | Requires connection to external system |
| Personal coding preferences | Rules (user_rules.md) | Global behavior customization |
| Team conventions | Rules (AGENTS.md) | Shared project standards |
| API integration | MCP Integration | External service interaction |
| Plan format customization | Rules (plan_rules.md) | Plan Mode output control |
| Domain expertise (finance, healthcare) | Custom Subagent | Specialized knowledge application |
Example: Combining All Three Methods
Scenario: Full-stack development team with strict compliance requirements Custom Subagent:- Compliance database MCP server: Check operations against compliance rules
- Audit log MCP server: Record all sensitive data access
Extensibility Best Practices
Start Simple, Scale Up
Progressive Adoption:- Phase 1: Start with basic rules (user_rules.md or AGENTS.md)
- Phase 2: Add custom subagents for repeated specialized tasks
- Phase 3: Integrate MCP for external system connections
Combine Methods Strategically
Synergy Examples: Rules + Subagents:- AGENTS.md specifies when to invoke custom subagents
- Rules enforce that subagent recommendations are followed
- AGENTS.md defines which MCP servers are approved for use
- Rules specify when external data access is required
- Custom subagent uses MCP tools to access external systems
- Subagent interprets MCP results with specialized expertise
Document Customizations
Team Documentation: For custom subagents and project rules (AGENTS.md):- Document rationale for non-obvious rules or subagents
- Provide examples of correct usage
- Include troubleshooting guides
- Version control alongside code
- Comment complex rules with reasoning
- Keep rules organized and updated
- Remove obsolete rules promptly
Test Thoroughly
Validation Process:- Create customization (subagent/rule/MCP config)
- Start fresh conversation to test
- Verify behavior matches expectations
- Refine based on results
- Document successful patterns
- Does subagent invoke automatically when expected?
- Do project rules override user rules correctly?
- Does MCP server connect and execute operations?
- Do combined methods interact without conflicts?
Troubleshooting Extensibility
Custom Subagent Issues
Subagent Not Invoking:- Check invocation policy (strict requires explicit @-mention)
- Verify “When to use” guidelines match your request
- Ensure file is in
~/.verdent/subagents/directory - Check YAML frontmatter syntax
- Review system prompt for clarity
- Refine “When to use” and “When NOT to use” guidelines
- Test with explicit @-mention to isolate behavior
- Iterate on system prompt based on results
Rule Conflicts
Rule Not Being Applied:- Check rule precedence (AGENTS.md > user_rules.md)
- Verify file is in correct location
- Start new conversation to test fresh application
- Make rules more specific and directive
- Look for contradictory rules in same file
- Check if rules are too vague
- Verify correct rule file is being edited
- Use explicit language (“Always”, “Never”, “Prefer”)
MCP Integration Issues
Connection Failures:- Verify
mcp.jsonsyntax - Check authentication credentials
- Ensure MCP server is running and accessible
- Validate network connectivity
- Confirm MCP server exposes expected tools
- Check tool parameter formats
- Review MCP server logs for errors
- Test MCP server independently