feat: directory-shaped skills with support files (COD-417) - #51
Merged
Conversation
A skill entry may now point at a directory containing SKILL.md. The full support tree (references/, templates/, scripts/, assets/) is read through the contained, symlink-rejecting walk and emitted under <skill-dir>/<name>/, byte for byte. - domain: Skill.Files support-file map, IsDirectory() - localfs: readSkillDirectory walk (SKILL.md + regular files only, symlinks/non-regular rejected, lone-SKILL.md dirs rejected) - sync: renderSkillDirOutput emits full skill trees deterministically; generation-time frontmatter contract enforcement via skillmeta - validate: directory entries accepted, SKILL.md frontmatter validated (name match + description), skills_have_no_output warning kills the silent skills-only+agents no-op - skillmeta: shared frontmatter parse/validate package - scaffold skill now models the frontmatter contract - README documents directory skills and the validation contract
… on creed's own skills - validate now applies the same frontmatter contract to flat skill files as to directory skills (name match + description when frontmatter present, warning when absent) - creed's own two skills carry the frontmatter contract; regenerated claude/cursor outputs - new flat-skill frontmatter diagnostic table test
Contributor
Author
Auto-Merge Gate — approvedConfidence: 0.86 Rationale: The implementation directly satisfies COD-417: directory entries read Checks observed: GitHub CI
Scope limits: This approval covers COD-417 only. No unresolved review comments, manual-review markers, secrets/auth/deployment/billing/destructive scope, or merge conflicts were found. |
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.
feat: directory-shaped skills with support files (COD-417)
Closes COD-417.
Problem
Creed's skill model was one flat
.mdper skill. Real Hermes-style skills are directories —<name>/SKILL.mdplusreferences/,templates/,scripts/,assets/— and 174 of 307 real skills in the hermes-skills tree are directory-shaped. Declaring a directory skill emitted exactly one file and silently dropped every support file, exit 0, "0 failed". Separately, a skills-only source with only theagentstarget (context-only) was a silent no-op.What changed
domain.SkillgainsFiles map[string][]byte+IsDirectory(). Flat skills (nilFiles) behave byte-identically to before.localfs.readSkillDirectory— a skill entry path that is a directory is walked withfilepath.WalkDir:SKILL.mdbecomes the skill content; every other regular file becomes a support file keyed by slash-relative path. Symlinks and non-regular files are rejected (same containment discipline as single-file reads, viareadContainedFile); a directory containing onlySKILL.mdis rejected with guidance to declare the file path directly.gitremote/layereddelegate to localfs, so they inherit this.renderSkillDirOutputemits directory skills under<skilldir>/<name>/SKILL.mdplus support files in sorted (deterministic) order. Flat skills still emit<name>.md.internal/skillmeta— shared frontmatter parse/validate: when a skill carries YAML frontmatter,namemust match the manifest entry anddescriptionmust be present. Missing frontmatter is a warning, not an error.validatereports the same diagnostics for both directory and flat skills, with the file path and problem in each message.skills_have_no_outputwarning in validate when declared skills have no enabled target with a skill-dir output — kills the silent skills-only +agentsno-op.Verification
All run locally on this branch:
go build ./...— passgo test -race -count=1 ./...— 11 packages okgo vet ./...,gofmt -l .— cleanscripts/check-generated.sh— "generated code is current"validatepasses (incl. frontmatter contract on own skills),syncidempotent (second run 0 written, all skipped)Notes
delegate_task) failed with runtime spawn timeouts (3×420s) this run; a detailed self-review found no blocking issues, and the deviation is logged in RUNNER.md. The Auto-Merge Gate evaluates this PR independently before any merge.go generateproduced zero drift.