Skip to content

Commit c04bbcb

Browse files
authored
feat: add Agentforce Vibes IDE support and --directory flag for setup skills (#337)
* feat: add Agentforce Vibes IDE support and --directory flag for setup skills Add `agentforce-vibes` as a new IDE target for `setup skills`, installing to `.a4drules/skills/` with auto-detection via the Salesforce Agentforce VS Code extension. Change `manual` default path from `.claude/skills/` to `.agents/skills/`. Add `--directory` flag for custom install paths. * Add changeset for Agentforce Vibes and --directory flag * fix: always include manual in interactive IDE selection list * feat: prompt for directory path when manual IDE is selected interactively
1 parent 03aefda commit c04bbcb

7 files changed

Lines changed: 156 additions & 32 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@salesforce/b2c-cli': minor
3+
'@salesforce/b2c-tooling-sdk': minor
4+
---
5+
6+
Add Agentforce Vibes (`--ide agentforce-vibes`) as a supported IDE target for `setup skills`, installing to `.a4drules/skills/`. Add `--directory` flag for custom installation paths. Change `manual` default directory to `.agents/skills/`.

docs/cli/setup.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -375,30 +375,32 @@ b2c setup skills [SKILLSET]
375375

376376
### Flags
377377

378-
| Flag | Description | Default |
379-
| ---------------- | ----------------------------------------------------------------------------- | ----------- |
380-
| `--list`, `-l` | List available skills without installing | `false` |
381-
| `--skill` | Install specific skill(s) (can be repeated) | |
382-
| `--ide` | Target IDE(s): claude-code, cursor, windsurf, vscode, codex, opencode, manual | Auto-detect |
383-
| `--global`, `-g` | Install to user home directory (global scope) | `false` |
384-
| `--update`, `-u` | Update existing skills (overwrite) | `false` |
385-
| `--version` | Specific release version | `latest` |
386-
| `--force` | Skip confirmation prompts (non-interactive) | `false` |
387-
| `--json` | Output results as JSON | `false` |
378+
| Flag | Description | Default |
379+
| --------------------- | ---------------------------------------------------------------------------------------------- | ----------- |
380+
| `--list`, `-l` | List available skills without installing | `false` |
381+
| `--skill` | Install specific skill(s) (can be repeated) | |
382+
| `--ide` | Target IDE(s): claude-code, cursor, windsurf, vscode, codex, opencode, agentforce-vibes, manual | Auto-detect |
383+
| `--directory`, `-d` | Custom installation directory (overrides IDE default path) | |
384+
| `--global`, `-g` | Install to user home directory (global scope) | `false` |
385+
| `--update`, `-u` | Update existing skills (overwrite) | `false` |
386+
| `--version` | Specific release version | `latest` |
387+
| `--force` | Skip confirmation prompts (non-interactive) | `false` |
388+
| `--json` | Output results as JSON | `false` |
388389

389390
### Supported IDEs
390391

391-
| IDE Value | IDE Name | Project Path | Global Path |
392-
| ------------- | ------------------------ | ------------------- | ----------------------------- |
393-
| `claude-code` | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
394-
| `cursor` | Cursor | `.cursor/skills/` | `~/.cursor/skills/` |
395-
| `windsurf` | Windsurf | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` |
396-
| `vscode` | VS Code / GitHub Copilot | `.github/skills/` | `~/.copilot/skills/` |
397-
| `codex` | OpenAI Codex CLI | `.codex/skills/` | `~/.codex/skills/` |
398-
| `opencode` | OpenCode | `.opencode/skills/` | `~/.config/opencode/skills/` |
399-
| `manual` | Manual | `.claude/skills/` | `~/.claude/skills/` |
392+
| IDE Value | IDE Name | Project Path | Global Path |
393+
| ------------------ | ------------------------ | --------------------- | --------------------------------------------------- |
394+
| `claude-code` | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
395+
| `cursor` | Cursor | `.cursor/skills/` | `~/.cursor/skills/` |
396+
| `windsurf` | Windsurf | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` |
397+
| `vscode` | VS Code / GitHub Copilot | `.github/skills/` | `~/.copilot/skills/` |
398+
| `codex` | OpenAI Codex CLI | `.codex/skills/` | `~/.codex/skills/` |
399+
| `opencode` | OpenCode | `.opencode/skills/` | `~/.config/opencode/skills/` |
400+
| `agentforce-vibes` | Agentforce Vibes | `.a4drules/skills/` | `~/Library/Application Support/Code/User/globalStorage` (macOS) |
401+
| `manual` | Manual | `.agents/skills/` | `~/.agents/skills/` |
400402

401-
Use `manual` when you want to install to the Claude Code paths without marketplace recommendations.
403+
Use `agentforce-vibes` for Salesforce Agentforce for VS Code. Use `manual` for generic installation with a custom `--directory` path.
402404

403405
### Examples
404406

@@ -422,6 +424,12 @@ b2c setup skills b2c --ide cursor --ide windsurf
422424
# Install specific skills only
423425
b2c setup skills b2c-cli --skill b2c-code --skill b2c-webdav --ide cursor
424426

427+
# Install to Agentforce Vibes (.a4drules/skills/)
428+
b2c setup skills b2c --ide agentforce-vibes
429+
430+
# Install to a custom directory
431+
b2c setup skills b2c --ide manual --directory ./my-skills
432+
425433
# Update existing skills
426434
b2c setup skills b2c --ide cursor --update
427435

@@ -465,7 +473,7 @@ The marketplace provides:
465473
- Centralized plugin management
466474
- Version tracking
467475

468-
Use `--ide manual` if you prefer manual installation to the same paths.
476+
Use `--ide manual` if you prefer manual installation, or `--ide agentforce-vibes` to install to the `.a4drules/skills/` directory used by Salesforce Agentforce for VS Code.
469477

470478
### Skill Sets
471479

docs/guide/agent-skills.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,34 @@ b2c setup skills b2c-cli --ide cursor --global --force
201201

202202
See [Setup Commands](/cli/setup) for full CLI documentation.
203203

204+
## Installation with Agentforce Vibes
205+
206+
[Agentforce for VS Code](https://developer.salesforce.com/docs/einstein/genai/guide/agentforce-in-ide.html) (Agentforce Vibes) automatically detects skills placed in the `.a4drules/skills/` directory.
207+
208+
### Using B2C CLI
209+
210+
```bash
211+
# Install to project .a4drules/skills/ directory
212+
b2c setup skills b2c --ide agentforce-vibes
213+
b2c setup skills b2c-cli --ide agentforce-vibes
214+
215+
# Install globally
216+
b2c setup skills b2c --ide agentforce-vibes --global
217+
```
218+
219+
### Manual Setup
220+
221+
Place skill directories in `.a4drules/skills/` (project) or your global storage directory:
222+
223+
| Location | Scope |
224+
|----------|-------|
225+
| `.a4drules/skills/` | Project (recommended) |
226+
| `~/Library/Application Support/Code/User/globalStorage` | Global (macOS) |
227+
| `~/.config/Code/User/globalStorage` | Global (Linux) |
228+
| `%APPDATA%\Code\User\globalStorage` | Global (Windows) |
229+
230+
When a global skill and project skill have the same name, the global skill takes precedence. Version control your project skills by committing `.a4drules/skills/` to your source repository so your team can share, review, and improve them together.
231+
204232
## Installation with Other IDEs
205233

206234
The B2C skills follow the [Agent Skills](https://agentskills.io/home) standard and can be used with other AI-powered development tools.
@@ -253,7 +281,17 @@ Skills are installed to:
253281

254282
### Manual Installation
255283

256-
For other AI-powered IDEs, download the skills zip files from the [latest GitHub release](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/releases/latest):
284+
Use `--ide manual` to install to the default `.agents/skills/` directory, or specify a custom path with `--directory`:
285+
286+
```bash
287+
# Install to .agents/skills/ (default for manual)
288+
b2c setup skills b2c --ide manual
289+
290+
# Install to a custom directory
291+
b2c setup skills b2c --ide manual --directory ./my-skills
292+
```
293+
294+
You can also download the skills zip files directly from the [latest GitHub release](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/releases/latest):
257295

258296
| Artifact | Contents |
259297
|----------|----------|

packages/b2c-cli/src/commands/setup/skills.ts

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
55
*/
66
import {Args, Flags, ux} from '@oclif/core';
7-
import {checkbox, confirm} from '@inquirer/prompts';
7+
import {checkbox, confirm, input} from '@inquirer/prompts';
88
import {BaseCommand, createTable, type ColumnDef} from '@salesforce/b2c-tooling-sdk/cli';
99
import {
1010
type IdeType,
@@ -77,6 +77,8 @@ export default class SetupSkills extends BaseCommand<typeof SetupSkills> {
7777
'<%= config.bin %> <%= command.id %> b2c --list',
7878
'<%= config.bin %> <%= command.id %> b2c-cli --skill b2c-code --skill b2c-webdav --ide cursor',
7979
'<%= config.bin %> <%= command.id %> b2c --global --update --force',
80+
'<%= config.bin %> <%= command.id %> b2c --ide agentforce-vibes',
81+
'<%= config.bin %> <%= command.id %> b2c --ide manual --directory ./my-skills',
8082
];
8183

8284
static flags = {
@@ -91,10 +93,14 @@ export default class SetupSkills extends BaseCommand<typeof SetupSkills> {
9193
multiple: true,
9294
}),
9395
ide: Flags.string({
94-
description: 'Target IDE(s): claude-code, cursor, windsurf, vscode, codex, opencode, manual',
96+
description: 'Target IDE(s): claude-code, cursor, windsurf, vscode, codex, opencode, agentforce-vibes, manual',
9597
options: ALL_IDE_TYPES,
9698
multiple: true,
9799
}),
100+
directory: Flags.string({
101+
char: 'd',
102+
description: 'Custom installation directory (overrides IDE default path)',
103+
}),
98104
global: Flags.boolean({
99105
char: 'g',
100106
description: 'Install to user home directory (global)',
@@ -218,12 +224,15 @@ export default class SetupSkills extends BaseCommand<typeof SetupSkills> {
218224
return {};
219225
}
220226

227+
// Always include 'manual' as an option in the IDE list
228+
const ideChoices: IdeType[] = detectedIdes.includes('manual') ? detectedIdes : [...detectedIdes, 'manual'];
229+
221230
// Non-interactive: use all detected IDEs; Interactive: let user select
222231
targetIdes = this.flags.force
223232
? detectedIdes
224233
: await checkbox({
225234
message: t('commands.setup.skills.selectIdes', 'Select target IDEs:'),
226-
choices: detectedIdes.map((ide) => ({
235+
choices: ideChoices.map((ide) => ({
227236
name: getIdeDisplayName(ide),
228237
value: ide,
229238
})),
@@ -264,8 +273,17 @@ export default class SetupSkills extends BaseCommand<typeof SetupSkills> {
264273
}
265274
}
266275

276+
// Prompt for manual installation directory
277+
let directory = this.flags.directory;
278+
if (targetIdes.includes('manual') && !directory && !this.flags.force) {
279+
directory = await input({
280+
message: t('commands.setup.skills.manualDirectory', 'Installation directory:'),
281+
default: '.agents/skills',
282+
});
283+
}
284+
267285
// Show installation preview
268-
const scope = this.flags.global ? 'global (user home)' : 'project';
286+
const scope = directory ? `directory: ${directory}` : this.flags.global ? 'global (user home)' : 'project';
269287
ux.stdout('');
270288
ux.stdout(
271289
t('commands.setup.skills.preview', 'Installing {{count}} skills to {{ides}} ({{scope}})', {
@@ -297,6 +315,7 @@ export default class SetupSkills extends BaseCommand<typeof SetupSkills> {
297315
global: this.flags.global,
298316
update: this.flags.update,
299317
projectRoot: process.cwd(),
318+
directory,
300319
});
301320
})
302321
.filter((p): p is Promise<InstallSkillsResult> => p !== null);

packages/b2c-tooling-sdk/src/skills/agents.ts

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ import type {IdeConfig, IdeType} from './types.js';
1111

1212
const home = os.homedir();
1313

14+
/**
15+
* Get the Agentforce Vibes global skills directory based on platform.
16+
*/
17+
function getAgentforceVibesGlobalDir(): string {
18+
const platform = process.platform;
19+
if (platform === 'darwin') {
20+
return path.join(home, 'Library', 'Application Support', 'Code', 'User', 'globalStorage');
21+
} else if (platform === 'win32') {
22+
return path.join(process.env.APPDATA || path.join(home, 'AppData', 'Roaming'), 'Code', 'User', 'globalStorage');
23+
}
24+
return path.join(home, '.config', 'Code', 'User', 'globalStorage');
25+
}
26+
1427
/**
1528
* IDE configurations with paths and detection logic.
1629
*/
@@ -88,13 +101,26 @@ export const IDE_CONFIGS: Record<IdeType, IdeConfig> = {
88101
},
89102
docsUrl: 'https://opencode.ai/',
90103
},
104+
'agentforce-vibes': {
105+
id: 'agentforce-vibes',
106+
displayName: 'Agentforce Vibes',
107+
paths: {
108+
projectDir: '.a4drules/skills',
109+
globalDir: getAgentforceVibesGlobalDir(),
110+
},
111+
detectInstalled: async () => {
112+
// Check for the Agentforce extension's globalStorage entry
113+
const globalStorageDir = getAgentforceVibesGlobalDir();
114+
return fs.existsSync(path.join(globalStorageDir, 'salesforce.salesforcedx-einstein-gpt'));
115+
},
116+
docsUrl: 'https://developer.salesforce.com/docs/einstein/genai/guide/agentforce-in-ide.html',
117+
},
91118
manual: {
92119
id: 'manual',
93120
displayName: 'Manual Installation',
94121
paths: {
95-
// Manual mode uses same paths as Claude Code
96-
projectDir: '.claude/skills',
97-
globalDir: path.join(home, '.claude/skills'),
122+
projectDir: '.agents/skills',
123+
globalDir: path.join(home, '.agents/skills'),
98124
},
99125
detectInstalled: async () => {
100126
// Manual is always "available" as a fallback
@@ -106,7 +132,16 @@ export const IDE_CONFIGS: Record<IdeType, IdeConfig> = {
106132
/**
107133
* All supported IDE types in display order.
108134
*/
109-
export const ALL_IDE_TYPES: IdeType[] = ['claude-code', 'cursor', 'windsurf', 'vscode', 'codex', 'opencode', 'manual'];
135+
export const ALL_IDE_TYPES: IdeType[] = [
136+
'claude-code',
137+
'cursor',
138+
'windsurf',
139+
'vscode',
140+
'codex',
141+
'opencode',
142+
'agentforce-vibes',
143+
'manual',
144+
];
110145

111146
/**
112147
* Detect which IDEs are installed on the system.
@@ -143,8 +178,15 @@ export async function detectInstalledIdes(): Promise<IdeType[]> {
143178
export function getSkillInstallPath(
144179
ide: IdeType,
145180
skillName: string,
146-
options: {global: boolean; projectRoot?: string},
181+
options: {global: boolean; projectRoot?: string; directory?: string},
147182
): string {
183+
// Custom directory override — used as the base path directly
184+
if (options.directory) {
185+
const projectRoot = options.projectRoot || process.cwd();
186+
const dir = path.isAbsolute(options.directory) ? options.directory : path.join(projectRoot, options.directory);
187+
return path.join(dir, skillName);
188+
}
189+
148190
const config = IDE_CONFIGS[ide];
149191

150192
if (options.global) {

packages/b2c-tooling-sdk/src/skills/installer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export async function installSkills(
140140
const targetPath = getSkillInstallPath(ide, sanitizedName, {
141141
global: options.global,
142142
projectRoot: options.projectRoot,
143+
directory: options.directory,
143144
});
144145

145146
// Get the base directory for path safety validation

packages/b2c-tooling-sdk/src/skills/types.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
/**
88
* Supported IDE types for skill installation.
99
*/
10-
export type IdeType = 'claude-code' | 'cursor' | 'windsurf' | 'vscode' | 'codex' | 'opencode' | 'manual';
10+
export type IdeType =
11+
| 'claude-code'
12+
| 'cursor'
13+
| 'windsurf'
14+
| 'vscode'
15+
| 'codex'
16+
| 'opencode'
17+
| 'agentforce-vibes'
18+
| 'manual';
1119

1220
/**
1321
* Skill set categories matching the plugins directory structure.
@@ -98,6 +106,8 @@ export interface InstallSkillsOptions {
98106
update: boolean;
99107
/** Project root for project-level installations */
100108
projectRoot?: string;
109+
/** Custom directory override (used instead of IDE-specific project path) */
110+
directory?: string;
101111
}
102112

103113
/**

0 commit comments

Comments
 (0)