Back to Prisma

Brief: S2-D2 — Generate wiring and mutual exclusion

projects/agent-native/slices/generate-skill-offer/briefs/d2-r1.md

7.9.0-dev.172.0 KB
Original Source

Brief: S2-D2 — Generate wiring and mutual exclusion

Pre-staged during S2-D1's run; confirm against its report and review before issuing.

Task

Wire handleSkillsOffer into packages/cli/src/Generate.ts: in the non-watch success path where the NPS survey runs (gated by !hideHints), call the offer first; skip handleNpsSurvey for this run when prompted === true. Injectable for tests like the existing surveyHandler constructor parameter. Add a Generate-level test pinning the ordering and the mutual exclusion.

Scope

In: packages/cli/src/Generate.ts; the Generate-level test (place per existing convention — extend the file that already exercises the surveyHandler injection, or add a vitest file if none fits).

Out: the offer module (interface fixes only, surfaced in your report); NPS internals; watch mode and --no-hints semantics (both must remain fully suppressing).

Completed when

  • Generate accepts an injectable offer handler (constructor default = handleSkillsOffer), invoked in the same guarded block as the survey, before it.
  • prompted === truehandleNpsSurvey not called this run; prompted === false → survey runs exactly as before. Watch mode and --no-hints call neither.
  • Tests pin: offer-before-survey ordering; mutual exclusion both ways; suppression under --no-hints and watch mode (mocked handlers).
  • Gates: packages/cli pnpm run tsc; the new/extended test file green; NPS Jest suite still green (pnpm exec jest nps.test.ts --silent).

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 (resumed persistent implementer).
  • Time-box: 35 minutes.
  • Halt conditions: the Generate success path turns out to have another exit that bypasses the survey block (surface rather than chase it); out-of-scope surface required; diff exceeds ~5 files.