feat: skill engineering pipeline — auto-split, size enforcement, skeleton generator#300
Open
fraser-svg wants to merge 5 commits intogarrytan:mainfrom
Open
feat: skill engineering pipeline — auto-split, size enforcement, skeleton generator#300fraser-svg wants to merge 5 commits intogarrytan:mainfrom
fraser-svg wants to merge 5 commits intogarrytan:mainfrom
Conversation
Add .claude/rules/skill-engineering.md with comprehensive skill-building guidelines derived from three Anthropic sources: - "The Complete Guide to Building Skills for Claude" (official PDF) - Claude Code documentation (code.claude.com/docs/en/skills) - Anthropic's skill-creator reference implementation Rules are path-scoped to **/*.tmpl, **/SKILL.md, **/skills/** so they load automatically when editing skill files but consume zero tokens during other gstack work. Covers: three-level progressive disclosure, 500-line SKILL.md limit, frontmatter requirements, directory structure, writing patterns, anti-patterns, and the gen-skill-docs template marker system.
…kill-docs Auto-split parses <!-- ref:filename.md --> markers in templates, extracts content to references/ files, and replaces with markdown links. Size validation warns at 500+ lines and errors at 800+ (warning-only for now until Phase 4 refactors all oversized skills). Orphan detection flags reference files that no longer correspond to template markers. Exports autoSplit() and validateSize() for testing. Adds import.meta.main guard so the module can be imported without triggering the main loop.
Creates Anthropic-compliant skill directories with SKILL.md.tmpl, references/, and scripts/. Validates kebab-case names, prevents overwriting existing directories, uses printf for safe description handling.
22 tests covering: auto-split extraction (single, multiple, nested error, orphan error, code block ignoring), validateSize boundaries (ok/warn/error), skeleton generator (structure, kebab-case validation, duplicate rejection), and integration (dry-run line counts, stderr warnings).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
<!-- ref:filename.md -->markers in templates extract content toreferences/files, replacing with markdown links for progressive disclosurebin/gstack-init-skill <name>scaffolds Anthropic-compliant skill directories.claude/rules/skill-engineering.mdfor progressive disclosure, size limits, frontmatter, directory structurePre-Landing Review
2 informational issues found and auto-fixed:
Codex Review
bun run buildfor existing oversized skills → fixed (warning-only)Test Coverage
Tests: 104 → 126 (+22 new)
Test plan
bun run gen:skill-docs --dry-runreports all FRESH with line countsbun run gen:skill-docssucceeds (no exit-1 from size errors)🤖 Generated with Claude Code