Background
create-rstack already supports extending the project creation flow through extraTools, which works well for copying templates, merging package.json, and running extra commands.
We want to add a separate first-class Skill step during project creation, so selected skills can be installed into the new project's .agents/skills/ directory via the skills CLI, instead of continuing to model this capability as part of tools.
The goal is to let wrappers such as create-rsbuild, create-rspack, and create-rslib expose built-in Skill options, while also supporting non-interactive selection through a --skill CLI flag.
Goal
Add a new Skill extension layer to create-rstack, parallel to tools, including:
- an
extraSkills API
- a
--skill CLI flag
- a dedicated Skill selection step in the create flow
- installation into project-local
.agents/skills/ via the skills CLI
Proposed API
Argv
Add:
type Argv = {
...
skill?: string | string[];
};
create() options
Add:
type ExtraSkill = {
value: string;
label: string;
source: string;
skill?: string;
when?: (templateName: string) => boolean;
order?: "pre" | "post";
};
create({
...,
extraSkills?: ExtraSkill[],
});
Field meanings
value: unique identifier used by CLI args and interactive prompts
label: prompt label
source: source passed to skills add, such as GitHub shorthand, repo URL, or git URL
skill: the single skill name installed by this option
when: optional template-based filter
order: controls prompt ordering
Each ExtraSkill represents one selectable skill option.
skill can remain optional so wrappers can still point source at a repo or subpath that already resolves to a single skill, but the intended model is one ExtraSkill -> one installed skill.
CLI Design
Add:
Behavior should match --tools:
- support
--skill foo
- support
--skill foo,bar
- support repeated flags, e.g.
--skill foo --skill bar
Here foo / bar map to extraSkills[].value, rather than exposing raw repo URLs directly.
Prompt Flow
The current flow is roughly:
- Project name
- Template
- Tools
- Copy template
- Run tool actions / commands
- Generate
AGENTS.md
Suggested new flow:
- Project name
- Template
- Skills
- Tools
- Copy template
- Install skills
- Run tool actions / commands
- Generate
AGENTS.md
Rationale:
- Skills are a distinct concept and should appear as a first-class step
- Skill installation requires the target directory to exist, so execution should happen after template files are copied
Installation Strategy
The first version should use the skills CLI rather than depending on any internal, non-public programmatic API.
For each selected ExtraSkill, run one command inside the generated project directory, for example:
npx skills add <source> --agent universal --yes --copy [--skill <name>]
Default behavior should be fixed:
- always pass
--agent universal
- always pass
--yes
- always pass
--copy
Rationale:
--agent universal ensures installation goes to project-local .agents/skills/
--yes avoids additional confirmation prompts inside scaffold flow
--copy produces stable, commit-friendly, reproducible output
Non-interactive Behavior
- if
--skill is explicitly provided, resolve skills directly and skip the Skill prompt
- if
--dir and --template are provided but --skill is not, skip Skill selection by default
- only show the Skill multiselect prompt in interactive mode
Error Handling
The first version should be fail-fast:
- if any selected Skill installation fails, abort the create flow
- the error should include:
value
source
- the actual executed command
- do not attempt rollback
Rationale: Skill installation is an explicit user-selected step, and continuing after failure would leave the generated project in a partially configured state.
Help Output
Add to --help:
--skill <skill> add skills, comma separated
Also add a new section:
This should be displayed alongside Optional tools.
Testing
Suggested coverage:
--skill argument parsing
- single value
- comma-separated values
- repeated flags
when(templateName) filtering
- only matching skills are shown and installed
- prompt skipping behavior
- skip Skill prompt when
--dir + --template + no --skill
- installation command generation
- verify
skills add is called correctly
- verify
--agent universal --yes --copy is always included
- verify
--skill <name> is appended when ExtraSkill.skill is set
- help output
- includes
--skill
- includes
Optional skills
Notes / Constraints
- v1 does not support entering arbitrary repo or URL values directly in the prompt; custom sources should come from wrapper-defined
extraSkills
- v1 does not expose agent selection; everything installs into
.agents/skills/
- v1 should not depend on internal JS APIs from
skills, to avoid coupling to non-public interfaces
- v1 assumes one selectable
ExtraSkill corresponds to one installed skill
Open Questions
- should
--skill "" behave like --tools "" and explicitly skip selection?
- should the final scaffold output include a note listing which skills were installed?
Background
create-rstackalready supports extending the project creation flow throughextraTools, which works well for copying templates, mergingpackage.json, and running extra commands.We want to add a separate first-class
Skillstep during project creation, so selected skills can be installed into the new project's.agents/skills/directory via theskillsCLI, instead of continuing to model this capability as part oftools.The goal is to let wrappers such as
create-rsbuild,create-rspack, andcreate-rslibexpose built-in Skill options, while also supporting non-interactive selection through a--skillCLI flag.Goal
Add a new Skill extension layer to
create-rstack, parallel totools, including:extraSkillsAPI--skillCLI flag.agents/skills/via theskillsCLIProposed API
ArgvAdd:
create()optionsAdd:
Field meanings
value: unique identifier used by CLI args and interactive promptslabel: prompt labelsource: source passed toskills add, such as GitHub shorthand, repo URL, or git URLskill: the single skill name installed by this optionwhen: optional template-based filterorder: controls prompt orderingEach
ExtraSkillrepresents one selectable skill option.skillcan remain optional so wrappers can still pointsourceat a repo or subpath that already resolves to a single skill, but the intended model is oneExtraSkill-> one installed skill.CLI Design
Add:
Behavior should match
--tools:--skill foo--skill foo,bar--skill foo --skill barHere
foo/barmap toextraSkills[].value, rather than exposing raw repo URLs directly.Prompt Flow
The current flow is roughly:
AGENTS.mdSuggested new flow:
AGENTS.mdRationale:
Installation Strategy
The first version should use the
skillsCLI rather than depending on any internal, non-public programmatic API.For each selected
ExtraSkill, run one command inside the generated project directory, for example:Default behavior should be fixed:
--agent universal--yes--copyRationale:
--agent universalensures installation goes to project-local.agents/skills/--yesavoids additional confirmation prompts inside scaffold flow--copyproduces stable, commit-friendly, reproducible outputNon-interactive Behavior
--skillis explicitly provided, resolve skills directly and skip the Skill prompt--dirand--templateare provided but--skillis not, skip Skill selection by defaultError Handling
The first version should be fail-fast:
valuesourceRationale: Skill installation is an explicit user-selected step, and continuing after failure would leave the generated project in a partially configured state.
Help Output
Add to
--help:Also add a new section:
This should be displayed alongside
Optional tools.Testing
Suggested coverage:
--skillargument parsingwhen(templateName)filtering--dir + --template + no --skillskills addis called correctly--agent universal --yes --copyis always included--skill <name>is appended whenExtraSkill.skillis set--skillOptional skillsNotes / Constraints
extraSkills.agents/skills/skills, to avoid coupling to non-public interfacesExtraSkillcorresponds to one installed skillOpen Questions
--skill ""behave like--tools ""and explicitly skip selection?