Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions packages/void/src/cli/skills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from 'node:fs';
import { log } from '@clack/prompts';
import { join, relative } from 'pathe';
import { detectAgents, getPackageDir, type AgentConfig } from './agents.ts';
import { getPackageDir, type AgentConfig } from './agents.ts';

type SkillInfo = {
dirName: string;
Expand Down Expand Up @@ -82,31 +82,6 @@ function linkSkills(
return linked;
}

/**
* Link skills for all detected agents. Returns total number of newly linked skills.
* Used by `void init` (interactive flow and `--agents` flag).
*/
export function linkSkillsForAgents(root: string): number {
const packageDir = getPackageDir();
const skillsDir = join(packageDir, 'skills');
const skills = parseSkills(skillsDir);
if (skills.length === 0) {
return 0;
}

const detected = detectAgents(root);
if (detected.length === 0) {
return 0;
}

let totalLinked = 0;
for (const agent of detected) {
log.info(`${agent.displayName} → ${agent.skillsDir}`);
totalLinked += linkSkills(root, skillsDir, skills, agent.skillsDir);
}
return totalLinked;
}

export function linkSkillsForSpecificAgents(root: string, agents: Array<AgentConfig>): number {
const packageDir = getPackageDir();
const skillsDir = join(packageDir, 'skills');
Expand Down