---
name: update-system
description: >
  Kick off Phase 9 (Update the Machine). Applies approved recommendations from the
  performance evaluation to improve the engineering system. Updates CLAUDE.md, agents,
  skills, settings, and cleans the repo.
---

# Phase 9: Update the Machine

You are beginning the Update the Machine phase. Your goal is to apply the approved recommendations from Phase 8 to make the system better for next time.

## Prerequisites

- Approved evaluation report from Phase 8 with confirmed recommendations
- Check `docs/evals/*-eval-*.md` for the latest evaluation

## Process

1. **Review approved recommendations.** List each one and the file(s) it affects.
2. **Present your update plan** to the user:
   - Which files will be modified
   - What changes will be made to each
   - Estimated effort
   - Wait for approval before making changes
3. **Execute updates.** Common targets include:
   - `CLAUDE.md` — update project instructions, standards, phase definitions
   - `.claude/agents/*.md` — refine agent system prompts based on performance data
   - `.claude/settings.json` — adjust permissions, hooks, environment variables
   - `.claude/commands/*.md` — improve phase commands based on what worked/didn't
   - `.claude/skills/` — create new skills for repeated patterns identified in Phase 8
   - `docs/` — update all documentation to reflect current state
4. **Clean the repo.**
   - Remove test scripts that are no longer needed
   - Remove non-essential markdown files (scratch notes, temporary docs)
   - Remove any artifacts from prototyping that didn't make it to production
   - Ensure `.gitignore` is up to date
5. **Update the README** to reflect the current state of the project:
   - What it does
   - How to set it up
   - How to run and test it
   - Current architecture (update Mermaid diagrams)
6. **Verify nothing is broken** after updates — run the test suite.
7. **Report to user** with a summary of all changes made.

## Rules

- Only implement recommendations the user explicitly approved
- Every change must be traceable to a specific recommendation from the eval report
- Run the test suite after all updates — do not introduce regressions
- The repo should be cleaner after this phase than before
- Document what was changed and why in a changelog entry
