Skip to content

fix: rename README.md to SKILL.md when copying skill directory #102

Open

Description

@jaehoonkim-x

Summary

When copying a skill directory using add-skill, the README.md file is copied as-is into the target directory. However, the agent runtime looks for SKILL.md, not README.md, so the skill metadata is not found correctly.

Changes

In apps/cli/src/commands/add-skill.ts, the copy logic now renames README.md → SKILL.md during the copy operation:

const githubDisplayFilename = "README.md";
const agentSkillFilename = "SKILL.md";
// ...
const targetEntry = entry === githubDisplayFilename ? agentSkillFilename : entry;
fs.cpSync(path.join(sourceDir, entry), path.join(targetDir, targetEntry), { recursive: true });

Fork / Branch

The fix is ready on my fork: https://github.com/jaehoonkim-x/expect/tree/main

Would love to have this merged. Please let me know if you'd like me to open a PR once collaborator access is granted, or if there's another preferred contribution path.

Activity

  1. changed the title [-]fix: 스킬 디렉토리 복사 시 README.md를 SKILL.md로 이름 변경[/-] [+]fix: rename README.md to SKILL.md when copying skill directory[/+] on Apr 23, 2026
  2. jrhe commented on May 1, 2026

    @jrhe

    Hit the same does not have the correct permissions to execute CreatePullRequest blocker @jaehoonkim-x mentioned, so leaving the work on a fork branch in case it's useful to a maintainer:

    Branch: jrhe/expect@fix/skill-md-copy-rename
    Compare view: main...jrhe:expect:fix/skill-md-copy-rename

    The change:

    • copySkillDirectoryContents: maps README.md → SKILL.md when copying from the shared source to each agent's skill dir (matches the fix proposed in this issue).
    • haveMatchingContents: applies the same mapping when comparing top-level entries, so subsequent expect init runs correctly report already-copied instead of re-copying every time.
    • Two new tests in apps/cli/tests/add-skill.test.ts covering both behaviours.
    • Changeset included.

    pnpm --filter expect-cli test → 158/158 passing. pnpm --filter expect-cli typecheck clean.

    For context: introduced by e01aa5c (renamed source to README.md to serve via the website's llms.txt route), but the CLI copy logic wasn't updated. Repro: npx expect-cli init -y fails with copied skill is missing SKILL.md for all five agents on a clean machine.

    Happy to defer entirely to @jaehoonkim-x's branch if preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions