Back to Prisma

Brief: D2 — Init wiring and integration tests

projects/agent-native/slices/init-skill-install/briefs/d2-r1.md

7.9.0-dev.172.6 KB
Original Source

Brief: D2 — Init wiring and integration tests

Issued after D1 R1 SATISFIED. Includes one orchestrator-directed side-task from the D1 review (yarn-1 routing, separate commit).

Task

Wire the D1 runner into packages/cli/src/Init.ts: a --no-skills flag (arg spec + help text), invocation of installSkills after file scaffolding (and after the PPG flow when taken), summary output on success, non-fatal warning with the manual command on failure — plus integration tests in packages/cli/src/__tests__/Init.vitest.ts with the runner mocked.

Scope

In: packages/cli/src/Init.ts; packages/cli/src/__tests__/Init.vitest.ts; packages/cli/src/init/generated-files.ts only if the summary integration requires it.

Out: the runner module itself (interface fixes only, surfaced in your report); Generate.ts; real network in tests; anything outside packages/cli/.

Completed when

  • --no-skills appears in the arg spec and prisma init --help output; passing it skips the install entirely (no runner call).
  • Default path calls installSkills({ cwd: <project output dir> }) after scaffolding; success appends .claude/skills/, .agents/skills/, skills-lock.json to the printed summary; failure prints a warning containing manualCommand and init still exits 0.
  • Init.vitest.ts covers: default path invokes the runner; --no-skills skips; failure is non-fatal (exit 0 + hint). Runner mocked.
  • packages/cli typecheck clean; Init.vitest.ts green (same commands as D1; record).
  • Side-task (separate commit): yarn-1 routing per the amended slice spec — detectRunner parses the yarn major from npm_config_user_agent; yarn/1.x routes to the npx --yes path (classic yarn has no dlx); yarn ≥2 keeps yarn dlx. Unit tests for both in skill-install.vitest.ts. Commit message carries a scope note.
  • Optional, implementer judgment: while touching Init.ts, dedupe the bun runtime check by exporting it from skill-install.ts and adopting it in Init.ts (D1 kept it module-local to avoid a cycle; consumption direction Init → skill-install is safe). Skip if it grows the diff disproportionately.

Standing instruction

Stay focused on the goal; control scope. Trivial-and-related fixes with a one-line note; drift halts and surfaces.

Operational metadata

  • Model tier: orchestrator-inherit (resume of persistent implementer).
  • Time-box: 45 minutes.
  • Halt conditions: runner interface mismatch requiring redesign (surface, don't redesign); out-of-scope surface required; diff exceeds ~8 files.