Files
kaizen-agentic/.claude/rules/architecture.md
tegwick 843cf4eee0
Some checks failed
ci / test (push) Failing after 40s
Publish Python package / publish (push) Successful in 4m46s
feat: agent authoring & doc generation (WP-0007, v1.4.0)
New authoring tooling and a fix for the doc-regeneration defect it exposed.

Added:
- src/kaizen_agentic/agent_docs.py — render + idempotent upsert of the
  CLAUDE.md "## Installed Agents" section (shared by installer and CLI)
- `kaizen-agentic docs generate [--check]` — idempotent doc refresh / CI gate
- `kaizen-agentic create-agent` — scaffold a schema-valid agent
- Frontmatter schema validation in `kaizen-agentic validate`
  (required name/description/category, known category, valid memory/model)
- tests: test_agent_docs, test_validate_schema, test_create_agent

Fixed:
- _update_documentation regex duplicated the Installed Agents block on every
  run (stopped at the first ### subheading) — now idempotent
- declared frontmatter `category` is authoritative (heuristic is fallback)
- list_installed_agents reads the frontmatter name, not the filename
- renamed agent-project-management.md -> agent-project-assistant.md to satisfy
  the agent-<name>.md convention (eliminates a name/filename collision that
  caused install/update to write a divergent duplicate)
- test_cli_error_handling no longer installs into the repo root (uses tmp)

Version 1.4.0; CHANGELOG, CLI cheat sheet, agency-framework, TODO updated.
Workplan KAIZEN-WP-0007 closed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 02:06:14 +02:00

1.5 KiB

Architecture

kaizen-agentic has two distinct layers:

1. Python framework (src/kaizen_agentic/)

  • core.pyAgent (abstract base) + AgentConfig (dataclass). Tracks performance, supports config updates, implements kaizen interface.
  • optimization.pyOptimizationLoop (runs improvement cycles, detects trends, generates recommendations) + PerformanceMetrics (execution time, success rate, quality scores).
  • metrics.pyMetricsStore + OptimizerStore (project-scoped .kaizen/metrics/ per ADR-004).

2. Agent definitions (agents/ — 20 files)

Markdown instruction sets read and followed by Claude. Not executables. Naming convention: agent-{name}.md. Packaged copies live in src/kaizen_agentic/data/agents/ for pip install distribution.

Category Agents
Testing tdd-workflow, test-maintenance, testing-efficiency
Quality code-refactoring, datamodel-optimization
Process requirements-engineering, keepaTodofile, keepaChangelog, keepaContributingfile, project-assistant, priority-evaluation, scope-analyst
Infrastructure setupRepository, tooling-optimization, sys-medic
Release releaseManager
Docs claude-documentation
Support wisdom-encouragement
Meta coach, optimization

Custodian integration

The state-hub MCP resolves the agents directory via host_paths[hostname]local_path. Tools: list_kaizen_agents(category?), get_kaizen_agent(name).