4.6 KiB
KaizenAgentTemplate
This is where we build from
KaizenAgent Definition Template
Version: 1.0
Last Updated: {timestamp}
agent: name: "{agent_name}" version: "1.0.0" description: "Brief description of agent's primary responsibility"
Core Specification
specification: purpose: | One paragraph describing the agent's single responsibility. Focus on the desired outcome, not implementation details.
triggers:
# When should this agent be invoked?
patterns:
- "File patterns that indicate this agent should run"
- "Keywords or context clues in requests"
- "Project states that require this agent"
explicit_commands:
- "--agent={agent_name}"
- "claude code --{shorthand}"
inputs:
required:
- name: "input_name"
type: "string|array|object"
description: "What this input represents"
optional:
- name: "optional_input"
type: "string"
default: "default_value"
description: "Optional configuration"
outputs:
primary:
type: "file|stdout|metadata"
description: "Main deliverable of the agent"
side_effects:
- "Any files created or modified"
- "External systems touched"
- "State changes made"
preconditions:
- "Conditions that must be true before agent runs"
- "Dependencies that must exist"
postconditions:
- "Guaranteed state after successful execution"
- "Invariants that will be maintained"
Idempotency Design
idempotency: strategy: "convergent|checkpoint|fingerprint|state_detection"
state_detection:
method: "How to check if work is already done"
implementation: |
# Pseudo-code or description of how to detect current state
check_current_state()
if (desired_state_achieved()) return current_state
proceed_with_transformation()
rollback:
supported: true
method: "How to undo changes if needed"
Performance Measurement
metrics: primary: name: "primary_success_metric" description: "Most important measure of agent success" measurement: "How to calculate this metric" target: "Desired value or improvement threshold"
secondary:
- name: "additional_metric_1"
description: "Secondary success indicator"
measurement: "Calculation method"
- name: "additional_metric_2"
description: "Quality or safety metric"
measurement: "How to measure"
collection:
frequency: "per_execution|daily|weekly"
storage: "where_metrics_are_stored"
retention: "how_long_to_keep_data"
Testing and Validation
testing: unit_tests: - scenario: "Test scenario description" input: "Sample input data" expected_output: "Expected result" verification: "How to verify success"
integration_tests:
- scenario: "End-to-end test scenario"
setup: "Required project state"
execution: "Commands to run"
validation: "Success criteria"
performance_tests:
- scenario: "Performance test case"
load: "Input complexity/size"
max_time: "Acceptable execution time"
resource_limits: "Memory/CPU constraints"
Dependencies and Context
dependencies: system: - "Required tools or binaries" - "Environment variables needed"
project:
- "Files that must exist"
- "Project structure assumptions"
other_agents:
- name: "dependency_agent"
relationship: "runs_before|runs_after|collaborates"
reason: "Why this dependency exists"
Configuration
configuration: defaults: key1: "default_value1" key2: "default_value2"
project_overrides:
path: ".kaizen/agents/{agent_name}.yml"
schema: "JSON schema for configuration validation"
environment_variables:
- name: "KAIZEN_{AGENT_NAME}_CONFIG"
description: "Runtime configuration override"
Evolution Tracking
optimization: baseline_performance: established: "{date}" metrics: {}
improvement_history:
- version: "1.0.1"
change: "Description of what was modified"
reason: "Why the change was made"
impact: "Measured improvement"
known_limitations:
- "Current limitation 1"
- "Area for future improvement"
kaizen_notes:
optimization_priority: "high|medium|low"
next_experiment: "Planned improvement to test"
success_criteria: "How to measure if experiment succeeded"
xxx