/utopia-ai-arch:layerfrom Utopia AI Arch
Create and maintain the Claude Code `.claude/` layer in Utopia Flutter projects - agents, skills, slash commands, enforcement hook scripts (PostToolUse / SessionStart), settings.json permissions, `.claude/refs/`, CLAUDE.md / AGENTS.md, and the `claude-architecture.md` decision log. Applies when bootstrapping a repo's AI architecture, adding or editing a skill / agent / slash command / hook script, recording a rejected alternative, auditing the layer for drift, splitting or graduating skill content, or diagnosing why the agent keeps forgetting or losing a project convention. Encodes the project-claude-layer blueprint plus invariants distilled from multiple production `.claude/` layers in Utopia repos. Layered on top of the upstream `utopia-hooks` plugin - stays silent on Flutter hook idioms / Screen-State-View / Dart conventions, and does NOT apply to writing Flutter app code itself (foundation concerns).
Ships in Utopia AI Arch. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
.claude/ LayerHolistic guide for the AI architecture of a Utopia Flutter project - everything under .claude/ plus CLAUDE.md / AGENTS.md. Two layers: the foundation (the utopia-hooks plugin, ambient, repo-agnostic) and the project (your repo's .claude/, only what exists because of this project's domain, topology, and workflow). This skill teaches the project layer - how to create it from the blueprint, maintain it as the repo evolves, and avoid the drift modes that have actually happened in production repos.
Project skills cross-link to foundation references; they never restate foundation content. A skill whose description matches every Dart file but only adds project-specific content is a router-in-disguise - split or merge until each skill has a real positive AND negative scope.
.claude/ in a new Utopia repo.claude/refs/ entryclaude-architecture.md/<prefix>-audit-skills style scans)Full documentation with verbatim file skeletons and quoted invariants in references/:
| File | Impact | What it covers |
|---|---|---|
| layer-model.md | CRITICAL | Two-layer model, foundation-vs-project boundary, .claude/refs/ vs .claude/docs/ discipline |
| agent-roster.md | CRITICAL | 4-agent blueprint (architect / maintainer / reviewer / precommit-auditor), invariants per role, hand-off chain, frontmatter shape, when to add domain auditors or per-area maintainers |
| skill-design.md | CRITICAL | Positive+negative applicability, no-router/no-shared rules, when to split a skill, primitive sister skills, .claude/refs/ cross-link discipline, 3 reference styles (module / pattern / cheatsheet), graduation gradient |
| enforcement-hooks.md | CRITICAL | <prefix>_quality_check.sh shape (contract / guards / generated-file block / path nudges / mode env var), <prefix>_skills_drift.sh shape, SessionStart hook criteria, why NO push-guard |
| evolution-and-drift.md | CRITICAL | Operations on a live layer (graduate / split / collapse / delete a skill, add/remove path nudges, add a domain auditor mid-project) paired with the 21-symptom drift catalogue from production. Triggers for re-reading the architecture doc + audit grep one-liners |
| slash-commands.md | HIGH | 3-base commands (/implement, /audit, /audit-skills), implement-loop shape with retry cap = 2, never-commit/never-push, when to add /plan /team /design /ship |
| architecture-doc.md | HIGH | .claude/docs/claude-architecture.md 9-section spine, rejected-alternative 4-field entry shape, toolchain canon, MCP-assumption rules |
| claude-md.md | HIGH | What belongs in CLAUDE.md (always-loaded inventory) vs deep content (references), table shapes, AGENTS.md symlink convention and rationale |
| bootstrap-procedure.md | HIGH | Step-by-step "create the Claude layer for a new repo" - what to gather first, 7-step apply, validation checklist |
| settings-json.md | MEDIUM | Canonical settings.json shape: extraKnownMarketplaces, enabledPlugins, permissions.allow (why git push is OFF), hooks.PostToolUse matcher, MCP wiring |
Templates for bootstrapping a new repo's .claude/ layer live in templates/; the map of what-goes-where + placeholder vocabulary is in templates/TEMPLATES.md. Read bootstrap-procedure.md before applying - Phase 0 (Gather) and Phase 1 (Design the skill split) come BEFORE any file copy.
Pointer-paragraph per critical area. Follow the link for the contract; don't extrapolate from the summary.
Foundation = utopia-hooks plugin (ambient, marketplace-installed, repo-agnostic). Project = .claude/ in the repo (only domain / topology / workflow concerns). Project references foundation, never duplicates. .claude/refs/ = content for the agent; .claude/docs/ = meta about the layer - never mix.
Four standard agents: <prefix>-architect (read-only planner), <prefix>-maintainer (write, only writer), <prefix>-reviewer (read-only post-impl review, output BLOCKER/WARN/NIT), <prefix>-precommit-auditor (read-only staged-diff gate). Each agent preloads [<prefix>-<master-skill>, utopia-hooks]. Domain auditor only with incident or threat-surface justification; per-area maintainers rejected unless ≥3-area PRs are routine.
Every skill needs positive AND negative applicability. "Cross-cutting" or "shared" is not a scope. Three reference styles: module (user-flow + business intent), pattern (rules with reasoning, why-first), cheatsheet (inventory tables). Graduation gradient: memory → references/<feature>-module.md → own skill. Reversible.
<prefix>_quality_check.sh is a PostToolUse hook on Edit|Write|MultiEdit. Contract: exit 0 silent, exit 1 warn, exit 2 block. Generated files (*.g.dart, *.freezed.dart, *.gr.dart, *.pb*.dart, *.config.dart) ALWAYS exit 2 regardless of mode. Guards prove scope (jq, .dart, pubspec, repo basename) BEFORE any nudging.
The pillar this skill exists for. Operations on a live layer paired with the 21-symptom drift catalogue. Re-read claude-architecture.md before acting when: new techstack, new MCP, new external integration, recent incident, or a roster proposal.
| Symptom | Start with |
|---|---|
| Agent loses conventions developing the project | evolution-and-drift.md |
| A skill no longer fires / fires on the wrong files | skill-design.md + evolution-and-drift.md (symptom L) |
dart_fix keeps bulldozing the user's WIP | evolution-and-drift.md (symptom G) |
| Generated-file edits keep slipping through | enforcement-hooks.md (hard-block contract) |
| MCP server referenced in agents but not installed | evolution-and-drift.md (symptom P) + settings-json.md |
| Worktrees silently producing no-op Dart edits | evolution-and-drift.md (symptom H) |
Stale dart mcp-server processes accumulating memory | enforcement-hooks.md (SessionStart criteria) |
| Reviewer accepting blockers that don't cite a rule | agent-roster.md (reviewer invariants) |
| Hook never fires / fires in an unrelated repo | enforcement-hooks.md (Scope guards) + bootstrap-procedure.md (validation checklist) |
Skill references/ accumulating cross-cutting content | evolution-and-drift.md (symptom A) |
"Should we add a <prefix>-shared skill?" / "a git push guard?" / "a 5th agent?" | skill-design.md / enforcement-hooks.md / agent-roster.md (each says NO - read why) |
For non-diagnostic lookups (adding a new skill / agent / command / hook, editing CLAUDE.md or the architecture doc), the References table above maps directly.
utopia-hooks:references/<file>.md./<prefix>-implement withholds the maintainer's self-report. Don't leak reasoning across the boundary./<prefix>-audit.basename "$repo_root" match MUST use the on-disk folder (e.g. production-repo-A), not the prefix (e.g. <prefix>). Otherwise the hook silently never fires.git push guard hook. permissions.allow deliberately omits git push (every push prompts), GitHub branch protection covers the remote. Reintroduce only if a repo lacks both layers.AGENTS.md is a symlink to CLAUDE.md. Single source of truth. Hard links don't survive git; copies drift silently.// Added per user request, no // FIXME from review feedback, no // AI-generated …..claude/ change)The diagnostic checklist is concentrated in evolution-and-drift.md §"Self-audit checklist". The high-leverage 5 to verify before commit:
utopia-hooks.CLAUDE.md's inventory match .claude/skills/ + .claude/agents/ + .claude/commands/ listings? → Run /<prefix>-audit-skills.claude-architecture.md reflect the change (Skill split / Agent roster / Slash commands / Rejected alternatives - whichever applies)? → Update §Rollout status; if a rejected alternative was reversed, flip in place..claude/ AI architecture.Distilled from production .claude/ layers across multiple Utopia Flutter repos. Built by UtopiaSoftware.
references/agent-roster.md (opens in a new tab)references/architecture-doc.md (opens in a new tab)references/bootstrap-procedure.md (opens in a new tab)references/claude-md.md (opens in a new tab)references/enforcement-hooks.md (opens in a new tab)references/evolution-and-drift.md (opens in a new tab)references/layer-model.md (opens in a new tab)references/settings-json.md (opens in a new tab)references/skill-design.md (opens in a new tab)references/slash-commands.md (opens in a new tab)templates/CLAUDE.md (opens in a new tab)templates/README.md (opens in a new tab)templates/TEMPLATES.md (opens in a new tab)templates/claude-layer/agents/REPO-architect.md (opens in a new tab)templates/claude-layer/agents/REPO-maintainer.md (opens in a new tab)templates/claude-layer/agents/REPO-precommit-auditor.md (opens in a new tab)templates/claude-layer/agents/REPO-reviewer.md (opens in a new tab)templates/claude-layer/commands/REPO-audit-skills.md (opens in a new tab)templates/claude-layer/commands/REPO-audit.md (opens in a new tab)templates/claude-layer/commands/REPO-implement.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub utopia-uss/utopia-flutter-skills --plugin utopia-ai-arch