Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions packages/agents/src/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export async function installCommand(
const toolMapping = loadToolMapping(overlayYaml);

// Install skills (shared + platform-specific)
const skillsPrefix = `${platformConfig.homeDir}/${platformConfig.skillsDir}`;
const skillsPrefix = `${platformConfig.homeDir}/${platformConfig.skillsDirName}`;
const skillEntries = await installSkills(
contentDir,
paths.skillsDir,
Expand Down Expand Up @@ -420,7 +420,6 @@ async function installSubagents(
const platformConfig = PLATFORMS[platformId];

const dirEntries = await readdir(subagentsSrcDir);
const subagentsDirName = platformConfig.subagentsDir;
const entries: Array<ManifestEntry> = [];

for (const entry of dirEntries) {
Expand All @@ -430,7 +429,7 @@ async function installSubagents(

const srcPath = path.join(subagentsSrcDir, entry);
const destPath = path.join(platformPaths.subagentsDir, entry);
const relativePath = `${subagentsDirName}/${entry}`;
const relativePath = `${platformConfig.subagentsDirName}/${entry}`;

// Resolve include directives at source-tree level. Run before the dry-run gate so missing targets, cycles, and
// out-of-tree references surface even when no files are written. Mirrors the ordering in installPlatformGuidance.
Expand Down Expand Up @@ -652,7 +651,7 @@ async function installScripts(
continue;
}
const destPath = path.join(scriptsDestDir, entry);
const relativePath = `${platformConfig.scriptsDir}/${entry}`;
const relativePath = `${platformConfig.scriptsDirName}/${entry}`;

if (options.dryRun) {
const action = options.link ? 'link' : 'copy';
Expand Down
14 changes: 8 additions & 6 deletions packages/agents/src/lib/__tests__/platform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,20 @@ describe('platform', () => {
const result = resolvePlatformPaths('claude', tempDir);

expect(result.platformHome).toBe(path.join(tempDir, PLATFORMS.claude.homeDir));
expect(result.skillsDir).toBe(path.join(tempDir, PLATFORMS.claude.homeDir, PLATFORMS.claude.skillsDir));
expect(result.subagentsDir).toBe(path.join(tempDir, PLATFORMS.claude.homeDir, PLATFORMS.claude.subagentsDir));
expect(result.scriptsDir).toBe(path.join(tempDir, PLATFORMS.claude.homeDir, PLATFORMS.claude.scriptsDir));
expect(result.skillsDir).toBe(path.join(tempDir, PLATFORMS.claude.homeDir, PLATFORMS.claude.skillsDirName));
expect(result.subagentsDir).toBe(path.join(tempDir, PLATFORMS.claude.homeDir, PLATFORMS.claude.subagentsDirName));
expect(result.scriptsDir).toBe(path.join(tempDir, PLATFORMS.claude.homeDir, PLATFORMS.claude.scriptsDirName));
});

it('should resolve correct paths for rovodev platform', () => {
const result = resolvePlatformPaths('rovodev', tempDir);

expect(result.platformHome).toBe(path.join(tempDir, PLATFORMS.rovodev.homeDir));
expect(result.skillsDir).toBe(path.join(tempDir, PLATFORMS.rovodev.homeDir, PLATFORMS.rovodev.skillsDir));
expect(result.subagentsDir).toBe(path.join(tempDir, PLATFORMS.rovodev.homeDir, PLATFORMS.rovodev.subagentsDir));
expect(result.scriptsDir).toBe(path.join(tempDir, PLATFORMS.rovodev.homeDir, PLATFORMS.rovodev.scriptsDir));
expect(result.skillsDir).toBe(path.join(tempDir, PLATFORMS.rovodev.homeDir, PLATFORMS.rovodev.skillsDirName));
expect(result.subagentsDir).toBe(
path.join(tempDir, PLATFORMS.rovodev.homeDir, PLATFORMS.rovodev.subagentsDirName),
);
expect(result.scriptsDir).toBe(path.join(tempDir, PLATFORMS.rovodev.homeDir, PLATFORMS.rovodev.scriptsDirName));
});

it('should produce absolute paths containing the platform home directory', () => {
Expand Down
18 changes: 9 additions & 9 deletions packages/agents/src/lib/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ export const PLATFORMS: Record<PlatformId, PlatformConfig> = {
claude: {
id: 'claude',
homeDir: '.claude',
skillsDir: 'skills',
subagentsDir: 'agents',
scriptsDir: 'scripts',
skillsDirName: 'skills',
subagentsDirName: 'agents',
scriptsDirName: 'scripts',
frontmatterFile: 'claude.yaml',
},
rovodev: {
id: 'rovodev',
homeDir: '.rovodev',
skillsDir: 'skills',
subagentsDir: 'subagents',
scriptsDir: 'scripts',
skillsDirName: 'skills',
subagentsDirName: 'subagents',
scriptsDirName: 'scripts',
frontmatterFile: 'rovodev.yaml',
},
};
Expand Down Expand Up @@ -57,9 +57,9 @@ export function resolvePlatformPaths(
const platformHome = path.join(home, config.homeDir);
return {
platformHome,
skillsDir: path.join(platformHome, config.skillsDir),
subagentsDir: path.join(platformHome, config.subagentsDir),
scriptsDir: path.join(platformHome, config.scriptsDir),
skillsDir: path.join(platformHome, config.skillsDirName),
subagentsDir: path.join(platformHome, config.subagentsDirName),
scriptsDir: path.join(platformHome, config.scriptsDirName),
};
}

Expand Down
12 changes: 6 additions & 6 deletions packages/agents/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export interface PlatformConfig {
readonly id: PlatformId;
/** Relative path from home to the platform's dot directory (e.g., `.claude`). */
readonly homeDir: string;
/** Relative path from the platform home to the skills directory. */
readonly skillsDir: string;
/** Relative path from the platform home to the subagents directory. */
readonly subagentsDir: string;
/** Relative path from the platform home to the scripts directory. */
readonly scriptsDir: string;
/** Name of the skills directory under the platform home. */
readonly skillsDirName: string;
/** Name of the subagents directory under the platform home. */
readonly subagentsDirName: string;
/** Name of the scripts directory under the platform home. */
readonly scriptsDirName: string;
/** Filename of the frontmatter overlay YAML for this platform. */
readonly frontmatterFile: string;
}
Expand Down
Loading