Skip to content

feat(cli): offer the Prisma Compute skill install during init#118

Merged
AmanVarshney01 merged 4 commits into
mainfrom
feat/cli-init-agent-skill-prompt
Jul 13, 2026
Merged

feat(cli): offer the Prisma Compute skill install during init#118
AmanVarshney01 merged 4 commits into
mainfrom
feat/cli-init-agent-skill-prompt

Conversation

@AmanVarshney01

Copy link
Copy Markdown
Member

Summary

init now offers to install the prisma-compute skill the same way app deploy does, so interactive setups get agent skills without a separate agent install step.

  • Extracted deploy's maybePromptForAgentSetup into a shared controllers/agent-setup.ts (pure move, single implementation; deploy behavior unchanged).
  • init runs the prompt after the link step, in both the fresh path and the --format ts conversion path (acting on the config directory, matching the other conversion side-effect steps).
  • The prompt and its dismissal state are shared between init and deploy: whichever runs interactively first asks, declining records the dismissal, and neither asks twice.
  • Never prompts in --json, --quiet, CI, non-interactive, or --yes runs; a failed install downgrades to a warning with the retry command and the config write stands.
  • Spec: documented the init agent skill step and cross-referenced the shared prompt from the deploy section.

Testing

  • New tests/init-agent-setup.test.ts covering accept (install invoked with --skill prisma-compute from the config dir), decline (dismissal recorded, init succeeds), already-installed (no prompt), install failure (warning + retry hint, exit 0), and non-interactive (no prompt).
  • Full CLI suite: 629 tests / 46 files pass; tsc --noEmit clean.

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.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8094b15e-cef9-4dce-92c4-2947bedc4f87

📥 Commits

Reviewing files that changed from the base of the PR and between f408df2 and eef0b1e.

📒 Files selected for processing (1)
  • docs/product/command-spec.md

Summary by CodeRabbit

  • New Features
    • prisma-cli init now interactively offers to install the Prisma Compute “agent skill” when it’s missing.
    • Declining records a local dismissal so the prompt won’t reappear on subsequent interactive runs; prisma-cli app deploy reuses the same dismissal state.
  • Bug Fixes
    • If installing the agent skill fails, the CLI warns and continues; dismissal is not recorded, so later interactive runs may offer again.
    • Quiet/non-interactive runs no longer show the installation prompt.
  • Documentation
    • Updated prisma-cli init guidance to clarify configuration writing is local-only, with only optional post-write install/link steps.

Walkthrough

The CLI now uses a shared Prisma Compute agent setup controller for interactive skill installation. init invokes it in normal and conversion flows, while deploy reuses the same prompt and dismissal state. Installation failures become warnings without blocking initialization. Tests add reusable skills-lock fixtures and cover acceptance, dismissal, existing installations, failures, and non-interactive runs. Documentation updates describe the shared behavior and prompt conditions.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Clearly states the new init prompt for Prisma Compute skill installation.
Description check ✅ Passed It accurately describes the shared agent setup prompt, init integration, dismissal behavior, and tests.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-init-agent-skill-prompt
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/cli-init-agent-skill-prompt

Comment @coderabbitai help to get the list of available commands.

@AmanVarshney01

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a589fdd and ce41f7d.

📒 Files selected for processing (8)
  • docs/product/command-spec.md
  • packages/cli/src/controllers/agent-setup.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/init.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/helpers/skills-lock.ts
  • packages/cli/tests/init-agent-setup.test.ts

Comment thread docs/product/command-spec.md Outdated
Comment thread docs/product/command-spec.md Outdated
Comment thread packages/cli/src/controllers/agent-setup.ts Outdated
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.
@AmanVarshney01

Copy link
Copy Markdown
Member Author

Addressed all three review comments in ce41f7d's follow-up:

  • --quiet guard: valid catch. canPrompt maps --json/CI/--no-interactive/non-TTY but not --quiet, so a quiet TTY run could still prompt (pre-existing deploy behavior that moved with the helper). The shared guard now checks context.flags.quiet, with a regression test.
  • init spec network claim: reworded; the remote steps are an accepted link and an accepted skill install, both optional and both after the config write.
  • failed-install dismissal state: both the init and deploy bullets now state a failed install records no dismissal, so a later interactive run offers again.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ce41f7d and f408df2.

📒 Files selected for processing (3)
  • docs/product/command-spec.md
  • packages/cli/src/controllers/agent-setup.ts
  • packages/cli/tests/init-agent-setup.test.ts

Comment thread docs/product/command-spec.md Outdated
@AmanVarshney01 AmanVarshney01 merged commit 10f6c43 into main Jul 13, 2026
10 checks passed
@AmanVarshney01 AmanVarshney01 deleted the feat/cli-init-agent-skill-prompt branch July 13, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant