feat(scripts): add prepare:worktree hook for agent job worktrees #53

Merged
janpeter merged 1 commit from feat/prepare-worktree-script into main 2026-05-28 22:59:34 +02:00
Owner

Pairs with scrum4me-mcp PR #27 (runs this hook per worktree).

Why

The agent worker runs npm run verify in a per-job git worktree, which lacks gitignored lib/manual.generated.ts (normally from postinstall/prebuild manual:build, never triggered by verify). Result: typecheck + 22 test files fail on @/lib/manual.generated.

What

Adds "prepare:worktree": "npm run manual:build" — the generic hook scrum4me-mcp createWorktreeForJob runs per worktree (paired with submodule init). Minimal on purpose: prisma client is shared via node_modules symlink + schema.prisma is committed, so gen-schema/prisma generate are NOT run per-worktree.

Verified

Worker worktree after submodule init + this hook: verify GREEN (140 files / 1235 tests).

Pairs with scrum4me-mcp PR #27 (runs this hook per worktree). ## Why The agent worker runs `npm run verify` in a per-job git worktree, which lacks gitignored `lib/manual.generated.ts` (normally from postinstall/prebuild `manual:build`, never triggered by verify). Result: typecheck + 22 test files fail on `@/lib/manual.generated`. ## What Adds `"prepare:worktree": "npm run manual:build"` — the generic hook scrum4me-mcp createWorktreeForJob runs per worktree (paired with submodule init). Minimal on purpose: prisma client is shared via node_modules symlink + schema.prisma is committed, so gen-schema/prisma generate are NOT run per-worktree. ## Verified Worker worktree after submodule init + this hook: verify GREEN (140 files / 1235 tests).
feat(scripts): add prepare:worktree hook for agent job worktrees
Some checks failed
CI / Lint, Typecheck, Test & Build (pull_request) Has been cancelled
CI / Detect deploy-relevant changes (pull_request) Has been cancelled
CI / Deploy Preview (PR) (pull_request) Has been cancelled
CI / Deploy Production (main) (pull_request) Has been cancelled
CI / Deploy Manual (workflow_dispatch) (pull_request) Has been cancelled
dc76a2febb
The agent worker runs `npm run verify` inside a per-job git worktree.
A fresh worktree lacks the gitignored generated file lib/manual.generated.ts
(normally produced by prebuild/postinstall's `manual:build`, which verify
never triggers), so typecheck + 22 test files failed to resolve
`@/lib/manual.generated` — environmental noise unrelated to the agent's code.

`prepare:worktree` is the generic hook scrum4me-mcp's createWorktreeForJob
now runs after checking out a worktree (alongside `git submodule update
--init` for vendor/scrum4me-shared). It regenerates the manual manifest in
the worktree. Kept minimal on purpose: prisma client is shared via the
node_modules symlink and schema.prisma is committed, so gen-schema/prisma
generate are intentionally NOT run per-worktree (would risk a client mismatch).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
janpeter/Scrum4Me!53
No description provided.