Description
Nanocoder maintains a distinction between process.cwd() and getProjectRoot(). When Nanocoder is started from or navigates into a subdirectory within a repository, project configuration, lockfiles, and .nanocoder/ assets reside at getProjectRoot(). However, getDaemonLock() in source/commands/doctor.tsx and planPromotion / checkSkillBundle in source/commands/skills.tsx hardcode process.cwd(). This causes /doctor to look for daemon lockfiles in the subdirectory, and /skills check <name> to fail to find skills stored under the root's .nanocoder/skills/.
Environment
- OS: Linux / macOS / Windows
- Node version: v20+ / v22+
- Nanocoder version: 1.30.0
- Provider: Any
- Model: Any
Steps to Reproduce
- In a repository initialized with Nanocoder,
cd into a subdirectory (e.g. cd packages/web or cd source/).
- Run
/doctor or /skills check <name>.
/doctor fails to locate the project daemon lockfile, and /skills check reports that .nanocoder/skills/<name> does not exist.
Expected Behavior
/doctor and /skills should use getProjectRoot() to consistently target the repository's configuration root.
Actual Behavior
process.cwd() is used, causing failures when operating in project subdirectories.
Logs/Screenshots
In source/commands/doctor.tsx:L124:
async function getDaemonLock(): Promise<DaemonLock | null> {
const projectRoot = process.cwd(); // BUG: should be getProjectRoot()
const lock = await readLockfile(projectRoot);
...
In source/commands/skills.tsx:L322:
const report = await checkSkillBundle(process.cwd(), name); // BUG: should be getProjectRoot()
Additional Context
Description
Nanocoder maintains a distinction between
process.cwd()andgetProjectRoot(). When Nanocoder is started from or navigates into a subdirectory within a repository, project configuration, lockfiles, and.nanocoder/assets reside atgetProjectRoot(). However,getDaemonLock()insource/commands/doctor.tsxandplanPromotion/checkSkillBundleinsource/commands/skills.tsxhardcodeprocess.cwd(). This causes/doctorto look for daemon lockfiles in the subdirectory, and/skills check <name>to fail to find skills stored under the root's.nanocoder/skills/.Environment
Steps to Reproduce
cdinto a subdirectory (e.g.cd packages/weborcd source/)./doctoror/skills check <name>./doctorfails to locate the project daemon lockfile, and/skills checkreports that.nanocoder/skills/<name>does not exist.Expected Behavior
/doctorand/skillsshould usegetProjectRoot()to consistently target the repository's configuration root.Actual Behavior
process.cwd()is used, causing failures when operating in project subdirectories.Logs/Screenshots
In
source/commands/doctor.tsx:L124:In
source/commands/skills.tsx:L322:Additional Context