Primary config: See
AGENTS.mdfor architecture, layer rules, and conventions. This file contains Claude Code-specific instructions only.
SYSTEM.md— Product vision and epics (START HERE)AGENTS.md— Agent instructions (layer rules, commands, conventions)ARCHITECTURE.md— Layer architecture and diagramsSTRUCTURE.md— Folder structure definitionsdocs/USE_CASES.md— All use cases (DL-, P-, M-, etc.)
- Three layers: data-layer → agents → cli (dependencies flow downward ONLY)
- CanonKeeper writes Neo4j: All other agents use
ProposedChangein MongoDB - Use case IDs mandatory: Reference
DL-20,P-6,ST-2etc. in commits/PRs - Tests required: Every code change needs tests (unit + integration/e2e)
- Evidence for canon facts: Every canonical fact MUST have
evidence_refs - Async MCP calls: All agent methods calling MCP tools must be
async - Logging: Use
structlog, neverprint()
# ❌ FORBIDDEN: CLI importing data-layer directly
from monitor_data.db import Neo4jClient # WRONG!
# ✅ CORRECT: CLI imports agents, agents import data-layer
from monitor_agents.loops import SceneLoop # RIGHT!- Importing data-layer from CLI → route through an agent instead
- Writing to Neo4j outside CanonKeeper → use
ProposedChangein MongoDB - Skipping
check_layer_dependencies.pybefore committing → run it - Forgetting
asyncon agent methods that call MCP tools → all MCP calls are async - Using
print()for logging → usestructlog(import structlog; log = structlog.get_logger())
Lain is a persistent code-intelligence MCP server configured for this workspace. Use Lain for:
- Blast radius analysis (
get_blast_radius) - Dependency traces (
trace_dependency,get_call_chain) - Dead code detection (
find_dead_code) - Semantic search (
semantic_search) - Architectural exploration (
explore_architecture,find_anchors) - Build/test integration (
run_build,run_tests,run_clippy)
Health check:
curl -s -X POST http://localhost:9999/mcp -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_health","arguments":{}},"id":1}'| To modify... | Edit files in... | Layer |
|---|---|---|
| Neo4j client | packages/data-layer/src/monitor_data/db/neo4j.py |
1 |
| MongoDB client | packages/data-layer/src/monitor_data/db/mongodb.py |
1 |
| Neo4j MCP tools | packages/data-layer/src/monitor_data/tools/neo4j_tools/ |
1 |
| ContextAssembly agent | packages/agents/src/monitor_agents/context_assembly.py |
2 |
| Narrator agent | packages/agents/src/monitor_agents/narrator.py |
2 |
| CanonKeeper agent | packages/agents/src/monitor_agents/canonkeeper.py |
2 |
| Scene loop | packages/agents/src/monitor_agents/loops/scene_loop.py |
2 |
| Play command | packages/cli/src/monitor_cli/commands/play.py |
3 |
| Topic | Read... |
|---|---|
| Product vision & epics | SYSTEM.md |
| Data-layer epic (DL-1..DL-18) | docs/USE_CASES.md + docs/use-cases/data-layer-details.md |
| Architecture overview | ARCHITECTURE.md |
| Data model | docs/ontology/ONTOLOGY.md |
| Database integration | docs/architecture/DATABASE_INTEGRATION.md |
| Agent orchestration | docs/architecture/AGENT_ORCHESTRATION.md |
| API specification | docs/architecture/DATA_LAYER_API.md |
| Quick reference | docs/AI_DOCS.md |
Note: AGENTS.md is the primary agent config. This file provides Claude Code-specific context and quick references.