AI Configuration Maintenance
Keep .claude/ directory living knowledge base. Stay current with project + AI tooling best practices.
Read .claude/rules/meta-ai-config.md first — defines conventions, budget constraints, anti-patterns this skill enforces.
Modes
create — New Artifact
Discover + Research — Invoke canonical multi-agent research primitive from /hex-plan (Phases 1-2). Spawn workers parallel:
- an explorer pass (1-2): existing
.claude/ patterns, conventions, cross-references, neighbors of artifact
- researcher pass (1-3, split by axis): Claude Code docs (
code.claude.com/docs), domain best practices, community patterns for artifact topic
Persist substantial findings as .agents/research/research_[topic].md for reuse. See /hex-plan "Research as a Reusable Primitive".
Draft — Follow meta-ai-config.md conventions:
- Respect context budget (<200 lines rules, <500 lines skills)
- Use
paths: scoping for rules unless truly global
- Skills: write description as "what + when to use" (max 1024 chars)
- Use progressive disclosure — SKILL.md overview, reference files for detail
- Add
disable-model-invocation: true for action skills with side effects
Integrate — Update AGENTS.md tables, meta-rule inventory
Validate — Run audit checks (see below)
audit — Check All Artifacts
Context budget audit:
- AGENTS.md under 280 lines?
- Each global rule under 200 lines?
- Count global rules — too many degrades performance
- Skill descriptions total within 2% context budget?
Structural audit:
- Every SKILL.md has
name + description?
- No
allowed-tools in skill frontmatter?
- All persona skills have
user-invocable: true?
- Hook scripts executable?
Dead glob audit:
- For each scoped rule, do
paths: patterns match existing files?
- After directory renames, glob patterns silently fail — verify with:
find . -path "pattern" | head -1
Cross-reference audit:
- Rules referencing other rules → targets exist?
- Skills referencing rules → correct filenames?
- Agents referencing rules → still valid?
Duplication audit:
- Same instruction in AGENTS.md AND rule? (single source of truth)
- Same domain knowledge in skill AND rule? (skill for on-demand, rule for always-on)
refresh — Sync AI Knowledge with Codebase
Detect drift — explorer pass:
- Public types in
subsystem-*.md still exist in code?
- New modules/crates lacking subsystem rules?
- Error variants, trait names, method signatures still match?
- CLI commands changed (new flags, subcommands)?
deny.toml / .licenserc.toml changed?
Research updates — researcher pass:
- Claude Code docs for new features (hooks, frontmatter, agents)
- New best practices in Rust, async, testing, security
- Check if
meta-ai-config.md needs updating
Update stale artifacts — Read current code, update with accurate info, preserve structure
Self-update — Check if this skill (meta-maintain-config) or meta-ai-config.md outdated per research findings. Update them too.
Validate — Run audit mode
review — AI Config Quality Review
Review recent changes to .claude/ for quality:
- Context budget — Change increase always-loaded context? Justified?
- Scoping — Could this global rule be path-scoped instead?
- Progressive disclosure — SKILL.md body under 500 lines? Move details to reference files?
- Description quality — Skill description specific enough for auto-discovery?
- Anti-patterns — Check against 8 anti-patterns in
meta-ai-config.md
- Consistency — Change follow existing artifact conventions?
- Reusability — Hook more appropriate than rule? (deterministic + zero context cost)
catalog-sync — Catalog Drift Review
When auditing AI config, verify .claude/rules.md reflects reality:
- Every rule in
.claude/rules/*.md has entry in .claude/rules.md
- Every catalog entry resolves to real file
AGENTS.md still links to catalog (CLAUDE.md only forwards via @AGENTS.md)
- "By concern" table reflects current development axes (add rows for new concerns; remove for retired)
- "By auto-load path" table matches actual
paths: frontmatter in each rule file
Run task claude:tests — structural tests catch most drift automatically (test_catalog_covers_all_rules, test_catalog_references_resolve, test_context_md_points_to_catalog). Manual review catches semantic drift (e.g., new concern worth catalog row even if no test complains).
research — Deep-Dive Topic
Invoke canonical multi-agent research primitive from /hex-plan (Phases 1-2). No reinvent.
Spawn workers parallel — per /hex-plan Phase 2 axis-splitting:
- researchers × 2-3, split by axis:
- Tooling axis — Claude Code / AI tooling best practices
- Domain axis — Rust patterns, OCI spec, cargo-deny, etc.
- Community axis — how other projects handle this
- explorer (optional) — ground external findings in existing
.claude/ artifacts
Synthesize → Actionable guidance. Persist as .agents/research/research_[topic].md
Apply → Update relevant artifacts
Refresh Targets
| Artifact |
What goes stale |
Refresh trigger |
subsystem-*.md rules |
Types, paths, signatures, error variants |
After refactors, new modules |
quality-rust.md (+ other quality-*.md) |
Language anti-patterns, async conventions, 2026 updates |
After edition/release updates, new tooling |
arch-principles.md |
Design principles, ADR index, code style conventions |
After new patterns, new modules |
| Persona skills |
Implementation patterns, fixtures, commands |
After new commands, workflows |
deps |
License allowlist, tool versions |
After deny.toml changes |
AGENTS.md |
Build commands, env vars, layout |
After new crates, env vars |
meta-ai-config.md |
Conventions, budget numbers, anti-patterns |
After Claude Code releases |
| This skill |
Modes, workflow, refresh targets |
After Claude Code releases |
Maintenance Schedule
| Frequency |
Action |
| Every feature branch |
audit before merging AI config changes |
| Monthly |
refresh to detect drift |
| On Claude Code update |
research "Claude Code new features" then self-update |
| On new tool integration |
create for tool's skill/rule, then audit |
| When something feels off |
review recent changes |
Constraints
- ALWAYS research online before creating AI artifacts
- ALWAYS run at least one research pass for domain knowledge
- ALWAYS check context budget impact (adding always-loaded context?)
- NEVER remove artifacts without checking cross-references first
- NEVER edit
settings.json hooks without testing hook script
- Prefer hooks over rules for enforcement (deterministic + zero context cost)
- Commits use
chore: prefix (per project convention)
1---2name: meta-maintain-config3description: AI Configuration Maintenance4---56# AI Configuration Maintenance78Keep `.claude/` directory living knowledge base. Stay current with project + AI tooling best practices.910**Read `.claude/rules/meta-ai-config.md` first** — defines conventions, budget constraints, anti-patterns this skill enforces.1112## Modes1314### `create` — New Artifact15161. **Discover + Research** — Invoke canonical multi-agent research primitive from `/hex-plan` (Phases 1-2). Spawn workers parallel:17 - an explorer pass (1-2): existing `.claude/` patterns, conventions, cross-references, neighbors of artifact18 - researcher pass (1-3, split by axis): Claude Code docs (`code.claude.com/docs`), domain best practices, community patterns for artifact topic1920 Persist substantial findings as `.agents/research/research_[topic].md` for reuse. See `/hex-plan` "Research as a Reusable Primitive".21222. **Draft** — Follow `meta-ai-config.md` conventions:23 - Respect context budget (<200 lines rules, <500 lines skills)24 - Use `paths:` scoping for rules unless truly global25 - Skills: write description as "what + when to use" (max 1024 chars)26 - Use progressive disclosure — SKILL.md overview, reference files for detail27 - Add `disable-model-invocation: true` for action skills with side effects28293. **Integrate** — Update AGENTS.md tables, meta-rule inventory30314. **Validate** — Run audit checks (see below)3233### `audit` — Check All Artifacts3435**Context budget audit:**36- AGENTS.md under 280 lines?37- Each global rule under 200 lines?38- Count global rules — too many degrades performance39- Skill descriptions total within 2% context budget?4041**Structural audit:**42- Every SKILL.md has `name` + `description`?43- No `allowed-tools` in skill frontmatter?44- All persona skills have `user-invocable: true`?45- Hook scripts executable?4647**Dead glob audit:**48- For each scoped rule, do `paths:` patterns match existing files?49- After directory renames, glob patterns silently fail — verify with: `find . -path "pattern" | head -1`5051**Cross-reference audit:**52- Rules referencing other rules → targets exist?53- Skills referencing rules → correct filenames?54- Agents referencing rules → still valid?5556**Duplication audit:**57- Same instruction in AGENTS.md AND rule? (single source of truth)58- Same domain knowledge in skill AND rule? (skill for on-demand, rule for always-on)5960### `refresh` — Sync AI Knowledge with Codebase61621. **Detect drift** — explorer pass:63 - Public types in `subsystem-*.md` still exist in code?64 - New modules/crates lacking subsystem rules?65 - Error variants, trait names, method signatures still match?66 - CLI commands changed (new flags, subcommands)?67 - `deny.toml` / `.licenserc.toml` changed?68692. **Research updates** — researcher pass:70 - Claude Code docs for new features (hooks, frontmatter, agents)71 - New best practices in Rust, async, testing, security72 - Check if `meta-ai-config.md` needs updating73743. **Update stale artifacts** — Read current code, update with accurate info, preserve structure75764. **Self-update** — Check if this skill (`meta-maintain-config`) or `meta-ai-config.md` outdated per research findings. Update them too.77785. **Validate** — Run `audit` mode7980### `review` — AI Config Quality Review8182Review recent changes to `.claude/` for quality:83841. **Context budget** — Change increase always-loaded context? Justified?852. **Scoping** — Could this global rule be path-scoped instead?863. **Progressive disclosure** — SKILL.md body under 500 lines? Move details to reference files?874. **Description quality** — Skill description specific enough for auto-discovery?885. **Anti-patterns** — Check against 8 anti-patterns in `meta-ai-config.md`896. **Consistency** — Change follow existing artifact conventions?907. **Reusability** — Hook more appropriate than rule? (deterministic + zero context cost)9192### `catalog-sync` — Catalog Drift Review9394When auditing AI config, verify `.claude/rules.md` reflects reality:95961. Every rule in `.claude/rules/*.md` has entry in `.claude/rules.md`972. Every catalog entry resolves to real file983. `AGENTS.md` still links to catalog (`CLAUDE.md` only forwards via `@AGENTS.md`)994. "By concern" table reflects current development axes (add rows for new concerns; remove for retired)1005. "By auto-load path" table matches actual `paths:` frontmatter in each rule file101102Run `task claude:tests` — structural tests catch most drift automatically (`test_catalog_covers_all_rules`, `test_catalog_references_resolve`, `test_context_md_points_to_catalog`). Manual review catches semantic drift (e.g., new concern worth catalog row even if no test complains).103104### `research` — Deep-Dive Topic105106Invoke canonical multi-agent research primitive from `/hex-plan` (Phases 1-2). No reinvent.1071081. **Spawn workers parallel** — per `/hex-plan` Phase 2 axis-splitting:109 - researchers × 2-3, split by axis:110 - *Tooling axis* — Claude Code / AI tooling best practices111 - *Domain axis* — Rust patterns, OCI spec, cargo-deny, etc.112 - *Community axis* — how other projects handle this113 - explorer (optional) — ground external findings in existing `.claude/` artifacts1141152. **Synthesize** → Actionable guidance. Persist as `.agents/research/research_[topic].md`1163. **Apply** → Update relevant artifacts117118## Refresh Targets119120| Artifact | What goes stale | Refresh trigger |121|----------|----------------|-----------------|122| `subsystem-*.md` rules | Types, paths, signatures, error variants | After refactors, new modules |123| `quality-rust.md` (+ other `quality-*.md`) | Language anti-patterns, async conventions, 2026 updates | After edition/release updates, new tooling |124| `arch-principles.md` | Design principles, ADR index, code style conventions | After new patterns, new modules |125| Persona skills | Implementation patterns, fixtures, commands | After new commands, workflows |126| `deps` | License allowlist, tool versions | After deny.toml changes |127| `AGENTS.md` | Build commands, env vars, layout | After new crates, env vars |128| `meta-ai-config.md` | Conventions, budget numbers, anti-patterns | After Claude Code releases |129| **This skill** | Modes, workflow, refresh targets | After Claude Code releases |130131## Maintenance Schedule132133| Frequency | Action |134|-----------|--------|135| Every feature branch | `audit` before merging AI config changes |136| Monthly | `refresh` to detect drift |137| On Claude Code update | `research "Claude Code new features"` then self-update |138| On new tool integration | `create` for tool's skill/rule, then `audit` |139| When something feels off | `review` recent changes |140141## Constraints142143- ALWAYS research online before creating AI artifacts144- ALWAYS run at least one research pass for domain knowledge145- ALWAYS check context budget impact (adding always-loaded context?)146- NEVER remove artifacts without checking cross-references first147- NEVER edit `settings.json` hooks without testing hook script148- Prefer hooks over rules for enforcement (deterministic + zero context cost)149- Commits use `chore:` prefix (per project convention)