@ngocsangairvds/vsaf 5.6.2 → 5.6.3

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 CHANGED
@@ -175,7 +175,7 @@ Starts a Model Context Protocol (MCP) server that exposes VSAF workflows and ski
175
175
  ### `vsaf install`
176
176
 
177
177
  ```bash
178
- vsaf install sdlc # Deploy 42 skills to .claude/skills/ (setup is install-time only)
178
+ vsaf install sdlc # Deploy skills/workflows to .vsaf/; pick IDEs (claude/cursor/codex/antigravity) to add command proxies
179
179
  ```
180
180
 
181
181
  ### `vsaf skill`
@@ -789,7 +789,7 @@ Strict dependency direction: **web → (HTTP) → cli → core**. Published as a
789
789
  | AI adapter | Shell out to `claude` CLI | No SDK dependency, simple to test |
790
790
  | Schema validation | AJV | Industry standard JSON Schema |
791
791
  | MCP integration | Stdio-based MCP server | Native Claude Code protocol, zero network config |
792
- | Skill distribution | `vsaf install` → `.claude/skills/` | Project-local install, available to Claude Code |
792
+ | Skill distribution | `vsaf install` → `.vsaf/skills` (canonical) + per-IDE command proxies | Skills stay in `.vsaf/`; selected IDEs get thin command/skill proxies (`.claude/commands`, `.agents/skills`, …) that drive runs via the vsaf MCP |
793
793
 
794
794
  ### Tech Stack
795
795
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngocsangairvds/vsaf",
3
- "version": "5.6.2",
3
+ "version": "5.6.3",
4
4
  "description": "logging step",
5
5
  "main": "packages/core/dist/index.js",
6
6
  "types": "packages/core/dist/index.d.ts",
@@ -33,6 +33,7 @@
33
33
  "postinstall": "node scripts/postinstall.js",
34
34
  "prepack": "node -e \"require('fs').copyFileSync('package.json','package.json.bak');const f='package.json',j=JSON.parse(require('fs').readFileSync(f));delete j.workspaces;require('fs').writeFileSync(f,JSON.stringify(j,null,2)+'\\n')\"",
35
35
  "postpack": "node -e \"require('fs').renameSync('package.json.bak','package.json')\"",
36
+ "pretest": "npm run build -w packages/core",
36
37
  "test": "bun test --timeout 60000 tests",
37
38
  "test:watch": "bun test --timeout 60000 --watch tests",
38
39
  "lint": "tsc --noEmit",
