Skip to content

feat(skills): /skill new scaffolds a stub + README walkthrough#394

Merged
esengine merged 2 commits intomainfrom
feat/366-skill-new-scaffold
May 7, 2026
Merged

feat(skills): /skill new scaffolds a stub + README walkthrough#394
esengine merged 2 commits intomainfrom
feat/366-skill-new-scaffold

Conversation

@esengine
Copy link
Copy Markdown
Owner

@esengine esengine commented May 7, 2026

Closes #366.

Why

User feedback: wanted to install a frontend-writing skill, found "no discoverable entry point". The /skill list empty state told users WHERE skills live but not HOW to author one — and there's no remote registry to install from.

The honest framing of this is: there's no marketplace yet, so the missing primitive isn't /skill browse (vapor), it's /skill new (the path users actually need).

What changes

  • /skill new <name> — writes <project>/.reasonix/skills/<name>.md with minimal frontmatter (name, description) + a comment block listing the optional knobs (runAs, allowed-tools, model).

  • /skill new <name> --global — writes ~/.reasonix/skills/<name>.md for cross-project use. Auto-falls-back to global when there's no project root (i.e. running outside reasonix code).

  • Refuses to overwrite existing files; rejects invalid names via the existing isValidSkillName regex.

  • Empty /skill list now ends with an explicit "no remote registry yet — scaffold one with /skill new <name>" line, so users don't keep hunting for a marketplace.

  • Slash command catalog entry updated: argsHint: "[list|show <name>|new <name>|<name> [args]]", summary mentions "scaffold".

  • /skill list footer now mentions New: /skill new <name> alongside View / Run.

  • README.md + README.zh-CN.md — "Author your first skill" subsection in the Getting Started area, with the scaffold commands and a note that the frontmatter accepts runAs: subagent for isolated subagent execution.

Tests

tests/skills.test.ts — 5 new cases:

  • writes a project-scope stub when projectRoot is set
  • falls back to global scope when projectRoot is absent
  • refuses to overwrite an existing skill (returns error)
  • rejects invalid skill names (../etc/passwd)
  • refuses project scope when no projectRoot is configured

Test plan

  • npm run verify — 135 files / 2166 passed / 1 skipped (was 2155, +5 new + carry-over)
  • Manual: /skill new my-test from reasonix code writes <repo>/.reasonix/skills/my-test.md; subsequent /skill list shows it
  • Manual: /skill new my-test --global writes under ~/.reasonix/skills/
  • Manual: /skill new my-test twice → second invocation reports the path conflict

User feedback: wanted to install a frontend-writing skill, "no
discoverable entry point". The /skill list empty state told users
WHERE skills live but not HOW to author one — and there's no remote
registry to install from.

Adds the missing creation step:

- /skill new <name>          → writes <project>/.reasonix/skills/<name>.md
- /skill new <name> --global → writes ~/.reasonix/skills/<name>.md

The stub carries the minimal frontmatter (name + description) plus
a comment block listing the optional knobs (runAs, allowed-tools,
model). Refuses to overwrite existing files; rejects invalid names
via the existing isValidSkillName regex.

Empty /skill list now surfaces the new scaffold + an explicit "no
remote registry yet" line so users don't keep hunting for a
marketplace that doesn't exist. Catalog + README in EN + zh-CN
gain the "author your first skill" path. The /skill list footer
mentions /skill new alongside show / run.
Comment thread src/skills.ts Fixed
…agged

CodeQL flagged the existsSync→writeFileSync sequence as a potential
file-system race. Switch to writeFileSync with `flag: "wx"` so the
existence check IS the atomic write — if a parallel process landed
the file between our check and write, EEXIST surfaces and we report
the conflict instead of silently overwriting.

Keep the folder-form pre-check for a cleaner error message when the
collision is on the dir-style skill (`<name>/SKILL.md`).
@esengine esengine merged commit ee5961f into main May 7, 2026
3 checks passed
@esengine esengine deleted the feat/366-skill-new-scaffold branch May 7, 2026 16:31
@esengine esengine mentioned this pull request May 7, 2026
5 tasks
esengine added a commit that referenced this pull request May 7, 2026
Three contributor-led follow-ups: storm guard exempts safe inspector
reads (#388 by @ctharvey), wait_for_job replaces polling loops with
one blocking call (#390 by @ctharvey), and /skill new finally
provides the missing scaffold for user skills (#394).
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.

Skill installation lacks a discoverable entry point

2 participants