@solidactions/cli 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -9
- package/dist/commands/ai-init.js +16 -47
- package/dist/commands/init.js +3 -0
- package/dist/index.js +2 -3
- package/dist/utils/skills.js +21 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ npm install -g @solidactions/cli
|
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
solidactions init <api-key> # Initialize (prompts for workspace)
|
|
15
|
-
solidactions init
|
|
15
|
+
solidactions ai init # Install AI skills and SDK reference (required for AI-assisted dev)
|
|
16
16
|
solidactions project deploy <project> <path> # Deploy a project
|
|
17
17
|
solidactions run start <project> <workflow> # Trigger a workflow
|
|
18
18
|
solidactions run view <run-id> # Inspect a run
|
|
@@ -127,16 +127,20 @@ Use `solidactions <command> --help` for full flag details on any command.
|
|
|
127
127
|
|
|
128
128
|
| Command | Key Flags | Description |
|
|
129
129
|
|---------|-----------|-------------|
|
|
130
|
-
| `ai init` | `--claude`, `--agents
|
|
130
|
+
| `ai init` | `--claude`, `--agents` | Install AI skills and SDK reference |
|
|
131
131
|
| `ai examples [names...]` | `--all`, `--overwrite` | Install example workflows |
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
`ai init` installs three auto-activating SolidActions skills and a
|
|
134
|
+
full SDK reference into your project:
|
|
135
|
+
|
|
136
|
+
- Skills go to `.claude/skills/` (for `--claude` / Claude Code) or
|
|
137
|
+
`.agents/skills/` (for `--agents` / Codex, Cursor, Gemini, Windsurf).
|
|
138
|
+
Codex auto-discovers the `.agents/skills/` path — see
|
|
139
|
+
https://developers.openai.com/codex/skills.
|
|
140
|
+
- The SDK reference is saved to `.solidactions/sdk-reference.md`.
|
|
141
|
+
- A slim pointer section is injected into `CLAUDE.md` or `AGENTS.md`
|
|
142
|
+
listing the skills and inlining the highest-cost hard rules
|
|
143
|
+
(determinism, step discipline, messaging) as a safety net.
|
|
140
144
|
|
|
141
145
|
## Development
|
|
142
146
|
|
package/dist/commands/ai-init.js
CHANGED
|
@@ -14,7 +14,7 @@ const markers_1 = require("../utils/markers");
|
|
|
14
14
|
const skills_1 = require("../utils/skills");
|
|
15
15
|
async function aiInit(options = {}) {
|
|
16
16
|
try {
|
|
17
|
-
// Determine target file
|
|
17
|
+
// Determine target file.
|
|
18
18
|
let targetFile;
|
|
19
19
|
if (options.claude && options.agents) {
|
|
20
20
|
console.error(chalk_1.default.red('Please specify only one of --claude or --agents'));
|
|
@@ -32,8 +32,8 @@ async function aiInit(options = {}) {
|
|
|
32
32
|
name: 'file',
|
|
33
33
|
message: 'Which AI helper file?',
|
|
34
34
|
choices: [
|
|
35
|
-
{ title: 'CLAUDE.md', value: 'CLAUDE.md' },
|
|
36
|
-
{ title: 'AGENTS.md', value: 'AGENTS.md' },
|
|
35
|
+
{ title: 'CLAUDE.md (Claude Code)', value: 'CLAUDE.md' },
|
|
36
|
+
{ title: 'AGENTS.md (Codex, Cursor, Gemini, etc.)', value: 'AGENTS.md' },
|
|
37
37
|
],
|
|
38
38
|
});
|
|
39
39
|
if (!response.file) {
|
|
@@ -42,58 +42,27 @@ async function aiInit(options = {}) {
|
|
|
42
42
|
}
|
|
43
43
|
targetFile = response.file;
|
|
44
44
|
}
|
|
45
|
-
// Decide whether to install skills (default true; --no-skills opts out)
|
|
46
|
-
const installSkillsEnabled = options.skills !== false;
|
|
47
|
-
// Determine skill targets if installing.
|
|
48
|
-
// Skills are Claude Code-specific (.claude/skills/) and not meaningful for other AI tools.
|
|
49
|
-
let skillTargets = [];
|
|
50
|
-
if (installSkillsEnabled && targetFile === 'CLAUDE.md') {
|
|
51
|
-
skillTargets = (0, skills_1.detectSkillTargets)();
|
|
52
|
-
if (skillTargets.length === 0) {
|
|
53
|
-
const resp = await (0, prompts_1.default)({
|
|
54
|
-
type: 'confirm',
|
|
55
|
-
name: 'create',
|
|
56
|
-
message: 'No `.claude/` directory found. Create `.claude/skills/` for SolidActions skills?',
|
|
57
|
-
initial: true,
|
|
58
|
-
});
|
|
59
|
-
if (resp.create === undefined) {
|
|
60
|
-
// User cancelled (Ctrl+C) — treat as abort, not decline
|
|
61
|
-
console.log(chalk_1.default.yellow('Cancelled.'));
|
|
62
|
-
process.exit(0);
|
|
63
|
-
}
|
|
64
|
-
else if (resp.create) {
|
|
65
|
-
skillTargets = [path_1.default.join(process.cwd(), '.claude', 'skills')];
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
console.log(chalk_1.default.yellow('Skipping skill install. Run with --no-skills to silence this prompt.'));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
45
|
console.log(chalk_1.default.blue('Fetching AI helper content...'));
|
|
73
|
-
// Fetch
|
|
74
|
-
const aiContent = await (0, skills_1.
|
|
75
|
-
// Fetch SDK reference (always)
|
|
46
|
+
// Fetch slim helper content for the chosen target.
|
|
47
|
+
const aiContent = await (0, skills_1.fetchAiHelperContent)(targetFile);
|
|
48
|
+
// Fetch SDK reference (always).
|
|
76
49
|
const sdkContent = await (0, github_1.fetchRawFile)('SolidActions', 'solidactions-ts-sdk', 'docs/sdk-reference.md');
|
|
77
|
-
// Save SDK reference to .solidactions/sdk-reference.md
|
|
50
|
+
// Save SDK reference to .solidactions/sdk-reference.md.
|
|
78
51
|
fs_extra_1.default.ensureDirSync('.solidactions');
|
|
79
52
|
fs_1.default.writeFileSync('.solidactions/sdk-reference.md', sdkContent, 'utf8');
|
|
80
53
|
console.log(chalk_1.default.green('✓ SDK reference saved to .solidactions/sdk-reference.md'));
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
54
|
+
// Always install skills — no prompt. The user chose `ai init <target>`,
|
|
55
|
+
// so they want AI tooling set up.
|
|
56
|
+
const targetDir = (0, skills_1.skillTargetDir)(targetFile);
|
|
57
|
+
console.log(chalk_1.default.blue(`Installing SolidActions skills to ${path_1.default.relative(process.cwd(), targetDir)}/ ...`));
|
|
58
|
+
const { written } = await (0, skills_1.installSkills)(targetDir);
|
|
59
|
+
for (const f of written) {
|
|
60
|
+
console.log(chalk_1.default.green(`✓ ${path_1.default.relative(process.cwd(), f)}`));
|
|
88
61
|
}
|
|
89
|
-
// Upsert
|
|
62
|
+
// Upsert the AI helper marker section.
|
|
90
63
|
(0, markers_1.upsertMarkerSection)(targetFile, 'SolidActions', aiContent);
|
|
91
|
-
// Upsert SDK reference pointer section
|
|
92
|
-
const sdkReferenceNote = `## SolidActions SDK Reference
|
|
93
|
-
|
|
94
|
-
The full SDK API reference is available at \`.solidactions/sdk-reference.md\`. Refer to it for detailed function signatures, error classes, retry configuration, and advanced patterns like forking, streaming, and signal URLs.`;
|
|
95
|
-
(0, markers_1.upsertMarkerSection)(targetFile, 'SolidActions SDK Reference', sdkReferenceNote);
|
|
96
64
|
console.log(chalk_1.default.green(`✓ AI helper installed to ${targetFile}`));
|
|
65
|
+
console.log(chalk_1.default.gray(' Existing files may still contain a separate "SolidActions SDK Reference" marker block from older CLI versions. That content is now redundant and can be deleted manually.'));
|
|
97
66
|
}
|
|
98
67
|
catch (error) {
|
|
99
68
|
if (error.message?.includes('rate limit')) {
|
package/dist/commands/init.js
CHANGED
|
@@ -152,6 +152,9 @@ async function init(apiKey, options) {
|
|
|
152
152
|
console.log(chalk_1.default.yellow('Could not set workspace. Run `solidactions workspace set` later.'));
|
|
153
153
|
}
|
|
154
154
|
console.log('');
|
|
155
|
+
console.log(chalk_1.default.blue('Next step — install AI helper docs and skills:'));
|
|
156
|
+
console.log(chalk_1.default.gray(' solidactions ai init Picks CLAUDE.md or AGENTS.md interactively'));
|
|
157
|
+
console.log('');
|
|
155
158
|
console.log(chalk_1.default.blue('Quick start:'));
|
|
156
159
|
console.log(chalk_1.default.gray(' solidactions project deploy <name> Deploy current directory'));
|
|
157
160
|
console.log(chalk_1.default.gray(' solidactions run start <proj> <wf> Run a workflow'));
|
package/dist/index.js
CHANGED
|
@@ -311,10 +311,9 @@ workspace
|
|
|
311
311
|
const ai = program.command('ai').description('AI helper tools');
|
|
312
312
|
ai
|
|
313
313
|
.command('init')
|
|
314
|
-
.description('Install AI
|
|
314
|
+
.description('Install SolidActions AI skills and SDK reference for AI-assisted development')
|
|
315
315
|
.option('--claude', 'Use CLAUDE.md (for Claude Code)')
|
|
316
|
-
.option('--agents', 'Use AGENTS.md (for Cursor, Windsurf, etc.)')
|
|
317
|
-
.option('--no-skills', 'Skip installing SolidActions skill files (uses legacy full CLAUDE.md injection)')
|
|
316
|
+
.option('--agents', 'Use AGENTS.md (for Codex, Cursor, Gemini, Windsurf, etc.)')
|
|
318
317
|
.action((options) => { (0, ai_init_1.aiInit)(options); });
|
|
319
318
|
ai
|
|
320
319
|
.command('examples')
|
package/dist/utils/skills.js
CHANGED
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.skillTargetDir = skillTargetDir;
|
|
7
7
|
exports.installSkills = installSkills;
|
|
8
|
-
exports.
|
|
8
|
+
exports.fetchAiHelperContent = fetchAiHelperContent;
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
11
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
@@ -19,53 +19,41 @@ const EXAMPLES_OWNER = 'SolidActions';
|
|
|
19
19
|
const EXAMPLES_REPO = 'solidactions-examples';
|
|
20
20
|
const SKILLS_PATH_PREFIX = 'skills';
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* Returns absolute paths to the target skills/ subdirectories.
|
|
22
|
+
* Resolve the skills directory for an AI helper target.
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
24
|
+
* - `CLAUDE.md` → `<cwd>/.claude/skills/` (Claude Code convention)
|
|
25
|
+
* - `AGENTS.md` → `<cwd>/.agents/skills/` (Codex auto-discovers this path;
|
|
26
|
+
* Cursor/Gemini read via AGENTS.md pointers)
|
|
28
27
|
*
|
|
29
|
-
*
|
|
30
|
-
* - If `.claude/` exists in cwd → include `.claude/skills/`
|
|
31
|
-
* - If neither exists → return empty (caller should prompt)
|
|
28
|
+
* The directory does not need to exist — the caller creates it.
|
|
32
29
|
*/
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
targets.push(path_1.default.join(cwd, '.claude', 'skills'));
|
|
30
|
+
function skillTargetDir(targetFile, cwd = process.cwd()) {
|
|
31
|
+
if (targetFile === 'CLAUDE.md') {
|
|
32
|
+
return path_1.default.join(cwd, '.claude', 'skills');
|
|
37
33
|
}
|
|
38
|
-
return
|
|
34
|
+
return path_1.default.join(cwd, '.agents', 'skills');
|
|
39
35
|
}
|
|
40
36
|
/**
|
|
41
37
|
* Fetch all SolidActions skill files from the examples repo and write
|
|
42
|
-
* them into
|
|
38
|
+
* them into the target directory. Overwrites existing files (skills
|
|
43
39
|
* are versioned upstream).
|
|
44
40
|
*/
|
|
45
|
-
async function installSkills(
|
|
41
|
+
async function installSkills(targetDir) {
|
|
46
42
|
const written = [];
|
|
47
|
-
|
|
48
|
-
fs_extra_1.default.ensureDirSync(dir);
|
|
49
|
-
}
|
|
43
|
+
fs_extra_1.default.ensureDirSync(targetDir);
|
|
50
44
|
for (const skillName of SKILL_NAMES) {
|
|
51
45
|
const remotePath = `${SKILLS_PATH_PREFIX}/${skillName}.md`;
|
|
52
46
|
const content = await (0, github_1.fetchRawFile)(EXAMPLES_OWNER, EXAMPLES_REPO, remotePath);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
written.push(filePath);
|
|
57
|
-
}
|
|
47
|
+
const filePath = path_1.default.join(targetDir, `${skillName}.md`);
|
|
48
|
+
fs_1.default.writeFileSync(filePath, content, 'utf8');
|
|
49
|
+
written.push(filePath);
|
|
58
50
|
}
|
|
59
51
|
return { written };
|
|
60
52
|
}
|
|
61
53
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* - skillsInstalled = true → fetches CLAUDE-skills-pointer.md (slim)
|
|
66
|
-
* - skillsInstalled = false → fetches CLAUDE.md (full, legacy)
|
|
54
|
+
* Fetch the slim AI-helper content for the target file from the examples
|
|
55
|
+
* repo. Single source per target — no legacy fallback.
|
|
67
56
|
*/
|
|
68
|
-
async function
|
|
69
|
-
|
|
70
|
-
return (0, github_1.fetchRawFile)(EXAMPLES_OWNER, EXAMPLES_REPO, file);
|
|
57
|
+
async function fetchAiHelperContent(targetFile) {
|
|
58
|
+
return (0, github_1.fetchRawFile)(EXAMPLES_OWNER, EXAMPLES_REPO, targetFile);
|
|
71
59
|
}
|