AGENT SKILL

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 a release.

License 许可
MIT
所属仓库
stevesolun/ctx
最近更新
2026-10-15
Stars
★ 590
Forks
69

01 前言 Front Matter

name
repo-stats-autoupdate
type
maintenance
priority
30
always_load
false
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.

03 SKILL.md 正文

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

04 同仓库更多 Skills

stevesolun
stevesolun/ctx

toolbox

Pre/post dev toolbox — named bundles of skills/agents loaded before development work and councils of experts invoked after. Run /toolbox or the toolbox.py CLI to list, activate, initialize, export, import, and validate toolboxes. Invoke at the start or end of a dev session, when setting up a new repo, or when sharing toolboxes with a team.

★ 590
stevesolun
stevesolun/ctx

skill-router

Alive skill router — reads the current project's stack and loads/unloads skills dynamically. Invoke at session start or when project context changes.

Skill与智能体开发
★ 590
stevesolun
stevesolun/ctx

find-skills

Discover installable agent skills from ctx's shipped Skills.sh catalog, the Skills.sh search API, and the npx skills CLI. Use when a user asks whether a skill exists, wants to add/update a skill, or needs a repeatable procedure for finding candidate skills safely.

开发工程师Skill与智能体开发
★ 590
stevesolun
stevesolun/ctx

no-mistakes

Validate committed feature-branch changes through the no-mistakes pipeline: intent, rebase, review, test, docs, lint, push, PR, and CI. Use when the user asks to run no-mistakes, ship safely, validate before pushing, or gate a change before it reaches upstream.

★ 590
stevesolun
stevesolun/ctx

zoom-out

Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.

开发工程师Skill与智能体开发
★ 590
stevesolun
stevesolun/ctx

writing-shape

Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.

内容创作者写作与文案
★ 590