repo-stats-autoupdate
Skill588 starsChanged 4 months agoMITView on GitHub
Keeps README badge + inline counts in sync with the real number of skills, agents, graph nodes/edges, communities, converted pipelines, and test inventory. Runs automatically on every commit via a git pre-commit hook. Use when the README drifts from reality or before publishing a release.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ask-mattSkill
- codebase-designSkill
- code-reviewSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- improve-codebase-architectureSkill
- prototypeSkill
- researchSkill
- resolving-merge-conflictsSkill
- setup-matt-pocock-skillsSkill
- tddSkill
- teachSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wayfinderSkill
- writing-great-skillsSkill
- ctx-dispatchSkill
- ctx-verifySkill
- skill-routerSkill
- find-skillsSkill
- skill-routerSkill
- toolboxSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
After that, every git commit runs .githooks/pre-commit which calls the updater and re-stages README.md if any number drifted.
- Distinctive: line 45
When you've deliberately phrased a number descriptively (e.g.
- Distinctive: line 46
When the wiki isn't deployed locally.
- Very specific: line 51
Does not verify graph integrity: If graphify-out/graph.json is corrupt, you'll get junk numbers.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.
Files
repo-stats-autoupdate
What this skill does
Reads the authoritative sources for the ctx repo's key numbers and patches README.md in place so badges and inline counts never drift:
| Number | Source of truth |
| Skills | ~/.claude/skill-wiki/graphify-out/graph.json — count nodes where type == "skill" |
| Agents | same file — count nodes where type == "agent" |
| Graph nodes | len(graph["nodes"]) |
| Graph edges | len(graph["edges"]), formatted as 642K / 1.2M |
| Communities | graph/communities.json → total_communities |
| Converted pipelines | ~/.claude/skill-wiki/converted/ subdir count |
| Tests | checked-in README/docs inventory by default; set CTX_UPDATE_REPO_STATS_LIVE_TESTS=1 to refresh from pytest --collect-only -q |
Fields that can't be resolved (e.g. wiki not deployed) are left untouched — the updater never blocks a commit.
How to use it
One-time install (per clone):
git config core.hooksPath .githooksAfter that, every git commit runs .githooks/pre-commit which calls the updater and re-stages README.md if any number drifted.
Manual run:
python src/update_repo_stats.py # patch README
python src/update_repo_stats.py --check # exit 1 if stale (for CI)
CTX_UPDATE_REPO_STATS_LIVE_TESTS=1 python src/update_repo_stats.py # refresh test inventoryWhen NOT to use it
- When you've deliberately phrased a number descriptively (e.g. "over 1,700 skills") — the regex patterns only match exact digits, so prose phrasings are safe, but double-check after big imports.
- When the wiki isn't deployed locally. The updater degrades gracefully: it prints a warning and skips fields it can't resolve. It does not invent numbers.
Known gaps (intentionally out of scope)
- Does not rebuild the graph or wiki. Rebuilding
graph/wiki-graph.tar.gztakes minutes and churns a large artifact — too heavy for per-commit. Runctx-wiki-graphify, thenpython src/validate_graph_artifacts.py --deep, and repack the tarball manually when the skill catalog changes materially. - Does not verify graph integrity. If
graphify-out/graph.jsonis corrupt, you'll get junk numbers. Run the wiki health check (python src/wiki_orchestrator.py --check) separately.
Related files
- src/update_repo_stats.py — the worker
- .githooks/pre-commit — the per-commit trigger
README.md— the target being kept in sync
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
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.

