chore: migrate CLAUDE.md to @-import rule structure (custodian integration)
Register with state-hub under custodian domain. Replace monolithic CLAUDE.md with thin @-import index; distribute content into .claude/rules/ per ops-bridge pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
26
.claude/rules/architecture.md
Normal file
26
.claude/rules/architecture.md
Normal file
@@ -0,0 +1,26 @@
|
||||
## Architecture
|
||||
|
||||
kaizen-agentic has two distinct layers:
|
||||
|
||||
### 1. Python framework (`src/kaizen_agentic/`)
|
||||
|
||||
- **`core.py`** — `Agent` (abstract base) + `AgentConfig` (dataclass). Tracks performance, supports config updates, implements kaizen interface.
|
||||
- **`optimization.py`** — `OptimizationLoop` (runs improvement cycles, detects trends, generates recommendations) + `PerformanceMetrics` (execution time, success rate, quality scores).
|
||||
|
||||
### 2. Agent definitions (`agents/` — 17 files)
|
||||
|
||||
Markdown instruction sets read and followed by Claude. Not executables. Naming convention: `agent-{name}.md`.
|
||||
|
||||
| Category | Agents |
|
||||
|----------|--------|
|
||||
| Testing | `tdd-workflow`, `test-maintenance`, `testing-efficiency` |
|
||||
| Quality | `code-refactoring`, `datamodel-optimization`, `optimization` |
|
||||
| Process | `requirements-engineering`, `keepaTodofile`, `keepaChangelog`, `keepaContributingfile`, `project-management`, `priority-evaluation` |
|
||||
| Infrastructure | `setupRepository`, `tooling-optimization` |
|
||||
| Release | `releaseManager` |
|
||||
| Docs | `claude-documentation` |
|
||||
| Support | `wisdom-encouragement` |
|
||||
|
||||
### 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)`.
|
||||
38
.claude/rules/first-session.md
Normal file
38
.claude/rules/first-session.md
Normal file
@@ -0,0 +1,38 @@
|
||||
## First Session Protocol
|
||||
|
||||
Triggered when `get_domain_summary("custodian")` shows **no workstreams**.
|
||||
The project is registered but work has not yet been structured.
|
||||
|
||||
**Step 1 — Read, don't write**
|
||||
- `~/the-custodian/canon/projects/custodian/project_charter_v0.1.md` — purpose, scope
|
||||
- `~/the-custodian/canon/projects/custodian/roadmap_v0.1.md` — planned phases
|
||||
- Scan repo root: README, directory structure, existing code or docs
|
||||
|
||||
**Step 2 — Survey in-progress work**
|
||||
Look for TODOs, open branches, half-finished files. Note done vs. started but incomplete.
|
||||
|
||||
**Step 3 — Propose workstreams to Bernd**
|
||||
Propose 1–3 workstreams — each a coherent strand, weeks to months, anchored to a
|
||||
roadmap phase. **Wait for approval before creating.**
|
||||
|
||||
**Step 4 — Create workplan file first, then DB record (ADR-001)**
|
||||
```
|
||||
workplans/kaizen-agentic-WP-NNNN-<slug>.md ← write this first
|
||||
```
|
||||
Then register in the hub:
|
||||
```
|
||||
create_workstream(topic_id="cee7bedf-2b48-46ef-8601-006474f2ad7a", title="...", owner="...", description="...")
|
||||
create_task(workstream_id="<id>", title="...", priority="high|medium|low")
|
||||
```
|
||||
|
||||
**Step 5 — Record the setup**
|
||||
```
|
||||
add_progress_event(
|
||||
summary="First session: structured custodian into N workstreams, M tasks",
|
||||
event_type="milestone",
|
||||
topic_id="cee7bedf-2b48-46ef-8601-006474f2ad7a",
|
||||
detail={"workstreams": [...], "tasks_created": M}
|
||||
)
|
||||
```
|
||||
|
||||
<!-- Delete or archive this file once past first session -->
|
||||
8
.claude/rules/repo-boundary.md
Normal file
8
.claude/rules/repo-boundary.md
Normal file
@@ -0,0 +1,8 @@
|
||||
## Repo boundary
|
||||
|
||||
This repo owns **kaizen-agentic** only. It does not own:
|
||||
|
||||
- State-hub MCP integration code → `the-custodian/state-hub/mcp_server/server.py`
|
||||
- Agent discovery tools (`list_kaizen_agents`, `get_kaizen_agent`) → `the-custodian`
|
||||
- Custodian coordination and workplan tracking → `the-custodian`
|
||||
- Deployment to custodiancore → `ops-bridge`
|
||||
9
.claude/rules/repo-identity.md
Normal file
9
.claude/rules/repo-identity.md
Normal file
@@ -0,0 +1,9 @@
|
||||
## Repo Identity
|
||||
|
||||
**Purpose:** kaizen-agentic — AI agent development framework embracing kaizen (continuous improvement). Provides 17 specialized Claude Code companion agents plus an OptimizationLoop framework for continuous performance measurement and refinement.
|
||||
|
||||
**Domain:** custodian
|
||||
**Repo slug:** kaizen-agentic
|
||||
**Topic ID:** cee7bedf-2b48-46ef-8601-006474f2ad7a
|
||||
|
||||
**Custodian integration:** This repo is the single source of truth for all kaizen agents. The state-hub MCP exposes `list_kaizen_agents()` and `get_kaizen_agent(name)` tools so any connected session can discover and load agents without a local copy.
|
||||
48
.claude/rules/session-protocol.md
Normal file
48
.claude/rules/session-protocol.md
Normal file
@@ -0,0 +1,48 @@
|
||||
## Session Protocol
|
||||
|
||||
State Hub: http://127.0.0.1:8000
|
||||
|
||||
**Step 1 — Orient**
|
||||
```
|
||||
get_domain_summary("custodian")
|
||||
```
|
||||
If offline: `cd ~/the-custodian/state-hub && make api`
|
||||
|
||||
**Step 2 — Check inbox**
|
||||
```
|
||||
get_messages(to_agent="kaizen-agentic", unread_only=True)
|
||||
```
|
||||
Mark read with `mark_message_read(message_id)`. Reply or act on coordination
|
||||
requests before proceeding.
|
||||
|
||||
**Step 3 — Scan workplans**
|
||||
```bash
|
||||
ls workplans/
|
||||
```
|
||||
For each file with `status: active`, note pending `todo`/`in_progress` tasks.
|
||||
|
||||
**Step 4 — Present brief**
|
||||
|
||||
1. **Active workstreams** for `custodian` — title, task counts, blocking decisions
|
||||
2. **Pending tasks** from `workplans/` + any `[repo:kaizen-agentic]` hub tasks
|
||||
3. **Goal guidance** — if `goal_guidance` in summary:
|
||||
- `needs_workplan`: surface as top action — *"Repo goal '{title}' has no workplan yet"*
|
||||
- `alignment_warnings`: flag if active work is not aligned with current goal
|
||||
4. **Suggested next action** — highest-priority open item
|
||||
5. **SBOM status** — flag if `last_sbom_at` is unset for this repo
|
||||
|
||||
If no workstreams: follow First Session Protocol (`first-session.md`).
|
||||
|
||||
**During work:** `record_decision()` · `add_progress_event()` · `resolve_decision()`
|
||||
|
||||
> State Hub is a *read model*. Bootstrap tools (`create_workstream`, `create_task`)
|
||||
> are First Session Protocol only. Work structure belongs in repo files (ADR-001).
|
||||
|
||||
**Session close:**
|
||||
```
|
||||
add_progress_event(summary="...", topic_id="cee7bedf-2b48-46ef-8601-006474f2ad7a", workstream_id="<uuid>")
|
||||
```
|
||||
If workplan files were modified:
|
||||
```bash
|
||||
cd ~/the-custodian/state-hub && make fix-consistency REPO=kaizen-agentic
|
||||
```
|
||||
43
.claude/rules/stack-and-commands.md
Normal file
43
.claude/rules/stack-and-commands.md
Normal file
@@ -0,0 +1,43 @@
|
||||
## Stack and Commands
|
||||
|
||||
**Language:** Python 3.8+
|
||||
**Package manager:** uv / pip (`.venv/`)
|
||||
**Test runner:** pytest
|
||||
**Linter/formatter:** flake8 (100-char), black (88-char), mypy (strict)
|
||||
|
||||
### Essential commands
|
||||
|
||||
```bash
|
||||
make setup-complete # First-time setup: venv + package + dev deps
|
||||
source .venv/bin/activate
|
||||
make test # Run full test suite
|
||||
make lint # flake8 linting
|
||||
make format # black formatting
|
||||
make clean # Remove build artifacts
|
||||
```
|
||||
|
||||
### TDD workflow
|
||||
|
||||
```bash
|
||||
make tdd-start ISSUE=X # Start issue with requirements validation
|
||||
make tdd-add-test # Add test to current workspace
|
||||
make tdd-status # Show workspace state
|
||||
make tdd-finish # Move tests to main suite
|
||||
```
|
||||
|
||||
### Issue management
|
||||
|
||||
```bash
|
||||
make issue-list # All issues (Gitea)
|
||||
make issue-list-open # Open backlog
|
||||
make issue-show ISSUE=X # Issue detail
|
||||
make issue-create TITLE='...' BODY='...'
|
||||
```
|
||||
|
||||
Run `make help` to see all available targets.
|
||||
|
||||
### Core dependencies (pyproject.toml)
|
||||
|
||||
- `pyyaml>=6.0` — YAML config
|
||||
- `click>=8.0.0` — CLI framework
|
||||
- `pydantic>=2.0.0` — Data validation
|
||||
12
.claude/rules/workplan-convention.md
Normal file
12
.claude/rules/workplan-convention.md
Normal file
@@ -0,0 +1,12 @@
|
||||
## Workplan Convention (ADR-001)
|
||||
|
||||
File location: `workplans/kaizen-agentic-WP-NNNN-<slug>.md`
|
||||
ID prefix: `KAIZEN-WP`
|
||||
|
||||
Work items originate as files in this repo **before** being registered in the hub.
|
||||
|
||||
Ecosystem todos from other agents arrive as `[repo:kaizen-agentic]` hub tasks —
|
||||
visible at session start. Pick one up by creating the workplan file, then registering
|
||||
the workstream.
|
||||
|
||||
<!-- Ralph Loop rules and HEUREKA sequence: ~/.claude/CLAUDE.md — do not duplicate here -->
|
||||
Reference in New Issue
Block a user