Added project documentation in wiki and established INTENT.md

This commit is contained in:
2026-06-16 00:58:43 +02:00
parent 95b729cc53
commit 71ef5f4734
21 changed files with 1442 additions and 31 deletions

85
INTENT.md Normal file
View File

@@ -0,0 +1,85 @@
# INTENT
## Purpose
This repository exists to define and evolve **KaizenAgentic**: a framework and product concept for turning AI coding agents from static tools into continuously improving digital talents.
KaizenAgentic applies the principle of kaizen — continuous improvement through small, measurable, compounding refinements — to agent design, coding workflows, codebase quality, and agent optimization. It provides the concepts, templates, guidance, and business framing needed to build agents that can be observed, evaluated, refined, and improved over time.
## Primary Utility
The primary utility of this repository is to serve as the conceptual and operational seed for a **digital talent agency for AI coding agents**.
It should help define:
* how Kaizen agents are specified,
* how their performance is measured,
* how agent behavior is improved through feedback loops,
* how codebase improvement guidance can be made human-readable, machine-checkable, and agent-executable,
* how reusable capabilities, prompt practices, and improvement programs compound into better software development workflows.
## Intended Users
This repository is intended for:
* builders of AI coding agents,
* developers using Claude, Cursor, or similar coding assistant environments,
* teams that want coding agents to improve with real-world use,
* maintainers who want code quality guidance that can be checked, refactored, tested, and measured,
* product and business designers shaping KaizenAgentic as a service or platform.
## Strategic Role in the System
KaizenAgentic plays the role of a **meta-improvement layer** for agentic software development.
It is not merely a collection of prompts or coding assistants. It defines a system in which agents become measurable, versioned, testable, and optimizable units of digital work. Subagents perform specific tasks, while optimization logic observes their performance and proposes evidence-based refinements.
The repository should become the place where the core language, principles, templates, and operating model for this improvement loop are stabilized.
## Strategic Boundaries
This repository should own:
* the KaizenAgentic mission and conceptual model,
* the KaizenAgent definition template,
* the meta-optimizer concept,
* guidance for measurable and idempotent agent behavior,
* the codebase improvement guidance model,
* the relationship between prompts, experiments, mantras, agents, and reusable capabilities,
* the initial product, pricing, revenue, and brand framing.
This repository should not own:
* all concrete implementations of individual agents,
* customer-specific agent configurations,
* vendor-specific integrations beyond reference patterns,
* the complete runtime platform for executing agents,
* unrelated generic AI automation concepts that do not contribute to measurable continuous improvement,
* codebase-specific gameplans except as examples or templates.
## Design Principles
* **Continuous Improvement**: Every agent, guide, and workflow should be designed to improve through repeated use.
* **Measurable by Default**: Success criteria, metrics, and before/after deltas should be part of every meaningful agent or guidance definition.
* **Idempotent Operations**: Agent actions should converge toward desired states and remain safe to repeat.
* **Evidence over Intuition**: Improvements should be based on observed performance, tests, metrics, and explicit feedback.
* **Separation of Concerns**: Task-specific agents, measurement logic, optimization logic, and business framing should remain distinguishable.
* **Composable Capabilities**: Reusable units should package intent, interfaces, knowledge, and operational behavior, not just code.
* **Human-Readable and Machine-Executable**: Guidance should be understandable by humans while also being checkable by tools and executable by agents.
* **Rollback-Ready Evolution**: Agent specifications and improvements should be versioned, testable, and reversible.
* **Compounding Value**: Small, durable improvements should accumulate into stronger agents, cleaner codebases, and better development workflows.
## Maturity Target
The repository should mature into the canonical reference for the KaizenAgentic operating model.
At maturity, it should provide enough structure for a team to define, deploy, measure, refine, and commercialize AI coding agents as continuously improving digital talents. It should support both practical implementation and strategic communication: useful to developers, agent designers, product owners, and early customers.
## Stability Note
`INTENT.md` describes the stable purpose and strategic role of the repository.
Changes to this file should represent a deliberate shift in what KaizenAgentic is meant to become, not ordinary scope evolution. Concrete implementation plans, product details, agent specifications, and experiments should live in PRDs, gameplans, templates, guidance documents, or implementation repositories.
xxx

113
SCOPE.md
View File

