recipe-agentfile-hygiene
Recipe: Agentfile Hygiene
Domain-invariant cognitive sweep recipe that audits every always-on agentfile in a project — every CLAUDE.md at any nesting level plus AGENTS.md — against the shared agentfile context-hygiene rubric, and emits one remediation deliverable per offending section into solution_outline.md for phase-5 to apply.
The capability splits along the same cognitive/deterministic seam recipe-security-audit uses: this recipe is the cognitive half — an LLM classification pass over each agentfile section — while the pm-plugin-development:plugin-doctor rules agentfile-line-count-over-budget and agentfile-directory-tree-present are the fast deterministic backstop. Both halves consume the single normative rubric in plan-marshall:ref-agentfile-hygiene, so they stay in sync by construction.
Unlike the audit-recipe family (recipe-code-review, recipe-security-audit), which emit findings into the triage pipeline, this is a plan-shape recipe: it emits remediation deliverables into the outline, following the emit-deliverables model proven by recipe-simplify-codebase. It is a sweep-all recipe — there is no scope × thoroughness gather; every discovered agentfile is classified in full.
Input
| Parameter | Type | Required | Description |
|---|---|---|---|
plan_id |
string | Yes | Plan identifier — from phase-3-outline |
There is no recipe_scope / recipe_thoroughness input and no recipe_package_source: the sweep is a fixed full pass over every agentfile, not a package iteration. The recipe is plan-bound. Its discovery metadata (key, default_change_type, scope) is returned by the plan-marshall-plugin extension's provides_recipes(), not declared here.
Enforcement
Execution mode: Deliverable-collection cognitive recipe — discover every agentfile, load the shared rubric, classify each section, emit one remediation deliverable per offending section, write the solution outline. Loaded by phase-3-outline's recipe path; not user-invocable.