Skip to content

feat(skills): support multi-part inline skills with asset files#22

Merged
mrsimpson merged 1 commit into
mainfrom
multi-file-skills
Apr 4, 2026
Merged

feat(skills): support multi-part inline skills with asset files#22
mrsimpson merged 1 commit into
mainfrom
multi-file-skills

Conversation

@mrsimpson
Copy link
Copy Markdown
Contributor

Intent

Inline skills defined in ade.extensions.mjs were limited to a single body (SKILL.md content). The agentskills.io progressive disclosure pattern calls for additional asset files (references/, scripts/, etc.) that agents load only when needed. This change enables that pattern for inline skills.

Also fixes a bug where writeInlineSkills had inverted change-detection logic (marking a skill as modified when unchanged, and silently skipping the write when content differed). Fixes a YAML frontmatter quoting bug that caused agentskills to reject SKILL.md files whose description contained colon-space sequences.

Key changes

  • InlineSkill gains an optional assets?: Record<string, string> field. Keys are relative paths (e.g. references/folder-structure.md); values are file contents. The path-as-type convention maps 1:1 to the output structure under .ade/skills/<name>/.
  • writeInlineSkills now writes asset files alongside SKILL.md, creating subdirectories as needed, and tracks the skill as modified only when any file content actually changes (idempotent on re-run).
  • formatYamlValue helper added: wraps YAML scalar values in double-quotes when they contain characters a YAML parser would misinterpret (colon-space, hash, leading indicator chars such as @). Used for the description field in generated SKILL.md frontmatter.

## Intent

Inline skills defined in `ade.extensions.mjs` were limited to a single
`body` (SKILL.md content). The agentskills.io progressive disclosure
pattern calls for additional asset files (references/, scripts/, etc.)
that agents load only when needed. This change enables that pattern for
inline skills.

Also fixes a bug where `writeInlineSkills` had inverted change-detection
logic (marking a skill as modified when unchanged, and silently skipping
the write when content differed). Fixes a YAML frontmatter quoting bug
that caused agentskills to reject SKILL.md files whose description
contained colon-space sequences.

## Key changes

- `InlineSkill` gains an optional `assets?: Record<string, string>` field.
  Keys are relative paths (e.g. `references/folder-structure.md`); values
  are file contents. The path-as-type convention maps 1:1 to the output
  structure under `.ade/skills/<name>/`.
- `writeInlineSkills` now writes asset files alongside SKILL.md, creating
  subdirectories as needed, and tracks the skill as modified only when any
  file content actually changes (idempotent on re-run).
- `formatYamlValue` helper added: wraps YAML scalar values in double-quotes
  when they contain characters a YAML parser would misinterpret (colon-space,
  hash, leading indicator chars such as `@`). Used for the description field
  in generated SKILL.md frontmatter.
@mrsimpson mrsimpson merged commit b8c6e1c into main Apr 4, 2026
1 check passed
@mrsimpson mrsimpson deleted the multi-file-skills branch April 4, 2026 14:01
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