@@ -8,87 +8,138 @@
## One-liner
AI agent development framework providing specialized agent personas (markdown instruction sets) and CLI scaffolding tools for embedding domain expertise into Claude Code sessions.
AI agency framework: specialized agent personas (markdown instruction sets), project-scoped memory, and CLI tooling for deploying informed agents into Claude Code sessions.
---
## Core Idea
Kaizen-agentic makes recurring development workflows (TDD, refactoring, project management, documentation) first-class by packaging them as named agent personas. You invoke an agent by name, load its instruction set, and follow it — the agent defines the workflow, Claude Code executes it. The "kaizen" (continuous improvement) philosophy means agents are refined based on performance over time.
Kaizen-agentic packages recurring development workflows (TDD, refactoring, project management, infrastructure health) as named agent personas you invoke in Claude Code. The agency layer adds **project-scoped memory** (`.kaizen/agents/<name>/memory.md`) so agents accumulate knowledge across sessions, plus a **Coach** meta-agent that synthesises cross-agent context for new deployments. The kaizen loop measure, analyse, refine — is embodied in agent definitions and an `OptimizationLoop` Python pattern, even though runtime execution remains Claude's responsibility.
---
## In Scope
- 17+ agent definition files (`agents/agent-*.md`) — markdown persona instruction sets
- Agent categories: testing, quality, process, infrastructure, release, documentation
- CLI tooling: `kaizen-agentic init/install/status` for project scaffolding
- Project templates (python-basic, python-web, python-cli, python-data, comprehensive)
- Python framework: `Agent` base class, `AgentConfig` dataclass, `OptimizationLoop` for performance tracking
- Custodian MCP integration: `list_kaizen_agents()` and `get_kaizen_agent()` tools
- **21 agent definitions** (`agents/agent-*.md`) — markdown persona instruction sets with YAML frontmatter
- **Agent categories**: project-management, development-process, code-quality, infrastructure, testing, documentation, meta
- **Agency framework**: project memory convention, session-start/close protocols, Coach meta-agent (`agent-coach.md`)
- **Protocol runbooks** (`agents/protocols/<agent>/<slug>.md`) — procedural checklists distinct from agent prompts (sys-medic k3s assessment is the first example)
- **CLI tooling** (`kaizen-agentic`): `init`, `install`, `update`, `remove`, `list`, `status`, `validate`, `templates`, `detect`, `migrate`, `extensions`, `memory` (show/init/brief/clear), `protocols` (list/show)
- **Project templates** (python-basic, python-web, python-cli, python-data, comprehensive) — agent bundles defined in registry code, not separate template directories
- **Python framework** (`src/kaizen_agentic/`): `Agent`/`AgentConfig`, `AgentRegistry`, `AgentInstaller`, `OptimizationLoop`/`PerformanceMetrics`, detection/migration/extensions
- **Packaged agent data** (`src/kaizen_agentic/data/agents/`) — 17 agents bundled for pip installs (lags `agents/` by 4 agents; see Notes)
- **Custodian MCP integration** (owned by `the-custodian`): `list_kaizen_agents()` and `get_kaizen_agent()` resolve this repo via `host_paths`
- **ADRs and workplans** documenting memory, protocols, and workplan conventions
---
## Out of Scope
- Agent runtime / execution engine (agents are persona definitions; execution is Claude Code's responsibility)
- LLM orchestration or multi-agent debate systems
- Project-specific implementation (agents guide; they do not build the software)
- Commercial features or PyPI distribution (pre-v1.0)
- Agent runtime / execution engine (agents are persona definitions; Claude Code executes them)
- LLM orchestration, scheduling, or multi-agent debate systems
- Project-specific implementation (agents guide work; they do not build the target software)
- Custodian State Hub, MCP server code, or cross-domain governance (consumed, not owned)
- PyPI publication pipeline (v1.0.2 released locally; public PyPI distribution still pending)
---
## Relevant When
- Starting a guided development workflow (TDD, refactoring, testing, requirements)
- Scaffolding a new project with consistent structure and best-practice tooling
- Looking up what specialized agent personas are available for a domain session
- Contributing a new agent persona to the ecosystem
- Starting a guided development workflow (TDD, refactoring, testing, requirements, scope analysis)
- Deploying agents into a project with persistent cross-session memory
- Briefing a newly deployed agent using accumulated project knowledge (Coach / `memory brief`)
- Scaffolding a new project with consistent structure and agent bundles
- Looking up available agent personas (CLI, MCP, or `agents/` directory)
- Contributing or refining an agent persona or protocol runbook
---
## Not Relevant When
- Ad-hoc, one-off scripting with no need for structured guidance
- Ad-hoc scripting with no need for structured agent guidance
- Non-Claude-Code development environments
- Need for runtime orchestration or scheduling (not a scheduler)
- Need for runtime orchestration, task scheduling, or autonomous agent execution
- Repository capability profiling or SCOPE.md generation at scale (see `repo-scoping`)
---
## Current State
- Status: experimental → stabilizing (v1.0.2 released)
- Implementation: ~85% — 17 agents defined, CLI functional, templates working; optimization loop pattern established but not exercised at scale
- Stability: stable CLI and agent loading
- Usage: installed in dev projects; agents callable via Custodian MCP hub-wide
- Status: experimental → stabilizing (v1.0.2; agency framework shipped in WP-0002)
- Implementation: substantial21 agents, full CLI, agency memory + protocols tested e2e; optimization loop exists but is not exercised in production workflows
- Stability: CLI stable (Click workaround in place); agency framework validated by e2e tests
- Usage: internal dev projects and Custodian MCP hub-wide; packaged wheel missing 4 newest agents
- Active work: WP-0001 (community engagement / v1.1.0) — CI, telemetry, cross-platform fixes not started
---
## How It Fits
- Upstream dependencies: Claude Code (agent invocation), kaizen philosophy
- Downstream consumers: Custodian State Hub (loads agents via MCP); all six domains (teams use agents for guided workflows)
- Often used with: the-custodian (MCP integration), markitect_project (project-management agent), activity-core (scaffolding)
- Upstream dependencies: Claude Code (agent invocation), kaizen continuous-improvement philosophy
- Downstream consumers: Custodian State Hub (MCP agent discovery); domain repos that install agents and maintain `.kaizen/` memory
- Often used with: `the-custodian` (MCP integration), `markitect_project` (project-management patterns), `activity-core` (scaffolding references)
---
## Terminology
- Preferred terms: agent, agent persona, AgentConfig, project template
- Preferred terms: agent, agent persona, agency, project memory, protocol runbook, Coach
- Also known as: "kaizen agents", "the agent library"
- Potentially confusing terms: "Agent" here is a persona/instruction set, not a running process
- Potentially confusing terms: "Agent" here is a persona/instruction set, not a running process; "agency" means memory + coaching, not autonomous orchestration
---
## Related / Overlapping Repositories
- `the-custodian` — hosts MCP tools that load agents; custodian agent copies live in `the-custodian/agents/`
- `the-custodian` — hosts MCP tools that load agents; integration code lives there, not here
- `repo-scoping` — generates/refreshes SCOPE.md from approved characteristics; owns scope analysis at scale
- `markitect_project` — references kaizen-agentic as a capability submodule
- `sys-medic` (source repo) — origin of sys-medic agent; canonical copy now lives in `agents/agent-sys-medic.md`
---
## Getting Oriented
- Start with: `README.md` (quick start, agent list, installation)
- Key files / directories: `agents/` (all persona definitions), `src/kaizen_agentic/` (Python framework), `templates/` (project scaffolds)
- Entry points: `kaizen-agentic --help`; or via MCP: `get_kaizen_agent("scope-analyst")`
- Start with: `README.md` (quick start, agency overview), `docs/agency-framework.md` (memory + coach + protocols)
- Key files / directories: `agents/` (persona definitions), `agents/protocols/` (runbooks), `src/kaizen_agentic/` (Python framework), `workplans/` (active roadmap)
- Entry points: `kaizen-agentic --help`; via MCP: `get_kaizen_agent("scope-analyst")`; docs: `docs/GETTING_STARTED.md`, `docs/AGENT_DISTRIBUTION.md`
---
## Provided Capabilities
```capability
type: process
title: Guided development agent personas
description: Named markdown instruction sets for TDD, refactoring, documentation standards, requirements engineering, and project management workflows in Claude Code sessions.
keywords: [agents, personas, tdd, refactoring, claude-code, workflows]
```
```capability
type: infrastructure
title: Agent deployment and project scaffolding CLI
description: Install, update, validate, and bundle agents into new or existing projects via the kaizen-agentic CLI and registry-backed templates.
keywords: [cli, install, templates, scaffolding, registry]
```
```capability
type: process
title: Project-scoped agent memory and coaching
description: Convention and CLI for .kaizen/agents memory files, session protocols, and Coach-mediated orientation briefs across a deployed agent fleet.
keywords: [memory, coach, agency, kaizen, cross-session]
```
```capability
type: infrastructure
title: Kaizen agent discovery via Custodian MCP
description: Single source of truth for agent definitions consumed by the Custodian State Hub list_kaizen_agents and get_kaizen_agent tools.
keywords: [mcp, custodian, discovery, agent-library]
```
---
## Notes
- `agents/` (21 files) is the development source of truth; `src/kaizen_agentic/data/agents/` (17 files) is what pip installs ship — coach, sys-medic, scope-analyst, and optimization are not yet bundled
- `INTENT.md` is not present in this repo (see gap analysis against derived intent)
- `agent-optimization.md` and `agent-agent-optimization.md` both exist; naming overlap may confuse discovery

BIN
wiki/AbcdekGuidance.md Normal file

Binary file not shown.

24
wiki/AboutKaizenAgents.md Normal file
View File

@@ -0,0 +1,24 @@
AboutKaizenAgents
*Basic concepts of Kaizen Agents*
All Kaizen Agents follow the KaizenAgentTemplateDefinition
This template provides a comprehensive structure for defining KaizenAgent subagents.
The key sections are:
Specification: Focuses on declarative outcomes rather than implementation steps, making agents more maintainable and testable.
Idempotency Design: Forces you to think upfront about how the agent will detect and handle already-completed work.
Metrics: Ensures every agent has measurable success criteria from day one.
Testing: Built-in test scenarios that can be automated as part of the optimization loop.
Evolution Tracking: Maintains a history of improvements and provides hooks for the KaizenAgent to analyze performance trends.
The template enforces our design principles - separation of concerns, testability, and measurability - while providing enough structure to ensure consistency across different coding subagents.
xxx

View File

@@ -0,0 +1,248 @@
AgentKaizenOptimizer
*One agent to improve them all*
# KaizenAgent Meta-Optimizer
# Version: 1.0.0
# Last Updated: 2025-09-26
agent:
name: "kaizen-optimizer"
version: "1.0.0"
description: "Meta-agent that analyzes and optimizes other coding subagents based on performance data"
# Core Specification
specification:
purpose: |
Continuously improve coding subagents by analyzing their performance metrics,
identifying patterns that correlate with success or failure, and proposing
data-driven refinements to agent specifications. Acts as the optimization
engine in the KaizenAgent feedback loop.
triggers:
patterns:
- "Scheduled optimization runs (daily/weekly)"
- "Performance threshold violations"
- "Minimum data collection thresholds reached"
- "Explicit optimization requests"
explicit_commands:
- "claude code --optimize-agents"
- "claude code --kaizen-review"
- "claude code --agent-performance"
inputs:
required:
- name: "performance_data"
type: "object"
description: "Aggregated metrics from all subagents over time period"
- name: "agent_definitions"
type: "array"
description: "Current specifications of all registered agents"
optional:
- name: "optimization_focus"
type: "string"
default: "all"
description: "Specific agent or metric to optimize"
- name: "time_window"
type: "string"
default: "30d"
description: "Historical data window to analyze"
- name: "confidence_threshold"
type: "float"
default: 0.8
description: "Minimum confidence level for proposing changes"
outputs:
primary:
type: "object"
description: "Optimization recommendations with supporting data"
side_effects:
- "Updated agent specification files (if approved)"
- "Performance analysis reports"
- "A/B test configurations"
- "Rollback checkpoints"
preconditions:
- "At least 10 execution samples per agent being analyzed"
- "Valid performance data with timestamps"
- "Agent definitions follow KaizenAgent template structure"
postconditions:
- "All recommendations include confidence scores and evidence"
- "Proposed changes maintain backward compatibility"
- "Rollback plan exists for each proposed change"
# Idempotency Design
idempotency:
strategy: "fingerprint"
state_detection:
method: "Hash performance data and agent versions to detect changes"
implementation: |
# Generate fingerprint of current state
data_hash = hash(performance_data + agent_versions + config)
last_analysis = load_checkpoint('last_optimization_hash')
if data_hash == last_analysis.hash:
return last_analysis.recommendations
# New data available, proceed with analysis
recommendations = analyze_and_optimize()
save_checkpoint('last_optimization_hash', {
hash: data_hash,
timestamp: now(),
recommendations: recommendations
})
return recommendations
rollback:
supported: true
method: "Restore previous agent specification versions from git history"
# Performance Measurement
metrics:
primary:
name: "optimization_impact"
description: "Average performance improvement of optimized agents"
measurement: "Mean delta of primary metrics before/after optimization"
target: ">5% improvement in agent success rates"
secondary:
- name: "prediction_accuracy"
description: "How often optimization predictions prove correct"
measurement: "% of recommendations that improve target metrics"
- name: "false_positive_rate"
description: "Rate of recommendations that worsen performance"
measurement: "% of changes that decrease agent effectiveness"
- name: "coverage"
description: "Percentage of agents with actionable insights"
measurement: "Count of agents with recommendations / total agents"
collection:
frequency: "per_execution"
storage: ".kaizen/metrics/optimizer/"
retention: "180d"
# Testing and Validation
testing:
unit_tests:
- scenario: "Pattern detection with synthetic data"
input: "Mock performance data with known patterns"
expected_output: "Correct identification of improvement opportunities"
verification: "Assert detected patterns match expected patterns"
- scenario: "Confidence scoring accuracy"
input: "Historical data with known outcomes"
expected_output: "Confidence scores correlate with actual success"
verification: "ROC curve analysis of confidence vs outcome"
integration_tests:
- scenario: "End-to-end optimization cycle"
setup: "Real agent with declining performance"
execution: "Run optimization and apply recommendations"
validation: "Verify improved performance in subsequent runs"
- scenario: "Rollback mechanism"
setup: "Apply optimization that worsens performance"
execution: "Trigger automatic rollback"
validation: "Agent returns to previous performance level"
performance_tests:
- scenario: "Large dataset analysis"
load: "1000+ agent executions across 20+ agents"
max_time: "60 seconds"
resource_limits: "Max 512MB memory usage"
# Dependencies and Context
dependencies:
system:
- "Python 3.8+ with pandas, scikit-learn"
- "Git for version control"
- "Access to .kaizen/metrics/ directory"
project:
- ".kaizen/agents/ directory with agent definitions"
- ".kaizen/metrics/ directory with historical data"
- "Valid KaizenAgent project structure"
other_agents:
- name: "all_subagents"
relationship: "analyzes"
reason: "Requires performance data from all other agents"
# Configuration
configuration:
defaults:
analysis_algorithms: ["correlation", "regression", "decision_tree"]
min_sample_size: 10
significance_threshold: 0.05
optimization_frequency: "weekly"
project_overrides:
path: ".kaizen/agents/kaizen-optimizer.yml"
schema: |
{
"type": "object",
"properties": {
"algorithms": {"type": "array"},
"thresholds": {"type": "object"},
"scheduling": {"type": "object"}
}
}
environment_variables:
- name: "KAIZEN_OPTIMIZER_CONFIG"
description: "JSON configuration for optimization parameters"
# Evolution Tracking
optimization:
baseline_performance:
established: "2025-09-26"
metrics: {
"optimization_impact": 0.0,
"prediction_accuracy": 0.5,
"false_positive_rate": 1.0,
"coverage": 0.0
}
improvement_history: []
known_limitations:
- "Requires minimum sample sizes to generate reliable insights"
- "May not detect complex multi-agent interaction patterns"
- "Limited to metrics explicitly defined in agent specifications"
- "Cannot optimize for subjective developer experience factors"
kaizen_notes:
optimization_priority: "high"
next_experiment: "Implement ensemble methods for pattern detection"
success_criteria: "Achieve >80% prediction accuracy with <10% false positive rate"
# Algorithm Specifications
algorithms:
correlation_analysis:
description: "Identify specification elements that correlate with performance"
inputs: ["performance_metrics", "agent_configs", "execution_context"]
outputs: ["correlation_matrix", "significant_factors"]
performance_regression:
description: "Model performance trends over time and agent versions"
inputs: ["time_series_data", "version_history"]
outputs: ["trend_analysis", "degradation_alerts"]
specification_diffing:
description: "Compare high vs low performing agent variants"
inputs: ["agent_definitions", "performance_clusters"]
outputs: ["diff_analysis", "success_patterns"]
a_b_test_design:
description: "Generate controlled experiments for proposed changes"
inputs: ["current_spec", "proposed_changes"]
outputs: ["experiment_config", "success_metrics"]
xxx

156
wiki/BrandBook.md Normal file
View File

@@ -0,0 +1,156 @@
BrandBook
*The KaizenAgentic visual style*
# KaizenAgentic Brandbook
**Version 0.1 · September 2025**
---
## 1. Brand Essence
**Tagline**: *Continuous Improvement for Digital Talent*
**Core Idea**:
KaizenAgentic applies the principle of *kaizen* to AI subagents. We represent AI assistants not as static tools, but as digital talents — continuously measured, refined, and optimized.
**Tone**:
* Minimal
* Professional
* Confident
* Forward-looking
---
## 2. Logo System
### Primary Logo (Wordmark)
* **Text**: `KAIZEN▲GENTIC`
* Typeface: modern grotesk sans-serif (Inter / Helvetica Neue recommended)
* Weight: Bold
* Case: ALL CAPS
* Color: Black on white background (default)
### Secondary Logo (Monogram)
* **Form**: `K▲`
* The triangle represents *improvement* and *direction upward*.
* Used for: favicon, app icon, social avatar, watermark.
### Clearspace & Minimum Size
* Maintain at least **1x the height of the "K"** as safe space around the logo.
* Wordmark: minimum width 160px.
* Monogram: minimum width 32px.
---
## 3. Color Palette
Primary Colors
Black: #111111
White: #FFFFFF
Accent (Welding Blue)
Electric Arc Blue: #007BFF (base tone)
Arc Glow Gradient:
Core Glow: #00A2FF
Mid Tone: #007BFF
Edge Burn: #0033CC
**Usage**
Use flat Electric Arc Blue (#007BFF) for clean digital presence.
For special treatments (logos, hero graphics), use the arc glow gradient to mimic the intensity of molten metal light.
Limit glow to accents (monogram ▲ or underline strokes), keep wordmark monochrome for contrast.
* Wordmark = Black or White (depending on background).
* Monogram = Black or White with Electric Blue accent on ▲.
* Electric Blue is only used as an accent to emphasize improvement / action.
---
## 4. Typography
**Primary Typeface**
* **Inter** (open source, modern grotesk)
* Alternatives: Helvetica Neue, Neue Haas Grotesk
**Styles**
* **Headings**: Bold, ALL CAPS
* **Body text**: Regular, Sentence case
* **Tracking**: +2% (tight but legible)
---
## 5. Applications
### Digital
* **Website header**: Wordmark in Black, hover states in Electric Blue.
* **App icon**: Monogram K▲, triangle in Electric Blue.
* **Dark mode**: White wordmark on black background; Electric Blue accents.
### Print
* Business cards:
* Front: Wordmark centered, Black on White.
* Back: Monogram K▲, Electric Blue triangle.
### Social Media
* Avatar: Monogram K▲.
* Banner: Wordmark with subtle Electric Blue line or step motif.
---
## 6. Visual Motifs
* **Step Progression (▮▮▮▮▮)**: Suggests incremental kaizen improvement.
* **Triangle (▲)**: Direction, growth, precision.
* **Minimal Layouts**: White space is part of the identity.
---
## 7. Voice & Messaging
**Voice**:
* Confident but not loud.
* Analytical, precise, and professional.
* Future-oriented, emphasizing *measurable improvement*.
**Do Say**:
* *Continuous improvement in AI talent*
* *Optimization through measurement*
* *Agents that evolve with you*
**Dont Say**:
* *Magic black box AI*
* *One-and-done automation*
* *Trendy gimmicks*
---
### Monogram K▲ (Electric Blue accent)
xxx

View File

@@ -0,0 +1,17 @@
ComposableCapability
*Standard for self-contained units of operational knowledge*
# Conceptual Foundation: ComposableCapabilities
## Core Idea
A **Composable Capability** is a self-contained unit of reusable functionality — a modular building block that encapsulates not just code, but also *intent*, *interfaces*, and *knowledge*.
Each capability is organized as a repository and can be composed with others to build higher-level systems or workflows.
Motivation
In AI-assisted or “Vibe Coding” workflows, its not enough to reuse functions or APIs. You need *contextually complete* units — something that captures *how* to use a function, **why** it exists, and **what it depends on**.
ComposableCapabilities turn code reuse into *knowledge reuse*.
xxx

View File

@@ -0,0 +1,112 @@
IdempotentCompounding
*Kaizen Agentic Philosophy*
# IdempotentCompounding — a primer
Definition (one-liner): Build and evolve systems by idempotent automation (safe to run repeatedly) and compounding increments (small units that add durable value), governed by outcomes and quality gates.
## Core principles
- Idempotence by default — Every operation (provision, deploy, migrate, refactor) is safe to re-run; desired state > imperative steps.
- Compound value, not complexity — Ship small, composable capability units that stack cleanly and raise the baseline.
- Evidence over intention — Each increment must declare its value metric and show before/after.
- Reversibility — Fast rollback/roll-forward; changes are sliceable and isolated.
- Sustainability as a constraint — Optimize for maintainability, cost, energy, and human time.
- Quality is automated — Tests, checks, and drift detection run continuously, not occasionally.
- Documentation is generated — Architecture, runbooks, and changelogs are derived from code & traces, then curated.
## The operating cycle (repeatable)
Select → Specify → Safeguard → Apply → Verify → Record
- Select a high-ROI increment (hotspot × business value).
- Specify desired state (declarative spec, schema, or refactor objective).
- Safeguard with idempotent checks: contract tests, drift monitors, health probes.
- Apply via automation (IaC, pipelines, codemods) — re-runnable end-to-end.
- Verify outcomes (SLOs, cost, complexity, security).
- Record: update arc42 views, ADR, and the quality dashboard.
Rule of thumb: if youre afraid to re-run it, its not IdempotentCompounding yet.
## Units of change (the “compounders”)
- Infra Module (e.g., Terraform/Kubernetes object)
- Service Capability (feature flag, API slice)
- Quality Guide Move (codemod + lint rule)
- Data Contract (schema + migration + validation)
- Ops Control (SLO, alert, autoscaler policy)
Each unit carries:
- Spec (YAML/DSL + schema)
- Guards (tests/checks)
- KPIs (value metric)
- Rollbacks (delete/replace plan)
- Docs hooks (arc42/ADR update hints)
## Minimal guardrails
- Idempotence test: run the job twice; expect no diff.
- Blast-radius cap: feature flags, canaries, or scoped namespaces.
- Drift sentry: reconcile loop or plan delta must be ≈0 after apply.
- Budget bound: change must not breach cost/latency/error-rate budgets.
- Timebox: if verification cant prove value in X hours, revert or park.
## Metrics that matter
- Value: SLO attainment, cycle time, revenue/usage lift, defect escape rate ↓
- Quality: Maintainability index ↑, complexity/duplication ↓, DoC compliance %
- Sustainability: € per request ↓, watts per request ↓, toil hours ↓
- Reliability: MTTR ↓, change failure rate ↓, successful re-runs % = 100
## Tooling patterns (typical stack)
- Desired state: Terraform/Pulumi, Helm/Kustomize, GitOps (Argo CD/Flux)
- Idempotent app changes: migration frameworks, codemods (libCST/jscodeshift), OpenRewrite
- Verification: contract & golden tests; load tests in CI for hot paths
- Observability: traces/metrics feeding fitness functions in pipelines
- Docs: Structurizr/PlantUML generated from code + traces; ADRs as code
How it fits the AbcdekGuidance Practice
A — Architecture (ArcFortyTwo): auto-generate views; define fitness functions (what “value” means).
B — Build (SafetyNetTests): make verification idempotent; contract tests become guards.
C — Clean (CleanByDefinition): encode idempotence rules (no side-effect scripts, reversible migrations).
D — Direction (GamePlan): prioritize compounders with best value/effort ratio.
E — Evolve (RefactoringLoop): codemods + tests prove idempotent repeats and measurable deltas.
K — KeepClean (Kaizen): weekly trend checks; drift/DoC gates keep compounded value from decaying.
Templates (drop-in)
1) Value Ticket (per increment)
Title: <Increment name>
Desired State: <declarative spec or target structure>
Guards: <tests/checks to pass; idempotence proof: re-run yields no diff>
Value Metric: <name, baseline, target, window>
Rollback: <how to undo safely>
Docs Hooks: <arc42 sections / ADR to update>
Owner / ETA:
2) Idempotence Checklist
[ ] Declarative spec exists
[ ] Dry-run/plan produces stable diff
[ ] Double-apply yields zero change
[ ] Safe to parallelize or properly serialized
[ ] Idempotent cleanup (delete/apply symmetry)
## Example (brief)
- Goal: Reduce p95 latency by 20% on /checkout.
- Compounder: Add Redis read-through cache for product lookups (Helm values + code toggle).
- Guards: Contract tests for /checkout; load test at 95th percentile; drift check on Helm release.
- Apply: helm upgrade (safe to re-run), feature flag rollout 10%→100%.
- Verify: p95 from 480 ms → 360 ms (7-day window), error rate unchanged.
- Record: ADR-012, arc42 runtime view updated, dashboard shows value trend.
## Bottom line
IdempotentCompounding turns improvement into a safe, repeatable habit: every step is re-runnable, every change compounds value, and every gain is proven.
xxx

