fraim-framework 2.0.120 → 2.0.122

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.
@@ -3,7 +3,7 @@ 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.resolveManagedCommand = exports.getPortableNpxCommand = void 0;
6
+ exports.resolveManagedCommand = exports.getSystemCommandPath = exports.getPortableNpxCommand = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const project_fraim_paths_1 = require("../../core/utils/project-fraim-paths");
@@ -36,10 +36,43 @@ const getPortableNpxCommand = () => {
36
36
  return null;
37
37
  };
38
38
  exports.getPortableNpxCommand = getPortableNpxCommand;
39
+ const getPathEntries = () => {
40
+ const rawPath = process.env.PATH || '';
41
+ return rawPath
42
+ .split(path_1.default.delimiter)
43
+ .map((entry) => entry.trim())
44
+ .filter(Boolean);
45
+ };
46
+ const getSystemCommandCandidates = (command) => {
47
+ if (!command || path_1.default.isAbsolute(command)) {
48
+ return command ? [command] : [];
49
+ }
50
+ const commandNames = process.platform === 'win32'
51
+ ? command.includes('.')
52
+ ? [command]
53
+ : [command, `${command}.cmd`, `${command}.exe`, `${command}.bat`, `${command}.com`]
54
+ : [command];
55
+ return getPathEntries().flatMap((entry) => commandNames.map((name) => path_1.default.join(entry, name)));
56
+ };
57
+ const getSystemCommandPath = (command) => {
58
+ for (const candidate of getSystemCommandCandidates(command)) {
59
+ try {
60
+ const stats = fs_1.default.statSync(candidate);
61
+ if (stats.isFile()) {
62
+ return candidate;
63
+ }
64
+ }
65
+ catch {
66
+ // Ignore missing or inaccessible PATH entries and keep scanning.
67
+ }
68
+ }
69
+ return null;
70
+ };
71
+ exports.getSystemCommandPath = getSystemCommandPath;
39
72
  const resolveManagedCommand = (command) => {
40
73
  if (command !== 'npx') {
41
74
  return command;
42
75
  }
43
- return (0, exports.getPortableNpxCommand)() || command;
76
+ return (0, exports.getPortableNpxCommand)() || (0, exports.getSystemCommandPath)(command) || command;
44
77
  };
45
78
  exports.resolveManagedCommand = resolveManagedCommand;
@@ -21,8 +21,9 @@ function describeConfiguredInvocationSurfaces(installedIDEs) {
21
21
  return installedIDEs.map((ide) => (0, ide_invocation_surfaces_1.describeInvocationSurface)(ide.name, ide.invocationProfile));
22
22
  }
23
23
  /**
24
- * Install the FRAIM slash command for Claude Code at the user level.
25
- * Writes to ~/.claude/commands/fraim.md and does not overwrite existing files.
24
+ * Install Claude FRAIM discovery artifacts at the user level.
25
+ * Writes a skill to ~/.claude/skills/fraim/SKILL.md and a compatibility command
26
+ * to ~/.claude/commands/fraim.md. Existing user files are preserved.
26
27
  */
