Skip to content

feat: support single-skill repos with root-level SKILL.md (npx skills init default layout) #243

@christso

Description

@christso

Problem

npx skills init my-skill creates a repo where SKILL.md lives at the root of the repository. Example layout:

my-skill-repo/
  SKILL.md          ← single skill at root
  README.md

Running allagents plugin install github:org/my-skill-repo then allagents skills list shows no skills for this repo.

Current support

PR #234 added support for multi-skill flat repos — repos with subdirectories each containing a SKILL.md:

dakota/
  brainstorming/SKILL.md
  debugging/SKILL.md
  ...

But root-level single-skill repos (the default output of npx skills init) are not handled. The code in skills.ts and transform.ts only looks one level deep for SKILL.md inside subdirectories, not at the plugin root itself.

Expected behavior

When a plugin repo has SKILL.md at the root (and no skills/ subdirectory and no subdirectories with SKILL.md), treat the entire repo as a single skill. The skill name should be derived from the SKILL.md frontmatter name field, falling back to the repo/directory name.

Implementation notes

In skills.ts getAllSkillsFromPlugins() and transform.ts skill sync logic, after checking:

  1. skills/ subdirectory → standard layout
  2. Subdirectories with SKILL.md → multi-skill flat layout (feat: auto-wrap flat SKILL.md repos as skills #234)

Add:
3. Root SKILL.md exists → single-skill layout: treat pluginPath itself as the skill directory

The skill name can be read from the frontmatter name field of the root SKILL.md, with the directory name as fallback.

Verification

# Create a minimal root-level SKILL.md repo
mkdir /tmp/single-skill-repo
echo '---\nname: my-skill\ndescription: test\n---\n# My skill' > /tmp/single-skill-repo/SKILL.md

# Install and list
allagents plugin install /tmp/single-skill-repo
allagents skills list
# Expected: shows "my-skill" from the installed plugin

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions