Skip to main content

Agent Management

Agent Management in PostQode allows you to enable and configure specialized agents that can handle specific tasks autonomously. These agents extend PostQode's capabilities by delegating complex tasks to purpose-built AI assistants.

Accessing Agent Management Settings

  1. Open VS Code with PostQode extension installed
  2. Click on the PostQode icon in the sidebar to open the PostQode panel
  3. Click on the Settings icon (gear icon) in the PostQode panel
  4. Navigate to the Agent Management section

Enable Agents

Default: Disabled

Allow the AI to delegate tasks to specialized agents for more efficient and focused task execution.

What are Specialized Agents?

Specialized agents are AI assistants configured for specific types of tasks. Instead of using a general-purpose AI for everything, PostQode can delegate tasks to agents that are optimized for particular domains.

Examples of Specialized Agents:

  • Code Review Agent - Focused on reviewing code quality and best practices
  • Testing Agent - Specialized in writing and executing tests
  • Documentation Agent - Expert at creating and updating documentation
  • Debugging Agent - Optimized for finding and fixing bugs
  • API Agent - Specialized in API testing and automation
  • Web Agent - Focused on web automation and browser testing

How Agent Delegation Works

When you enable agents, PostQode can:

  1. Analyze Your Task - Understand what you're trying to accomplish
  2. Select Appropriate Agent - Choose the best specialized agent for the task
  3. Delegate Execution - Hand off the task to the specialized agent
  4. Return Results - Bring back the completed work

Example Flow:

You: "Review this code for security issues"

PostQode: Analyzes request → Delegates to Code Review Agent

Code Review Agent: Performs security analysis

PostQode: Returns security review results to you

Benefits of Using Agents

1. Specialized Expertise

Each agent is optimized for specific tasks with:

  • Domain-specific knowledge
  • Specialized prompts and instructions
  • Focused tool access
  • Optimized workflows

2. Improved Efficiency

  • Faster task completion with specialized agents
  • Better results from domain expertise
  • Reduced token usage with focused agents
  • Parallel task execution capabilities

3. Better Organization

  • Clear separation of concerns
  • Consistent behavior for specific task types
  • Easier to maintain and update
  • Reusable across projects

4. Customization

  • Create your own specialized agents
  • Tailor agents to your team's needs
  • Share agents across projects
  • Version control agent configurations

Types of Agents

PostQode supports different types of agents, each serving specific purposes and stored in different locations.

Built-in Agents

Location: Bundled with PostQode extension

Purpose: Pre-configured agents provided by PostQode for common tasks.

PostQode comes with several built-in agents that are ready to use out of the box:

  • Code Review Agent - Reviews code for quality, security, and best practices
  • Testing Agent - Generates and executes test suites
  • Documentation Agent - Creates and updates technical documentation
  • Debugging Agent - Helps identify and fix bugs
  • Refactoring Agent - Assists with code refactoring and optimization

Benefits:

  • ✅ No configuration needed - works immediately
  • ✅ Professionally designed and tested
  • ✅ Regularly updated with PostQode releases
  • ✅ Optimized for common development tasks
  • ✅ Best practices built-in

How to Use: Built-in agents are automatically available when you enable the "Enable Agents" feature. PostQode will automatically delegate tasks to the appropriate built-in agent based on your request.

Note: Built-in agents cannot be modified directly, but you can create custom agents that override or extend their functionality.

Organization Agents

Location: Configured by your organization administrator

Purpose: Company-wide agents shared across all organization members.

Organization agents are centrally managed agents that enforce company standards and workflows across all team members.

Characteristics:

  • Centrally Managed: Configured and maintained by organization admins
  • Automatic Distribution: Automatically available to all organization members
  • Enforced Standards: Ensures consistent practices across teams
  • Cannot be Modified: Individual users cannot change organization agents
  • Priority: Take precedence over personal and project agents

Common Use Cases:

  • Security Review Agent: Enforces company security standards
  • Compliance Agent: Ensures regulatory compliance
  • Code Style Agent: Enforces company coding standards
  • Documentation Agent: Maintains consistent documentation format
  • Deployment Agent: Follows company deployment procedures

