Skip to content

Skill installer fails at every startup: packages/skill is never built, and it is invoked via npx in a Bun-only repo #2113

Closed

Description

@malibio

Problem

Every app startup logs:

WARN Skill install failed: Some("Skill installer exited with status exit status: 127:
npm warn config ignoring workspace config at .../packages/desktop-app/.npmrc
sh: nodespace-skill: command not found")

Exit 127 = command not found. The skill installer never runs, so SKILL.md and the agent shims are never copied into place.

Two compounding root causes

1. packages/skill is never built

packages/skill/package.json declares bin: { "nodespace-skill": "dist/install.js" } and a build script (tsc), but packages/skill/dist/ does not exist and nothing invokes that build:

  • root build → bun run --cwd packages/desktop-app build only
  • there is a test:skill script but no build:skill
  • packages/skill is a workspace member (workspaces: ["packages/*"]), so its bin gets linked — but the link target dist/install.js was never produced

Hence the resolved binary exists as a link and immediately fails to execute.

2. The invocation goes through npx, in a Bun-only repo

run_skill_installer (packages/desktop-app/src-tauri/src/skill_setup.rs:147-153):

Command::new("npx")
    .args(["--yes", "@nodespaceai/skill", "install"])

@nodespaceai/skill is not published to the npm registry, so npx falls back to the workspace link and hits cause 1. The stray npm warn config ignoring workspace config in the error is npm reading the repo .npmrc on its way to failing.

Per CLAUDE.md this repo is Bun-only — npm/yarn/pnpm are blocked, and bunx is the sanctioned one-off runner. Shelling out to npx contradicts that regardless of whether the package resolves.

Fix direction

Both causes must be addressed; fixing either alone leaves it broken.

Build: wire packages/skill's build into whatever produces a runnable app — either a root build:skill invoked by the app build, or as part of build:sidecars/the Tauri build. The installer is a startup dependency of the desktop app, so it must be built before the app can succeed on first run.

Invocation: decide how the installer is meant to be reached in a shipped build, then make dev match:

  • If it ships inside the app bundle, invoke the built script directly (or via bunx) rather than resolving a registry package at runtime.
  • If it is genuinely meant to come from npm at runtime, then @nodespaceai/skill needs publishing, and the failure should be a clean "not installed" state rather than an exit-127 warning every launch.

The first is more consistent with a local-first desktop app that should not depend on registry availability at startup.

Failure surfacing: the current warning fires on every launch and is otherwise silent — the user has no indication that DB-seeded skills are missing. Either make first-run failure visible/actionable, or make the absence a real no-op rather than a recurring warning.

Verification

Confirmed on a freshly reset database (2026-08-17) with a clean build from current main: warning present at startup, packages/skill/dist/ absent.

Acceptance criteria

  • packages/skill is built as part of producing a runnable app; dist/install.js exists
  • Skill installation succeeds on first launch with no exit-127 warning
  • Installer invocation does not shell out to npx/npm (Bun-only per CLAUDE.md)
  • Decision recorded: bundled installer vs. published npm package
  • A genuine install failure surfaces once and actionably, not as a silent per-launch warning
  • Verified on a fresh ~/.nodespace — SKILL.md and agent shims land in the expected locations

Activity

  1. malibio commented on Aug 17, 2026

    @malibio
    CollaboratorAuthor

    Reframing — the published skill should be generated from the local agent's skills

    The issue body treats this as "build packages/skill and stop shelling out to npx". That fixes the startup warning but misses the real architecture.

    Intended model:

    • The local agent's skills are the source of truth — the DB-seeded skill nodes built in packages/agent/src/skill_pipeline.rs (8 skills: Research & Search, Node Creation, Schema Creation, Graph Editing, Relationship Management, Node Deletion, Bulk Import, Organization) and the shared rule constants in packages/agent/src/skill_rules.rs.
    • The published skill is a generated artifact derived from those, living in a separate repo that users install from.
    • Generation is what keeps them from drifting: the same guidance drives the in-app local agent and the external-harness skill, because one is produced from the other.

    The pattern already exists, but stops short

    packages/agent/src/bin/gen_skill_md.rs already regenerates a block of packages/skill/SKILL.md from skill_rules.rs, bounded by:

    <!-- BEGIN GENERATED: schema-rules (see packages/agent/src/skill_rules.rs, ...) -->
    <!-- END GENERATED: schema-rules -->
    

    with --write / --check, and a test (gen_skill_md.rs:157) failing the build when the checked-in block is stale.

    But that covers only the schema-rules block. SKILL.md is 532 lines; the rest — plus packages/skill/{src/{install,installer,agents,index,types}.ts, shims/} — is hand-maintained. So today most of the published surface can drift from the skills that actually drive the agent, which is precisely the failure mode the generator was introduced to prevent.

    Related: #1958 ("Structurally enforce parity between internal skill guidance and external SKILL.md") is the same concern and should be reconciled with this issue rather than solved twice.

    What this changes about the fix

    The startup warning is still a real bug and still needs both root causes addressed (unbuilt dist/, npx invocation). But the target state is bigger:

    1. Extend generation from one block to the whole publishable skill artifact, sourced from skill_pipeline.rs + skill_rules.rs. Decide explicitly what remains hand-authored (installer mechanics, shims, packaging) versus generated (all guidance content).
    2. Define the publish path to the separate distribution repo — how the generated artifact gets there, and what gates it (the existing --check pattern extended, so a guidance change that isn't regenerated fails the build).
    3. Then settle the runtime question in the issue body: whether the desktop app installs a bundled copy or resolves the published package, and make the dev path match.

    Order matters: (3) is where the startup warning lives, but deciding it before (1)/(2) risks wiring the app to an artifact whose provenance is about to change.

    Open questions

    • Which repo is the publish target, and is it already created?
    • Is @nodespaceai/skill intended to be published to npm at all, or is the separate repo the distribution channel (git-install, release asset, etc.)? This determines whether npx @nodespaceai/skill is the right invocation once the package exists.
    • Does the generated artifact carry all 8 skills' markdown_content, or a curated subset? The in-app skills are retrieval-targeted and tool-whitelisted; an external harness may need different framing of the same rules.

    Added acceptance criteria

  2. malibio commented on Aug 17, 2026

    @malibio
    CollaboratorAuthor

    Confirmed: the distribution target does not exist yet

    Checked 2026-08-17:

    • No skill repo under NodeSpaceAI. The org holds: nodespace-core, nodespace-docs, nodespace-sync, nodespace-cloud, nodespace-nlp-experiment, nodespace-cloudsync-experiment, homebrew-nodespace, nodespace-website.
    • No skill repo under malibio either — the nodespace-* repos there are the pre-consolidation set (core-types, core-logic, desktop-app, core-ui, nlp-engine, data-store, system-design, workflow-engine), none skill-related.
    • @nodespaceai/skill is not published to npm — registry.npmjs.org/@nodespaceai%2Fskill returns {"error":"Not found"}, and an npm text search for "nodespace" returns only unrelated third-party packages.

    This fully accounts for the startup failure: npx --yes @nodespaceai/skill install (skill_setup.rs:150-151) resolves a package that has never been published, falls back to the local workspace link, and hits the unbuilt dist/.

    So the scope is larger than a broken invocation — the entire distribution path is unbuilt: no target repo, no published package, and the generator (gen_skill_md.rs) covers only the schema-rules block of what would need publishing.

    Sequencing implication

    The runtime question ("bundled copy vs. resolve the published package") cannot be settled before the distribution path exists. Suggested order:

    1. Create the distribution repo; decide the channel
    2. Extend generation from skill_pipeline.rs / skill_rules.rs to the full publishable artifact
    3. Define the publish path and its staleness gate
    4. Point the desktop app at whatever (1)–(3) produce, and make dev match

    Until then, the app's startup attempt is guaranteed to fail. Consider making that a clean no-op (or a single actionable first-run message) rather than a per-launch exit-127 warning, so the noise stops without pre-committing to a distribution design.

    Channel worth considering

    homebrew-nodespace already exists as a public distribution channel. If the skill is aimed at users who install NodeSpace, that may fit better than npm — worth deciding deliberately rather than inheriting npm because the current code happens to shell out to npx.

  3. malibio commented on Aug 17, 2026

    @malibio
    CollaboratorAuthor

    Distribution: support multiple channels, but sequence them after generation

    Decided direction: support as many install channels as practical. They are not alternatives — they are different entry points to the same generated artifact.

    Channel Audience Cost on top of generation
    Plugin marketplace (.claude-plugin/marketplace.json) Claude Code — the only channel with discovery a manifest in the repo
    Plain git clone into the agent's skills dir anyone; zero infrastructure free — the repo already is this
    Installer (install command, current packages/skill) multi-agent: Codex, Gemini, OpenCode already built
    Homebrew via existing homebrew-nodespace tap users who install NodeSpace by brew anyway a formula

    The marketplace is the one worth adding deliberately: it is the only path where a user finds the skill rather than already knowing the install command. Every other channel presumes prior awareness of NodeSpace.

    Sequencing matters

    Multiple channels are cheap only after generation exists. Adding channels first makes each one another copy of the content to keep in sync — exactly the drift #1958 exists to prevent. Order:

    1. Generation from skill_pipeline.rs / skill_rules.rs
    2. Distribution repo as the generated output (CI in nodespace-core regenerates and pushes)
    3. Channels multiply freely — each publishes the same generated artifact

    Per-agent variants are a generation requirement, not a channel one

    The four agents have genuinely different integration surfaces, already reflected in packages/skill/shims/:

    • claude-code/nodespace-hook.ts
    • codex/nodespace-plugin.ts
    • gemini/nodespace-handler.ts + nodespace-tools.json
    • opencode/nodespace-plugin.ts

    Plus differing skill-file conventions (Claude Code expects YAML frontmatter with name/description driving retrieval). So "support many agents" means the generator emits per-agent variants, not one SKILL.md copied four ways. That belongs in the generation design.

    Reconsider the npm dependency

    npx is defensible for a cross-agent installer (Node is near-universal on dev machines), but it means publishing to npm to ship markdown plus a copy script, in a repo that is otherwise Bun-only per CLAUDE.md. A shell installer or the existing Homebrew tap would avoid the npm dependency. Worth an explicit decision rather than inheriting npm because skill_setup.rs:150 happens to call npx.

    Auto-acquire when the CLI is absent — design gap

    The stated intent is that a user who installs the skill standalone gets something that knows how to acquire NodeSpace when it is not yet installed.

    Current behaviour is the opposite. packages/skill/SKILL.md:65:

    command not found: nodespace → "Tell the user: NodeSpace CLI is not installed. They need to install it (e.g. via the NodeSpace DMG or cargo install nodespace-cli). Do not proceed."

    And packages/skill/README.md lists the CLI as a prerequisite rather than something the skill can obtain.

    Making this bootstrap instead is a real design change with a safety dimension: a skill that installs software when a coding agent encounters a missing binary should ask before acting, not silently install. Suggested shape — detect absence, explain what NodeSpace is, offer a concrete one-line install (brew or shell installer), and proceed only on explicit user confirmation.

    Note cargo install nodespace-cli is referenced in that troubleshooting row — verify it is a real published crate, or correct it.

    Added acceptance criteria

    • Generator emits per-agent variants, not one file copied per agent
    • Distribution repo is a generated output with a staleness gate, not hand-authored
    • Channels supported: marketplace manifest, plain clone, installer, Homebrew — each publishing the same generated artifact
    • npm-vs-alternative decision recorded explicitly
    • Missing-CLI path offers guided acquisition with explicit user confirmation, replacing "do not proceed"
    • cargo install nodespace-cli reference verified or corrected
  4. malibio commented on Aug 17, 2026

    @malibio
    CollaboratorAuthor

    Decision: dedicated public repo for the artifact; source and generation stay in core

    Clarified goal: NodeSpace should be listed in the marketplaces/directories that already exist — not run its own marketplace.

    That is what forces a dedicated repo. The current ecosystem is third-party directories crawling GitHub — SkillsClaude (7,200+ entries, graded on an official/featured/tested/verified/unverified trust ladder), Claude Skills Hub (~42.8k skills, refreshed daily), Claude Marketplaces. Submission is name + description + repository URL, and their crawlers expect the repo to be the skill: root-level SKILL.md, README about the skill, its own stars and issues.

    nodespace-core cannot serve that end. A listing pointing at nodespace-core/packages/skill resolves to a monorepo where the skill is a subdirectory and the repo identity is a knowledge-base application. It is the wrong shape for the consumer-facing artifact — not a size or visibility problem.

    Split:

    Concern Home
    Source of truth (skill content, rules) nodespace-core — skill_pipeline.rs, skill_rules.rs
    Generation + staleness gate nodespace-core — extend gen_skill_md.rs
    Published artifact (root SKILL.md, per-agent shims, README) new dedicated public repo, generated output, never hand-edited
    Directory listings submit the dedicated repo's URL

    This matches the pattern already used for homebrew-nodespace: a small public repo that is an output of the main one.

    Reference shape: anthropics/skills — a plain public repo of skill directories.

    Channels then layer on the same repo at low cost: plain git clone, the existing multi-agent installer (Codex/Gemini/OpenCode, which the Claude-centric directories do not cover), Homebrew via the existing tap, and — if ever wanted — a .claude-plugin/marketplace.json. No own-marketplace required.

    Blocking gap: SKILL.md has no YAML frontmatter

    packages/skill/SKILL.md begins with # NodeSpace Skill — there is no --- frontmatter block.

    Per the official skills documentation, name and description are required, and the description is the only content the model sees before deciding whether to load the skill. It is also the field the directories index for search and display.

    Consequences today, independent of any repo decision:

    • The skill is not listable in the directories in its current form
    • Loading/triggering is degraded — the model has no frontmatter description to match against

    Since generation already owns part of this file, the frontmatter must be generated too, from the same source as the rest. Retrieval here is known to be highly sensitive to description wording, so the generated description warrants deliberate authoring rather than a restatement of the title.

    Added acceptance criteria

    • Dedicated public repo created; artifact is generated output, never hand-edited
    • Root-level SKILL.md with valid YAML frontmatter (name, description)
    • Frontmatter is generated from the same source as the body, with the description authored for retrieval
    • README in the distribution repo describes the skill, not the monorepo
    • Submitted to SkillsClaude / Claude Skills Hub / Claude Marketplaces
    • Multi-agent installer continues to serve Codex, Gemini, OpenCode
    • Core retains source of truth + generation + staleness gate; no hand-maintained copy in the distribution repo
  5. malibio commented on Aug 17, 2026

    @malibio
    CollaboratorAuthor

    Verified: cargo install nodespace-cli does not work

    Flagged earlier as needing verification — confirmed broken. crates.io returns:

    {"errors":[{"detail":"crate `nodespace-cli` does not exist"}]}
    

    The name matches locally (packages/cli/Cargo.toml → name = "nodespace-cli"), but it has never been published.

    Three places instruct users to run it:

    File:line Context
    packages/skill/SKILL.md:65 troubleshooting row for command not found: nodespace
    packages/skill/src/installer.ts:38 installer's missing-CLI message
    packages/desktop-app/src-tauri/src/skill_setup.rs:202 app-side equivalent

    All three tell the user (or tell the agent to tell the user) to run a command that fails with a crates.io error. This is user-facing bad advice sitting in the document that is about to be distributed, so it should be corrected regardless of how the wider distribution work lands.

    Fix: replace with an install path that actually works — the DMG (already mentioned alongside it) and/or brew install nodespace via the existing tap. Note the tap is currently stale (#2114), so if Homebrew becomes the recommended path, that sync matters more.

    Alternatively publish nodespace-cli to crates.io and make the instruction true — but that is a distribution decision of its own, and cargo install is a poor default for non-Rust users.

    This overlaps the auto-acquire design question already recorded here: whichever acquisition path the skill offers, all three messages should name the same one rather than three copies drifting separately.

    • cargo install nodespace-cli removed or made true in all three locations
    • The three missing-CLI messages name a single, verified install path
  6. self-assigned this
    on Aug 18, 2026
  7. mstomar125 commented on Aug 18, 2026

    @mstomar125
    Contributor

    Fixed both root causes:

    1. Build: added scripts/build-skill.ts (bun run build:skill) — builds packages/skill via its own tsc and stages dist/, shims/, SKILL.md, package.json into packages/desktop-app/src-tauri/resources/skill/, bundled via a new Tauri resources entry. Wired into root build, dev:tauri, tauri:build, and the pre-push gate.
    2. Invocation: skill_setup.rs now resolves the installer through Tauri's BaseDirectory::Resource (bundled build) with a source-checkout fallback (dev/cargo test), and runs it directly via bun <path> install — no more npx/npm.

    Decision: bundled installer, not a published @nodespaceai/skill npm package — this is a local-first app and shouldn't depend on registry availability at startup, and bundling avoids version-skew between the app and the installer. Full reasoning in the PR description.

    Also addressed the failure-surfacing ask: a genuine install failure now logs at WARN and emits a one-time skill:install-failed event to the frontend (shown via the existing status-bar error pattern); repeat failures on later launches log at DEBUG only instead of repeating the warning every startup.

    Verified end-to-end against an isolated fake $HOME (never touched the real ~/.nodespace/~/.claude) — the built installer correctly detects agent dirs and installs SKILL.md + shims. PR: #2143

  8. mstomar125 commented on Aug 18, 2026

    @mstomar125
    Contributor

    Merged in #2143 (squash commit b6ec420c). Closed automatically via the PR's Closes #2113.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions