feat(skills): /skill new scaffolds a stub + README walkthrough#394
Merged
feat(skills): /skill new scaffolds a stub + README walkthrough#394
Conversation
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.
…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
added a commit
that referenced
this pull request
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #366.
Why
User feedback: wanted to install a frontend-writing skill, found "no discoverable entry point". The
/skill listempty 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>.mdwith minimal frontmatter (name,description) + a comment block listing the optional knobs (runAs,allowed-tools,model)./skill new <name> --global— writes~/.reasonix/skills/<name>.mdfor cross-project use. Auto-falls-back to global when there's no project root (i.e. running outsidereasonix code).Refuses to overwrite existing files; rejects invalid names via the existing
isValidSkillNameregex.Empty
/skill listnow 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 listfooter now mentionsNew: /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: subagentfor isolated subagent execution.Tests
tests/skills.test.ts— 5 new cases:projectRootis setprojectRootis absenterror)../etc/passwd)projectRootis configuredTest plan
npm run verify— 135 files / 2166 passed / 1 skipped (was 2155, +5 new + carry-over)/skill new my-testfromreasonix codewrites<repo>/.reasonix/skills/my-test.md; subsequent/skill listshows it/skill new my-test --globalwrites under~/.reasonix/skills//skill new my-testtwice → second invocation reports the path conflict