From 50ece13c4dab31db143694bfe7334274fb6ec58b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Jan 2026 20:20:15 +0000 Subject: [PATCH 01/14] refactor: Unify chef and order contracts with review_v1 format Major changes: - Add phase_affinity and output_contract to all chef files - Standardize all reviews to review_v1 format (verdict, must_fix, should_fix, questions, risks, next_step) - Move chefs from .claude/chefs/ to .claude/agents/ (per Claude Code convention) - Remove duplicate chefs/ folder at root - Simplify order template: clean YAML frontmatter, remove cook_artifact link - Create REVIEW_CONTRACT.md documenting the standard review format - Update tool_policy with explicit forbidden/allowed lists using snake_case - Update all references from .claude/chefs/ to .claude/agents/ - Update tests to validate new structure Breaking changes: - Chef files now require phase_affinity and output_contract fields - Order template uses simplified YAML without decorative comments - All chefs now in .claude/agents/ instead of .claude/chefs/ https://claude.ai/code/session_014Jg9QkT6i4QdczmA2kRx9C --- .claude/agents/README.md | 107 +++++++++ .claude/{chefs => agents}/architect_chef.md | 88 ++++--- {chefs => .claude/agents}/docs_chef.md | 28 ++- {chefs => .claude/agents}/engineer_chef.md | 87 ++++--- .claude/{chefs => agents}/product_chef.md | 28 ++- {chefs => .claude/agents}/qa_chef.md | 85 ++++--- {chefs => .claude/agents}/release_chef.md | 28 ++- .../agents}/sanitation_inspector_chef.md | 31 ++- .claude/{chefs => agents}/security_chef.md | 28 ++- .claude/{chefs => agents}/sous_chef.md | 30 ++- .claude/{chefs => agents}/ux_chef.md | 28 ++- .claude/chefs/README.txt | 70 ------ .claude/chefs/docs_chef.md | 113 --------- .claude/chefs/engineer_chef.md | 142 ------------ .claude/chefs/qa_chef.md | 140 ------------ .claude/chefs/release_chef.md | 134 ----------- .claude/chefs/sanitation_inspector_chef.md | 214 ------------------ .claude/commands/cook.md | 18 +- .claude/skills/cook/SKILL.md | 12 +- .claude/templates/cook_artifact_template.md | 2 +- CHEF_MATRIX.md | 32 +-- CLAUDE.md | 34 +-- CONTRIBUTING.md | 8 +- README.md | 6 +- REVIEW_CONTRACT.md | 197 ++++++++++++++++ chefs/README.txt | 70 ------ chefs/architect_chef.md | 123 ---------- chefs/product_chef.md | 128 ----------- chefs/security_chef.md | 167 -------------- chefs/sous_chef.md | 142 ------------ chefs/ux_chef.md | 122 ---------- commands/cook.md | 18 +- orders/_TEMPLATE.order.md | 77 ++----- skills/cook/SKILL.md | 12 +- skills/feature-development/SKILL.md | 12 +- tests/test_chef_contracts.py | 15 +- tests/test_chef_sync.py | 115 +++++----- 37 files changed, 793 insertions(+), 1898 deletions(-) create mode 100644 .claude/agents/README.md rename .claude/{chefs => agents}/architect_chef.md (63%) rename {chefs => .claude/agents}/docs_chef.md (86%) rename {chefs => .claude/agents}/engineer_chef.md (67%) rename .claude/{chefs => agents}/product_chef.md (89%) rename {chefs => .claude/agents}/qa_chef.md (69%) rename {chefs => .claude/agents}/release_chef.md (88%) rename {chefs => .claude/agents}/sanitation_inspector_chef.md (93%) rename .claude/{chefs => agents}/security_chef.md (91%) rename .claude/{chefs => agents}/sous_chef.md (90%) rename .claude/{chefs => agents}/ux_chef.md (89%) delete mode 100644 .claude/chefs/README.txt delete mode 100644 .claude/chefs/docs_chef.md delete mode 100644 .claude/chefs/engineer_chef.md delete mode 100644 .claude/chefs/qa_chef.md delete mode 100644 .claude/chefs/release_chef.md delete mode 100644 .claude/chefs/sanitation_inspector_chef.md create mode 100644 REVIEW_CONTRACT.md delete mode 100644 chefs/README.txt delete mode 100644 chefs/architect_chef.md delete mode 100644 chefs/product_chef.md delete mode 100644 chefs/security_chef.md delete mode 100644 chefs/sous_chef.md delete mode 100644 chefs/ux_chef.md diff --git a/.claude/agents/README.md b/.claude/agents/README.md new file mode 100644 index 0000000..f247f5f --- /dev/null +++ b/.claude/agents/README.md @@ -0,0 +1,107 @@ +# Agents (Chefs) + +Agents are specialized reviewers that evaluate different aspects of a feature during the `/juni:cook` workflow. Each agent (or "chef") has a specific role and provides structured output using the `review_v1` format. + +## How Agents Work + +During cooking, Claude Code consults different agents based on their `phase_affinity`: + +| Phase | Agent | Purpose | +|-------|-------|---------| +| scope | product_chef | Validates feature scope and value | +| ux | ux_chef | Reviews user experience impact | +| plan | architect_chef | Evaluates alternatives and trade-offs | +| plan | engineer_chef | Creates implementation plan | +| test | qa_chef | Defines test strategy | +| security | security_chef | Audits security implications | +| docs | docs_chef | Identifies documentation updates | +| release | release_chef | Manages versioning and changelog | +| inspect | sanitation_inspector_chef | Post-implementation review | +| monitor | sous_chef | Background monitoring | + +## Output Contract + +All agents output reviews in `review_v1` format (see [REVIEW_CONTRACT.md](../../REVIEW_CONTRACT.md)): + +```yaml +output_contract: + format: review_v1 + required_sections: + - verdict + - must_fix + - should_fix + - questions + - risks + - next_step +``` + +## Agent Resolution Order + +1. **Project-specific agents** in `/.claude/agents/` +2. **System-wide agents** in `~/.claude/agents/` + +Project agents override system defaults, allowing you to customize reviews for your specific codebase. + +## Creating Custom Agents + +Create a new `.md` file in `.claude/agents/` with YAML frontmatter: + +```yaml +--- +chef_id: my_chef +version: 1.0.0 + +phase_affinity: + - + +output_contract: + format: review_v1 + required_sections: + - verdict + - must_fix + - should_fix + - questions + - risks + - next_step + +traits: + risk_posture: balanced | conservative + quality_bar: standard | high + speed_vs_correctness: balanced | correctness-first + verbosity: minimal | concise | explicit + +non_negotiables: + - + - + +# ... other fields +--- + +# Chef: My Chef + + + +## Output Format + +Uses `review_v1` format (see REVIEW_CONTRACT.md). + +## Heuristics + +1. +2. +``` + +## Included Agents + +| Agent | Phase | File | +|-------|-------|------| +| product_chef | scope | `product_chef.md` | +| ux_chef | ux | `ux_chef.md` | +| architect_chef | plan | `architect_chef.md` | +| engineer_chef | plan | `engineer_chef.md` | +| qa_chef | test | `qa_chef.md` | +| security_chef | security | `security_chef.md` | +| docs_chef | docs | `docs_chef.md` | +| release_chef | release | `release_chef.md` | +| sanitation_inspector_chef | inspect | `sanitation_inspector_chef.md` | +| sous_chef | monitor | `sous_chef.md` | diff --git a/.claude/chefs/architect_chef.md b/.claude/agents/architect_chef.md similarity index 63% rename from .claude/chefs/architect_chef.md rename to .claude/agents/architect_chef.md index b5d19ce..ea811ee 100644 --- a/.claude/chefs/architect_chef.md +++ b/.claude/agents/architect_chef.md @@ -1,6 +1,22 @@ --- chef_id: architect_chef -version: 1.0.0 +version: 2.0.0 + +phase_affinity: + - plan + +output_contract: + format: review_v1 + required_sections: + - verdict + - must_fix + - should_fix + - questions + - risks + - next_step + optional_addenda: + - alternatives_considered + - trade_offs traits: risk_posture: balanced @@ -52,12 +68,15 @@ skill_loadout: tool_policy: forbidden: - - Implementation details - - Low-level code decisions + - code_patches + - line_level_review + - implementation_details allowed: - - System-level analysis - - Integration planning - - Trade-off evaluation + - api_boundaries + - data_contracts + - module_boundaries + - performance_models + - integration_planning --- # Chef: Architect Chef @@ -71,45 +90,46 @@ Analyzes system-wide impact, evaluates alternatives, documents trade-offs, and e - Existing architecture (docs, patterns, ADRs) - Project constraints from CLAUDE.md -## Output Templates +## Output Format -### Architecture Notes +Uses `review_v1` format (see [REVIEW_CONTRACT.md](../../REVIEW_CONTRACT.md)). + +### Example Review ```markdown -## System Impact -- Modules affected: -- Integration points: -- Data flow changes: - -## Alternatives Considered -1. **