agentleFS
SyladSylad/claude-code-codex/.claude/skills/update-rtk-stats/SKILL.md

update-rtk-stats

Skill0 starsChanged 12 days agoMITView on GitHub

Use when the user wants to refresh the RTK savings stats displayed on the claude-code-codex Case studies page (`/case-studies`). Triggers on "/update-rtk-stats", "refresh rtk stats", "maj stats rtk", or after a long session where rtk usage might have meaningfully changed the numbers. Reads `rtk gain --format json`, writes to frontend/src/data/rtk-stats.json, and proposes a commit.

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    If rtk isn't found, stop and tell the user how to install it (https://github.com/rtk-ai/rtk).

    line 33
  2. Distinctive:

    Do NOT auto-push without confirmation — RTK stats refresh is a routine but visible commit on a public repo.

    line 102

≈ “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

Update RTK Stats

Refreshes the live RTK savings counters shown on the claude-code-codex Case studies page (/case-studies). Single-purpose skill : read fresh stats from the local rtk binary, persist them in the repo, and propose a commit.

When to use

  • ✅ User says "/update-rtk-stats", "refresh rtk", "maj rtk stats"
  • ✅ Periodic refresh (e.g. monthly cadence), especially after a long pair-programming session
  • ✅ Right after changing how RTK is configured (new filters, scope changes)

When not to use

  • ❌ The rtk binary isn't installed or in PATH (the skill will fail — RTK is required, not optional)
  • ❌ The user wants to display stats elsewhere (this skill only writes to the canonical JSON, the display is in RtkStats.astro)
  • ❌ The user wants per-command breakdown (this skill only stores the summary — extend the JSON shape if needed)

Procedure

Step 1 — Verify rtk + repo path

which rtk
rtk --version

If rtk isn't found, stop and tell the user how to install it (https://github.com/rtk-ai/rtk).

The target file is frontend/src/data/rtk-stats.json inside the claude-code-codex repo. Confirm we're in or under that repo with git rev-parse --show-toplevel and that package.json mentions claude-code-codex somewhere. If not, ask the user to cd there first.

Step 2 — Capture stats

rtk gain --format json

Sample shape (keep this stable — RtkStats.astro reads these exact keys) :

{
  "summary": {
    "total_commands": 1546,
    "total_input": 1889477,
    "total_output": 1459761,
    "total_saved": 433733,
    "avg_savings_pct": 22.955,
    "total_time_ms": 616294,
    "avg_time_ms": 398
  }
}

Step 3 — Write the JSON with timestamp

Pipe through node (or jq if available) to add a lastUpdated ISO timestamp. Don't use jq blindly — the user's machine may not have it (verified case 2026-05-08).

Safe one-liner :

rtk gain --format json | node -e '
const fs = require("fs");
let data = "";
process.stdin.on("data", c => data += c);
process.stdin.on("end", () => {
  const j = JSON.parse(data);
  j.lastUpdated = new Date().toISOString();
  fs.writeFileSync(process.argv[1], JSON.stringify(j, null, 2) + "\n");
  console.log("wrote", process.argv[1]);
});
' frontend/src/data/rtk-stats.json

Step 4 — Verify the build still passes

export PATH="$HOME/.nvm/versions/node/v22.22.2/bin:$PATH"
cd frontend && npm run build 2>&1 | tail -5

The RtkStats.astro component is server-rendered and reads the JSON at build time. If the JSON shape drifted, the build will fail clearly.

Step 5 — Show the diff and propose a commit

git diff frontend/src/data/rtk-stats.json

Then propose to the user :

git add frontend/src/data/rtk-stats.json
git commit -m "chore: refresh RTK stats (<short summary like 'now 1.5M saved'>)"
git push

Do NOT auto-push without confirmation — RTK stats refresh is a routine but visible commit on a public repo. Wait for the user's "go" before pushing.

Anti-patterns

  • ❌ Hard-coding stats in the SKILL.md or another file. The single source of truth is frontend/src/data/rtk-stats.json.
  • ❌ Using jq blindly — verified that Sylvain's machine doesn't have it. Always have a node-based fallback ready.
  • ❌ Modifying the JSON shape without updating RtkStats.astro. They're coupled — change both.
  • ❌ Running this skill when rtk itself is broken. Sanity check first.

Companion

  • /save — captures meta learnings; /update-rtk-stats captures the quantitative trace of the collab.
  • /skillify — was used to extract concepts from Ruflo; this skill captures concepts from Sylvain's own daily-driver tooling.

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.