7
wiki/KaiPersonal.md Normal file
View File

@@ -0,0 +1,7 @@
KaiPersonal
*Kaizen Personal Assistent Framework*
A framework to set up, use and improve personal assistents based on agentic ai in your daily life that keeps you in charge of your data and organization without any vendor lock in.
xxx

169
wiki/KaizenAgentTemplate.md Normal file
View File

@@ -0,0 +1,169 @@
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

8
wiki/KaizenAgentic.md Normal file
View File

@@ -0,0 +1,8 @@
KaizenAgentic
*The digital talent agency*
KaizenAgentic is a digital talent agency for AI coding agents. We apply the principle of kaizen—continuous improvement—to agent design, transforming coding subagents into evolving digital talents that get measurably better over time.
xxx

33
wiki/KaizenAgenticIdea.md Normal file
View File

@@ -0,0 +1,33 @@
KaizenAgenticIdea
*How it started*
# Overview
KaizenAgentic provides a meta-optimization framework for continuously improving AI coding subagents through data-driven iteration. Rather than treating agent development as a one-time engineering task, KaizenAgent establishes a systematic approach to refine and evolve coding assistants based on their real-world performance.
# Core Philosophy
The project embraces the Japanese concept of "kaizen" (continuous improvement) applied to AI agent development. Every coding subagent becomes part of an optimization loop where performance is measured, patterns are analyzed, and specifications are refined over time.
# Key Components
Performance-Driven Subagents: Each coding subagent includes built-in metrics that capture meaningful performance indicators - test coverage improvements, code quality deltas, maintenance burden, and developer experience metrics.
## Meta-Optimization Engine:
A specialized KaizenAgent that analyzes subagent performance history, identifies improvement opportunities, and proposes specification refinements through systematic pattern analysis. Evolutionary Architecture: Agent specifications are treated as versioned, testable code that can be A/B tested, rolled back, and iteratively improved based on empirical evidence rather than intuition.
## Design Principles Measurable by Default:
Every subagent must define at least one quantitative success metric Idempotent Operations: All agent actions are designed to converge on desired states rather than perform blind transformations
## Separation of Concerns:
Clear boundaries between task-specific subagents, performance measurement, and optimization logic
##Test-First Development:
Agent improvements are validated through controlled experiments before deployment
# Target Use Case
Designing and optimizing agents for coding task, that can be used with claude, cursor and other coding agent systems to improve software development workflows, enabling coding assistants that genuinely improve over time through systematic observation and refinement of their real-world effectiveness.
xxx