@@ -1 +1 @@
1
- {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/adapters/claude.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAwD,MAAM,cAAc,CAAC;AAI1G,eAAO,MAAM,aAAa,EAAE,eA0B3B,CAAC"}
1
+ {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/adapters/claude.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,eAAe,EAAwD,MAAM,cAAc,CAAC;AAI1G,eAAO,MAAM,aAAa,EAAE,eAqE3B,CAAC"}
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
2
  // packages/cli/src/adapters/claude.ts
3
- // Claude Code adapter. Writes only MCP/instruction references; skill content
4
- // stays canonical under .vsaf/skills.
3
+ // Claude Code adapter. Writes slash-command proxies (.claude/commands/*.md) that
4
+ // drive runs via the vsaf MCP, plus MCP config and a CLAUDE.md instruction marker.
5
+ // Skill CONTENT stays canonical under .vsaf/skills — the commands are thin proxies.
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
5
9
  Object.defineProperty(exports, "__esModule", { value: true });
6
10
  exports.claudeAdapter = void 0;
7
11
  const fs_1 = require("fs");
8
12
  const path_1 = require("path");
13
+ const js_yaml_1 = __importDefault(require("js-yaml"));
9
14
  const adapter_js_1 = require("./adapter.js");
10
15
  const install_js_1 = require("../commands/install.js");
11
16
  const shared_js_1 = require("./shared.js");
@@ -20,9 +25,50 @@ exports.claudeAdapter = {
20
25
  },
21
26
  install(ctx) {
22
27
  const result = (0, adapter_js_1.emptyResult)('claude');
28
+ const commandsDir = (0, path_1.join)(ctx.projectPath, '.claude', 'commands');
29
+ (0, fs_1.mkdirSync)(commandsDir, { recursive: true });
30
+ // 1a. Workflow proxies → /<wfName> slash commands. Each drives the run through
31
+ // the vsaf MCP engine; node content is always read from canonical .vsaf/.
32
+ for (const [filename, yamlContent] of Object.entries(ctx.packInfo.workflows ?? {})) {
33
+ const wfName = (0, path_1.basename)(filename, '.yaml');
34
+ let desc = `Run the VSAF ${wfName} workflow`;
35
+ try {
36
+ const parsed = js_yaml_1.default.load(yamlContent);
37
+ if (parsed?.description)
38
+ desc = parsed.description.trim().split('\n')[0];
39
+ }
40
+ catch { /* use fallback description */ }
41
+ const body = `---\ndescription: ${desc}\n---\n\n`
42
+ + `# /${wfName} — VSAF Workflow\n\n`
43
+ + `Execute the VSAF workflow \`${ctx.packName}/${wfName}\` (definition: \`.vsaf/workflows/${ctx.packName}/${wfName}.yaml\`).\n\n`
44
+ + `1. Call the \`vsaf\` MCP tool \`vsaf_start\` with \`workflow: "${ctx.packName}/${wfName}"\`, \`args: <user arguments>\`, \`projectPath: <project root>\`.\n`
45
+ + `2. For each returned AI node, read \`.vsaf/commands/<node.command>.md\` and \`.vsaf/skills/<node.command>/SKILL.md\` (single source of truth) and execute the node.\n`
46
+ + `3. Report results with \`vsaf_next\` and repeat until \`done: true\`. Check progress with \`vsaf_status\`; continue interrupted runs with \`vsaf_resume\`.\n`;
47
+ const target = (0, path_1.join)(commandsDir, `${wfName}.md`);
48
+ if (!(0, fs_1.existsSync)(target) || ctx.options.force)
49
+ (0, fs_1.writeFileSync)(target, body, 'utf-8');
50
+ result.commands.push(wfName);
51
+ }
52
+ // 1b. Top-level skill proxies → /<pack>-<skill> (e.g. /sdlc-onboard-docs).
53
+ // Step-level skills (a/b/c, contain "/") and bundled helpers stay engine-internal:
54
+ // the agent reaches them through workflow nodes, never as IDE entry points.
55
+ for (const skill of ctx.packInfo.skillNames.filter(s => !shared_js_1.SKIP_SKILLS.includes(s) && !/[\\/]/.test(s))) {
56
+ const name = `${ctx.packName}-${skill}`;
57
+ const body = `---\ndescription: Run VSAF skill ${name}\n---\n\n`
58
+ + `# /${name}\n\n`
59
+ + `Read \`.vsaf/commands/${name}.md\` if it exists, then \`.vsaf/skills/${name}/SKILL.md\` and any referenced files before acting. `
60
+ + `Treat \`.vsaf/skills/${name}\` as the single source of truth; do not copy it into \`.claude/skills/\`.\n`;
61
+ const target = (0, path_1.join)(commandsDir, `${name}.md`);
62
+ if (!(0, fs_1.existsSync)(target) || ctx.options.force)
63
+ (0, fs_1.writeFileSync)(target, body, 'utf-8');
64
+ result.commands.push(name);
65
+ }
66
+ // 2. MCP (project-level .mcp.json).
23
67
  (0, install_js_1.ensureMcpConfig)(ctx.projectPath);
24
68
  result.mcp = { path: (0, path_1.join)(ctx.projectPath, '.mcp.json'), servers: ['vsaf', 'gitnexus'] };
25
- (0, shared_js_1.writeMarkerFile)((0, path_1.join)(ctx.projectPath, 'CLAUDE.md'), `pack=${ctx.packName} ide=claude`, `## VSAF \`${ctx.packName}\` (Claude)\n\nCanonical skills live in \`.vsaf/skills/\`; do not copy them into \`.claude/skills/\`. Commands live in \`.vsaf/commands/\` and workflows in \`.vsaf/workflows/\`. When executing a VSAF command, read the referenced \`.vsaf/commands/<name>.md\` and \`.vsaf/skills/<name>/SKILL.md\` files.\n\nArtifact boundary: generated knowledge/docs/artifacts stay at project root beside \`.vsaf\` or inside root \`.vsaf/\`; never auto-write them inside service/subproject folders unless explicitly authorized.`);
69
+ // 3. Instruction marker block in CLAUDE.md.
70
+ (0, shared_js_1.writeMarkerFile)((0, path_1.join)(ctx.projectPath, 'CLAUDE.md'), `pack=${ctx.packName} ide=claude`, `## VSAF \`${ctx.packName}\` (Claude)\n\nSlash commands in \`.claude/commands/\` (e.g. \`/${ctx.packName}-onboard-docs\`, workflow \`/master-sdlc-headless\`) proxy to the canonical \`.vsaf/\` flows and drive runs via the \`vsaf\` MCP tools (vsaf_start/vsaf_next/vsaf_status/vsaf_resume). Canonical skills live in \`.vsaf/skills/\`; do not copy them into \`.claude/skills/\`. When executing a node, read \`.vsaf/commands/<name>.md\` then \`.vsaf/skills/<name>/SKILL.md\`.\n\nArtifact boundary: generated knowledge/docs/artifacts stay at project root beside \`.vsaf\` or inside root \`.vsaf/\`; never auto-write them inside service/subproject folders unless explicitly authorized.`);
71
+ // 4. Binaries.
26
72
  if (!ctx.options._skipGraphify && !(0, shared_js_1.installGraphifyPlatform)('claude')) {
27
73
  result.warnings.push('graphify claude install failed — run: graphify install');
28
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/adapters/claude.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,6EAA6E;AAC7E,sCAAsC;;;AAEtC,2BAAgC;AAChC,+BAA4B;AAC5B,6CAA0G;AAC1G,uDAAyD;AACzD,2CAAuE;AAE1D,QAAA,aAAa,GAAoB;IAC5C,EAAE,EAAE,QAAQ;IACZ,gBAAgB,EAAE,QAAQ;IAE1B,MAAM,CAAC,WAAmB;QACxB,OAAO,IAAA,eAAU,EAAC,IAAA,WAAI,EAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,gBAAgB,CAAC,IAAY;QAC3B,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,CAAC;IAED,OAAO,CAAC,GAAmB;QACzB,MAAM,MAAM,GAAG,IAAA,wBAAW,EAAC,QAAQ,CAAC,CAAC;QACrC,IAAA,4BAAe,EAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,IAAA,WAAI,EAAC,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;QACzF,IAAA,2BAAe,EACb,IAAA,WAAI,EAAC,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,EAClC,QAAQ,GAAG,CAAC,QAAQ,aAAa,EACjC,aAAa,GAAG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C;QACjF,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/adapters/codex.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAwD,MAAM,cAAc,CAAC;AAW1G,eAAO,MAAM,YAAY,EAAE,eAyC1B,CAAC"}
1
+ {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/adapters/codex.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,eAAe,EAAwD,MAAM,cAAc,CAAC;AAW1G,eAAO,MAAM,YAAY,EAAE,eAgF1B,CAAC"}
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
  // packages/cli/src/adapters/codex.ts
3
- // Codex adapter. Writes MCP + AGENTS.md references only; VSAF skill content stays
4
- // canonical under .vsaf/skills.
3
+ // Codex adapter. Writes Codex skill proxies (.agents/skills/<name>/SKILL.md
4
+ // invoked via the `$` skill mention), MCP into .codex/config.toml, and an AGENTS.md
5
+ // marker. Skill CONTENT stays canonical under .vsaf/skills; the proxies are thin.
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
5
9
  Object.defineProperty(exports, "__esModule", { value: true });
6
10
  exports.codexAdapter = void 0;
7
11
  const fs_1 = require("fs");
8
12
  const path_1 = require("path");
9
13
  const os_1 = require("os");
14
+ const js_yaml_1 = __importDefault(require("js-yaml"));
10
15
  const adapter_js_1 = require("./adapter.js");
11
16
  const shared_js_1 = require("./shared.js");
12
17
  const toml_mcp_js_1 = require("./toml-mcp.js");
@@ -27,7 +32,50 @@ exports.codexAdapter = {
27
32
  },
28
33
  install(ctx) {
29
34
  const result = (0, adapter_js_1.emptyResult)('codex');
30
- // 1. MCPproject .codex/config.toml (surgical merge, preserves trust).
35
+ // 1. Codex skill proxies → .agents/skills/<name>/SKILL.md (invoke with `$<name>`).
36
+ // Codex discovers skills from `.agents/skills` at repo/cwd; these are thin
37
+ // proxies that drive runs via the vsaf MCP. Content stays canonical in .vsaf/.
38
+ const skillsRoot = (0, path_1.join)(ctx.projectPath, '.agents', 'skills');
39
+ for (const [filename, yamlContent] of Object.entries(ctx.packInfo.workflows ?? {})) {
40
+ const wfName = (0, path_1.basename)(filename, '.yaml');
41
+ let desc = `Run the VSAF ${ctx.packName}/${wfName} workflow`;
42
+ try {
43
+ const parsed = js_yaml_1.default.load(yamlContent);
44
+ if (parsed?.description)
45
+ desc = parsed.description.trim().split('\n')[0];
46
+ }
47
+ catch { /* use fallback description */ }
48
+ const body = `---\nname: ${wfName}\ndescription: ${desc}\n---\n\n`
49
+ + `# ${wfName} — VSAF Workflow\n\n`
50
+ + `Execute the VSAF workflow \`${ctx.packName}/${wfName}\` (definition: \`.vsaf/workflows/${ctx.packName}/${wfName}.yaml\`).\n\n`
51
+ + `1. Call the \`vsaf\` MCP tool \`vsaf_start\` with \`workflow: "${ctx.packName}/${wfName}"\`, \`args: <user arguments>\`, \`projectPath: <project root>\`.\n`
52
+ + `2. For each returned AI node, read \`.vsaf/commands/<node.command>.md\` and \`.vsaf/skills/<node.command>/SKILL.md\` (single source of truth) and execute the node.\n`
53
+ + `3. Report results with \`vsaf_next\` and repeat until \`done: true\`. Check progress with \`vsaf_status\`; continue interrupted runs with \`vsaf_resume\`.\n`;
54
+ const dir = (0, path_1.join)(skillsRoot, wfName);
55
+ const target = (0, path_1.join)(dir, 'SKILL.md');
56
+ if (!(0, fs_1.existsSync)(target) || ctx.options.force) {
57
+ (0, fs_1.mkdirSync)(dir, { recursive: true });
58
+ (0, fs_1.writeFileSync)(target, body, 'utf-8');
59
+ }
60
+ result.commands.push(wfName);
61
+ }
62
+ // Top-level skill proxies → .agents/skills/<pack>-<skill>/SKILL.md (e.g. sdlc-onboard-docs).
63
+ // Step-level (contain "/") and bundled skills stay engine-internal.
64
+ for (const skill of ctx.packInfo.skillNames.filter(s => !shared_js_1.SKIP_SKILLS.includes(s) && !/[\\/]/.test(s))) {
65
+ const name = `${ctx.packName}-${skill}`;
66
+ const body = `---\nname: ${name}\ndescription: Run VSAF skill ${name}\n---\n\n`
67
+ + `# ${name}\n\n`
68
+ + `Read \`.vsaf/commands/${name}.md\` if it exists, then \`.vsaf/skills/${name}/SKILL.md\` and any referenced files before acting. `
69
+ + `Treat \`.vsaf/skills/${name}\` as the single source of truth; do not copy it here.\n`;
70
+ const dir = (0, path_1.join)(skillsRoot, name);
71
+ const target = (0, path_1.join)(dir, 'SKILL.md');
72
+ if (!(0, fs_1.existsSync)(target) || ctx.options.force) {
73
+ (0, fs_1.mkdirSync)(dir, { recursive: true });
74
+ (0, fs_1.writeFileSync)(target, body, 'utf-8');
75
+ }
76
+ result.commands.push(name);
77
+ }
78
+ // 2. MCP → project .codex/config.toml (surgical merge, preserves trust).
31
79
  const tomlPath = (0, path_1.join)(ctx.projectPath, '.codex', 'config.toml');
32
80
  try {
33
81
  result.mcp = (0, toml_mcp_js_1.writeTomlMcp)(tomlPath, {
@@ -39,9 +87,9 @@ exports.codexAdapter = {
39
87
  catch (err) {
40
88
  result.warnings.push(`Không cập nhật được .codex/config.toml: ${err.message}`);
41
89
  }
42
- // 2. Instruction marker block in AGENTS.md.
43
- (0, shared_js_1.writeMarkerFile)((0, path_1.join)(ctx.projectPath, 'AGENTS.md'), `pack=${ctx.packName} ide=codex`, `## VSAF \`${ctx.packName}\` (Codex)\n\nCanonical skills: \`.vsaf/skills/\` · Commands: \`.vsaf/commands/\` · Workflows: \`.vsaf/workflows/\` · MCP: \`.codex/config.toml\` [mcp_servers] (vsaf + gitnexus).\n\nWhen a workflow/node references a skill, read \`.vsaf/commands/<name>.md\` first, then \`.vsaf/skills/<name>/SKILL.md\` and any files it includes. Do not install or copy skill directories into \`.agents/skills/\`.\n\nArtifact boundary: generated knowledge/docs/artifacts stay at project root beside \`.vsaf\` or inside root \`.vsaf/\`; never auto-write them inside service/subproject folders unless explicitly authorized.`);
44
- // 3. Binaries.
90
+ // 3. Instruction marker block in AGENTS.md.
91
+ (0, shared_js_1.writeMarkerFile)((0, path_1.join)(ctx.projectPath, 'AGENTS.md'), `pack=${ctx.packName} ide=codex`, `## VSAF \`${ctx.packName}\` (Codex)\n\nSkill proxies in \`.agents/skills/\` (invoke with \`$<name>\`, e.g. \`$${ctx.packName}-onboard-docs\`, workflow \`$master-sdlc-headless\`) drive runs via the \`vsaf\` MCP (\`.codex/config.toml\` [mcp_servers], vsaf + gitnexus). Canonical skills: \`.vsaf/skills/\` · Commands: \`.vsaf/commands/\` · Workflows: \`.vsaf/workflows/\`.\n\nWhen a node references a skill, read \`.vsaf/commands/<name>.md\` first, then \`.vsaf/skills/<name>/SKILL.md\` and any files it includes. Do not copy canonical skill content into \`.agents/skills/\` — the proxies are references only.\n\nArtifact boundary: generated knowledge/docs/artifacts stay at project root beside \`.vsaf\` or inside root \`.vsaf/\`; never auto-write them inside service/subproject folders unless explicitly authorized.`);
92
+ // 4. Binaries.
45
93
  if (!ctx.options._skipGraphify && !(0, shared_js_1.installGraphifyPlatform)('codex')) {
46
94
  result.warnings.push('graphify codex install failed — run: graphify install --platform codex');
47
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/adapters/codex.ts"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,kFAAkF;AAClF,gCAAgC;;;AAEhC,2BAAgC;AAChC,+BAA4B;AAC5B,2BAA6B;AAC7B,6CAA0G;AAC1G,2CAA6G;AAC7G,+CAA6C;AAE7C,sFAAsF;AACtF,SAAS,WAAW,CAAC,KAA8B;IACjD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;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