Skip to content

feat: directory-shaped skills with support files (COD-417) - #51

Merged
shivros merged 2 commits into
mainfrom
runner/COD-417-directory-skills
Sep 12, 2026
Merged

feat: directory-shaped skills with support files (COD-417)#51
shivros merged 2 commits into
mainfrom
runner/COD-417-directory-skills

Conversation

@shivros

@shivros shivros commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

feat: directory-shaped skills with support files (COD-417)

Closes COD-417.

Problem

Creed's skill model was one flat .md per skill. Real Hermes-style skills are directories — <name>/SKILL.md plus references/, 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 the agents target (context-only) was a silent no-op.

What changed

  • domain.Skill gains Files map[string][]byte + IsDirectory(). Flat skills (nil Files) behave byte-identically to before.
  • localfs.readSkillDirectory — a skill entry path that is a directory is walked with filepath.WalkDir: SKILL.md becomes 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, via readContainedFile); a directory containing only SKILL.md is rejected with guidance to declare the file path directly. gitremote/layered delegate to localfs, so they inherit this.
  • renderSkillDirOutput emits directory skills under <skilldir>/<name>/SKILL.md plus support files in sorted (deterministic) order. Flat skills still emit <name>.md.
  • New internal/skillmeta — shared frontmatter parse/validate: when a skill carries YAML frontmatter, name must match the manifest entry and description must be present. Missing frontmatter is a warning, not an error.
  • Sync enforces the contract at generation time (render fails on broken/mismatched frontmatter instead of byte-copying blindly); validate reports the same diagnostics for both directory and flat skills, with the file path and problem in each message.
  • skills_have_no_output warning in validate when declared skills have no enabled target with a skill-dir output — kills the silent skills-only + agents no-op.
  • Scaffold skill and creed's own two dogfood skills now carry the frontmatter contract; regenerated outputs.
  • README documents directory skills, the frontmatter contract, and the no-op warning.

Verification

All run locally on this branch:

  • go build ./... — pass
  • go test -race -count=1 ./... — 11 packages ok
  • go vet ./..., gofmt -l . — clean
  • scripts/check-generated.sh — "generated code is current"
  • Dogfood: built binary against creed's own repo — validate passes (incl. frontmatter contract on own skills), sync idempotent (second run 0 written, all skipped)
  • New tests: localfs directory reads (happy/missing-SKILL.md/symlink/lone-SKILL.md), renderer tree emission + determinism + frontmatter enforcement, validate diagnostics table (dir + flat: mismatch/missing-description/no-frontmatter/unterminated), symlink rejection, no-output warning, end-to-end zero-data-loss sync with 5/5 file-count parity + idempotency

Notes

  • The dual review panel (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.
  • Generated surfaces: no descriptor/signature changes — go generate produced zero drift.

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
@shivros

shivros commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Auto-Merge Gate — approved

Confidence: 0.86

Rationale: The implementation directly satisfies COD-417: directory entries read SKILL.md plus contained regular support files, emit the complete deterministic tree, retain flat-skill behavior, validate frontmatter at validation and render time, and warn on skills with no enabled skill-output target. The change includes focused unit and end-to-end idempotency/data-loss tests.

Checks observed: GitHub CI Test, Lint, Creed context drift, and Secret Scan all succeeded. Independent gate verification also passed:

  • go test -race -count=1 ./...
  • go vet ./...
  • gofmt -l $(git ls-files '*.go') (clean)
  • ./scripts/check-generated.sh

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.

@shivros
shivros merged commit 9e8bf55 into main Sep 12, 2026
4 checks passed
@shivros
shivros deleted the runner/COD-417-directory-skills branch September 12, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant