Repository navigation
Conversation
|
🎉 Thanks for opening your first pull request in RoleCraft! A maintainer will review it soon — it helps if |
c9591a0 to
e3e98ea
Compare
e3e98ea to
27e2021
Compare
sametcelikbicak
left a comment
There was a problem hiding this comment.
Nice catch on the orphan check — the name.replace(/-/g, '/') heuristic was genuinely broken, and keying the search dirs off the lock entry's recorded agents is the right shape. Two things before merge.
1. getDirForAgent ignores the cwd argument.
lockEntrySkillDirs receives cwd and uses it for the project entry on the line above, but project-scoped agents resolve through proj() → process.cwd(). The two disagree whenever they differ:
skill really at /tmp/x/.devin/skills/acme-devin-skill
apiDoctor('/other') → missingDirs: 1
devin, copilot, eve, promptscript and forge all use proj(), so all five are affected. The CLI never shows it — doctorCommand passes process.cwd() — but apiDoctor is exported as doctor from src/index.js, so an API caller passing any other directory gets the same false positive this PR is fixing.
Line 288 in 27e2021
Every other path in apiDoctor resolves through the cwd parameter, so this looks like the one place it was missed.
2. This overlaps #332.
#332 ("project-scoped agents write to the global lockfile") is open and touches the same area. Worth deciding together whether they land as one change — the two share a root cause, and splitting them means whoever reviews second inherits a half-migrated function.
Verified on this branch: the #330 fixture reproduces clean — orphaned: 0, missingDirs: 0, hashMismatches: 0 — with a scoped slug (acme/my-skill → acme-my-skill) and a non-markdown file in the tree. npm run lint passes, 1395/1395 tests pass.
Description
Fixes #330.
rolecraft doctornow derives skill directory checks from each lockfile entry's recorded agents, so agent-specific installs such as~/.claude/skillsare not reported missing. It also compares shared skill directory names against normalized lock slugs so scoped slugs are not reported as orphaned.Validation run:
node --test src/api/doctor.test.jsnode --test src/commands/doctor.test.jsPATH=/tmp/rolecraft-gitwrap:$PATH npm test(local Git is 2.20.1, so the wrapper only translatesgit init -bused by release-prep tests)node --check src/api/doctor.jsnode --check src/api/doctor.test.jsgit diff --checknpm run lint.Local
npm run lintreaches Biome, but this machine's glibc is 2.28 and the installed Biome binary requires GLIBC_2.29/2.30.Type of change
Checklist
npm test)npm run lint)Related issue
Fixes #330