Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Audit `.flow/memory/` entries against the current codebase and decide Keep / Update / Consolidate / Replace / Delete per entry. Triggers on /flow-next:audit, "audit memory", "review memory", "refresh learnings", "sweep stale memory", "consolidate overlapping memory entries". Optional `mode:autofix` token in arguments runs without questions and marks ambiguous as stale. Optional scope hint after the mode token (concept, category, module, or path) narrows what gets audited.
.claude/skills/gmickel-flow-next-audit/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-19 | ✗→✓ | ▲ Improved | 230% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 157% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 174% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 190% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 156% | 0% |
Memory entries decay. A .flow/memory/bug/runtime-errors/ entry logged six months ago might reference a renamed file, a deleted function, or a codepath that no longer exists. Without periodic review, the store accumulates zombie entries and memory-scout surfaces outdated advice.
This skill IS the audit. The host agent (Claude Code / Codex / Droid) walks .flow/memory/, reads each entry, uses Read/Grep/Glob/git to verify references against the current codebase, applies engineering judgment, and decides per entry whether to Keep / Update / Consolidate / Replace / Delete / Harden. Optional autofix mode applies unambiguous actions and marks ambiguous as stale.
Harden is the graduation path: a lesson that keeps getting re-learned and states a mechanically checkable rule should stop riding the context window and become a gate. The audit proposes an artifact in a surface the repo already has — a lint rule, a CI step, or a rule in the substantive CLAUDE.md / AGENTS.md — verifies the gate actually fires, and only then demotes the entry to a pointer at it (file stays on disk, provenance intact). Propose-and-confirm by design: gate surfaces are shared repo infrastructure, so Harden never applies unattended.
Decision entries (.flow/memory/knowledge/decisions/) and glossary terms (GLOSSARY.md files at the repo root and on the ancestor chain) are walked alongside the rest of memory. Decisions get a calibrated judging question — "does the constraint that motivated this choice still hold?" — and Replace becomes a two-step supersession (write successor, mark old decision_status: superseded, never git rm). Glossary terms are scanned for code usage; zero-hit terms get a <!-- stale: ... --> HTML comment via Edit tool (no flowctl glossary mark-stale exists), _Avoid_ aliases appearing in code surface as alias-creep findings.
There is no Python audit-engine, no codex/copilot subprocess dispatch, no deterministic scorer. The host agent is already an LLM and does the work directly. flowctl provides only thin persistence plumbing (memory mark-stale, memory mark-fresh, memory mark-hardened, memory search --status). All judgment — is this recurring, is it mechanizable, which gate surface, what should the rule say — stays in this skill; there is no flowctl gate subcommand and never will be.
Read workflow.md for the full phase-by-phase execution. Read phases.md for the 6-outcomes lookup with memory-schema-specific calibration.
CRITICAL: flowctl is BUNDLED — NOT installed globally. which flowctl will fail (expected). Define once; subsequent blocks (here and in workflow.md) use $FLOWCTL:
bashFLOWCTL="${CODEX_HOME:-$HOME/.codex}/scripts/flowctl" [ -x "$FLOWCTL" ] || FLOWCTL="<plugin-root>/scripts/flowctl" # <plugin-root> = the directory two levels above this skill's SKILL.md file (the harness gave you that file's absolute path when the skill loaded); substitute it literally [ -x "$FLOWCTL" ] || FLOWCTL=".flow/bin/flowctl"
Inline skill (no context: fork) — plain-text numbered prompt must stay reachable across phases. Subagents can't call plain-text numbered prompts (Claude Code issues #12890, #34592). Phase 3 (Ask) and Phase 6 (Discoverability check) both require user choice in interactive mode.
Parse $ARGUMENTS for the literal token mode:autofix. If present, strip it from the arguments — the remainder is the scope hint.
bashRAW_ARGS="$ARGUMENTS" MODE="interactive" if [[ "$RAW_ARGS" == *"mode:autofix"* ]]; then MODE="autofix" # Strip token, collapse whitespace, trim. SCOPE_HINT=$(printf "%s" "$RAW_ARGS" | sed 's/mode:autofix//' | tr -s ' ' | sed 's/^ //;s/ $//') else SCOPE_HINT="$RAW_ARGS" fi
| Mode | When | Behavior | |------|------|----------| | Interactive (default) | User is at the terminal | Ask decisions on ambiguous cases via plain-text numbered prompt; confirm batched actions; run discoverability check with consent | | Autofix (mode:autofix in arguments) | Ralph or batch usage | No user questions. Apply Keep/Update/Consolidate/auto-Delete/Replace-with-sufficient-evidence directly. Mark ambiguous as stale. Print the full report. Discoverability surfaces as a recommendation, not an edit |
git rm subsumed), auto-Delete (only when code AND problem domain both gone), Replace (only with sufficient evidence to write a trustworthy successor).--gate-ref that would be recorded — but write no artifact and demote no entry.flowctl memory mark-stale <id> --reason "..." instead of guessing. Stale-marking writes are atomic and round-trip safe.In autofix mode, skip user questions entirely and apply the rules above.
In interactive mode, follow these principles:
Ask the user via plain text. Render the options below as a numbered list 1. … N., followed by a final option N+1. Other — type your own answer. Print the question, then the numbered list, then stop and wait for the user's next message before continuing. Parse the reply as: a bare number 1–N+1 → that option; the literal text of an option label → that option; free text after Other → custom answer.
plain-text numbered prompt. Never silently skip the question.The goal is automated maintenance with human oversight on judgment calls — not a question for every finding.
.flow/memory/pitfalls.md, conventions.md, decisions.md at the memory root). Skip with a warning that recommends /flow-next:memory-migrate first. Report includes the skipped count._audit/, _review/, or any other _* directory under .flow/memory/.git rm on superseded decision entries. Decision history stays on disk. Replace for knowledge/decisions/ entries means write a new entry and mark the old decision_status: superseded with superseded_by: <new-id> — never delete the old file.mode:autofix (and therefore any pilot / Ralph invocation) Harden never applies: no gate artifact is written, no entry is demoted, no un-graduation is executed. Candidates surface under Recommended only. Graduation edits files outside .flow/memory/ — lint config, CI, CLAUDE.md — and silent edits to shared repo infrastructure from an autonomous sweep are unacceptable. Audit proposes; a human accepts.memory mark-hardened runs only after the gate is confirmed live (resolved lint config / a job that actually runs / the substantive instruction file). Verification failure leaves the entry active and reports a failed graduation. A gate that does not fire is worse than no gate.git rm on Harden. Ever, on any track. The entry file stays on disk as a pointer at the gate — that is what keeps "why does this rule exist?" answerable.memory mark-stale, memory mark-fresh, memory mark-hardened, memory search --status). There is no flowctl gate subcommand — the gate artifact is skill-authored prose/config written via Edit/Write. fn-38 task 2 ships only glossary {add,list,read,remove} — there is no flowctl glossary mark-stale; use Edit tool. Use Write tool + git for moves and deletes.context: fork — plain-text numbered prompt must stay reachable.Execute the phases in workflow.md in order:
.flow/memory/{bug,knowledge}/<category>/, group by module / category, count, choose interaction path (focused / batch / broad), skip legacy + _* directories with a counted warning. knowledge/decisions/ entries are picked up automatically by the same glob.0.5 Glossary scan — enumerate GLOSSARY.md files via flowctl glossary list --json; per term, grep tracked code for the term and each _Avoid_ alias (case-insensitive whole-word, normalized whitespace); zero hits + zero alias hits → mark stale via Edit tool (HTML comment after the term heading); alias hits → surface as alias-creep finding for Phase 3 (interactive) or report (autofix); skip husk files (count: 0) with a single advisory. 0.75 Change-detection pre-filter — pre-scan recurrence artifacts (## Update heading count, entry-file commit count, related_to size) BEFORE the auto-Keep decision, so a recurrence-qualified entry reaches Phase 1 even when its module is unchanged; hardened entries get a cheap gate-liveness check instead of re-investigation.
1.75 Cross-doc analysis — compare entries sharing module / category for overlap (problem, solution, root cause, files), supersession (newer canonical entry covers older narrower precursor), contradictions.
decision_status: superseded, superseded_by: <new-id>; never git rm the old). Harden requires a recurrence signal AND mechanizability, and passes the duplication guard first.git rm subsumed. Replace: write new entry, git rm old (decisions: write new + edit old's frontmatter to mark superseded, never git rm). Delete: git rm (only when code AND problem domain both gone). Harden: write the artifact, verify the gate fires, then flowctl memory mark-hardened <id> --gate-ref "<path>#<rule-id> -- <note>" — never git rm; verification failure leaves the entry active. Glossary stale: Edit comment after term heading. Ambiguous in autofix: flowctl memory mark-stale.@-including the other) mentions .flow/memory/ with schema basics (track / category / module / tags / status) and when to consult. Add a minimal line if missing — interactive asks consent, autofix surfaces as recommendation.The full report is the deliverable — print it as markdown to stdout. Do not summarize internally and emit a one-liner.
Report structure (see workflow.md §5 for full schema):
textMemory Audit Summary ==================== Scanned: N entries Skipped legacy: M (run `/flow-next:memory-migrate` first to make these auditable) Kept: X Updated: Y Consolidated: C Replaced: Z Deleted: W Hardened: H (failed graduations: HF; un-graduated: HU) Marked stale: S Glossary -------- Files scanned: F (H husks) Terms scanned: T Kept: K_g Marked stale: S_g Alias-creep flagged: A_g
Then per-entry detail (id, classification, evidence, action taken). For Consolidate: which entry was canonical, what unique content was merged, what was deleted. For Replace: what the old entry recommended vs what current code does, path to successor (decision Replace also notes the old entry now carries decision_status: superseded). For Marked stale: why ambiguous. For Harden: gate type, artifact path, --gate-ref, and how the gate was verified live (a failed graduation names the reason and states the entry was left active). For glossary terms: only stale + alias-creep cases get per-term lines (Keep is silent); husks get a one-line advisory each.
Autofix mode splits actions into Applied (writes succeeded) and Recommended (writes failed — e.g. permission denied — plus every Harden candidate, which autofix never attempts). The structure is the same; only the bucket differs.
Other measured skills in the registry, with their headline benchmark lift.