Benefits:

  • ✅ Consistent standards across entire organization
  • ✅ Centralized updates and improvements
  • ✅ Enforced best practices
  • ✅ Reduced configuration overhead for team members
  • ✅ Compliance and security enforcement

How Organization Agents Work:

  1. Admin Configuration: Organization admins configure agents in the organization settings
  2. Automatic Sync: Agents are automatically synced to all organization members
  3. Transparent Usage: Users don't need to do anything - agents work automatically
  4. Cannot Override: Individual users cannot disable or modify organization agents
  5. Regular Updates: Admins can update agents, changes propagate automatically

Example Scenario:

Your Organization: Acme Corp
Organization Agents:
- acme-security-reviewer (enforces Acme security standards)
- acme-code-style-checker (enforces Acme coding style)
- acme-deployment-validator (validates deployment procedures)

When you write code:

PostQode automatically uses acme-security-reviewer

Code is checked against Acme's security standards

You receive feedback aligned with company policies

For Organization Administrators:

To configure organization agents:

  1. Access organization settings in PostQode admin panel
  2. Navigate to "Organization Agents" section
  3. Create or upload agent configuration files
  4. Set agent priority and scope
  5. Publish agents to organization members

For Team Members:

Organization agents work automatically:

  • No configuration needed
  • Cannot be disabled (enforced by organization)
  • Visible in agent list with "Organization" badge
  • Take priority over personal and project agents
  • Updates happen automatically

Agent Storage Locations

Agents are defined as .md files (Markdown) in specific directories. PostQode looks for agents in the following locations:

1. Project Agents (Team-Shared)

Location: .postqode/agents/

Purpose: Agents shared with your entire team through version control.

Use Cases:

  • Team-specific workflows
  • Project-specific conventions
  • Shared testing strategies
  • Company coding standards

Example:

your-project/
└── .postqode/
└── agents/
├── code-reviewer.md
├── api-tester.md
└── documentation-writer.md

Benefits:

  • ✅ Version controlled with your project
  • ✅ Shared automatically with team members
  • ✅ Consistent across all team members
  • ✅ Project-specific customization

2. Personal Agents (All Projects)

Location: ~/.postqode/agents/

Purpose: Your personal agents available across all your projects.

Use Cases:

  • Personal productivity tools
  • Individual coding preferences
  • Cross-project utilities
  • Personal automation scripts

Example:

~/.postqode/
└── agents/
├── my-code-style-checker.md
├── my-commit-message-generator.md
└── my-refactoring-assistant.md

Benefits:

  • ✅ Available in all your projects
  • ✅ Personal customization
  • ✅ Not shared with team (private)
  • ✅ Portable across workspaces

3. Claude Code Compatible Agents

Location: .claude/agents/

Purpose: Agents compatible with Claude Code format for cross-tool compatibility.

Use Cases:

  • Sharing agents with Claude Code users
  • Migration from Claude Code
  • Cross-tool workflows
  • Standard agent formats

Example:

your-project/
└── .claude/
└── agents/
├── test-generator.md
└── bug-fixer.md

Benefits:

  • ✅ Compatible with Claude Code
  • ✅ Standard format
  • ✅ Easy migration
  • ✅ Broader ecosystem support

Creating Custom Agents

You can create your own specialized agents by creating .md files in any of the agent directories.

Agent File Structure

Agents are defined using Markdown files with YAML frontmatter:

---
name: code-reviewer
description: Reviews code for quality, security, and best practices
model: claude-3-5-sonnet
tools: [read_file, search_files, write_to_file]
---

# Code Review Agent

You are a specialized code review agent focused on:
- Code quality and maintainability
- Security vulnerabilities
- Performance issues
- Best practices adherence

## Review Process

1. Read the code files
2. Analyze for issues
3. Provide detailed feedback
4. Suggest improvements

## Focus Areas

- Security: Check for common vulnerabilities
- Performance: Identify bottlenecks
- Maintainability: Assess code clarity
- Best Practices: Verify standards compliance

Agent Configuration Options

Frontmatter Fields