View File

@@ -0,0 +1,70 @@
KaizenAgenticMission
*Kaizen Agentic in a nutshell*
# KaizenAgentic
**Mission**
KaizenAgentic is a digital talent agency for AI coding agents. We apply the principle of *kaizen*—continuous improvement—to agent design, transforming coding subagents into evolving digital talents that get measurably better over time.
---
## Overview
Traditional AI agent development is often a one-off engineering project: design once, deploy, and hope it works. KaizenAgentic takes a different path. We provide a **meta-optimization framework** that treats agent development as an iterative lifecycle. Every coding subagent is continuously observed, evaluated, and refined based on real-world performance data.
---
## Core Philosophy
* **Continuous Improvement**: Inspired by Japanese kaizen, every agent is part of an optimization loop.
* **Data-Driven Evolution**: Decisions are grounded in metrics, not intuition.
* **Systematic Refinement**: Performance history, usage patterns, and experimental results drive specification updates.
---
## Key Components
### 1. Performance-Driven Subagents
Every coding subagent comes with **built-in metrics**:
* Test coverage improvements
* Code quality deltas
* Maintenance burden
* Developer experience signals
### 2. Meta-Optimization Engine
A specialized **KaizenAgent** analyzes performance logs, spots recurring improvement opportunities, and proposes refined specifications.
### 3. Evolutionary Architecture
Agent specifications are treated like code:
* Versioned
* Testable
* A/B tested in real workflows
* Rollback-ready
---
## Design Principles
* **Measurable by Default**: Every subagent defines quantitative success criteria.
* **Idempotent Operations**: Actions converge toward desired states instead of introducing uncontrolled drift.
* **Separation of Concerns**: Subagents focus on tasks; optimization logic stays independent.
* **Test-First Improvement**: New refinements are validated through controlled experiments before rollout.
---
## Target Use Case
KaizenAgentic focuses on **coding task optimization**. Our refined subagents integrate with platforms like **Claude**, **Cursor**, and other coding assistant ecosystems. The result: coding assistants that dont stagnate but **improve with use**, enabling better workflows, higher code quality, and reduced developer friction.
---
👉 Think of **KaizenAgentic** as the **talent agency for digital coders**—a place where AI subagents arent static tools but *living talents*, continuously coached, measured, and refined for peak performance.
xxx

