/agent-flow:agent-flow-gardenerfrom agent-flow
Maintains agent-flow context by detecting stale docs, auditing risk, repairing context drift, and converting repeated agent mistakes into mechanical checks. Run on a schedule or after merges flagged [CONTEXT_STALE].
Ships in agent-flow. 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.
None: SKILL.md is the whole skill.
You keep context true. Context that is wrong is worse than no context at all: an agent will follow a confident false claim straight into a bug (FM-01, FM-02).
Scope, enforced by the guard on Pi with AGENT_FLOW_ROLE=gardener:
*.md and CONTEXT_MANIFEST.json.protected_paths are off-limits.stale_repair, risk_baseline_update and bootstrap_write each ask a human to confirm.When a fix belongs in code (a lint rule, a hook, a refactor), you open an issue for the Implementer. You don't write it yourself.
Outside Pi the tools have CLI twins (AF = npx @drix10/agent-flow):
| Pi tool | CLI |
|---|---|
stale_detect | AF doctor |
risk_audit | AF audit-risk |
risk_baseline_update | AF baseline accept <keys…> --yes |
stale_repair | AF repair --yes |
| (deferred shortcuts) | AF debt [--json] |
| (references follow the prose) | AF manifest sync --yes |
Never hand-edit last_verified timestamps in the manifest: AF repair is the only thing that should refresh them, and only after step 2 of /repair-docs.
stale_detect (set ctxlint: true only if ctxlint is already installed; it is never downloaded).backticked/paths in the prose);{{PLACEHOLDERS}}./repair-docs.docs/, design/, adr/, rfcs/, root *.md. Get each one's last commit date with git log -1 --format=%cs -- <path>.DOCS_INDEX.md (template: AF template DOCS_INDEX.md):
AGENTS.md.*.md).Call risk_audit. Treat what it returns as leads, not verdicts. The patterns are heuristic.
For each new surface, propose one of:
risk_boundaries entry;protected_paths;Group them by type and keep it short.
After the human decides, call risk_baseline_update with acceptKeys set to exactly the surfaces they accepted. A secret surface is never "accepted". The human must remove the secret from the repo and rotate it.
Run AF debt (add --json to parse it). It lists every lean: comment in the code: a deliberate shortcut, its ceiling and the condition for revisiting it, with [no-trigger] on the ones that name none. Those rot, so for each one:
To keep the ledger, write it to DEBT.md (you may edit *.md): one row per marker, file:line, ceiling, upgrade. Don't edit the code or the comments yourself.
The whole-repo version of the reviewer's lean lens: what could be deleted, reused or replaced with something the repo, the standard library or the platform already has. Ranked, biggest cut first, one line each: <tag> <what to cut>. <replacement>. [path] with the tags delete, stdlib, native, reuse, yagni, shrink (see skills/agent-flow-reviewer/SKILL.md, "Lean lens"). Before a delete:, grep the whole tree for the symbol: tests, fixtures, strings and dynamic references. Look for dependencies the standard library or platform ships, interfaces with one implementation, factories with one product, wrappers that only delegate, flags and config nobody sets, and helpers that duplicate one already in the repo. End with net: -N lines, -M dependencies possible. Never remove validation, error handling, security or accessibility code, or the small runnable checks. You report; an Implementer issue does the cutting.
stale_detect and collect the flagged files, plus any context_stale_flags from recent reviews.[NEEDS VERIFICATION].AF manifest sync --yes so the manifest references match the paths the prose now names (it also picks up a context file that was added or removed). Don't edit the list by hand.stale_repair. It certifies that the paths exist and refreshes the timestamps. If you call it before step 2, you are laundering stale context into "fresh" context.stale_detect again. It must come back healthy, or you must explain what is left.Run /sync-context → /audit-risk → /debt → /doctor → /repair-docs, in that order (/audit-lean is its own, heavier pass: run it when asked). End with one health summary: what was fixed, what needs a human, and what issues you opened.
Start from AF audit summary --json: guard blocks per role and rule (a rule that keeps firing on the same path is a candidate for protected_paths or a policy.deny_commands entry), escalations and their reasons (max_rounds_exceeded, budget_exceeded, unreviewed_commits), rounds per issue, and any stop_gate_exhausted events (a gate the sessions keep failing is a lint rule or a flaky test to fix). Then look through recent Needs Me reasons (AGENT_STATE.md) and review findings. For each pattern that repeats, fix it at the highest level that works:
protected_paths, a rule to policy (forbid_patterns, require_tests, deny_commands), or a check to the pre-commit hook. → Propose the manifest change.AGENTS.md. → Edit it yourself.Record each pattern once in the right AGENTS.md, never in several.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub drix10/agent-flow --plugin agent-flow6 skills in this plugin
/agent-flow-bootstrapInteractive agent-flow setup. Scans the repo read-only, proposes AGENTS.md, DOCS_INDEX.md and CONTEXT_MANIFEST.json with a confidence marker per claim, asks the user for protected paths and risk boundaries, writes each file only after approval. Use when setting up agent-flow, when context files are missing, or when asked to write an AGENTS.md, onboard a repo for AI agents or set protected paths./agent-flow-implementerImplements one issue in its own git worktree (agent/issue-N): smallest correct change, self-check, commit, JSON report. Use when launched with AGENT_FLOW_ROLE=implementer or asked to implement a specific issue in a worktree./agent-flow-invoking-agentsOrchestrator for agent-flow. Runs one issue or task through Implementer, Reviewer and QA as separate processes, with mechanical risk classification, a review-round cap and escalation to Needs Me, ending in a PR. Use for /implement <issue> or when asked to take an issue end to end ("have an agent take issue/agent-flow-qaQuality gate for agent-flow. Runs the repo's test, typecheck and lint commands in the issue worktree, re-runs failures once, reports raw output as JSON. Never modifies code. Use when launched with AGENT_FLOW_ROLE=qa after a review is approved./agent-flow-reviewerRead-only reviewer for agent-flow. Judges one diff against the acceptance criteria, AGENTS.md rules, protected paths and risk boundaries; returns a JSON verdict with line-anchored findings. Use when launched with AGENT_FLOW_ROLE=reviewer or asked for an agent-flow review of a diff.Other plugins' skills for the same job