Required:

  • name: Unique identifier for the agent
  • description: What the agent does (used for task matching)

Optional:

  • model: Specific AI model to use (e.g., claude-3-5-sonnet, gpt-4)
  • tools: Array of tools the agent can use
  • temperature: Creativity level (0.0 - 1.0)
  • max_tokens: Maximum response length
  • system_prompt: Additional system instructions

Example Configurations

Testing Agent:

---
name: testing-agent
description: Generates and executes comprehensive test suites
model: claude-3-5-sonnet
tools: [read_file, write_to_file, execute_command, search_files]
temperature: 0.3
---

Documentation Agent:

---
name: docs-agent
description: Creates and updates technical documentation
model: gpt-4
tools: [read_file, write_to_file, search_files]
temperature: 0.7
---

API Testing Agent:

---
name: api-testing-agent
description: Automates API testing and validation
model: claude-3-5-sonnet
tools: [read_file, write_to_file, execute_command]
temperature: 0.2
---

Using Agents

Automatic Agent Selection

When agents are enabled, PostQode automatically selects the appropriate agent based on your task:

You: "Review this authentication code for security issues"

PostQode: Matches task → Delegates to Code Review Agent

Code Review Agent: Performs security review

Result: Detailed security analysis returned

Manual Agent Selection

You can also explicitly request a specific agent:

You: "Use the testing-agent to create unit tests for this module"

PostQode: Delegates to Testing Agent

Testing Agent: Generates comprehensive unit tests

Agent Capabilities

Different agents have access to different tools:

Code Review Agent:

  • ✅ Read files
  • ✅ Search codebase
  • ❌ Write files (read-only review)
  • ❌ Execute commands

Testing Agent:

  • ✅ Read files
  • ✅ Write test files
  • ✅ Execute tests
  • ✅ Search for test patterns

Documentation Agent:

  • ✅ Read code files
  • ✅ Write documentation
  • ✅ Search for examples
  • ❌ Execute commands

Best Practices

1. Start with Project Agents

For team projects:

  • ✅ Create agents in .postqode/agents/
  • ✅ Commit agents to version control
  • ✅ Document agent purposes in README
  • ✅ Keep agents focused on project needs

2. Use Personal Agents for Individual Preferences

For personal workflows:

  • ✅ Create agents in ~/.postqode/agents/
  • ✅ Customize to your coding style
  • ✅ Keep private preferences separate
  • ✅ Don't mix with team agents

3. Keep Agents Focused

Each agent should have a clear, specific purpose:

  • Good: "API Testing Agent" - Tests API endpoints
  • Bad: "General Helper Agent" - Does everything

4. Limit Tool Access

Give agents only the tools they need:

# Testing agent doesn't need browser tools
tools: [read_file, write_to_file, execute_command]

# Documentation agent doesn't need execute
tools: [read_file, write_to_file, search_files]

5. Document Your Agents

Include clear instructions in the agent file:

## Purpose
This agent reviews code for security vulnerabilities.

## When to Use
- Before merging pull requests
- After implementing authentication
- When handling user input
- Before production deployment

## What It Checks
- SQL injection vulnerabilities
- XSS attack vectors
- Authentication bypass issues
- Data exposure risks

Troubleshooting

Agent Not Being Selected

Symptoms:

  • PostQode doesn't delegate to your custom agent
  • General AI handles tasks instead of specialized agent

Solutions:

  1. Check agent description matches your task type
  2. Verify agent file is in correct directory
  3. Ensure agent file has .md extension
  4. Restart VS Code to reload agents
  5. Check agent file has valid YAML frontmatter

Agent Fails to Execute

Symptoms:

  • Agent starts but fails during execution
  • Error messages about missing tools

Solutions:

  1. Verify agent has access to required tools
  2. Check model configuration is correct
  3. Ensure API keys are properly configured
  4. Review agent system prompt for errors
  5. Check agent has necessary permissions

Agent File Not Found

Symptoms:

  • "Agent file not found" error
  • Agent doesn't appear in available agents

