/repo-stats-autoupdate
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
$ npx -y skills add stevesolun/ctx --skill repo-stats-autoupdate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/repo-stats-autoupdate
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
SKILL.md
repo-stats-autoupdate.SKILL.mdname: repo-stats-autoupdate
description: 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.
type: maintenance
priority: 30
always_load: false
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 .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
- [src/update_repo_stats.py](../../src/update_repo_stats.py) — the worker
- [.githooks/pre-commit](../../.githooks/pre-commit) — the per-commit trigger
- `README.md` — the target being kept in sync
Read more
name: repo-stats-autoupdate description: 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. type: maintenance priority: 30 always_load: false
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 .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
- [src/update_repo_stats.py](../../src/update_repo_stats.py) — the worker
- [.githooks/pre-commit](../../.githooks/pre-commit) — the per-commit trigger
- `README.md` — the target being kept in sync
ctx is a Python CLI and library that recommends a small, relevant set of skills, agents, and MCP servers for a repository or task. It can use your organization's local/private knowledge or the shipped graph.
Repo: stevesolun/ctx
Other skills on stevesolun-ctx.
- /ctx-dispatch
Coordinate nontrivial work in the ctx repository when a task has independent investigation, implementation, or test lanes; compute-heavy checks; or repetitive changes suited to scripts or codemods. Use for decomposition and concurrency decisions, not simple edits or questions.
Open skill - /ctx-verify
Select proportional validation for changes or reviews in the ctx repository. Use before handing off material code, workflow, migration, documentation, security, packaging, or release changes; before a PR; or when asked whether a change is adequately tested. Do not use for pure
Open skill - /agents-md-protocol
Create or review an AGENTS.md file so coding agents get stable repo-local instructions: environment setup, testing, style, security boundaries, PR policy, and handoff rules. Use when a repo lacks durable agent guidance or when a custom harness needs a predictable context file.
Open skill - /cavecrew
Decision guide for delegating to caveman-style subagents. Tells the main thread WHEN to spawn `cavecrew-investigator` (locate code), `cavecrew-builder` (1-2 file edit), or `cavecrew-reviewer` (diff review) instead of doing the work inline or using vanilla `Explore`. Subagent
Open skill - /caveman-commit
Ultra-compressed commit message generator. Cuts noise from commit messages while preserving intent and reasoning. Conventional Commits format. Subject ≤50 chars, body only when "why" isn't obvious. Use when user says "write a commit", "commit message", "generate commit",
Open skill - /caveman-compress
Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens. Preserves all technical substance, code, URLs, and structure. Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md.
Open skill

