feat(cli): offer the Prisma Compute skill install during init#118
Conversation
Extract deploy's one-time agent setup prompt into a shared controllers/agent-setup.ts and run it from init after the link step, in both the fresh path and the JSON-to-TS conversion path. The prompt and its dismissal state are shared, so whichever of init or deploy runs interactively first asks, and neither asks twice. Non-interactive, --json, --quiet, and --yes runs never prompt; a failed install downgrades to a warning with the retry command.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughThe CLI now uses a shared Prisma Compute agent setup controller for interactive skill installation. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/product/command-spec.md`:
- Line 1415: Update the interactive human deploy documentation to clarify that
only successful installation or explicit decline records state and suppresses
future prompts. State that failed installations leave the Prisma Compute skill
missing without dismissal state, allowing shouldOfferPrismaAgentSetup() to offer
the prompt again later.
- Line 421: Update the earlier init contract near the linking description to
clarify that config writing is offline, while accepted link and agent-install
steps may access the network. Reconcile the statement that linking is the only
remote step with the later prisma-compute installation behavior, preserving the
existing interactive and non-interactive conditions.
In `@packages/cli/src/controllers/agent-setup.ts`:
- Around line 25-27: Update the prompt guard in the agent setup flow to also
return immediately when context.flags.quiet is enabled, alongside the existing
canPrompt(context) and context.flags.yes checks. Preserve prompting for
interactive, non-quiet executions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5c9c2493-712e-4b53-b977-fb78a7b2295b
📒 Files selected for processing (8)
docs/product/command-spec.mdpackages/cli/src/controllers/agent-setup.tspackages/cli/src/controllers/app.tspackages/cli/src/controllers/init.tspackages/cli/tests/agent.test.tspackages/cli/tests/app-controller.test.tspackages/cli/tests/helpers/skills-lock.tspackages/cli/tests/init-agent-setup.test.ts
CodeRabbit review follow-ups: --quiet on a TTY could still reach the shared skill prompt because canPrompt does not map quiet; guard it in the shared helper so init and deploy both honor the documented contract. Spec now also states that a failed install records no dismissal (a later interactive run offers again) and that init's remote steps are the accepted link and skill install, not linking alone.
|
Addressed all three review comments in ce41f7d's follow-up:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/product/command-spec.md`:
- Line 396: Update the remote-step description in the command specification to
include accepted types installation alongside link and agent-skill installation.
State that types installation is optional and occurs after the config is
written, while preserving the claim that writing the config itself requires no
authentication or network access.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 43640a04-9d36-4a4d-8ce5-f4f73b0cd242
📒 Files selected for processing (3)
docs/product/command-spec.mdpackages/cli/src/controllers/agent-setup.tspackages/cli/tests/init-agent-setup.test.ts
Summary
initnow offers to install theprisma-computeskill the same wayapp deploydoes, so interactive setups get agent skills without a separateagent installstep.maybePromptForAgentSetupinto a sharedcontrollers/agent-setup.ts(pure move, single implementation; deploy behavior unchanged).initruns the prompt after the link step, in both the fresh path and the--format tsconversion path (acting on the config directory, matching the other conversion side-effect steps).--json,--quiet, CI, non-interactive, or--yesruns; a failed install downgrades to a warning with the retry command and the config write stands.Testing
tests/init-agent-setup.test.tscovering accept (install invoked with--skill prisma-computefrom the config dir), decline (dismissal recorded, init succeeds), already-installed (no prompt), install failure (warning + retry hint, exit 0), and non-interactive (no prompt).tsc --noEmitclean.