Description
Problem
PlatformConfig's directory fields (skillsDir, subagentsDir, scriptsDir) hold bare directory names such as "agents". But resolvePlatformPaths returns an object that reuses the same field names for fully-resolved absolute paths such as ~/.claude/agents. When both objects are in scope, as in installSubagents, the identical names are ambiguous: a reader cannot tell a name from a path without tracing the type. This has already forced a workaround. A local alias, const subagentsDirName = platformConfig.subagentsDir, exists at one install site purely to disambiguate the segment from the path.
Context
PlatformConfig is defined in packages/agents/src/lib/types.ts.
- The
PLATFORMS literal and resolvePlatformPaths live in packages/agents/src/lib/platform.ts.
- Bare-name field consumers are
resolvePlatformPaths plus three reads in packages/agents/src/commands/install.ts, roughly 15 edit sites across the three files.
- Resolved-path consumers (
paths.* / platformPaths.*) are a separate, larger set that keeps the *Dir names, because those values genuinely are paths.
homeDir is intentionally excluded. It has no resolved-path counterpart (resolved paths use platformHome), so it is unambiguous.
platform.test.ts reads the renamed segments directly (e.g. PLATFORMS.claude.skillsDir), so its assertions must be updated to the new names.
PlatformConfig is confirmed package-internal: the @codeassembly/agents package exposes only a bin (no exports/main/module), so no changelog, docs, or migration are required.
Relevant considerations
- Minimal scope: rename the config segments only. The
*DirName (name) versus *Dir (path) contrast disambiguates without introducing a broader *Name / *Path / *FullPath vocabulary the codebase does not otherwise use.
- Pure rename with no behavioral change. No new tests are expected, though existing assertions that reference the renamed segments must be updated to the new names.
Proposed solution
Rename skillsDir / subagentsDir / scriptsDir to skillsDirName / subagentsDirName / scriptsDirName on PlatformConfig and in the PLATFORMS literal, updating each renamed field's doc comment to describe a directory name rather than a path. Update resolvePlatformPaths to read the renamed segment fields while keeping its output keys (the full paths) named *Dir. Update the three platformConfig.*Dir reads in install.ts, inline the now-redundant subagentsDirName alias, and update the platform.test.ts assertions that reference the renamed segments.
Acceptance criteria
Must have
Description
Problem
PlatformConfig's directory fields (skillsDir,subagentsDir,scriptsDir) hold bare directory names such as"agents". ButresolvePlatformPathsreturns an object that reuses the same field names for fully-resolved absolute paths such as~/.claude/agents. When both objects are in scope, as ininstallSubagents, the identical names are ambiguous: a reader cannot tell a name from a path without tracing the type. This has already forced a workaround. A local alias,const subagentsDirName = platformConfig.subagentsDir, exists at one install site purely to disambiguate the segment from the path.Context
PlatformConfigis defined inpackages/agents/src/lib/types.ts.PLATFORMSliteral andresolvePlatformPathslive inpackages/agents/src/lib/platform.ts.resolvePlatformPathsplus three reads inpackages/agents/src/commands/install.ts, roughly 15 edit sites across the three files.paths.*/platformPaths.*) are a separate, larger set that keeps the*Dirnames, because those values genuinely are paths.homeDiris intentionally excluded. It has no resolved-path counterpart (resolved paths useplatformHome), so it is unambiguous.platform.test.tsreads the renamed segments directly (e.g.PLATFORMS.claude.skillsDir), so its assertions must be updated to the new names.PlatformConfigis confirmed package-internal: the@codeassembly/agentspackage exposes only abin(noexports/main/module), so no changelog, docs, or migration are required.Relevant considerations
*DirName(name) versus*Dir(path) contrast disambiguates without introducing a broader*Name/*Path/*FullPathvocabulary the codebase does not otherwise use.Proposed solution
Rename
skillsDir/subagentsDir/scriptsDirtoskillsDirName/subagentsDirName/scriptsDirNameonPlatformConfigand in thePLATFORMSliteral, updating each renamed field's doc comment to describe a directory name rather than a path. UpdateresolvePlatformPathsto read the renamed segment fields while keeping its output keys (the full paths) named*Dir. Update the threeplatformConfig.*Dirreads ininstall.ts, inline the now-redundantsubagentsDirNamealias, and update theplatform.test.tsassertions that reference the renamed segments.Acceptance criteria
Must have
PlatformConfig'sskillsDir/subagentsDir/scriptsDirare renamed toskillsDirName/subagentsDirName/scriptsDirName, and all config-segment reads are updated.resolvePlatformPathskeep their*Dirnames.PLATFORMS.claude.skillsDirinpackages/agents/src/lib/__tests__/platform.test.ts) are updated to the*DirNamenames, and the full test suite passes.