π The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
[fix] Skills copier path resolution - fixed in both bin/init and src/cli locations
rUv16ebe473573b
diff --git a/bin/init/skills-copier.js b/bin/init/skills-copier.jsindex 758664b9ad..979967ff0e 100644--- a/bin/init/skills-copier.js+++ b/bin/init/skills-copier.js@@ -10,37 +10,54 @@ const __dirname = dirname(__filename);* Copy all skill files from the installed package to project directory*/export async function copySkillFiles(targetDir, options = {}) {+ console.log(' π copySkillFiles function called');+ console.log(` π Target directory: ${targetDir}`);+ console.log(` βοΈ Options:`, options);+ console.log(` π __dirname: ${__dirname}`);+const { force = false, dryRun = false } = options;// Path to skill files - try multiple locations- const packageSkillsDir = join(__dirname, '../../../../.claude/skills'); // From npm package- const localSkillsDir = '/workspaces/claude-code-flow/.claude/skills'; // Local development- const cwdSkillsDir = join(process.cwd(), '.claude/skills'); // Current working directory+ const packageSkillsDir = join(__dirname, '../../.claude/skills'); // From npm package (bin/init/ -> root)+ const localSkillsDir = join(__dirname, '../../../.claude/skills'); // Local development (for testing)+ const globalNpmSkillsDir = '/usr/local/lib/node_modules/claude-flow/.claude/skills'; // Global npm installlet sourceSkillsDir;- // Try local development first, then package, then cwd- try {- await fs.access(localSkillsDir);- sourceSkillsDir = localSkillsDir;- console.log(' π Using local development skill files');- } catch {+ // Try package location first (most common for npm installs), then local dev, then global npm+ const locationsToTry = [+ { path: packageSkillsDir, label: 'packaged skill files' },+ { path: localSkillsDir, label: 'local development skill files' },+ { path: globalNpmSkillsDir, label: 'global npm skill files' }+ ];++ for (const location of locationsToTry) {try {- await fs.access(packageSkillsDir);- sourceSkillsDir = packageSkillsDir;- console.log(' π Using packaged skill files');- } catch {- try {- await fs.access(cwdSkillsDir);- sourceSkillsDir = cwdSkillsDir;- console.log(' π Using current directory skill files');- } catch {- console.log(' β οΈ No skill files found in any location');- return { success: false, error: 'Skill files not found' };+ console.log(` π Checking: ${location.path}`);+ await fs.access(location.path);+ // Verify it's actually a directory with skills+ const items = await fs.readdir(location.path);+ console.log(` π Found ${items.length} items at ${location.path}`);+ if (items.length > 0) {+ sourceSkillsDir = location.path;+ console.log(` π Using ${location.label}`);+ console.log(` π Path: ${location.path}`);+ break;}+ } catch (err) {+ console.log(` β Failed to access ${location.path}: ${err.message}`);+ // Try next location+ continue;}}+ if (!sourceSkillsDir) {+ console.log(' β οΈ No skill files found in any location');+ console.log(' π Searched locations:');+ locationsToTry.forEach(loc => console.log(` - ${loc.path}`));+ return { success: false, error: 'Skill files not found' };+ }+const targetSkillsDir = join(targetDir, '.claude/skills');console.log('π Copying skill system files...');diff --git a/src/cli/simple-commands/init/skills-copier.js b/src/cli/simple-commands/init/skills-copier.jsindex a0b936b8e9..e7730594c4 100644--- a/src/cli/simple-commands/init/skills-copier.js+++ b/src/cli/simple-commands/init/skills-copier.js@@ -10,37 +10,55 @@ const __dirname = dirname(__filename);* Copy all skill files from the installed package to project directory*/export async function copySkillFiles(targetDir, options = {}) {+ console.log(' π copySkillFiles function called');+ console.log(` π Target directory: ${targetDir}`);+ console.log(` βοΈ Options:`, options);+ console.log(` π __dirname: ${__dirname}`);+const { force = false, dryRun = false } = options;// Path to skill files - try multiple locations- const packageSkillsDir = join(__dirname, '../../../../../.claude/skills'); // From npm package- const localSkillsDir = '/workspaces/claude-code-flow/.claude/skills'; // Local development- const cwdSkillsDir = join(process.cwd(), '.claude/skills'); // Current working directory+ // From npm package: src/cli/simple-commands/init/ -> root = ../../../../+ const packageSkillsDir = join(__dirname, '../../../../.claude/skills');+ const localSkillsDir = join(__dirname, '../../../../../.claude/skills'); // Local development (one more level up)+ const globalNpmSkillsDir = '/usr/local/lib/node_modules/claude-flow/.claude/skills'; // Global npm installlet sourceSkillsDir;- // Try local development first, then package, then cwd- try {- await fs.access(localSkillsDir);- sourceSkillsDir = localSkillsDir;- console.log(' π Using local development skill files');- } catch {+ // Try package location first (most common for npm installs), then local dev, then global npm+ const locationsToTry = [+ { path: packageSkillsDir, label: 'packaged skill files' },+ { path: localSkillsDir, label: 'local development skill files' },+ { path: globalNpmSkillsDir, label: 'global npm skill files' }+ ];++ for (const location of locationsToTry) {try {- await fs.access(packageSkillsDir);- sourceSkillsDir = packageSkillsDir;- console.log(' π Using packaged skill files');- } catch {- try {- await fs.access(cwdSkillsDir);- sourceSkillsDir = cwdSkillsDir;- console.log(' π Using current directory skill files');- } catch {- console.log(' β οΈ No skill files found in any location');- return { success: false, error: 'Skill files not found' };+ console.log(` π Checking: ${location.path}`);+ await fs.access(location.path);+ // Verify it's actually a directory with skills+ const items = await fs.readdir(location.path);+ console.log(` π Found ${items.length} items at ${location.path}`);+ if (items.length > 0) {+ sourceSkillsDir = location.path;+ console.log(` π Using ${location.label}`);+ console.log(` π Path: ${location.path}`);+ break;}+ } catch (err) {+ console.log(` β Failed to access ${location.path}: ${err.message}`);+ // Try next location+ continue;}}+ if (!sourceSkillsDir) {+ console.log(' β οΈ No skill files found in any location');+ console.log(' π Searched locations:');+ locationsToTry.forEach(loc => console.log(` - ${loc.path}`));+ return { success: false, error: 'Skill files not found' };+ }+const targetSkillsDir = join(targetDir, '.claude/skills');console.log('π Copying skill system files...');