repo-stats-autoupdate

SkillAI & models

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.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the repo-stats-autoupdate skill

What this skill tells your AI

The instructions your AI receives, as published by stevesolun/ctx in skills/repo-stats-autoupdate/SKILL.md and read by ahel’s review.

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:

NumberSource of truth
Skills~/.claude/skill-wiki/graphify-out/graph.json — count nodes where type == "skill"
Agentssame file — count nodes where type == "agent"
Graph nodeslen(graph["nodes"])
Graph edgeslen(graph["edges"]), formatted as 642K / 1.2M
Communitiesgraph/communities.jsontotal_communities
Converted pipelines~/.claude/skill-wiki/converted/ subdir count
Testschecked-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 .githooks

After 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 inventory

When 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.gz takes minutes and churns a large artifact — too heavy for per-commit. Run ctx-wiki-graphify, then python 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.json is corrupt, you'll get junk numbers. Run the wiki health check (python src/wiki_orchestrator.py --check) separately.

Related files

Signals

GitHub stars
585
Forks
71
Last commit
Aug 2026
Advanced
Catalog kind
skill
Gateway key
repo-stats-autoupdate
Source
github.com/stevesolun/ctx