Repository navigation
feat(docs-sync): render the skill token table from measured_tokens stamps - #203
Merged
Merged
Conversation
…amps apache/magpie#1394 moved each skill's token count into its own measured_tokens frontmatter stamp and replaced the committed table in docs/mode-economics.md with a marker. Render the table from the stamps during sync-docs, before the link rewrite, so the page keeps its table and the rows link to GitHub as before. Generated-by: Claude Opus 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apache/magpie#1394 stopped committing the per-skill token table in
docs/mode-economics.md. That table's shared header lines changed on every regeneration, so any two skill PRs conflicted. Each skill now carries its own count as a generatedmeasured_tokens:frontmatter line, and the page carries a marker instead of the table. Without this PR the website's mode-economics page shows no table at all.scripts/gen-skill-tokens.mjsreads each skill'smeasured_tokens:stamp and replaces the<!-- SKILL TOKEN TABLE … -->marker with the rendered table. No tokenizer runs on the site: the numbers are the stamps apache/magpie'sskill-token-count --checkalready verified in CI.sync-docs.shruns it after the docs are copied and before the link rewrite, so the table's../skills/<name>/SKILL.mdlinks are rewritten to GitHub exactly like the old committed table's were.Test plan
node --test scripts/gen-skill-tokens.test.mjs— 9 tests:$-patterns literallybash scripts/sync-docs.shagainst apache/magpiemain(with #1394) rendered all 75 counts intosrc/content/docs/mode-economics.md, the marker is gone, and rows link tohttps://github.com/apache/magpie/blob/main/skills/<name>/SKILL.md.prekpasses on the changed files.🤖 Generated with Claude Code