agentleFS
anthony-chaudharyanthony-chaudhary/fak/.agents/skills/refresh-cachedoc-numbers/SKILL.md

refresh-cachedoc-numbers

Skill47 starsChanged 13 days agoApache-2.0View on GitHub

Refresh the recent-operational cachevalue numbers in a guarded doc (e.g. docs/integrations/fable5-more-usage-for-free.md) when this-week's telemetry has moved on. Re-derives the frozen snapshots from live `fak cachevalue report`, reconciles the doc's rendered numbers + snapshot_date to the fresh capture, and re-runs the hermetic audit (fak cachedoc-numbers-audit, gated in `make cachedoc-numbers-lint`) until every rendered number binds to a committed snapshot field and the doc's arithmetic invariants hold. Use when this named workflow matches the task.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run this from the repo root, where fak has its data context.

    line 40
  2. Very specific:

    Never edit a rendered number without also moving its snapshot + expected.

    line 72
  3. Very specific:

    Don't invent precision. Match the doc's existing rounding (a ≈ value gets 3% slack.

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/refresh-cachedoc-numbers — re-capture a cachevalue doc's live numbers, honestly

A doc under this gate (see tools/docnumbers/README.md) quotes recent operational telemetry — this week's fleet fak cachevalue report, the last few days of dev sessions. Those windows advance, so the numbers go stale. This skill re-captures them from live fak, reconciles the doc to the fresh capture, and proves the result with the hermetic audit — instead of hand-editing prose and hoping the arithmetic still closes.

The distrust that matters: the new numbers come from a fresh --json capture, and every one of them must land back in a committed snapshot the audit checks. You are not "updating the text" — you are re-deriving the evidence and making the text match it.

Steps

  1. See what's guarded and whether it's stale.
    fak cachedoc-numbers-audit
    A WARN [staleness] line, or a FAIL, tells you which manifest needs a refresh. Read that manifest (tools/docnumbers/<stem>.json) and its doc.
  2. Re-derive the frozen snapshots from live fak.
    fak cachedoc-numbers-audit --refresh   # add --manifest <stem>.json to scope it
    Run this from the repo root, where fak has its data context. It rewrites the snapshots under snapshot_dir for every source that has a cmd, and prints how many fields each got. Sources with cmd: null are machine-specific per-session captures — recapture those by hand with fak cachevalue status --session <id> --json if the doc still cites them.
  3. Read the fresh snapshots and reconcile the doc. For each changed field, Edit the doc's rendered number to the correctly-rounded fresh value, and Edit the manifest's matching expected (and any appears_as string that embeds the number). Re-derive any invariant expect/parts and the snapshot_date. Keep the provenance labels (WITNESSED/OBSERVED/ ESTIMATED) truthful — a value's provenance does not change just because it moved.

    The audit will reject a doc number that is not a correct rounding of its snapshot field, an expected that disagrees with the snapshot, or a decomposition that no longer sums. Let it drive you: fix what it names.

  4. Prove it.
    go test -v ./internal/cachedocaudit/...    # contract still holds
    fak cachedoc-numbers-audit                 # the corpus is clean
    Optionally --live to confirm the cited fields still exist in fresh output. Both must exit 0 with no FAIL before you commit.
  5. Commit the doc, manifest, and snapshots together — they are one artifact. Stamp the commit with the doc's lane (fak <leaf>; use mcp__fak__fak_index_lane if unsure).

Guardrails

  • Never edit a rendered number without also moving its snapshot + expected; a number the audit can't trace to a committed field is exactly what this gate exists to stop.
  • Don't invent precision. Match the doc's existing rounding (a ≈ value gets 3% slack; a plain value must round correctly). If a field is now zero or missing after --refresh, you likely ran it outside the repo's fak data context — re-run from the repo root before trusting it.
  • This skill only touches guarded docs. Committed benchmark claims belong to docs/benchmarks/BENCHMARK-AUTHORITY.md; the README's numbers to tools/readme_freshness_audit.py. Don't cross those streams.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.