Repository navigation
chore(skills): add reference TOC sync script, pre-commit hook, and CI check - #45
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a pre-commit hook and a Python script (sync_tocs.py) with accompanying unit tests to deterministically generate Table of Contents (TOC) and validate markdown hygiene for skills. The reviewer feedback highlights several key areas for improvement, including fixing a YAML parsing bug with empty lines in block scalars, preventing false positives in the Caution: keyword check by ignoring fenced code blocks, handling OSError when executing git commands, ensuring cross-platform path consistency on Windows using .as_posix(), and removing a non-hermetic unit test that checks the active workspace.
ssbushi
force-pushed
the
sb/toc-sync-tooling
branch
from
November 6, 2026 16:20
b3a849d to
f89564b
Compare
pavelgj
approved these changes
Nov 6, 2026
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.
Follow-up to #44.
Adds zero-dependency Python 3 stdlib tooling to keep reference Tables of Contents and skill markdown files in sync before downstream import:
scripts/sync_tocs.py: regenerates- [Title](#anchor): Lines start-endentries onskills/*/references/*.mdfiles over 100 lines (and removes them when files shrink to 100 lines or fewer), skips CommonMark fenced code blocks, and checks fence balance,Caution:LeakR keywords, andSKILL.mdfrontmatter (name,description<= 1024 UTF-8 bytes)..githooks/pre-commit: runspython3 scripts/sync_tocs.py --stagedto update and restage drifted reference TOCs on commit (enable locally withgit config core.hooksPath .githooks)..github/workflows/validate-skills.ymlandscripts/test_sync_tocs.py: runs hermeticunittestcoverage andpython3 scripts/sync_tocs.py --checkon pushes and pull requests tomain.