Repository navigation
Description
Summary
Change core's skill installer (packages/skill) as ADR-082 (proposed) §5 specifies, so the skill's reference files are no longer a hand-kept list.
- Install every reference. Install every
references/*.mdfile in the skill the installer runs from, instead of thereferences/...entries in each agent'sshims. That skill is the stagedresources/skill/, orpackages/skill/in a source checkout. - Record what it installed, per agent. Uninstall removes exactly the recorded files. A later install removes any recorded file the new skill no longer contains.
- Derive the public skill repository's file list the same way.
This is the first half of ADR-082 §5's skill-content extension point. #3369 adds the build input. #3370 then removes the Pro-only guidance, and this record makes that removal clean on users' machines.
Context
- How the installer works today (
packages/skill/src/installer.ts):install()copies each agent'sconfig.shims.uninstall()removes the same list, then prunes only the directories derived fromshims(ownedDirs).installedName()keepsreferences/nested and flattens harness shims.
- The hand-kept lists. Each agent's
shimsinpackages/skill/src/agents.tsnames three references:references/cli.md,references/shared-workspaces.mdandreferences/graph-authored-guidance.md. packages/skill/references/holds six files. Besides those three, it holdsjira-playbook.md,linear-playbook.mdandspec-driven-playbook.md.SKILL.md's "Work tracking" line (~272) points agents at the three playbooks, but no agent'sshimslists them. Both the installed skill and the public skill repository therefore link to files that are not there.- The PTY-session embed in
packages/agent(context_assembly.rs,write_skill_md) already writes all six. - Taking the list from the directory fixes this: the three playbooks start being installed and published. This is a deliberate, visible change, so state it in the PR description.
- Files outlive the list today.
install()never deletes a file it no longer ships.uninstall()removes only the currentshims. A dropped reference therefore keepsreferences/, and with it the install directory, alive withoutSKILL.md: the stranded-directory caseinstalledName's doc warns about.
- The public repository.
scripts/publish-skill-repo.tspublishessharedShimPaths(), the intersection of every agent'sshims.readSkillSource()reads four named files. - Most installs will have no record. The first-launch install runs once:
~/.nodespace/setup.json'sskill_installedflag makes later launches no-ops (skill_setup.rsmodule doc). So most existing installs predate any record. See "Installs without a record". - ADR-082 §5 depends on ADR-081 R3.
- If R3 chooses (b), keep the guidance reworded in core: close this issue as not planned.
- If R3 chooses (c), delete the guidance: this issue still stands, because it is what makes Move the Pro shared-workspaces agent guidance out of core's skill #3370's removal clean.
Scope
packages/skill/src/agents.ts. Remove everyreferences/*entry from every agent'sshims. KeepSKILL.mdand the harness shims.packages/skill/src/installer.ts.- Add
listReferenceFiles(packageRoot). It returns the sorted*.mdfiles directly under<packageRoot>/references/. It is not recursive: ADR-082 §5 accepts only Markdown files there. It returns[]when the directory is absent. install(targetAgents?, packageRoot):- Copy the shims as today, then copy each reference to
<installDir>/references/<name>. - After copying, write the record
<installDir>/.nodespace-install.json, as{ "files": [ ...sorted relative paths ] }. - Then delete every file named in the previous record that is not in the new set. Delete only paths that resolve inside
installDirand are regular files, and ignore any other entry. - Prune
references/if it is now empty.
- Copy the shims as today, then copy each reference to
uninstall(targetAgents?, packageRoot = PACKAGE_ROOT):- With a record: remove exactly the recorded files and the record.
- Without a record: remove the agent's
shims, plus every file fromlistReferenceFiles(packageRoot)that exists in the install directory. Add the pre-record list if the reviewer accepts option A below. - Then prune:
references/, and the install directory when it is empty, as today.
- Pass the resource root into
uninstall. Update the caller inpackages/skill/src/install.ts(uninstall(targetAgents), ~197) to pass the--resource-rootit already parses. The Claude Code plugin reconciliation (uninstall(['claude-code'])insideinstall) passes its ownpackageRoot. - Don't change
checkInstalled. The record file must not make it, or the "directory is now empty" check, misbehave.
- Add
- Installs without a record (reviewer decision; name the choice in the PR):
-
Option A (recommended). Treat a missing record as the files the pre-record installer wrote:
SKILL.md;- the agent's harness shim;
references/cli.md,references/shared-workspaces.mdandreferences/graph-authored-guidance.md.
Put the three references in an exported
PRE_RECORD_REFERENCESconstant. Its doc should say it covers installs made before the record existed, and can be deleted once those are gone. CLAUDE.md's no-backward-compatibility rule is about data; this is installer hygiene for files core itself put on users' machines. -
Option B. Add no constant. Legacy installs keep any reference a later skill drops, and uninstalling them may strand
references/.
-
scripts/publish-skill-repo.ts.sharedShimPaths()returns the shared shims (now onlySKILL.md), plusreferences/<name>for every*.mdinpackages/skill/references/.- Update the header doc,
readSkillSource()(return the references as a map, or drop the per-file fields) and therenderPublishFilesdoc. - This script never reads
NODESPACE_SKILL_EXTENSIONS(ADR-082 §5).
scripts/publish-skill-repo.test.ts.- Update the expected lists (the tests at ~40, ~84 and ~105) to
SKILL.mdplus the six references. - Add a test that every
references/...link in the publishedSKILL.mdresolves to a published file.
- Update the expected lists (the tests at ~40, ~84 and ~105) to
packages/skill/src/tests/installer.test.ts.- Make
seedPkgRootalso seedreferences/, and update its comment (36-41) and the comment at 252-257. - Change the config test "each agent has … at least one agent shim" (70-77). Antigravity's
shimsbecomes onlySKILL.md, so assert that every agent hasSKILL.md, and that every agent except antigravity has a harness shim. - Add the tests listed under Tests and verification.
- Make
- No change to
packages/agent, whose embed already writes every reference, or totauri.conf.json(resources/skill/**/*).
Out of scope
- The
NODESPACE_SKILL_EXTENSIONSbuild input and the release guard (Add the NODESPACE_SKILL_EXTENSIONS build input to core's skill build #3369). - Removing
shared-workspaces.md(Move the Pro shared-workspaces agent guidance out of core's skill #3370). - Pruning files from the public repository in
scripts/push-to-external-repo.ts.
Steps
- Follow CLAUDE.md's startup sequence:
- pull
main; EnterWorktree({name: "issue-<N>-skill-install-record"});bun install, then thebun run testbaseline;- self-assign at pickup and set In Progress.
- pull
- Confirm ADR-081 R3 and ADR-082 §5 have merged, and note R3's outcome in the PR.
- Change
agents.tsandinstaller.ts, theninstall.ts'suninstallcall. - Update the publish script and its tests.
- Update and add the installer tests. Mutation-check each new test individually.
- Run
bun run build:skilland confirm the stagedresources/skill/references/is unchanged (six files). - Run
bun run scripts/check-pro-boundary.ts. This PR should neither add nor remove a marker; if a count moved, find out why. - Verify, then finish:
bun run quality:fix, and commit;git push origin HEAD:issue-<N>-skill-install-record;gh pr create --head issue-<N>-skill-install-record;- merge only with
bun run merge <PR#>once approved.
Acceptance criteria
-
agents.tsnames noreferences/path. - Installing from a package root installs every
references/*.md(six at af8ddb6), and everyreferences/...link in the installedSKILL.mdresolves. - Each install writes a record listing exactly what it wrote. A reinstall from a skill without one reference deletes that reference and updates the record.
- Uninstall with a record leaves no install directory behind. A user's own file in
references/survives, and so doreferences/and the install directory around it. - A record entry that points outside the install directory is ignored.
- The public file list is
SKILL.mdplus every reference inpackages/skill/references/. - The PR description names the behaviour change (three playbooks now installed and published) and the reviewer's option A or B choice.
-
BASELINESinscripts/check-pro-boundary.tsstill equals the CLI's counts (this PR adds and removes no marker), and the CLI exits 0.
Tests and verification
New installer tests. Mutation-check each one by reverting the matching installer.ts change and confirming it fails.
- Install copies every
references/*.mdin the package root, including one thatagents.tsdoes not name. - Install writes a record listing exactly the files it wrote.
- A second install from a package root missing one reference deletes that installed reference and updates the record.
- Uninstall with a record removes the recorded files and the record, and leaves no install directory.
- Uninstall keeps a user's own file in
references/, and therefore keepsreferences/and the install directory. - A record entry such as
../outside.mdis never deleted. - Option A only: uninstall without a record removes the pre-record references, including one the current package no longer ships, and prunes the directory.
Commands:
bun run test:skillbun run test:scriptsbun run skill:checkbun run build:skillbun run test:changed(skill and scripts tiers)bun run scripts/check-pro-boundary.ts
Dependencies
- Guardrail: stop new Pro code from landing in core #3302: the ratchet whose counts this PR must leave unchanged.
- NodeSpaceAI/nodespace-docs#88 (ADR-081): ADR-081 merged with R3 decided.
- NodeSpaceAI/nodespace-docs#90 (ADR-082): ADR-082 merged, with §5's installer rules.
Risks and rollback
- Users who reinstall get three more reference files. It is intended:
SKILL.mdalready links them. - A new dotfile appears in each skill directory. Agent harnesses discover a skill by
SKILL.md, so it is inert there. - Rollback. Revert the PR. An older installer ignores the record, so after a rollback, uninstall leaves
.nodespace-install.jsonbehind and keeps the install directory. Delete that file by hand if needed.
Plan key: C10.6a (pro-boundary DAG).
🤖 Generated with Claude Code
Activity
Install skill references from the package root and record installed f…