LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtOct 26, 2026, 5:06 PM
updatedAtOct 26, 2026, 7:40 PM
githubUrlhttps://github.com/neomjs/neo/issues/20131
authorneo-opus-grace
commentsCount0
parentIssue20114
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 26, 2026, 7:40 PM

A workspace's nested neo.mjs install runs the maintainer prepare step

neo-opus-grace
neo-opus-grace commented on Oct 26, 2026, 5:06 PM

Context

In the cloud cold walk for neomjs/neo#20114 (2026-10-26, npx neo-app@13.3.2), the install log shows:

> myapp@0.1.0 postinstall
> cd node_modules/neo.mjs && npm i && npm run bundle-parse5 && npm run bundle-marked
> neo.mjs@13.3.1 prepare
> node ./buildScripts/util/prepare.mjs

.git can't be foundneo-agent-skills: materialized 39 link(s) into .claude/skills → node_modules
neo-agent-skills: .claude/skills/ must be git-ignored — these are projection artifacts, never committed bytes.

added 543 packages, and audited 544 packages in 19s

The Problem

Every scaffolded workspace runs the engine's maintainer prepare inside its dependency:

  • husky prints .git can't be found with no trailing newline, so the next line runs into it;
  • the skills materializer links 39 maintainer skills into node_modules/neo.mjs/.claude/skills, from the engine's own neo-agent-skills devDependency rather than the workspace's app audience.

That means confusing install output, maintainer artifacts in a consumer's node_modules, and work no consumer needs.

The Architectural Reality

  • buildScripts/util/prepare.mjs guards both stages with isDependencyBuild({env, root}), which returns true only when INIT_CWD differs from the package root. That catches a git-dependency install.
  • The workspace's postinstall (written by neomjs/create-app tasks/createPackageJson.mjs) runs npm i with its cwd inside node_modules/neo.mjs, so INIT_CWD equals root and the guard reads "not a dependency".

The Fix

Extend isDependencyBuild so a package root that sits inside a node_modules directory also counts as a dependency build. That keeps the two stages scoped to a real checkout, without depending on how the consumer invokes npm. A maintainer clone is unchanged.

Acceptance Criteria

  • AC-1: isDependencyBuild returns true for a root inside node_modules even when INIT_CWD equals that root, and stays false for a top-level clone (unit arms, red-first on dev).
  • AC-2: under that condition prepare.mjs runs neither husky nor the materializer, and prints nothing.
  • AC-3 (post-release): a fresh npx neo-app install log no longer shows .git can't be found or a skills materialization inside node_modules/neo.mjs.

Out of Scope

  • Whether the workspace's nested npm i in node_modules/neo.mjs is needed at all (543 packages, 19 s of the 58 s install). That is the scaffold's postinstall design, a separate question for neomjs/create-app.

Related

Parent: neomjs/neo#20114 · neomjs/create-app#51

Sweeps (2026-10-26T16:06Z): live latest-open, the 5 newest neomjs/neo issues since the 15:52Z full sweep, no equivalent; keyword prepare.mjs / isDependencyBuild / husky, none open; A2A, latest 30 messages, no claim; own-assignment, #20114, #20128, #20129, none overlapping. This promotes the defect-note "neo-app workspace install is wrong in its output" with the cloud agent's root-cause evidence.

Origin Session ID: 9853627c-2129-4d41-b905-0c74bec35a48 Retrieval Hint: "prepare.mjs isDependencyBuild INIT_CWD node_modules nested npm i workspace postinstall husky .git can't be found skills materialize"

tobiu referenced in commit a81048b - "fix(build): a package root inside node_modules is a dependency build for prepare (#20131) (#20137) on Oct 26, 2026, 7:40 PM
tobiu closed this issue on Oct 26, 2026, 7:40 PM