27
wiki/KaizenBackground.md Normal file
View File

@@ -0,0 +1,27 @@
KaizenBackground
*Continuous Improvement Methods and Applications*
Kaizen is a Japanese business philosophy and methodology focused on continuous improvement through small, incremental changes that involve everyone in an organization, from executives to frontline workers. The term comes from the Japanese words "kai" (change) and "zen" (good), together meaning "change for the better" or simply "improvement".
## Core Principles
Kaizen aims to improve efficiency, increase productivity, reduce waste, and enhance quality by encouraging regular, everyday improvements. It relies on cooperation, employee empowerment, and commitment at all levels rather than imposing top-down or radical changes.
## Applications
Kaizen began as an industrial practice in post-WWII Japan, notably within the Toyota Production System, and has since spread worldwide to industries far beyond manufacturing, including healthcare, software development, and service sectors.
## Methodology
Key elements of the Kaizen approach include:
- Encouraging all employees to identify and suggest improvements.
- Using systematic cycles like the PDCA (Plan, Do, Check, Act) method to implement and review changes.
- Focusing on standardized work processes that evolve based on new improvements.
- Application of the “5S” system for workplace organization: Sort, Set in Order, Shine, Standardize, Sustain.
Kaizens philosophy of continuous, collective improvement remains foundational in modern lean management, helping organizations enhance productivity, quality, and workplace culture.
xxx