Solutions:

  1. Verify file is in correct directory:
    • .postqode/agents/ for project agents
    • ~/.postqode/agents/ for personal agents
    • .claude/agents/ for Claude Code compatible
  2. Check file has .md extension
  3. Ensure directory exists (create if needed)
  4. Restart VS Code to reload agents

Multiple Agents Conflict

Symptoms:

  • Wrong agent selected for task
  • Agents interfering with each other

Solutions:

  1. Make agent descriptions more specific
  2. Use unique, clear agent names
  3. Limit agent scope to specific tasks
  4. Review agent selection logic
  5. Disable conflicting agents temporarily

Agent Management Tips

Organizing Agents

By Function:

.postqode/agents/
├── code-review/
│ ├── security-reviewer.md
│ ├── performance-reviewer.md
│ └── style-checker.md
├── testing/
│ ├── unit-test-generator.md
│ ├── integration-tester.md
│ └── e2e-tester.md
└── documentation/
├── api-doc-writer.md
└── readme-updater.md

By Project Area:

.postqode/agents/
├── frontend-specialist.md
├── backend-specialist.md
├── database-specialist.md
└── devops-specialist.md

Sharing Agents

Within Team:

  1. Create agent in .postqode/agents/
  2. Commit to version control
  3. Team members get agent automatically
  4. Document in project README

Across Projects:

  1. Create agent in ~/.postqode/agents/
  2. Copy to other projects as needed
  3. Or keep in personal directory for all projects

Updating Agents

To update an agent:

  1. Edit the .md file
  2. Save changes
  3. Restart VS Code (or reload window)
  4. Agent uses new configuration

Version control agents:

# Commit agent changes
git add .postqode/agents/
git commit -m "Update code review agent with new security checks"
git push

Example Agents

Security Review Agent

File: .postqode/agents/security-reviewer.md

---
name: security-reviewer
description: Reviews code for security vulnerabilities and best practices
model: claude-3-5-sonnet
tools: [read_file, search_files]
temperature: 0.2
---

# Security Review Agent

You are a security-focused code reviewer specializing in identifying vulnerabilities.

## Review Checklist

### Authentication & Authorization
- [ ] Proper authentication checks
- [ ] Authorization before sensitive operations
- [ ] Secure session management
- [ ] Token validation

### Input Validation
- [ ] All user inputs validated
- [ ] SQL injection prevention
- [ ] XSS attack prevention
- [ ] Command injection checks

### Data Protection
- [ ] Sensitive data encrypted
- [ ] Secure data transmission
- [ ] No hardcoded secrets
- [ ] Proper error handling (no data leaks)

### Dependencies
- [ ] No known vulnerable dependencies
- [ ] Dependencies up to date
- [ ] Secure dependency sources

## Output Format

Provide findings in this format:
1. **Critical Issues** - Must fix before deployment
2. **High Priority** - Should fix soon
3. **Medium Priority** - Fix when possible
4. **Low Priority** - Nice to have improvements
5. **Recommendations** - Best practices suggestions

API Testing Agent

File: .postqode/agents/api-tester.md

---
name: api-tester
description: Creates and executes comprehensive API test suites
model: claude-3-5-sonnet
tools: [read_file, write_to_file, execute_command, search_files]
temperature: 0.3
---

# API Testing Agent

You are specialized in API testing and validation.

## Testing Approach

### 1. Analyze API
- Review API endpoints and methods
- Identify request/response formats
- Understand authentication requirements
- Map data dependencies

### 2. Generate Test Cases
- **Positive Tests**: Valid inputs and expected success
- **Negative Tests**: Invalid inputs and error handling
- **Boundary Tests**: Edge cases and limits
- **Integration Tests**: Multi-endpoint workflows

### 3. Create Test Files
- Generate request files in YAML format
- Create test cases with assertions
- Set up test suites with proper configuration
- Include hooks for setup/teardown

### 4. Execute and Validate
- Run test suites
- Verify all assertions pass
- Check performance metrics
- Report any failures

## Test Quality Standards

Every test must include:
- Clear, descriptive name
- Comprehensive assertions
- Proper error handling
- Performance checks
- Documentation

Documentation Agent

