Summary
/api/commands/list discovers user skill commands from os.homedir()/.pilotdeck/skills instead of the active PILOT_HOME/skills. This makes the command palette diverge from the authoritative skill store whenever PILOT_HOME is set for isolated homes, multi-instance setups, or tests.
Code path
The authoritative skill path is PILOT_HOME-aware:
src/pilot/paths.ts:20-22 resolves the active PilotDeck home from PILOT_HOME or ~/.pilotdeck.
src/pilot/paths.ts:56-62 maps global skills to resolve(pilotHome, "skills").
src/extension/skills/SkillManager.ts:88-90 resolves user skills through the active pilotHome.
ui/server/routes/skills.js:59 uses resolvePilotHome(process.env).
ui/server/routes/skills.js:102-103 uses path.join(PILOT_HOME, SKILLS_SUBDIR) for user skills.
The command-list route diverges:
ui/server/routes/commands.js:12 imports resolvePilotHome.
ui/server/routes/commands.js:130-172 turns skill directories into slash commands.
ui/server/routes/commands.js:888 uses os.homedir().
ui/server/routes/commands.js:902-906 scans homeDir/.pilotdeck/skills for user skill commands.
Steps to reproduce
This can be reproduced without modifying the repository by invoking the existing route handler with separate temporary HOME and PILOT_HOME values:
- Set
HOME=<tmp>/default-home.
- Set
PILOT_HOME=<tmp>/pilot-home.
- Create
<tmp>/default-home/.pilotdeck/skills/home_only_repro/SKILL.md.
- Create
<tmp>/pilot-home/skills/pilot_only_repro/SKILL.md.
- Import
ui/server/routes/commands.js with node --import tsx and invoke the POST /list handler with req.body = {}.
Observed result:
{
"statusCode": 200,
"hasHomeOnly": true,
"hasPilotOnly": false,
"matchingCustomNames": ["/home_only_repro"]
}
Expected behavior
When PILOT_HOME is set, user skill commands should be discovered from PILOT_HOME/skills, matching SkillManager and /api/skills/*.
Actual behavior
/api/commands/list scans HOME/.pilotdeck/skills, so it can miss active user skills under PILOT_HOME/skills and surface stale commands from the default home.
Existing coverage
Related but not full coverage:
Suggested fix
Use the existing resolver in ui/server/routes/commands.js:
const pilotHome = resolvePilotHome(process.env);
const userCommandsDir = path.join(pilotHome, 'commands');
const userSkillsDir = path.join(pilotHome, 'skills');
Suggested tests
- Add a route-level regression test that sets separate temporary
HOME and PILOT_HOME values.
- Assert
/api/commands/list includes a skill from PILOT_HOME/skills/foo/SKILL.md.
- Assert it does not leak a skill from
HOME/.pilotdeck/skills/bar/SKILL.md when PILOT_HOME is set.
Submitted with Codex.
Summary
/api/commands/listdiscovers user skill commands fromos.homedir()/.pilotdeck/skillsinstead of the activePILOT_HOME/skills. This makes the command palette diverge from the authoritative skill store wheneverPILOT_HOMEis set for isolated homes, multi-instance setups, or tests.Code path
The authoritative skill path is
PILOT_HOME-aware:src/pilot/paths.ts:20-22resolves the active PilotDeck home fromPILOT_HOMEor~/.pilotdeck.src/pilot/paths.ts:56-62maps global skills toresolve(pilotHome, "skills").src/extension/skills/SkillManager.ts:88-90resolves user skills through the activepilotHome.ui/server/routes/skills.js:59usesresolvePilotHome(process.env).ui/server/routes/skills.js:102-103usespath.join(PILOT_HOME, SKILLS_SUBDIR)for user skills.The command-list route diverges:
ui/server/routes/commands.js:12importsresolvePilotHome.ui/server/routes/commands.js:130-172turns skill directories into slash commands.ui/server/routes/commands.js:888usesos.homedir().ui/server/routes/commands.js:902-906scanshomeDir/.pilotdeck/skillsfor user skill commands.Steps to reproduce
This can be reproduced without modifying the repository by invoking the existing route handler with separate temporary
HOMEandPILOT_HOMEvalues:HOME=<tmp>/default-home.PILOT_HOME=<tmp>/pilot-home.<tmp>/default-home/.pilotdeck/skills/home_only_repro/SKILL.md.<tmp>/pilot-home/skills/pilot_only_repro/SKILL.md.ui/server/routes/commands.jswithnode --import tsxand invoke thePOST /listhandler withreq.body = {}.Observed result:
{ "statusCode": 200, "hasHomeOnly": true, "hasPilotOnly": false, "matchingCustomNames": ["/home_only_repro"] }Expected behavior
When
PILOT_HOMEis set, user skill commands should be discovered fromPILOT_HOME/skills, matchingSkillManagerand/api/skills/*.Actual behavior
/api/commands/listscansHOME/.pilotdeck/skills, so it can miss active user skills underPILOT_HOME/skillsand surface stale commands from the default home.Existing coverage
Related but not full coverage:
PILOT_HOMEhandling in the plugin loader, but it does not touchui/server/routes/commands.jsor user skill command discovery.Suggested fix
Use the existing resolver in
ui/server/routes/commands.js:Suggested tests
HOMEandPILOT_HOMEvalues./api/commands/listincludes a skill fromPILOT_HOME/skills/foo/SKILL.md.HOME/.pilotdeck/skills/bar/SKILL.mdwhenPILOT_HOMEis set.Submitted with Codex.