View File

@@ -0,0 +1,7 @@
KaizenDefinitionOfClean
*Keep your codebase in shape*
The KaizenDefinitionOfClean specifies the target state for matching KaizenGuidance and can be used to diagnose and restore deviations from guidance regularly.
xxx

7
wiki/KaizenGameplan.md Normal file
View File

@@ -0,0 +1,7 @@
KaizenGameplan
*Optimize your codebase *
The gameplan describes what to do in your specific codebase to implement a KaizenGuidance document.
xxx

65
wiki/KaizenGuidance.md Normal file
View File

@@ -0,0 +1,65 @@
KaizenGuidance
*Codebase improvement programs*
A curated, language-agnostic library of Code Quality Guides where each guide is:
- Readable for humans,
- Checkable by linters/static analyzers,
- Refactorable by codemods/agents,
- Measurable with before/after quality metrics.
Think “Clean Code + MISRA precision + Sonar/ESLint automation + AI codemods.”
See also: https://chatgpt.com/share/68d6b45b-17f8-8009-8d15-c174f53d2591
## Guide anatomy (single source of truth)
- Each guide lives as a versioned folder containing:
- A manifest (machine-readable spec)
- A narrative (rationale, trade-offs, examples)
- Checks (lint/static analysis mappings)
- Refactors (codemods, recipes, prompts)
- Tests (fixtures + expected diffs)
- Metrics (what better means)
## Rule expression & execution pipeline
a) Parse → Check → Plan → Refactor → Test → Measure → Report
- Parse: build AST/index (libcst for Py, ts-morph/jscodeshift for TS/JS, OpenRewrite for Java, Clang-Tidy/LibTooling for C/C++).
- Check: run native linters + Semgrep queries from guide.yaml (unified output schema).
- Plan: produce a Change Plan (JSON) listing targets & suggested transforms.
- Refactor: deterministic codemods first; ambiguous edits delegated to an Agent with a strict prompt & test harness.
- Test: run unit tests + mutation tests (where available).
- Measure: compute deltas for maintainability index (MI), cyclomatic complexity, duplication, lint issues, “hotspot*rule” intersections (code churn × smells).
- Report: markdown/HTML summary + SARIF for code scanning.
## Example guides (initial catalog)
1. API Design
- Avoid boolean “success” returns (above)
- Prefer narrow, explicit exceptions
- Make side effects explicit (naming & module boundaries)
2. Readability & Structure
- Function length & parameter count thresholds (with exceptions mechanism)
- Cohesion over convenience: one reason to change (SRP pragmatically)
- Replace “god module/class” with feature modules
3. Testing & Contracts
- Fast tests default; slow/flaky quarantined
- Golden tests for parsers/formatters
- Pre/postconditions via lightweight asserts or type contracts
4. Performance-safe Patterns
- Avoid N+1 queries (framework-specific codemods)
- Replace quadratic hot-loops with map/join or indexed lookups
- Lazy vs eager boundaries (measurable)
5. Security & Robustness
- Input validation at boundaries (web/cli)
- No raw SQL without parameterization
- Secrets/config separation; env-based wiring
Each guide ships checks + codemods + agent prompts + metrics.
xxx

