- Essential project files: .gitignore, pyproject.toml, README.md - Documentation framework: CHANGELOG.md, CONTRIBUTING.md, TODO.md, CLAUDE.md - 15 specialized agent definitions for comprehensive development workflow - Core source code structure with optimization framework - Testing infrastructure with example tests - Proper Python package structure following PythonVibes standards This establishes the complete foundation for the AI agent development framework with agent-driven workflows, continuous improvement principles, and comprehensive development infrastructure. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
13 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
Kaizen Agentic is an AI agent development framework that embraces the Japanese concept of "kaizen" (continuous improvement). Every coding subagent becomes part of an optimization loop where performance is measured, patterns are analyzed, and specifications are refined over time.
Repository Structure
This is a modern Python project with agent development focus:
kaizen-agentic/
├── Makefile # Comprehensive development commands and workflows
├── pyproject.toml # Python project configuration and dependencies
├── src/kaizen_agentic/ # Main Python package
│ ├── __init__.py # Package exports and version info
│ ├── core.py # Core Agent and AgentConfig classes
│ └── optimization.py # OptimizationLoop and PerformanceMetrics
├── tests/ # Test suite with pytest
│ ├── __init__.py
│ └── test_core.py # Core functionality tests
├── agents/ # Agent definitions and configurations
│ ├── agent-claude-documentation.md
│ ├── agent-project-management.md
│ ├── agent-repository-structure.md
│ ├── agent-keepaTodofile.md
│ ├── agent-keepaChangelog.md
│ └── [other agent definitions]
├── .claude/ # Claude Code configuration
│ └── settings.local.json # Local permissions and settings
├── .venv/ # Python virtual environment (created by setup)
├── TODO.md # Current todofile (Keep a Todofile format)
├── CHANGELOG.md # Version history (Keep a Changelog format)
├── CONTRIBUTING.md # Developer contribution guidelines
├── CLAUDE.md # Claude Code guidance documentation
├── LICENSE # MIT License
└── README.md # Project overview
Quick Start
For first-time setup or when starting fresh:
# Complete setup with development dependencies
make setup-complete
# Activate virtual environment
source .venv/bin/activate
# Verify everything works
make test && make lint
Key Development Commands
The Makefile provides an extensive set of commands for development workflow. Use make help to see all available commands.
Essential Commands
make help- Show all available commands with descriptionsmake setup- Basic project setup (creates venv + installs package)make setup-complete- Complete setup including dev dependencies (recommended)make test- Run all tests with pytestmake lint- Run code linting with flake8 (100 char line length)make format- Format code with blackmake clean- Clean build artifacts and cache
Environment Management
make venv-status- Check virtual environment statusmake ensure-project-structure- Auto-create Python project structure if missingmake install-dev- Install package in development modemake setup-dev- Install development dependencies (pytest, black, flake8, mypy)make install-deps- Install dependencies user-local (fallback option)make install-system- Install system dependencies via apt (requires sudo)
Testing Infrastructure
The project includes comprehensive testing capabilities:
Basic Testing
make test- Run all tests with pytestmake test-status- Show test status summary without re-runningmake test-new- Create new test file templatemake test-coverage ISSUE=X- Analyze test coverage for specific issue
Advanced Testing
make test-clean- Clean test run (exclude workspaces, fresh cache)make test-tdd- Quick TDD tests for fast feedback (<30s)make test-changed- Run tests for changed files onlymake test-module MODULE=name- Run tests for specific modulemake test-efficient- Enhanced test suite excluding workspaces
Architectural Testing
make test-arch- Run tests in architectural order (reverse dependency)make test-foundation- Foundation layer tests (fastest feedback)make test-infrastructure- Infrastructure layer testsmake test-domain- Domain layer tests (business logic)make test-quick- Foundation + infrastructure only (fast)
Randomized Testing
make test-random- Run tests in random order to detect hidden dependenciesmake test-random-seed SEED=X- Run with specific seed for reproducibilitymake test-random-repeat NUM=X- Run multiple random iterations
Issue Management
The project uses Gitea for issue tracking with integrated CLI tools:
make issue-list- Show all issues with status and prioritymake issue-list-open- Show only open issues (active backlog)make issue-show ISSUE=X- Show detailed view of specific issuemake issue-create TITLE='...' BODY='...'- Create new issuemake issue-close ISSUE=X- Close an issuemake issue-get- Export issues to various formats (CSV, JSON, TSV)
TDD Workflow
Complete test-driven development support:
make tdd-start ISSUE=X- Start working on issue with requirements validationmake tdd-add-test- Add test to current issue workspacemake tdd-status- Show current workspace statemake tdd-finish- Complete issue work (move tests to main)make test-from-issue ISSUE=X- Generate test skeleton from issue
Core Framework Architecture
The repository provides a working AI agent framework with kaizen optimization:
Core Classes
-
AgentConfig (
src/kaizen_agentic/core.py)- Configuration dataclass for agents
- Includes name, description, model, instructions, and metadata
-
Agent (
src/kaizen_agentic/core.py)- Abstract base class for AI agents
- Provides performance tracking and configuration updates
- Implements kaizen optimization interface
-
OptimizationLoop (
src/kaizen_agentic/optimization.py)- Implements continuous improvement cycles
- Performance analysis and trend detection
- Generates improvement recommendations
-
PerformanceMetrics (
src/kaizen_agentic/optimization.py)- Container for agent performance data
- Tracks execution time, success rate, quality scores
Agent System Architecture
Specialized agent definitions in agents/ directory:
-
claude-expert (
agent-claude-documentation.md)- Specialized in Claude Code documentation and features
- Access to official docs.claude.com resources
- Handles Claude Code configuration and best practices
-
project-assistant (
agent-project-management.md)- Project status tracking and progress management
- Manages ProjectStatusDigest.md, ProjectDiary.md, and NEXT.md
- Handles session start-up and wrap-up protocols
-
repository-assistant (
agent-repository-structure.md)- Repository structure management and refactoring
- Enforces directory structure conventions
- Optimizes project organization
-
todo-keeper (
agent-keepaTodofile.md)- Specialized Todo.md file management and maintenance
- Task tracking, progress monitoring, and workflow optimization
- Integrates todo management with issue tracking and TDD workflows
-
changelog-keeper (
agent-keepaChangelog.md)- Specialized CHANGELOG.md file management and version history documentation
- Semantic versioning and change categorization (Added, Changed, Fixed, etc.)
- Integrates with release workflows and maintains Keep a Changelog format
-
contributing-keeper (
agent-keepaContributingfile.md)- Specialized CONTRIBUTING.md file management and developer onboarding
- Development workflow documentation and code standards maintenance
- Contributor guidelines and community standards management
Development Workflow Patterns
Kaizen Philosophy
- Continuous Improvement: Every coding session should measure performance and refine specifications
- Pattern Recognition: Analyze agent behavior and optimize workflows over time
- Specification Evolution: Agent definitions should be updated based on performance data
Agent Optimization Loop
- Measure: Track agent performance and effectiveness using PerformanceMetrics
- Analyze: Use OptimizationLoop to identify patterns and trends
- Refine: Update agent specifications and workflows based on insights
- Iterate: Repeat the cycle for continuous improvement
Development Best Practices
- Always use virtual environment: Run
make venv-statusbefore starting - Test-driven development: Write tests first, then implementation
- Code quality: Run
make lintandmake formatbefore commits - Performance tracking: Use the optimization framework for agent improvements
- Todo tracking: Maintain a todofile for task management and progress tracking
- Change documentation: Keep a changelog for version history and feature tracking
Python Project Configuration
Dependencies
Core Dependencies (pyproject.toml):
pyyaml>=6.0- YAML configuration parsingclick>=8.0.0- CLI frameworkpydantic>=2.0.0- Data validation and settings
Development Dependencies:
pytest>=6.0.0- Testing frameworkblack>=22.0.0- Code formattingflake8>=5.0.0- Code lintingmypy>=1.0.0- Type checking
Code Quality Configuration
- Black: Line length 88, Python 3.8+ target
- Flake8: Max line length 100, ignores E203, W503
- Pytest: Configured with markers for slow, integration, e2e, smoke tests
- MyPy: Strict typing with comprehensive checks enabled
Setup and Installation
First Time Setup
# Complete setup (recommended)
make setup-complete
# Activate environment
source .venv/bin/activate
# Verify installation
make test
Alternative Setup Methods
# Basic setup only
make setup
# Manual dev dependencies
make setup-dev
# Check environment status
make venv-status
Troubleshooting
If setup fails:
- Try
make install-systemfor system packages - Use
make install-deps-forceto override restrictions - Try
make install-deps-venvfor isolated environment
Project Management Tools
Todo Tracking
- Purpose: Maintain visibility into current tasks and progress
- File:
TODO.md- Structured todofile following Keep a Todofile format - Agent: Use
todo-keeperagent for maintaining todofiles - Usage: Track work items organized by impact type (Add, Refactor, Fix, Deprecate, Secure, Remove)
- Benefits: Helps maintain focus and provides clear progress indicators aligned with changelog categories
- Integration: Works well with issue management, TDD workflows, and changelog management
- Structure: Organized by change impact type, mirroring changelog categories
- Format: Uses markdown checkboxes within sprint-focused sections
Changelog Management
- Purpose: Document changes, features, and version history
- File:
CHANGELOG.md- Structured markdown file following Keep a Changelog format - Agent: Use
changelog-keeperagent for maintaining CHANGELOG.md files - Usage: Track what has been added, changed, fixed, removed, deprecated, or security-related
- Benefits: Provides clear communication about project evolution and version impacts
- Format: Follows Keep a Changelog standard with semantic versioning
- Structure: Organized by version with categories (Added, Changed, Fixed, Deprecated, Removed, Security)
- Integration: Links with git tags, releases, and issue references
Important Notes
- Self-healing setup:
make setupautomatically creates missing project structure - Comprehensive help: Use
make helpto explore all available commands - Agent-focused: Agent definitions in
agents/directory are the core of this system - Quality-first: Always run tests and linting before commits
- TDD emphasis: The project emphasizes test-driven development workflows
- Kaizen approach: Apply continuous improvement principles to all development
- Documentation practices: Maintain todofiles and changelogs for better project management
Agent Usage Guidelines
When working with this repository:
- Read Agent Definitions: Understand the specialized agents available in
agents/ - Follow TDD Patterns: Use the established test-driven development workflows
- Measure and Improve: Apply kaizen principles using the optimization framework
- Update Documentation: Keep agent definitions current with actual usage patterns
- Use the Framework: Leverage the core Agent and OptimizationLoop classes for new agents
- Test Everything: Use the comprehensive testing infrastructure for quality assurance
- Track Progress: Maintain todofiles for current work and use changelog for completed work
- Document Changes: Update changelog when adding features, fixing bugs, or making improvements
- Version Management: Use changelog-keeper agent to maintain proper version history and semantic versioning