File: .postqode/agents/docs-writer.md

---
name: docs-writer
description: Creates and updates technical documentation
model: gpt-4
tools: [read_file, write_to_file, search_files]
temperature: 0.7
---

# Documentation Agent

You are a technical documentation specialist.

## Documentation Standards

### Structure
- Clear headings and sections
- Table of contents for long docs
- Code examples with explanations
- Visual aids (diagrams, screenshots)

### Content
- **What**: Explain what the feature does
- **Why**: Explain why it's useful
- **How**: Step-by-step instructions
- **Examples**: Real-world use cases
- **Troubleshooting**: Common issues and solutions

### Style
- Clear, concise language
- Active voice
- Present tense
- Consistent terminology
- Proper formatting

## Output Format

Use Markdown with:
- Proper heading hierarchy
- Code blocks with language tags
- Lists for steps and options
- Tables for comparisons
- Links to related docs

Advanced Configuration

Agent Priority

When multiple agents could handle a task, PostQode selects based on:

  1. Description Match - How well the agent description matches the task
  2. Tool Availability - Whether the agent has required tools
  3. Model Capability - Agent's model capabilities
  4. Recent Success - Agent's past performance on similar tasks

Agent Chaining

Agents can work together on complex tasks:

Complex Task: "Build and test a new API endpoint"

1. Code Generation Agent → Creates the endpoint code

2. Code Review Agent → Reviews for quality and security

3. Testing Agent → Generates and runs tests

4. Documentation Agent → Creates API documentation

Agent Context

Agents have access to:

  • Project Files - Can read and analyze your codebase
  • Conversation History - Understands previous context
  • Tool Results - Sees results from tool executions
  • Variables - Access to environment and project variables

Security Considerations

Agent Permissions

Be mindful of what tools you give agents:

Safe Tools:

  • read_file - Reading files is generally safe
  • search_files - Searching is read-only

Potentially Risky Tools:

  • ⚠️ write_to_file - Can modify your codebase
  • ⚠️ execute_command - Can run system commands
  • ⚠️ browser_action - Can interact with web services

Best Practices for Security

  1. Principle of Least Privilege

    • Give agents only the tools they absolutely need
    • Review agent tool access regularly
    • Remove unused tools from agent configuration
  2. Review Agent Actions

    • Monitor what agents are doing
    • Review file changes before committing
    • Check command executions
    • Validate agent outputs
  3. Separate Concerns

    • Don't create "super agents" with all tools
    • Keep agents focused and limited
    • Use multiple specialized agents instead
  4. Version Control

    • Track agent file changes in Git
    • Review agent modifications in PRs
    • Document agent purposes and limitations

Troubleshooting

Agents Not Working

Symptoms:

  • Agents feature enabled but not working
  • Tasks not being delegated to agents

Solutions:

  1. Verify "Enable Agents" is turned on in settings
  2. Check agent files exist in correct directories
  3. Ensure agent files have valid YAML frontmatter
  4. Restart VS Code to reload agent configurations
  5. Check PostQode output panel for error messages

Agent Selection Issues

Symptoms:

  • Wrong agent selected for task
  • No agent selected when one should be

Solutions:

  1. Make agent descriptions more specific and clear
  2. Ensure description matches the types of tasks you want delegated
  3. Check for conflicting agent descriptions
  4. Review agent tool requirements
  5. Verify agent model is properly configured

Agent Execution Errors

Symptoms:

  • Agent starts but fails during execution
  • Incomplete or incorrect results

Solutions:

  1. Check agent has access to required tools
  2. Verify model configuration and API keys
  3. Review agent system prompt for errors
  4. Check file paths and permissions
  5. Monitor PostQode output for detailed error messages

Performance Issues

Symptoms:

  • Slow agent responses
  • High token usage
  • Frequent timeouts

Solutions:

  1. Use faster models for simple agents
  2. Limit agent tool access to essentials
  3. Reduce agent context size
  4. Optimize agent prompts
  5. Consider using lower temperature settings

Next Steps


Ready to use agents? Enable the feature in settings and start delegating tasks to specialized AI assistants!