Closed general

Home page Skills stat should count skills bundled inside apps

Colby Knox · 2mo ago ·closed by Colby Knox

The home page's Skills stat counts skill-type pages only. Apps routinely bundle many skills (the three-tier layout: root SKILL.md, skills/<name>/SKILL.md, plus dev-skills/ and publish-skills/), so the number understates what the registry actually hosts. The stat should count skills wherever they live.

What already exists, which makes this small

pages.skill_count already stores the number of SKILL.md files in each page repo, for every page type. It is recomputed inside indexRepo, which runs on every publish, commit, and delete, so the per-page number is already event-driven and needs no new hooks.

Plan

  1. Home stat becomes a sum. Skills = SUM(skill_count) across all accessible pages, with a floor of 1 for skill-type pages (a skill page is a skill even if an old index left its count at 0). Same accessiblePagesWhere scoping as the other numbers: anon sees public totals, logged-in users additionally see their private and org pages' skills.
  2. One-time correctness sweep. skill_count is NOT NULL DEFAULT 0, so pages last indexed before the column existed sit at 0 indistinguishably from genuinely having no skills. A deferred boot sweep (same pattern as the render-column backfill: yielding, unref'd, logged) recomputes the count for every page so the number is right immediately, not only after each page's next publish.
  3. Counting rule: every SKILL.md in the repo counts, including the dev and publish tiers, matching what the page's own Skills tab shows, so the two surfaces agree.

Decisions worth recording

  • Skills bundled in PRIVATE apps count only for viewers who can access those apps, exactly like the page counts today.
  • No new schema and no new write-path hooks: the publish/commit/delete freshness requirement is satisfied by indexRepo already owning the column.

1 Reply

Colby Knox · 2mo ago

Shipped and live. The home page Skills stat went from 68 to 459 with the deploy: 68 standalone skill pages, and roughly 390 more skills bundled inside apps that the old count ignored.

How it works, matching the plan above:

  • The stat is now SUM(skill_count) across accessible pages, floored at 1 for skill-type pages, under the same accessiblePagesWhere scoping as the other numbers. Anonymous visitors see public totals; logging in adds the skills bundled in your private and org apps.
  • Freshness comes free: indexRepo already recomputes skill_count on every publish, commit, and delete, so no new hooks were needed. The number moves the moment a publish lands.
  • A boot-deferred sweep (one ls-tree per page, yielding, writes only on change) recounts every page as a correctness backstop for rows last indexed before the column existed, and self-heals any future drift. On prod it turned out the columns were already fresh, which is why the jump was visible immediately at restart.
  • The stat's hover text on the landing page now says it includes skills bundled inside apps, so the number does not read as "skill pages" to anyone comparing it against /skills.

Counting rule, recorded for posterity: every SKILL.md in a repo counts, including the dev and publish tiers, matching what each page's own Skills tab shows.

Log in to reply.