Skip to content

Commit 8720621

Browse files
authored
@W-20898700 Add setup skills command for IDE skill installation (#57)
* initial skills * documentation * improve setup skills command UX and fix rate limiting - Add @inquirer/prompts for interactive multi-select prompts - Change skillset selection to multi-select (can install both b2c and b2c-cli) - Rename github-copilot IDE to vscode for clarity - Add docsUrl to IDE configs and show documentation links after installation - Use direct GitHub download URLs instead of API to avoid rate limiting - Update documentation with new IDE names and flag options
1 parent 1420b6f commit 8720621

File tree

15 files changed

+2092
-5
lines changed

15 files changed

+2092
-5
lines changed

.github/workflows/publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,22 @@ jobs:
138138
gh release create "$GITHUB_REF_NAME" --notes-file /tmp/release-notes.md $PRERELEASE_FLAG
139139
env:
140140
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141+
142+
- name: Package skills artifacts
143+
if: steps.release-type.outputs.type == 'stable'
144+
run: |
145+
# Create b2c-skills.zip containing plugins/b2c/skills/
146+
cd plugins/b2c && zip -r ../../b2c-skills.zip skills/
147+
cd ../..
148+
# Create b2c-cli-skills.zip containing plugins/b2c-cli/skills/
149+
cd plugins/b2c-cli && zip -r ../../b2c-cli-skills.zip skills/
150+
cd ../..
151+
echo "Created skills artifacts:"
152+
ls -la *.zip
153+
154+
- name: Upload skills to release
155+
if: steps.release-type.outputs.type == 'stable'
156+
run: |
157+
gh release upload "$GITHUB_REF_NAME" b2c-skills.zip b2c-cli-skills.zip
158+
env:
159+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const guideSidebar = [
3838
{ text: 'SLAS Commands', link: '/cli/slas' },
3939
{ text: 'Custom APIs', link: '/cli/custom-apis' },
4040
{ text: 'SCAPI Schemas', link: '/cli/scapi-schemas' },
41+
{ text: 'Setup Commands', link: '/cli/setup' },
4142
{ text: 'Auth Commands', link: '/cli/auth' },
4243
{ text: 'Logging', link: '/cli/logging' },
4344
],

docs/cli/setup.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
---
2+
description: Commands for installing AI agent skills for Claude Code, Cursor, Windsurf, and other agentic IDEs.
3+
---
4+
5+
# Setup Commands
6+
7+
Commands for setting up the development environment with AI agent skills.
8+
9+
## b2c setup skills
10+
11+
Install agent skills from the B2C Developer Tooling project to AI-powered IDEs.
12+
13+
This command downloads skills from GitHub releases and installs them to the configuration directories of supported IDEs. Skills teach AI assistants about B2C Commerce development, CLI commands, and best practices.
14+
15+
### Usage
16+
17+
```bash
18+
b2c setup skills [SKILLSET]
19+
```
20+
21+
### Arguments
22+
23+
| Argument | Description | Default |
24+
|----------|-------------|---------|
25+
| `SKILLSET` | Skill set to install: `b2c` or `b2c-cli` | Prompted interactively |
26+
27+
### Flags
28+
29+
| Flag | Description | Default |
30+
|------|-------------|---------|
31+
| `--list`, `-l` | List available skills without installing | `false` |
32+
| `--skill` | Install specific skill(s) (can be repeated) | |
33+
| `--ide` | Target IDE(s): claude-code, cursor, windsurf, vscode, codex, opencode, manual | Auto-detect |
34+
| `--global`, `-g` | Install to user home directory (global scope) | `false` |
35+
| `--update`, `-u` | Update existing skills (overwrite) | `false` |
36+
| `--version` | Specific release version | `latest` |
37+
| `--force` | Skip confirmation prompts (non-interactive) | `false` |
38+
| `--json` | Output results as JSON | `false` |
39+
40+
### Supported IDEs
41+
42+
| IDE Value | IDE Name | Project Path | Global Path |
43+
|-----------|----------|--------------|-------------|
44+
| `claude-code` | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
45+
| `cursor` | Cursor | `.cursor/skills/` | `~/.cursor/skills/` |
46+
| `windsurf` | Windsurf | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` |
47+
| `vscode` | VS Code / GitHub Copilot | `.github/skills/` | `~/.copilot/skills/` |
48+
| `codex` | OpenAI Codex CLI | `.codex/skills/` | `~/.codex/skills/` |
49+
| `opencode` | OpenCode | `.opencode/skills/` | `~/.config/opencode/skills/` |
50+
| `manual` | Manual | `.claude/skills/` | `~/.claude/skills/` |
51+
52+
Use `manual` when you want to install to the Claude Code paths without marketplace recommendations.
53+
54+
### Examples
55+
56+
```bash
57+
# Interactive mode (prompts for skillset and IDEs)
58+
b2c setup skills
59+
60+
# List available skills in a skillset
61+
b2c setup skills b2c --list
62+
b2c setup skills b2c-cli --list
63+
64+
# Install b2c skills to Cursor (project scope)
65+
b2c setup skills b2c --ide cursor
66+
67+
# Install b2c-cli skills to Cursor (global/user scope)
68+
b2c setup skills b2c-cli --ide cursor --global
69+
70+
# Install to multiple IDEs
71+
b2c setup skills b2c --ide cursor --ide windsurf
72+
73+
# Install specific skills only
74+
b2c setup skills b2c-cli --skill b2c-code --skill b2c-webdav --ide cursor
75+
76+
# Update existing skills
77+
b2c setup skills b2c --ide cursor --update
78+
79+
# Non-interactive mode (for CI/CD) - skillset required
80+
b2c setup skills b2c-cli --ide cursor --global --force
81+
82+
# Install a specific version
83+
b2c setup skills b2c --version v0.1.0 --ide cursor
84+
85+
# Output as JSON
86+
b2c setup skills b2c --list --json
87+
```
88+
89+
### Interactive Mode
90+
91+
When run without `--force`, the command provides an interactive experience:
92+
93+
1. Prompts you to select skill set(s) (if not provided as argument) - you can select both `b2c` and `b2c-cli`
94+
2. Downloads skills from the latest release (or specified version)
95+
3. Auto-detects installed IDEs
96+
4. Prompts you to select target IDEs
97+
5. Shows installation preview
98+
6. Confirms before installing
99+
7. Reports results
100+
101+
In non-interactive mode (`--force`), the skillset argument is required.
102+
103+
### Claude Code Recommendation
104+
105+
For Claude Code users, we recommend using the plugin marketplace for automatic updates:
106+
107+
```bash
108+
claude plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
109+
claude plugin install b2c-cli
110+
claude plugin install b2c
111+
```
112+
113+
The marketplace provides:
114+
- Automatic updates when new versions are released
115+
- Centralized plugin management
116+
- Version tracking
117+
118+
Use `--ide manual` if you prefer manual installation to the same paths.
119+
120+
### Skill Sets
121+
122+
| Skill Set | Description |
123+
|-----------|-------------|
124+
| `b2c` | B2C Commerce development patterns and practices |
125+
| `b2c-cli` | B2C CLI commands and operations |
126+
127+
### Output
128+
129+
When installing, the command reports:
130+
- Successfully installed skills with paths
131+
- Skipped skills (already exist, use `--update` to overwrite)
132+
- Errors encountered during installation
133+
134+
Example output:
135+
136+
```
137+
Downloading skills from release latest...
138+
Detecting installed IDEs...
139+
Installing 12 skills to Cursor (project)
140+
141+
Successfully installed 12 skill(s):
142+
- b2c-code → .cursor/skills/b2c-code/
143+
- b2c-webdav → .cursor/skills/b2c-webdav/
144+
...
145+
```
146+
147+
### Environment
148+
149+
Skills are downloaded from the GitHub releases of the [b2c-developer-tooling](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling) repository:
150+
151+
| Artifact | Contents |
152+
|----------|----------|
153+
| `b2c-cli-skills.zip` | Skills for B2C CLI commands and operations |
154+
| `b2c-skills.zip` | Skills for B2C Commerce development patterns |
155+
156+
Downloaded artifacts are cached locally at: `~/.cache/b2c-cli/skills/{version}/{skillset}/`
157+
158+
### See Also
159+
160+
- [Agent Skills & Plugins Guide](/guide/agent-skills) - Overview of available skills
161+
- [Claude Code Skills Documentation](https://claude.ai/code) - Claude Code skill format
162+
- [Cursor Skills Documentation](https://cursor.com/docs/context/skills) - Cursor skill format

docs/guide/agent-skills.md

Lines changed: 125 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,148 @@ To remove the marketplace:
103103
claude plugin marketplace remove b2c-developer-tooling
104104
```
105105

106+
## Installation with B2C CLI
107+
108+
The B2C CLI provides a `setup skills` command that downloads and installs agent skills to any supported IDE.
109+
110+
### Interactive Mode
111+
112+
Run without arguments to interactively select skill sets and IDEs:
113+
114+
```bash
115+
b2c setup skills
116+
```
117+
118+
This prompts you to select which skill sets (`b2c`, `b2c-cli`, or both) and which IDEs to install to.
119+
120+
### List Available Skills
121+
122+
```bash
123+
b2c setup skills b2c --list
124+
b2c setup skills b2c-cli --list
125+
```
126+
127+
### Install to Specific IDEs
128+
129+
::: code-group
130+
131+
```bash [Project Scope]
132+
# Install b2c skills to Cursor (current project only)
133+
b2c setup skills b2c --ide cursor
134+
135+
# Install b2c-cli skills to Windsurf
136+
b2c setup skills b2c-cli --ide windsurf
137+
138+
# Install to multiple IDEs
139+
b2c setup skills b2c --ide cursor --ide windsurf
140+
```
141+
142+
```bash [User Scope]
143+
# Install globally (available in all projects)
144+
b2c setup skills b2c --ide cursor --global
145+
146+
# Install to GitHub Copilot globally
147+
b2c setup skills b2c-cli --ide vscode --global
148+
```
149+
150+
:::
151+
152+
### Install Specific Skills
153+
154+
```bash
155+
# Install only certain skills from a skillset
156+
b2c setup skills b2c-cli --skill b2c-code --skill b2c-webdav --ide cursor
157+
```
158+
159+
### Update Existing Skills
160+
161+
```bash
162+
# Overwrite existing skills with latest versions
163+
b2c setup skills b2c --ide cursor --update
164+
```
165+
166+
### Non-Interactive Mode
167+
168+
For CI/CD pipelines or scripted installations, the skillset argument is required:
169+
170+
```bash
171+
b2c setup skills b2c-cli --ide cursor --global --force
172+
```
173+
174+
See [Setup Commands](/cli/setup) for full CLI documentation.
175+
106176
## Installation with Other IDEs
107177

108178
The B2C skills follow the [Agent Skills](https://agentskills.io/home) standard and can be used with other AI-powered development tools.
109179

180+
::: tip Recommended
181+
Use the [`b2c setup skills`](/cli/setup) command for easier installation to any supported IDE.
182+
:::
183+
110184
### Cursor
111185

112186
See the [Cursor Skills documentation](https://cursor.com/docs/context/skills) for configuration instructions.
113187

114-
Copy skill files from the plugin directories to your Cursor skills location:
188+
Skills are installed to:
189+
- **Project scope**: `.cursor/skills/` in your project
190+
- **User scope**: `~/.cursor/skills/`
191+
192+
### Windsurf
193+
194+
See the [Windsurf documentation](https://docs.windsurf.com/) for configuration instructions.
115195

116-
- [b2c-cli skills](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/plugins/b2c-cli/skills)
117-
- [b2c skills](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/plugins/b2c/skills)
196+
Skills are installed to:
197+
- **Project scope**: `.windsurf/skills/` in your project
198+
- **User scope**: `~/.codeium/windsurf/skills/`
118199

119200
### VS Code with GitHub Copilot
120201

121202
See the [VS Code Agent Skills documentation](https://code.visualstudio.com/docs/copilot/customization/agent-skills) for configuration instructions.
122203

204+
Skills are installed to:
205+
- **Project scope**: `.github/skills/` in your project
206+
- **User scope**: `~/.copilot/skills/`
207+
123208
You can also append skill content to `.github/copilot-instructions.md` in your repository.
124209

125-
### Other IDEs
210+
### Codex CLI
211+
212+
See the [Codex documentation](https://github.com/openai/codex) for configuration instructions.
213+
214+
Skills are installed to:
215+
- **Project scope**: `.codex/skills/` in your project
216+
- **User scope**: `~/.codex/skills/`
217+
218+
### OpenCode
219+
220+
See the [OpenCode documentation](https://opencode.ai/) for configuration instructions.
221+
222+
Skills are installed to:
223+
- **Project scope**: `.opencode/skills/` in your project
224+
- **User scope**: `~/.config/opencode/skills/`
225+
226+
### Manual Installation
227+
228+
For other AI-powered IDEs, download the skills zip files from the [latest GitHub release](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/releases/latest):
229+
230+
| Artifact | Contents |
231+
|----------|----------|
232+
| `b2c-cli-skills.zip` | Skills for B2C CLI commands and operations |
233+
| `b2c-skills.zip` | Skills for B2C Commerce development patterns |
234+
235+
Each zip contains a `skills/` folder with individual skill directories. Extract and copy to your IDE's custom instructions location:
236+
237+
```bash
238+
# Download from latest release
239+
curl -LO https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/releases/latest/download/b2c-cli-skills.zip
240+
curl -LO https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/releases/latest/download/b2c-skills.zip
241+
242+
# Extract and copy to your IDE's skills directory
243+
unzip b2c-cli-skills.zip -d /path/to/your/ide/skills/
244+
unzip b2c-skills.zip -d /path/to/your/ide/skills/
245+
```
126246

127-
For other AI-powered IDEs, copy the `SKILL.md` files and any `references/` directories to your IDE's custom instructions location.
247+
Each skill is a directory containing a `SKILL.md` file and optionally a `references/` folder with additional documentation.
128248

129249
## Usage Examples
130250

packages/b2c-cli/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"registry": "https://registry.npmjs.org/"
1313
},
1414
"dependencies": {
15+
"@inquirer/prompts": "^8.2.0",
1516
"@oclif/core": "^4",
1617
"@oclif/plugin-autocomplete": "^3",
1718
"@oclif/plugin-help": "^6",
@@ -131,6 +132,9 @@
131132
"description": "Browse and retrieve SCAPI schema specifications"
132133
}
133134
}
135+
},
136+
"setup": {
137+
"description": "Setup commands for development environment"
134138
}
135139
}
136140
},

0 commit comments

Comments
 (0)