27
28
  async function installSlashCommands(homeDir) {
28
29
  const home = homeDir || os_1.default.homedir();
@@ -30,7 +31,8 @@ async function installSlashCommands(homeDir) {
30
31
  if (!fs_1.default.existsSync(claudeDir)) {
31
32
  return;
32
33
  }
33
- installFileIfMissing(path_1.default.join(claudeDir, 'commands', 'fraim.md'), (0, ide_invocation_surfaces_1.buildClaudeSlashCommandContent)(), 'Claude slash command (~/.claude/commands/fraim.md)');
34
+ installFileIfMissing(path_1.default.join(claudeDir, 'skills', 'fraim', 'SKILL.md'), (0, ide_invocation_surfaces_1.buildClaudeSkillContent)(), 'Claude FRAIM skill (~/.claude/skills/fraim/SKILL.md)');
35
+ installFileIfMissing(path_1.default.join(claudeDir, 'commands', 'fraim.md'), (0, ide_invocation_surfaces_1.buildClaudeCommandShimContent)(), 'Claude compatibility command (~/.claude/commands/fraim.md)');
34
36
  }
35
37
  /**
36
38
  * Install FRAIM invocation artifacts for non-Claude IDEs.
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FRAIM_INVOCATION_BODY = exports.CURSOR_MDC_FRONTMATTER = exports.FRAIM_LAUNCH_PHRASE = void 0;
4
+ exports.buildClaudeSkillContent = buildClaudeSkillContent;
5
+ exports.buildClaudeCommandShimContent = buildClaudeCommandShimContent;
4
6
  exports.buildClaudeSlashCommandContent = buildClaudeSlashCommandContent;
5
7
  exports.buildCursorMentionRuleContent = buildCursorMentionRuleContent;
6
8
  exports.buildCodexSkillContent = buildCodexSkillContent;
@@ -12,7 +14,7 @@ exports.CURSOR_MDC_FRONTMATTER = `---
12
14
  description: FRAIM discovery and execution contract
13
15
  alwaysApply: true
14
16
  ---`;
15
- exports.FRAIM_INVOCATION_BODY = `Follow this process:
17
+ exports.FRAIM_INVOCATION_BODY = `Follow this process:
16
18
 
17
19
  1. **If the user did not specify a FRAIM job or topic**:
18
20
  Call \`list_fraim_jobs()\` to discover available jobs. Present the results grouped by the categories returned by the server. For each group, list 3-5 of the most relevant jobs with a one-line description.
@@ -25,11 +27,23 @@ exports.FRAIM_INVOCATION_BODY = `Follow this process:
25
27
  - For skills, use the content returned by \`get_fraim_file(...)\`.
26
28
 
27
29
  4. **Execute**:
28
- - For jobs, follow the phased instructions and use \`seekMentoring\` when the job requires phase transitions.
29
- - For skills, apply the skill steps directly to the user's current context.
30
+ - For jobs, follow the phased instructions and use \`seekMentoring\` when the job requires phase transitions.
31
+ - For skills, apply the skill steps directly to the user's current context.
30
32
  `;
33
+ function buildClaudeSkillContent() {
34
+ return `# FRAIM
35
+
36
+ ${exports.FRAIM_INVOCATION_BODY}`;
37
+ }
38
+ function buildClaudeCommandShimContent() {
39
+ return `# FRAIM Compatibility Command
40
+
41
+ Use the FRAIM skill when Claude exposes skills directly. This compatibility command keeps \`/fraim\` working on surfaces that still discover legacy command files.
42
+
43
+ ${exports.FRAIM_INVOCATION_BODY}`;
44
+ }
31
45
  function buildClaudeSlashCommandContent() {
32
- return exports.FRAIM_INVOCATION_BODY;
46
+ return buildClaudeCommandShimContent();
33
47
  }
34
48
  function buildCursorMentionRuleContent() {
35
49
  return `${exports.CURSOR_MDC_FRONTMATTER}
@@ -12,6 +12,7 @@ const START_MARKER = '<!-- FRAIM_AGENT_ADAPTER_START -->';
12
12
  const END_MARKER = '<!-- FRAIM_AGENT_ADAPTER_END -->';
13
13
  const CURSOR_RULE_PATH = path_1.default.join('.cursor', 'rules', 'fraim.mdc');
14
14
  const CLAUDE_FRAIM_COMMAND_PATH = path_1.default.join('.claude', 'commands', 'fraim.md');
15
+ const CLAUDE_FRAIM_SKILL_PATH = path_1.default.join('.claude', 'skills', 'fraim', 'SKILL.md');
15
16
  const VSCODE_FRAIM_PROMPT_PATH = path_1.default.join('.github', 'prompts', 'fraim.prompt.md');
16
17
  const CODEX_FRAIM_SKILL_PATH = path_1.default.join('.codex', 'skills', 'fraim', 'SKILL.md');
17
18
  const WINDSURF_FRAIM_COMMAND_PATH = path_1.default.join('.windsurf', 'commands', 'fraim.md');
@@ -108,7 +109,8 @@ ${ide_invocation_surfaces_1.FRAIM_INVOCATION_BODY}`;
108
109
  { path: CURSOR_RULE_PATH, content: cursorManagedBody },
109
110
  { path: VSCODE_FRAIM_PROMPT_PATH, content: vscodePrompt },
110
111
  { path: path_1.default.join(project_fraim_paths_1.WORKSPACE_FRAIM_DIRNAME, 'README.md'), content: fraimReadme },
111
- { path: CLAUDE_FRAIM_COMMAND_PATH, content: (0, ide_invocation_surfaces_1.buildClaudeSlashCommandContent)() },
112
+ { path: CLAUDE_FRAIM_SKILL_PATH, content: (0, ide_invocation_surfaces_1.buildClaudeSkillContent)() },
113
+ { path: CLAUDE_FRAIM_COMMAND_PATH, content: (0, ide_invocation_surfaces_1.buildClaudeCommandShimContent)() },
112
114
  { path: CODEX_FRAIM_SKILL_PATH, content: (0, ide_invocation_surfaces_1.buildCodexSkillContent)() },
113
115
  { path: WINDSURF_FRAIM_COMMAND_PATH, content: (0, ide_invocation_surfaces_1.buildWindsurfCommandContent)() },
114
116
  { path: KIRO_FRAIM_COMMAND_PATH, content: (0, ide_invocation_surfaces_1.buildKiroCommandContent)() }
@@ -127,6 +129,7 @@ function ensureAgentAdapterFiles(projectRoot) {
127
129
  ? mergeCursorRule(existing, file.content)
128
130
  : file.path.endsWith('README.md')
129
131
  || file.path === VSCODE_FRAIM_PROMPT_PATH
132
+ || file.path === CLAUDE_FRAIM_SKILL_PATH
130
133
  || file.path === CLAUDE_FRAIM_COMMAND_PATH
131
134
  || file.path === CODEX_FRAIM_SKILL_PATH
132
135
  || file.path === WINDSURF_FRAIM_COMMAND_PATH
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-framework",
3
- "version": "2.0.120",
3
+ "version": "2.0.122",
4
4
  "description": "FRAIM: AI Workforce Infrastructure — the organizational capability that turns AI agents into an accountable workforce, their operators into capable AI managers, and executives into leaders with clear optics on AI proficiency.",
5
5
  "main": "index.js",
6
6
  "bin": {