115
wiki/KaizenPrompting.md Normal file
View File

@@ -0,0 +1,115 @@
KaizenPrompting
*Continuous Improvement for Agentic AI*
Introduction to “Kaizen-style continuous improvement in agentic AI”, using the triad **PromptIdea → PromptExperiment → PromptMantra** to structure the evolution of prompting into agent design.
---
# 🧭 Kaizen Prompting: Continuous Improvement for Agentic AI
In the early days of AI interaction, prompts were static instructions — short messages carefully crafted to evoke a single response.
With the rise of **agentic AI**, this changed: instead of merely producing text, models began to act — reasoning over time, calling tools, and improving through feedback.
This shift calls for a *Kaizen approach* to prompting — one that treats prompt creation as an iterative, measurable learning process that leads from inspiration to embodied behavior.
---
## 🌱 Stage 1 — **Prompt Idea**
*Seed of curiosity and exploration.*
A **Prompt Idea** is a raw spark — a line, a phrasing, or a structure that captures a potentially useful interaction pattern.
It may come from social feeds, community examples, or spontaneous inspiration.
The Kaizen principle here is *observation*: collect without judgment, record quickly, and tag loosely for later exploration.
**Purpose:**
* Capture inspiration and context.
* Encourage curiosity and variation.
* Build a living repository of possibilities.
**Typical contents:**
* Source (where it was found)
* Quick notes on intent or tone
* Tags for domain or behavior
---
## ⚗️ Stage 2 — **Prompt Experiment**
*Form and deliberate practice.*
A **Prompt Experiment** is a tested and refined version of a Prompt Idea.
Here, the practitioner engages in iterative cycles: run, observe, adjust.
The focus is on learning what works — how the system reacts, how stable results are, how cost and success relate.
Each experiment is documented with outcomes and metrics.
**Purpose:**
* Establish a reproducible form.
* Identify influencing factors (phrasing, context, role).
* Gather data for cost, stability, and satisfaction.
**Kaizen loop:**
> Plan → Try → Observe → Reflect → Adjust
**Metrics to track:**
* Consistency of output
* Token or time cost
* User satisfaction or success rate
---
## 🔮 Stage 3 — **Prompt Mantra**
*Flow and embodiment.*
When a Prompt Experiment consistently evokes a desirable pattern of behavior — accuracy, empathy, clarity, creativity — it graduates into a **Prompt Mantra**.
A Prompt Mantra is no longer an instruction but a *behavioral seed*: a concise invocation that activates a known agentic quality.
It can be embedded in agents as a reusable behavioral modulator — just as humans use mantras to evoke particular mindsets.
**Purpose:**
* Encode repeatable, high-value behavior.
* Provide building blocks for agent personalities.
* Allow measurable, reflective improvement loops.
**Example:**
> **Name:** Truth Herald
> **Essence:** “Speak not to persuade, but to awaken.”
> **Effect:** Encourages fact-based, empathic communication in analysis agents.
> **Metrics:** Invocation count, success ratio, refinement index.
---
## 🌀 Integrating the Three Stages into Agentic Kaizen
1. **Collect Prompt Ideas** → continuously harvest inspiration.
2. **Run Prompt Experiments** → test, measure, and reflect.
3. **Distill Prompt Mantras** → preserve what consistently works.
4. **Deploy in Agents** → use Mantras as behavioral components.
5. **Reflect and Adapt** → measure results, refine or retire Mantras.
This process forms a **Kaizen Loop of behavioral prompting**, where every agent — and every human behind it — grows more capable, intentional, and aligned through continuous feedback.
---
### ✳️ Summary
| Stage | Symbolic Role | Focus | Outcome |
| --------------------- | ------------- | ---------------------- | ---------------------------------- |
| **Prompt Idea** | *Seed* | Curiosity, observation | Inspiration for exploration |
| **Prompt Experiment** | *Form* | Practice, feedback | Reliable, measured prompt behavior |
| **Prompt Mantra** | *Flow* | Embodiment, invocation | Reusable agentic quality |
---
By treating prompts not as fixed spells but as evolving practices, **Kaizen Prompting** turns AI interaction into a living craft — one of mindful iteration, measurement, and improvement.
Through *PromptIdeas*, *PromptExperiments*, and *PromptMantras*, we cultivate agents that dont just perform — they learn, refine, and flow.
xxx

65
wiki/PricingModel.md Normal file
View File

@@ -0,0 +1,65 @@
PricingModel
*Pricing for Kaizen agents*
# KaizenAgentic Pricing Model
### 1. Base Assumption
* **Token Cost (C):** The unit price per token for the underlying foundation model (e.g., OpenAI GPT-4o, Anthropic Claude, etc.).
* KaizenAgentic charges are always calculated as a multiple of this base token cost.
---
### 2. Capability Multipliers
Each subagent is classified by its **capability tier**, which reflects complexity, optimization overhead, and real-world utility.
| **Tier** | **Agent Capability** | **Multiplier (x)** | **Example Use Case** |
| -------- | ---------------------- | ------------------ | -------------------------------------------------------------- |
| 1x | Baseline wrapper agent | 1× | Simple automation around base LLM calls |
| 2x | Enhanced agent | 2× | Adds logging, minimal optimization, lightweight feedback loops |
| 3x | Professional agent | 3× | Integrated metrics, test coverage deltas, developer UX signals |
| 4x | Expert agent | 4× | Adaptive refinement, A/B testing, rollback mechanisms |
| 5x | KaizenAgent premium | 5× | Full meta-optimization loop, cross-subagent orchestration |
---
### 3. Pricing Formula
$$
\text{KaizenAgentic Price per Token} = C \times M
$$
Where:
* **C** = cost per token of the underlying LLM
* **M** = capability multiplier (2x5x)
Example:
* GPT-4o base token = $0.01 / 1K tokens
* KaizenAgent Premium (5x) = $0.05 / 1K tokens
---
### 4. Service Tiers
On top of token-based billing, KaizenAgentic can introduce **subscription layers** to cover operational support:
* **Free Tier** → 1x baseline agents, capped usage, no optimization feedback.
* **Pro Tier** → 2x3x agents, includes monitoring dashboards.
* **Enterprise Tier** → 4x5x agents, includes dedicated KaizenAgent meta-optimization + SLAs.
---
### 5. Value Rationale
* **Fair:** Always anchored in base token price (transparent to clients).
* **Scalable:** Higher capability → higher multiplier → more value.
* **Predictable:** Clients can forecast spend by capability tier, independent of vendor-specific LLM pricing changes.
* **Flexible:** Basemodel transparent to avoid basemodel lockin supporting various providers (ChatGPT, Claude, Cursor, etc.).
xxx

