Authoring skills

Register and publish agent skills from a library package.

A library publishes skills by bundling skill directories in its npm package and listing them in package.json. Use create skills to register those directories and verify what consumers will receive.

In this guide you will:

  • Register or scaffold a skill directory.
  • Include its resources in the published package.
  • Verify the package consumers will install.

Register a skill

{
  "name": "@acme/forms",
  "files": ["dist", "skills"],
  "jfdevelops": {
    "skills": [{ "name": "build-forms", "path": "./skills/build-forms" }]
  }
}

Each path is a directory inside the package containing a SKILL.md whose frontmatter name matches both the registration and the directory name:

---
name: build-forms
description: Build forms with validation and accessible errors.
---

# Build Forms

Steps, commands, and conventions for the agent to follow.

Names are lowercase kebab-case, at most 64 characters. Descriptions are 1 to 1024 characters after trimming. Each path starts with ./, its segments use only letters, digits, _, and -, and it must stay inside the package after symlinks are resolved. A skill may include other files, such as references/, which are copied with it; bundled symlinks and special files are rejected.

jfdevelops create skills

Run it in the library, or in a workspace that contains it. It runs without a terminal, needs npm on PATH, and does not need jfdevelops.json:

npx @jfdevelops/cli create skills
  1. Choose the package. --package <name> matches a target by its package name. Otherwise the only named package that is not an app is used. With several, you choose, and without a terminal you must pass --package. With none, the command fails.
  2. Register or scaffold. Without --path, unregistered SKILL.md directories in the package are offered for registration (node_modules anywhere, dist, .git, and the installed copies in .agents/skills, .claude/skills, .cursor/skills, and .github/skills are ignored). Skills with invalid frontmatter or a mismatched name are reported and never modified. Duplicate names are reported with "Register one with --path". It then asks "Name a new skill to scaffold (Enter to skip)", and for a name it also asks when an agent should use the skill, then scaffolds it in skills/<name>/. --name and --description answer these questions. Pass --path <skill-directory> to register or scaffold at a specific location inside the chosen package. A relative path is resolved from --directory (default .) when that places it inside the package. Otherwise it is resolved from the package root. After choosing the package, the command skips the registration and name questions. For an existing valid SKILL.md, it ignores --name. For a new skill, it uses the directory name, requires any supplied --name to match, and takes the description from --description or asks for it in a terminal. Scaffolding needs an empty or missing directory.
  3. Update package.json. Registrations are added to jfdevelops.skills without duplicates. When the files field would leave a skill out of the published package, the skill's top-level directory is added to it. Other fields, their order, and the file's indentation are kept.
  4. Verify publication. The CLI checks every registration as a consumer will see it, then runs npm pack --dry-run without lifecycle scripts, which needs npm on PATH, and confirms every file of every skill is in the tarball. Files that npm never publishes are skipped. Missing files are listed with the fix, and the command exits with code 1.

To scaffold a skill without being asked, pass its name and description:

npx @jfdevelops/cli create skills --name build-forms --description "Build forms with validation and accessible errors."

Running it again on a package whose skills are all registered changes nothing and repeats the publication check, so it is safe in a release checklist. With --yes, it registers every unregistered skill, scaffolds nothing, runs the publication check, and exits with code 1 when files are missing:

npx @jfdevelops/cli create skills --yes

The CLI never publishes; release the library with your usual process.

After publishing, consumers get the skills with npx @jfdevelops/cli init, jfdevelops add skill <name>, or, for integrations, jfdevelops add addon <name>, and keep them current with jfdevelops skills sync or jfdevelops skills update. Shared convention skills are not authored this way; they are maintained in the jfdevelops/skills repository.

Next steps