Skip to main content

Agent Development Guide

Prerequisites

Before developing CODITECT agents, ensure you have:

  • CODITECT framework cloned and configured
  • Python 3.10+ installed
  • Understanding of YAML frontmatter format
  • Familiarity with Claude Code Task tool

Verify environment:

# Check CODITECT installation
ls -la .coditect/

# Verify agents directory
ls agents/ | head -10

Agent Development Guide

Complete guide to developing CODITECT agents with proper frontmatter, MoE classification, and thinking budget configuration.


Quick Start

Step 1: Create Agent File

Create a new agent in agents/your-agent-name.md:

---
title: "Your Agent Name"
component_type: agent
version: "1.0.0"
audience: contributor
status: stable
summary: "One-line description (max 100 chars)"
keywords: ['keyword1', 'keyword2']
tokens: ~2000
created: 2025-12-22
updated: 2025-12-22
agent_type: specialist
domain: ['development']
moe_role: specialist
moe_capabilities:
- specialized_analysis
- task_execution
invocation_pattern: "Task(subagent_type='your-agent-name', prompt='...')"
requires_context: true
model: sonnet
tools: "Read, Write, Edit, Grep, Glob"
quality_score: 75
last_reviewed: 2025-12-22
---

You are a [Your Agent Role] responsible for [primary responsibility].

## Core Capabilities
- Capability 1
- Capability 2

## When to Use
- Use case 1
- Use case 2

Step 2: Configure Frontmatter

Review and customize all required fields (see schema below).

Step 3: Activate Agent

python3 scripts/update-component-activation.py activate agent your-agent-name --reason "Purpose"
python3 scripts/update-component-counts.py

Agent Frontmatter Schema (ADR-018)

Required Fields

FieldTypeDescription
titlestringHuman-readable agent name
component_typestringAlways agent
versionsemverAgent version (e.g., "1.0.0")
audienceenumcustomer, contributor, or both
statusenumdraft, experimental, stable, production, deprecated
summarystringOne-line description (max 100 chars)
keywordsarraySearch keywords for discovery
tokensstringEstimated token count (e.g., ~2000)
createddateCreation date (YYYY-MM-DD)
updateddateLast update date (YYYY-MM-DD)

Agent-Specific Fields

FieldTypeDescription
agent_typeenumspecialist, analyst, judge, orchestrator, reviewer, generator
domainarrayAreas of expertise: security, development, qa, devops, documentation, research
moe_roleenumMoE classification (see below)
moe_capabilitiesarrayAgent capabilities for MoE routing
invocation_patternstringHow to invoke this agent
requires_contextboolWhether agent needs conversation context
modelenumsonnet, opus, haiku
toolsstringAvailable tools (comma-separated)
quality_scoreintQuality score 0-100
last_revieweddateLast review date

MoE Role Classification

CODITECT uses Mixture of Experts (MoE) for intelligent agent routing.

Role Types

RolePurposeCapabilities
orchestratorCoordinate multi-agent workflowstask_decomposition, agent_selection, workflow_coordination
analystDeep analysis and pattern recognitiondeep_analysis, pattern_recognition, evidence_gathering
judgeEvaluate and score outputsevaluation, scoring, verdict_generation, consensus_building
specialistDomain-specific expertisespecialized_analysis, task_execution
noneNo MoE routing needed-

Example MoE Configurations

Orchestrator Agent:

moe_role: orchestrator
moe_capabilities:
- task_decomposition
- agent_selection
- workflow_coordination
- result_aggregation

Analyst Agent:

moe_role: analyst
moe_capabilities:
- deep_analysis
- pattern_recognition
- evidence_gathering
- uncertainty_quantification

Judge Agent:

moe_role: judge
moe_capabilities:
- evaluation
- scoring
- verdict_generation
- consensus_building

Thinking Budgets

Configure thinking budget in frontmatter for cost control:

thinking:
budget_tokens: 10000 # Max thinking tokens
enabled: true # Enable extended thinking
level: standard # minimal, standard, extended, maximum

Budget Levels

LevelTokensUse Case
minimal2,000Simple lookups, quick responses
standard10,000Most development tasks
extended25,000Complex analysis, code review
maximum50,000Architecture decisions, deep research

See Thinking Budget System for details.


Agent Body Structure

After frontmatter, include:

1. Role Statement

You are a [Role] responsible for [primary responsibility].

2. Core Capabilities

## Core Capabilities
- Capability 1 with description
- Capability 2 with description

3. When to Use

## When to Use
- Use case 1
- Use case 2

## When NOT to Use
- Anti-pattern 1
- Anti-pattern 2

4. Usage Examples

## Usage Examples

**Example 1: Basic Usage**
\`\`\`
Task(subagent_type='your-agent', prompt='Do something specific')
\`\`\`

Invocation Patterns

Direct Task Invocation

Task(subagent_type='agent-name', prompt='Your detailed prompt here')

With Model Override

Task(subagent_type='agent-name', prompt='...', model='opus')

Background Execution

Task(subagent_type='agent-name', prompt='...', run_in_background=True)

Agent Activation

After creating an agent, activate it:

# Add to activation status
python3 scripts/update-component-activation.py activate agent YOUR-AGENT-NAME --reason "Purpose"

# Update component counts
python3 scripts/update-component-counts.py

# Verify
python3 scripts/update-component-activation.py status agent YOUR-AGENT-NAME

Best Practices

DO

  • Use descriptive, action-oriented names (e.g., code-reviewer, security-auditor)
  • Include clear "When to Use" and "When NOT to Use" sections
  • Provide concrete usage examples
  • Set appropriate thinking budgets for complexity
  • List all required tools explicitly

DON'T

  • Create agents that overlap significantly with existing ones
  • Use vague summaries or descriptions
  • Skip the MoE role classification
  • Hardcode paths or project-specific values
  • Create agents without activation

Troubleshooting

Agent Not Activating

Problem: New agent doesn't appear in component counts Solution: Run activation command:

python3 scripts/update-component-activation.py activate agent YOUR-AGENT --reason "purpose"
python3 scripts/update-component-counts.py

Frontmatter Validation Errors

Problem: Agent fails frontmatter validation Solution: Verify all required fields present (title, component_type, version, status, summary)

MoE Role Not Recognized

Problem: Agent not routed correctly by MoE system Solution: Verify moe_role is one of: orchestrator, analyst, judge, specialist, none



Next Steps

After creating your agent:

  1. Test invocation: /agent your-agent-name "test task"
  2. Review: Component Activation Guide
  3. Explore: Thinking Budget System
  4. Reference: Agent Frontmatter Config

Last Updated: 2025-12-28 Compliance: CODITECT Documentation Standard v1.0.0