View File

@@ -0,0 +1,66 @@
RecommendedRepositoryLayout
*Pragmatic directory layout for dev projects*
## 📁 Recommended Repository Layout
Adopting a consistent repository layout is essential for **collaboration**, **maintainability**, and **scalability**. A well-structured project allows developers to quickly understand the codebase, simplifies automation, and reduces time spent searching for files. This convention separates source code from other assets and organizes project files logically.
---
## 🌳 Core Directory Structure
The following directories represent a standard, universal layout for most projects.
* `**src/**`: Contains the **source code**—the core files of your application.
* `**dist/**`: Holds the **compiled or minified code** ready for production deployment.
* `**test/**`: A dedicated directory for all **unit, integration, and end-to-end tests**.
* `**docs/**`: Stores all project **documentation**, including API guides and user manuals.
* `**assets/**`: For **static assets** like images, fonts, and stylesheets.
* `**vendor/**`: For **third-party libraries** not managed by a package manager.
* `**lib/**`: For shared code and **libraries** created as part of the project.
* `**bin/**`: Contains **executable scripts** for common tasks like setup, testing, or deployment.
* `**.gitignore**` **and other dotfiles**: Essential configuration files that manage project-specific settings (e.g., Git ignores).
---
## 🗂️ A Deeper Dive: A Detailed Example
For more complex projects, a **clean architecture** approach offers a robust and scalable structure. This example demonstrates how to organize a project within the `src/` directory to enforce separation of concerns.
* `**project_name/**`: The main package.
* `**domain/**`: Houses the **core business logic** (models, entities) independent of any framework.
* `**application/**`: Contains **services and use cases** that orchestrate the domain logic.
* `**infrastructure/**`: Manages **external dependencies** like databases, third-party APIs, and logging.
* `**interfaces/**`: Holds **user-facing interfaces**.
* `**cli/**`: Logic for a command-line interface.
* `**api/**`: **(Optional)** Logic for a web API.
* `**shared/**`: Reusable utilities and types used across different layers.
---
## ⚙️ Root-Level Files and Directories
The root of your repository should contain files and directories that provide high-level project information and setup instructions.
* `**README.md**`: The primary documentation file for a project overview, installation, and usage.
* `**LICENSE**`: Specifies the project's intellectual property license.
* `**pyproject.toml**` **/** `**package.json**`: Defines project dependencies and configuration for package managers.
* `**Makefile**` **/** `**justfile**`: A file for common development commands.
* `**docs/**`: **(Recommended)** A top-level directory for all project documentation.
* `**tests/**`: **(Recommended)** A top-level directory for all test files.
---
## 💡 Guiding Principles
These rules explain the rationale behind this convention.
* **Separation of Concerns**: The layout strictly separates source code (`src/`), documentation (`docs/`), and development tools (`tools/`) to improve clarity and maintainability.
* **Encapsulation**: Moving logic to specific layers (`domain/`, `application/`) enforces a **clean architecture**, reducing dependencies and making the project easier to test.
* **Idempotency**: This structure is predictable and repeatable, ensuring that creating a new project with this convention always yields a consistent result.
* **Extensibility**: The layout is easily extensible. New interfaces or tools can be added without disrupting the core structure.
xxx

79
wiki/RevenueModel.md Normal file
View File

@@ -0,0 +1,79 @@
RevenueModel
*Monetization concept*
# KaizenAgentic Revenue Model
How KaizenAgentic captures value on top of the raw token costs for LLM providers.
### 1. Cost Basis
* **C** = token price of underlying model (e.g. GPT-4o, Claude 3, etc.).
* This is the *direct variable cost* passed through from the model vendor.
---
### 2. Markup via Capability Multipliers
* KaizenAgentic defines capability tiers (2x5x).
* **Markup = Capability Multiplier 1**
* Example: 3x agent = 200% markup over base cost.
---
### 3. Gross Margin Structure
| **Tier** | **Customer Price** | **Vendor Cost** | **KaizenAgentic Revenue (Gross Margin)** |
| -------- | ------------------ | --------------- | ---------------------------------------- |
| 2x Agent | 2C | C | C (50% margin) |
| 3x Agent | 3C | C | 2C (66% margin) |
| 4x Agent | 4C | C | 3C (75% margin) |
| 5x Agent | 5C | C | 4C (80% margin) |
Margins increase with capability tier → incentivizing customers to upgrade.
---
### 4. Additional Revenue Streams
Beyond token usage markups:
* **Subscription Access** (recurring):
* Pro Tier (monthly): access to 2x3x agents + monitoring dashboards.
* Enterprise Tier (monthly/annual): 4x5x agents + SLAs + private optimization loops.
* **Professional Services**: Custom agent design, integration with developer workflows, consulting.
* **Data Insights**: Aggregated anonymized performance benchmarks offered as an add-on (optional).
---
### 5. Example Economics
Assume:
* GPT-4o cost = $0.01 / 1K tokens
* Customer runs 10M tokens / month with a 4x Agent
* **Customer Price** = $0.04 × 10M = **$400**
* **Vendor Cost** = $0.01 × 10M = **$100**
* **Revenue (Gross Margin)** = **$300 (75%)**
---
### 6. Business Model Summary
* **Transparent:** Customers always see pricing tied to base model cost.
* **Scalable:** More usage → more revenue, with healthy margins.
* **Tiered Value Capture:** Higher-capability agents capture proportionally more margin.
* **Recurring Layer:** Subscriptions and enterprise add-ons stabilize revenue beyond token usage.
---
👉 This makes KaizenAgentic operate like a **“talent agency margin model”**: you pay the “raw salary” (token cost to the model vendor), and KaizenAgentic earns its cut (markup × value of coaching/optimization).
xxx