feat(cli): add agent skills setup flow - #100

Merged
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install
Jun 29, 2026
Merged

feat(cli): add agent skills setup flow#100
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install

Conversation

@AmanVarshney01

@AmanVarshney01AmanVarshney01 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds agent install, agent update, and agent status to install/check Prisma skills from prisma/skills.
  • Uses the detected package manager for CLI tips and the Skills CLI runner: bunx, pnpm dlx, yarn dlx, or npx -y.
  • Runs the Skills CLI through Execa, always buffers its output, and shows only Prisma CLI-owned success/failure text.
  • Reads skills-lock.json structurally for status/prompt decisions.
  • Auth can show an agent setup tip, and interactive app deploy can prompt once to install only prisma-compute.
  • Prompts use Clack with the CLI runtime streams and abort signal; selecting No dismisses the deploy prompt, while canceling aborts the command.
  • Dry-run output is honest and shell-safe, e.g. --skill '*'.

Examples

pnpm dlx @prisma/cli@latest agent install
pnpm dlx @prisma/cli@latest agent install --skill prisma-compute
pnpm dlx @prisma/cli@latest agent status --json
pnpm dlx @prisma/cli@latest agent status --global

Without package-manager detection:

npx -y @prisma/cli@latest agent install

Deploy prompt output:

◇ Install the Prisma Compute skill for this project?
│ Yes
✔ Installed the Prisma Compute skill for this project.

Testing

  • pnpm --filter @prisma/cli exec vitest run tests/prompt.test.ts tests/app-controller.test.ts tests/agent.test.ts
  • pnpm --filter @prisma/cli test
  • pnpm --recursive exec tsc --noEmit
  • pnpm lint
  • Manual agent install --skill prisma-compute smoke from /Users/aman/dev/test/prisma-cli-agent-install-quiet
  • Manual deploy prompt smoke from /Users/aman/dev/test/prisma-cli-deploy-quiet

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds the agent command group with install, update, and status subcommands, plus shared types and command metadata. It introduces setup-state detection, managed AGENTS.md/CLAUDE.md updates, package-manager runner resolution, and local dismissed-prompt persistence. auth login can now suggest prisma-cli agent install, and app deploy can prompt to install agent guidance for linked projects. New tests cover the agent commands, auth hinting, and deploy prompting.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.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 nameStatusExplanation
Title check✅ PassedThe title is concise and accurately captures the main change: adding an agent skills setup flow to the CLI.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description check✅ PassedThe description matches the changeset by summarizing the new agent commands, package-manager runner support, prompts, and documentation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/agent-skills-install
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/agent-skills-install

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

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 8dd0cd5 to ec1d0ceCompareJune 25, 2026 11:16

@coderabbitaicoderabbitaiBot 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: 4

🤖 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 186-198: The child process error handler in the install flow is
treating aborts as failures, so update the `child.on("error")` path to detect an
`AbortError` from `spawn` and re-throw or reject with that abort instead of
wrapping it in `skillsInstallFailed(...)`. Keep `child.on("close")` for real
exit codes, but let cancellations from the `context.runtime.signal` propagate
cleanly so the runtime handles them as user aborts rather than install errors.
In `@packages/cli/src/controllers/app.ts`:
- Around line 4246-4258: The optional agent-setup prompt in app.ts currently
aborts when confirmPrompt is canceled instead of treating cancel like a declined
install. Update the flow around confirmPrompt so Esc/Ctrl+C is handled the same
as a false response, using the existing shouldInstall branch to record
setAgentSetupPromptDismissedAt and continue without throwing, rather than
exiting before the install step.
In `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 135-150: The Windows handling in packageRunner currently routes
every binary through binary(), which incorrectly turns bunx into a .cmd shim.
Update packageRunner to special-case the "bun" branch so it uses bunx.exe on
win32 (or plain bunx when appropriate), while keeping binary() and the existing
.cmd behavior for pnpm, yarn, and npm shims.
In `@packages/cli/src/lib/agent/setup-status.ts`:
- Around line 25-41: The setup status logic in setup-status.ts is duplicating
the skills lock filename between the computed skillsLockPath used by
hasPrismaSkillsLock and the returned skillsLockPath field in the status object.
Update the setup-status flow around readPrismaAgentProjectFileStatus,
hasPrismaSkillsLock, and the returned object to derive both from the same
source, such as a shared constant or path.basename(skillsLockPath), so the value
stays consistent if the filename changes.
🪄 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: 6a6d0fa7-6817-4cd3-a20b-faf56031ffa5

📥 Commits

Reviewing files that changed from the base of the PR and between 7833e62 and 8dd0cd5.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts Outdated
Comment threadpackages/cli/src/controllers/app.ts
Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/src/lib/agent/setup-status.ts Outdated

@coderabbitaicoderabbitaiBot 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 165-178: runChildProcess currently spawns the executable directly,
which fails on Windows when resolveSkillsPackageRunner() returns .cmd/.bat
runners like npx.cmd or pnpm.cmd. Update runChildProcess to detect win32 and
launch these runners through a Windows-compatible path (for example using shell
execution or cmd.exe /c) while preserving args, cwd, env, and signal handling;
use the runChildProcess and resolveSkillsPackageRunner symbols to locate the
fix.
🪄 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: 10e171f8-8039-4f05-b73b-edebb47bf814

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd0cd5 and ec1d0ce.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from ec1d0ce to bd6a348CompareJune 25, 2026 11:28

@coderabbitaicoderabbitaiBot 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

♻️ Duplicate comments (1)
packages/cli/src/controllers/app.ts (1)

4248-4260: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Cancel still aborts the deploy (previously flagged as addressed).

confirmPrompt throws usageError on Esc/Ctrl+C, and the try/catch here only wraps runAgentInstall (Line 4262+), not the confirmPrompt call. So canceling this optional prompt aborts the whole deploy before any deploy work begins. The earlier review marked this resolved in ec1d0ce, but the current code does not handle cancellation — please confirm whether the fix was reverted.

Treat cancel the same as a decline: record the dismissal and continue.

🛡️ Proposed handling
- const shouldInstall = await confirmPrompt({- input: context.runtime.stdin,- output: context.runtime.stderr,- message: "Install Prisma agent guidance for this project?",- initialValue: true,- });-- if (!shouldInstall) {+ let shouldInstall: boolean;+ try {+ shouldInstall = await confirmPrompt({+ input: context.runtime.stdin,+ output: context.runtime.stderr,+ message: "Install Prisma agent guidance for this project?",+ initialValue: true,+ });+ } catch {+ shouldInstall = false;+ }++ if (!shouldInstall) {
await context.stateStore.setAgentSetupPromptDismissedAt(
new Date().toISOString(),
);
return [];
}
#!/bin/bash# Confirm confirmPrompt still throws on cancel and isn't wrapped at the call site.
fd -t f 'prompt.ts' packages/cli/src/shell --exec sed -n '60,95p' {}
printf'\n--- call site ---\n'
rg -nP -C3 'await confirmPrompt' packages/cli/src/controllers/app.ts
🤖 Prompt for 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.
In `@packages/cli/src/controllers/app.ts` around lines 4248 - 4260, The optional
install prompt in app.ts is not handling cancel, so Esc/Ctrl+C from
confirmPrompt still aborts the deploy. Update the confirmPrompt call site around
shouldInstall to catch usageError cancellation and treat it the same as a false
response: setAgentSetupPromptDismissedAt, then continue by returning [] only for
a real decline and otherwise proceed without failing the deploy. Use the
existing runAgentInstall try/catch location as a reference, but move the cancel
handling to the prompt step itself.
🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 2872-3126: Add a deploy test for the cancel path of the agent
guidance prompt, since the current cases only cover accept and decline. In the
`runAppDeploy` flow in `app-controller.test.ts`, make `confirmPrompt` reject to
simulate cancellation and assert it is handled like a decline: `deployApp` still
runs, `runAgentInstall` is not called, and `readAgentSetupPromptDismissedAt` is
recorded. Use the existing interactive deploy test setup and the
`confirmPrompt`, `runAppDeploy`, and `context.stateStore` symbols to place the
new case alongside the current prompt behavior tests.
---
Duplicate comments:
In `@packages/cli/src/controllers/app.ts`:
- Around line 4248-4260: The optional install prompt in app.ts is not handling
cancel, so Esc/Ctrl+C from confirmPrompt still aborts the deploy. Update the
confirmPrompt call site around shouldInstall to catch usageError cancellation
and treat it the same as a false response: setAgentSetupPromptDismissedAt, then
continue by returning [] only for a real decline and otherwise proceed without
failing the deploy. Use the existing runAgentInstall try/catch location as a
reference, but move the cancel handling to the prompt step itself.
🪄 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: d828c377-27dd-4fe7-9674-9565d8830d77

📥 Commits

Reviewing files that changed from the base of the PR and between ec1d0ce and bd6a348.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/tests/app-controller.test.ts Outdated
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 2 times, most recently from c181b4c to 1eb31e9CompareJune 25, 2026 12:02

@coderabbitaicoderabbitaiBot 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: 2

🤖 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 `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 147-164: packageRunnerForPackageManager currently mixes the spawn
runner with the display formatter by always applying binary(), which makes
help/examples emit .cmd on Windows. Split the logic used by
resolvePackageRunner* so resolveSkillsPackageRunner keeps the platform-specific
spawn binary behavior for agent.ts, while
resolvePrismaCliPackageCommandFormatter* returns plain package commands; update
the packageRunnerForPackageManager helper and any related formatter functions to
use the correct output for each path.
In `@packages/cli/tests/agent.test.ts`:
- Around line 54-62: The agent help and managed-file command strings are being
formatted with the Windows .cmd suffix from resolvePackageRunner(), which leaks
npx.cmd/pnpm.cmd into displayed output. Update the display-path in
formatPrismaCliCommand() and the agent command generation used by agent
help/status/install/update so .cmd is stripped for user-facing text, while
keeping the executable name with .cmd only for spawning.
🪄 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: 7894b920-baa6-41f8-a079-ae5770d48413

📥 Commits

Reviewing files that changed from the base of the PR and between c181b4c and 1eb31e9.

📒 Files selected for processing (22)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/cli-command.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/cli-command.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/shell/help.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/tests/agent.test.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 1eb31e9 to 416804cCompareJune 25, 2026 12:17
coderabbitai[bot]
coderabbitaiBot previously approved these changes Jun 25, 2026
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 16 times, most recently from cea395c to 452762bCompareJune 26, 2026 12:15
luanvdw
luanvdw previously approved these changes Jun 26, 2026

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work on this!

Could we make these minor docs changes?

  • agent is now listed in command-spec.md as part of the beta command surface, but command-principles.md still says the preview only includes auth, project, git, branch, database, and app.
  • The implementation adds a new structured error code, AGENT_SKILLS_INSTALL_FAILED, but error-conventions.md doesn’t list or define it yet.

Both are small, but since these docs are the contract for future CLI work and agent-facing behavior, I’d update them in this PR so we don’t leave the model slightly split.

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 076e420 to bfd2d37CompareJune 26, 2026 14:01

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

@AmanVarshney01
AmanVarshney01 merged commit e9666a6 into mainJun 29, 2026
10 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/agent-skills-install branch June 29, 2026 07:55
Sign up for freeto 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.

2 participants

@AmanVarshney01@luanvdw
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

feat(cli): add agent skills setup flow - #100

Merged
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install
Jun 29, 2026
Merged

feat(cli): add agent skills setup flow#100
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install

Conversation

@AmanVarshney01

@AmanVarshney01AmanVarshney01 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds agent install, agent update, and agent status to install/check Prisma skills from prisma/skills.
  • Uses the detected package manager for CLI tips and the Skills CLI runner: bunx, pnpm dlx, yarn dlx, or npx -y.
  • Runs the Skills CLI through Execa, always buffers its output, and shows only Prisma CLI-owned success/failure text.
  • Reads skills-lock.json structurally for status/prompt decisions.
  • Auth can show an agent setup tip, and interactive app deploy can prompt once to install only prisma-compute.
  • Prompts use Clack with the CLI runtime streams and abort signal; selecting No dismisses the deploy prompt, while canceling aborts the command.
  • Dry-run output is honest and shell-safe, e.g. --skill '*'.

Examples

pnpm dlx @prisma/cli@latest agent install
pnpm dlx @prisma/cli@latest agent install --skill prisma-compute
pnpm dlx @prisma/cli@latest agent status --json
pnpm dlx @prisma/cli@latest agent status --global

Without package-manager detection:

npx -y @prisma/cli@latest agent install

Deploy prompt output:

◇ Install the Prisma Compute skill for this project?
│ Yes
✔ Installed the Prisma Compute skill for this project.

Testing

  • pnpm --filter @prisma/cli exec vitest run tests/prompt.test.ts tests/app-controller.test.ts tests/agent.test.ts
  • pnpm --filter @prisma/cli test
  • pnpm --recursive exec tsc --noEmit
  • pnpm lint
  • Manual agent install --skill prisma-compute smoke from /Users/aman/dev/test/prisma-cli-agent-install-quiet
  • Manual deploy prompt smoke from /Users/aman/dev/test/prisma-cli-deploy-quiet

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds the agent command group with install, update, and status subcommands, plus shared types and command metadata. It introduces setup-state detection, managed AGENTS.md/CLAUDE.md updates, package-manager runner resolution, and local dismissed-prompt persistence. auth login can now suggest prisma-cli agent install, and app deploy can prompt to install agent guidance for linked projects. New tests cover the agent commands, auth hinting, and deploy prompting.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.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 nameStatusExplanation
Title check✅ PassedThe title is concise and accurately captures the main change: adding an agent skills setup flow to the CLI.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description check✅ PassedThe description matches the changeset by summarizing the new agent commands, package-manager runner support, prompts, and documentation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/agent-skills-install
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/agent-skills-install

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

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 8dd0cd5 to ec1d0ceCompareJune 25, 2026 11:16

@coderabbitaicoderabbitaiBot 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: 4

🤖 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 186-198: The child process error handler in the install flow is
treating aborts as failures, so update the `child.on("error")` path to detect an
`AbortError` from `spawn` and re-throw or reject with that abort instead of
wrapping it in `skillsInstallFailed(...)`. Keep `child.on("close")` for real
exit codes, but let cancellations from the `context.runtime.signal` propagate
cleanly so the runtime handles them as user aborts rather than install errors.
In `@packages/cli/src/controllers/app.ts`:
- Around line 4246-4258: The optional agent-setup prompt in app.ts currently
aborts when confirmPrompt is canceled instead of treating cancel like a declined
install. Update the flow around confirmPrompt so Esc/Ctrl+C is handled the same
as a false response, using the existing shouldInstall branch to record
setAgentSetupPromptDismissedAt and continue without throwing, rather than
exiting before the install step.
In `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 135-150: The Windows handling in packageRunner currently routes
every binary through binary(), which incorrectly turns bunx into a .cmd shim.
Update packageRunner to special-case the "bun" branch so it uses bunx.exe on
win32 (or plain bunx when appropriate), while keeping binary() and the existing
.cmd behavior for pnpm, yarn, and npm shims.
In `@packages/cli/src/lib/agent/setup-status.ts`:
- Around line 25-41: The setup status logic in setup-status.ts is duplicating
the skills lock filename between the computed skillsLockPath used by
hasPrismaSkillsLock and the returned skillsLockPath field in the status object.
Update the setup-status flow around readPrismaAgentProjectFileStatus,
hasPrismaSkillsLock, and the returned object to derive both from the same
source, such as a shared constant or path.basename(skillsLockPath), so the value
stays consistent if the filename changes.
🪄 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: 6a6d0fa7-6817-4cd3-a20b-faf56031ffa5

📥 Commits

Reviewing files that changed from the base of the PR and between 7833e62 and 8dd0cd5.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts Outdated
Comment threadpackages/cli/src/controllers/app.ts
Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/src/lib/agent/setup-status.ts Outdated

@coderabbitaicoderabbitaiBot 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 165-178: runChildProcess currently spawns the executable directly,
which fails on Windows when resolveSkillsPackageRunner() returns .cmd/.bat
runners like npx.cmd or pnpm.cmd. Update runChildProcess to detect win32 and
launch these runners through a Windows-compatible path (for example using shell
execution or cmd.exe /c) while preserving args, cwd, env, and signal handling;
use the runChildProcess and resolveSkillsPackageRunner symbols to locate the
fix.
🪄 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: 10e171f8-8039-4f05-b73b-edebb47bf814

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd0cd5 and ec1d0ce.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from ec1d0ce to bd6a348CompareJune 25, 2026 11:28

@coderabbitaicoderabbitaiBot 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

♻️ Duplicate comments (1)
packages/cli/src/controllers/app.ts (1)

4248-4260: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Cancel still aborts the deploy (previously flagged as addressed).

confirmPrompt throws usageError on Esc/Ctrl+C, and the try/catch here only wraps runAgentInstall (Line 4262+), not the confirmPrompt call. So canceling this optional prompt aborts the whole deploy before any deploy work begins. The earlier review marked this resolved in ec1d0ce, but the current code does not handle cancellation — please confirm whether the fix was reverted.

Treat cancel the same as a decline: record the dismissal and continue.

🛡️ Proposed handling
- const shouldInstall = await confirmPrompt({- input: context.runtime.stdin,- output: context.runtime.stderr,- message: "Install Prisma agent guidance for this project?",- initialValue: true,- });-- if (!shouldInstall) {+ let shouldInstall: boolean;+ try {+ shouldInstall = await confirmPrompt({+ input: context.runtime.stdin,+ output: context.runtime.stderr,+ message: "Install Prisma agent guidance for this project?",+ initialValue: true,+ });+ } catch {+ shouldInstall = false;+ }++ if (!shouldInstall) {
await context.stateStore.setAgentSetupPromptDismissedAt(
new Date().toISOString(),
);
return [];
}
#!/bin/bash# Confirm confirmPrompt still throws on cancel and isn't wrapped at the call site.
fd -t f 'prompt.ts' packages/cli/src/shell --exec sed -n '60,95p' {}
printf'\n--- call site ---\n'
rg -nP -C3 'await confirmPrompt' packages/cli/src/controllers/app.ts
🤖 Prompt for 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.
In `@packages/cli/src/controllers/app.ts` around lines 4248 - 4260, The optional
install prompt in app.ts is not handling cancel, so Esc/Ctrl+C from
confirmPrompt still aborts the deploy. Update the confirmPrompt call site around
shouldInstall to catch usageError cancellation and treat it the same as a false
response: setAgentSetupPromptDismissedAt, then continue by returning [] only for
a real decline and otherwise proceed without failing the deploy. Use the
existing runAgentInstall try/catch location as a reference, but move the cancel
handling to the prompt step itself.
🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 2872-3126: Add a deploy test for the cancel path of the agent
guidance prompt, since the current cases only cover accept and decline. In the
`runAppDeploy` flow in `app-controller.test.ts`, make `confirmPrompt` reject to
simulate cancellation and assert it is handled like a decline: `deployApp` still
runs, `runAgentInstall` is not called, and `readAgentSetupPromptDismissedAt` is
recorded. Use the existing interactive deploy test setup and the
`confirmPrompt`, `runAppDeploy`, and `context.stateStore` symbols to place the
new case alongside the current prompt behavior tests.
---
Duplicate comments:
In `@packages/cli/src/controllers/app.ts`:
- Around line 4248-4260: The optional install prompt in app.ts is not handling
cancel, so Esc/Ctrl+C from confirmPrompt still aborts the deploy. Update the
confirmPrompt call site around shouldInstall to catch usageError cancellation
and treat it the same as a false response: setAgentSetupPromptDismissedAt, then
continue by returning [] only for a real decline and otherwise proceed without
failing the deploy. Use the existing runAgentInstall try/catch location as a
reference, but move the cancel handling to the prompt step itself.
🪄 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: d828c377-27dd-4fe7-9674-9565d8830d77

📥 Commits

Reviewing files that changed from the base of the PR and between ec1d0ce and bd6a348.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/tests/app-controller.test.ts Outdated
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 2 times, most recently from c181b4c to 1eb31e9CompareJune 25, 2026 12:02

@coderabbitaicoderabbitaiBot 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: 2

🤖 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 `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 147-164: packageRunnerForPackageManager currently mixes the spawn
runner with the display formatter by always applying binary(), which makes
help/examples emit .cmd on Windows. Split the logic used by
resolvePackageRunner* so resolveSkillsPackageRunner keeps the platform-specific
spawn binary behavior for agent.ts, while
resolvePrismaCliPackageCommandFormatter* returns plain package commands; update
the packageRunnerForPackageManager helper and any related formatter functions to
use the correct output for each path.
In `@packages/cli/tests/agent.test.ts`:
- Around line 54-62: The agent help and managed-file command strings are being
formatted with the Windows .cmd suffix from resolvePackageRunner(), which leaks
npx.cmd/pnpm.cmd into displayed output. Update the display-path in
formatPrismaCliCommand() and the agent command generation used by agent
help/status/install/update so .cmd is stripped for user-facing text, while
keeping the executable name with .cmd only for spawning.
🪄 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: 7894b920-baa6-41f8-a079-ae5770d48413

📥 Commits

Reviewing files that changed from the base of the PR and between c181b4c and 1eb31e9.

📒 Files selected for processing (22)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/cli-command.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/cli-command.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/shell/help.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/tests/agent.test.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 1eb31e9 to 416804cCompareJune 25, 2026 12:17
coderabbitai[bot]
coderabbitaiBot previously approved these changes Jun 25, 2026
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 16 times, most recently from cea395c to 452762bCompareJune 26, 2026 12:15
luanvdw
luanvdw previously approved these changes Jun 26, 2026

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work on this!

Could we make these minor docs changes?

  • agent is now listed in command-spec.md as part of the beta command surface, but command-principles.md still says the preview only includes auth, project, git, branch, database, and app.
  • The implementation adds a new structured error code, AGENT_SKILLS_INSTALL_FAILED, but error-conventions.md doesn’t list or define it yet.

Both are small, but since these docs are the contract for future CLI work and agent-facing behavior, I’d update them in this PR so we don’t leave the model slightly split.

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 076e420 to bfd2d37CompareJune 26, 2026 14:01

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

@AmanVarshney01
AmanVarshney01 merged commit e9666a6 into mainJun 29, 2026
10 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/agent-skills-install branch June 29, 2026 07:55
Sign up for freeto 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.

2 participants

@AmanVarshney01@luanvdw
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(cli): add agent skills setup flow - #100

Merged
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install
Jun 29, 2026
Merged

feat(cli): add agent skills setup flow#100
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install

Conversation

@AmanVarshney01

@AmanVarshney01AmanVarshney01 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds agent install, agent update, and agent status to install/check Prisma skills from prisma/skills.
  • Uses the detected package manager for CLI tips and the Skills CLI runner: bunx, pnpm dlx, yarn dlx, or npx -y.
  • Runs the Skills CLI through Execa, always buffers its output, and shows only Prisma CLI-owned success/failure text.
  • Reads skills-lock.json structurally for status/prompt decisions.
  • Auth can show an agent setup tip, and interactive app deploy can prompt once to install only prisma-compute.
  • Prompts use Clack with the CLI runtime streams and abort signal; selecting No dismisses the deploy prompt, while canceling aborts the command.
  • Dry-run output is honest and shell-safe, e.g. --skill '*'.

Examples

pnpm dlx @prisma/cli@latest agent install
pnpm dlx @prisma/cli@latest agent install --skill prisma-compute
pnpm dlx @prisma/cli@latest agent status --json
pnpm dlx @prisma/cli@latest agent status --global

Without package-manager detection:

npx -y @prisma/cli@latest agent install

Deploy prompt output:

◇ Install the Prisma Compute skill for this project?
│ Yes
✔ Installed the Prisma Compute skill for this project.

Testing

  • pnpm --filter @prisma/cli exec vitest run tests/prompt.test.ts tests/app-controller.test.ts tests/agent.test.ts
  • pnpm --filter @prisma/cli test
  • pnpm --recursive exec tsc --noEmit
  • pnpm lint
  • Manual agent install --skill prisma-compute smoke from /Users/aman/dev/test/prisma-cli-agent-install-quiet
  • Manual deploy prompt smoke from /Users/aman/dev/test/prisma-cli-deploy-quiet

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds the agent command group with install, update, and status subcommands, plus shared types and command metadata. It introduces setup-state detection, managed AGENTS.md/CLAUDE.md updates, package-manager runner resolution, and local dismissed-prompt persistence. auth login can now suggest prisma-cli agent install, and app deploy can prompt to install agent guidance for linked projects. New tests cover the agent commands, auth hinting, and deploy prompting.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.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 nameStatusExplanation
Title check✅ PassedThe title is concise and accurately captures the main change: adding an agent skills setup flow to the CLI.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description check✅ PassedThe description matches the changeset by summarizing the new agent commands, package-manager runner support, prompts, and documentation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/agent-skills-install
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/agent-skills-install

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

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 8dd0cd5 to ec1d0ceCompareJune 25, 2026 11:16

@coderabbitaicoderabbitaiBot 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: 4

🤖 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 186-198: The child process error handler in the install flow is
treating aborts as failures, so update the `child.on("error")` path to detect an
`AbortError` from `spawn` and re-throw or reject with that abort instead of
wrapping it in `skillsInstallFailed(...)`. Keep `child.on("close")` for real
exit codes, but let cancellations from the `context.runtime.signal` propagate
cleanly so the runtime handles them as user aborts rather than install errors.
In `@packages/cli/src/controllers/app.ts`:
- Around line 4246-4258: The optional agent-setup prompt in app.ts currently
aborts when confirmPrompt is canceled instead of treating cancel like a declined
install. Update the flow around confirmPrompt so Esc/Ctrl+C is handled the same
as a false response, using the existing shouldInstall branch to record
setAgentSetupPromptDismissedAt and continue without throwing, rather than
exiting before the install step.
In `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 135-150: The Windows handling in packageRunner currently routes
every binary through binary(), which incorrectly turns bunx into a .cmd shim.
Update packageRunner to special-case the "bun" branch so it uses bunx.exe on
win32 (or plain bunx when appropriate), while keeping binary() and the existing
.cmd behavior for pnpm, yarn, and npm shims.
In `@packages/cli/src/lib/agent/setup-status.ts`:
- Around line 25-41: The setup status logic in setup-status.ts is duplicating
the skills lock filename between the computed skillsLockPath used by
hasPrismaSkillsLock and the returned skillsLockPath field in the status object.
Update the setup-status flow around readPrismaAgentProjectFileStatus,
hasPrismaSkillsLock, and the returned object to derive both from the same
source, such as a shared constant or path.basename(skillsLockPath), so the value
stays consistent if the filename changes.
🪄 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: 6a6d0fa7-6817-4cd3-a20b-faf56031ffa5

📥 Commits

Reviewing files that changed from the base of the PR and between 7833e62 and 8dd0cd5.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts Outdated
Comment threadpackages/cli/src/controllers/app.ts
Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/src/lib/agent/setup-status.ts Outdated

@coderabbitaicoderabbitaiBot 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 165-178: runChildProcess currently spawns the executable directly,
which fails on Windows when resolveSkillsPackageRunner() returns .cmd/.bat
runners like npx.cmd or pnpm.cmd. Update runChildProcess to detect win32 and
launch these runners through a Windows-compatible path (for example using shell
execution or cmd.exe /c) while preserving args, cwd, env, and signal handling;
use the runChildProcess and resolveSkillsPackageRunner symbols to locate the
fix.
🪄 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: 10e171f8-8039-4f05-b73b-edebb47bf814

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd0cd5 and ec1d0ce.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from ec1d0ce to bd6a348CompareJune 25, 2026 11:28

@coderabbitaicoderabbitaiBot 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

♻️ Duplicate comments (1)
packages/cli/src/controllers/app.ts (1)

4248-4260: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Cancel still aborts the deploy (previously flagged as addressed).

confirmPrompt throws usageError on Esc/Ctrl+C, and the try/catch here only wraps runAgentInstall (Line 4262+), not the confirmPrompt call. So canceling this optional prompt aborts the whole deploy before any deploy work begins. The earlier review marked this resolved in ec1d0ce, but the current code does not handle cancellation — please confirm whether the fix was reverted.

Treat cancel the same as a decline: record the dismissal and continue.

🛡️ Proposed handling
- const shouldInstall = await confirmPrompt({- input: context.runtime.stdin,- output: context.runtime.stderr,- message: "Install Prisma agent guidance for this project?",- initialValue: true,- });-- if (!shouldInstall) {+ let shouldInstall: boolean;+ try {+ shouldInstall = await confirmPrompt({+ input: context.runtime.stdin,+ output: context.runtime.stderr,+ message: "Install Prisma agent guidance for this project?",+ initialValue: true,+ });+ } catch {+ shouldInstall = false;+ }++ if (!shouldInstall) {
await context.stateStore.setAgentSetupPromptDismissedAt(
new Date().toISOString(),
);
return [];
}
#!/bin/bash# Confirm confirmPrompt still throws on cancel and isn't wrapped at the call site.
fd -t f 'prompt.ts' packages/cli/src/shell --exec sed -n '60,95p' {}
printf'\n--- call site ---\n'
rg -nP -C3 'await confirmPrompt' packages/cli/src/controllers/app.ts
🤖 Prompt for 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.
In `@packages/cli/src/controllers/app.ts` around lines 4248 - 4260, The optional
install prompt in app.ts is not handling cancel, so Esc/Ctrl+C from
confirmPrompt still aborts the deploy. Update the confirmPrompt call site around
shouldInstall to catch usageError cancellation and treat it the same as a false
response: setAgentSetupPromptDismissedAt, then continue by returning [] only for
a real decline and otherwise proceed without failing the deploy. Use the
existing runAgentInstall try/catch location as a reference, but move the cancel
handling to the prompt step itself.
🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 2872-3126: Add a deploy test for the cancel path of the agent
guidance prompt, since the current cases only cover accept and decline. In the
`runAppDeploy` flow in `app-controller.test.ts`, make `confirmPrompt` reject to
simulate cancellation and assert it is handled like a decline: `deployApp` still
runs, `runAgentInstall` is not called, and `readAgentSetupPromptDismissedAt` is
recorded. Use the existing interactive deploy test setup and the
`confirmPrompt`, `runAppDeploy`, and `context.stateStore` symbols to place the
new case alongside the current prompt behavior tests.
---
Duplicate comments:
In `@packages/cli/src/controllers/app.ts`:
- Around line 4248-4260: The optional install prompt in app.ts is not handling
cancel, so Esc/Ctrl+C from confirmPrompt still aborts the deploy. Update the
confirmPrompt call site around shouldInstall to catch usageError cancellation
and treat it the same as a false response: setAgentSetupPromptDismissedAt, then
continue by returning [] only for a real decline and otherwise proceed without
failing the deploy. Use the existing runAgentInstall try/catch location as a
reference, but move the cancel handling to the prompt step itself.
🪄 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: d828c377-27dd-4fe7-9674-9565d8830d77

📥 Commits

Reviewing files that changed from the base of the PR and between ec1d0ce and bd6a348.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/tests/app-controller.test.ts Outdated
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 2 times, most recently from c181b4c to 1eb31e9CompareJune 25, 2026 12:02

@coderabbitaicoderabbitaiBot 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: 2

🤖 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 `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 147-164: packageRunnerForPackageManager currently mixes the spawn
runner with the display formatter by always applying binary(), which makes
help/examples emit .cmd on Windows. Split the logic used by
resolvePackageRunner* so resolveSkillsPackageRunner keeps the platform-specific
spawn binary behavior for agent.ts, while
resolvePrismaCliPackageCommandFormatter* returns plain package commands; update
the packageRunnerForPackageManager helper and any related formatter functions to
use the correct output for each path.
In `@packages/cli/tests/agent.test.ts`:
- Around line 54-62: The agent help and managed-file command strings are being
formatted with the Windows .cmd suffix from resolvePackageRunner(), which leaks
npx.cmd/pnpm.cmd into displayed output. Update the display-path in
formatPrismaCliCommand() and the agent command generation used by agent
help/status/install/update so .cmd is stripped for user-facing text, while
keeping the executable name with .cmd only for spawning.
🪄 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: 7894b920-baa6-41f8-a079-ae5770d48413

📥 Commits

Reviewing files that changed from the base of the PR and between c181b4c and 1eb31e9.

📒 Files selected for processing (22)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/cli-command.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/cli-command.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/shell/help.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/tests/agent.test.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 1eb31e9 to 416804cCompareJune 25, 2026 12:17
coderabbitai[bot]
coderabbitaiBot previously approved these changes Jun 25, 2026
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 16 times, most recently from cea395c to 452762bCompareJune 26, 2026 12:15
luanvdw
luanvdw previously approved these changes Jun 26, 2026

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work on this!

Could we make these minor docs changes?

  • agent is now listed in command-spec.md as part of the beta command surface, but command-principles.md still says the preview only includes auth, project, git, branch, database, and app.
  • The implementation adds a new structured error code, AGENT_SKILLS_INSTALL_FAILED, but error-conventions.md doesn’t list or define it yet.

Both are small, but since these docs are the contract for future CLI work and agent-facing behavior, I’d update them in this PR so we don’t leave the model slightly split.

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 076e420 to bfd2d37CompareJune 26, 2026 14:01

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

@AmanVarshney01
AmanVarshney01 merged commit e9666a6 into mainJun 29, 2026
10 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/agent-skills-install branch June 29, 2026 07:55
Sign up for freeto 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.

2 participants

@AmanVarshney01@luanvdw
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(cli): add agent skills setup flow - #100

Merged
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install
Jun 29, 2026
Merged

feat(cli): add agent skills setup flow#100
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install

Conversation

@AmanVarshney01

@AmanVarshney01AmanVarshney01 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds agent install, agent update, and agent status to install/check Prisma skills from prisma/skills.
  • Uses the detected package manager for CLI tips and the Skills CLI runner: bunx, pnpm dlx, yarn dlx, or npx -y.
  • Runs the Skills CLI through Execa, always buffers its output, and shows only Prisma CLI-owned success/failure text.
  • Reads skills-lock.json structurally for status/prompt decisions.
  • Auth can show an agent setup tip, and interactive app deploy can prompt once to install only prisma-compute.
  • Prompts use Clack with the CLI runtime streams and abort signal; selecting No dismisses the deploy prompt, while canceling aborts the command.
  • Dry-run output is honest and shell-safe, e.g. --skill '*'.

Examples

pnpm dlx @prisma/cli@latest agent install
pnpm dlx @prisma/cli@latest agent install --skill prisma-compute
pnpm dlx @prisma/cli@latest agent status --json
pnpm dlx @prisma/cli@latest agent status --global

Without package-manager detection:

npx -y @prisma/cli@latest agent install

Deploy prompt output:

◇ Install the Prisma Compute skill for this project?
│ Yes
✔ Installed the Prisma Compute skill for this project.

Testing

  • pnpm --filter @prisma/cli exec vitest run tests/prompt.test.ts tests/app-controller.test.ts tests/agent.test.ts
  • pnpm --filter @prisma/cli test
  • pnpm --recursive exec tsc --noEmit
  • pnpm lint
  • Manual agent install --skill prisma-compute smoke from /Users/aman/dev/test/prisma-cli-agent-install-quiet
  • Manual deploy prompt smoke from /Users/aman/dev/test/prisma-cli-deploy-quiet

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds the agent command group with install, update, and status subcommands, plus shared types and command metadata. It introduces setup-state detection, managed AGENTS.md/CLAUDE.md updates, package-manager runner resolution, and local dismissed-prompt persistence. auth login can now suggest prisma-cli agent install, and app deploy can prompt to install agent guidance for linked projects. New tests cover the agent commands, auth hinting, and deploy prompting.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.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 nameStatusExplanation
Title check✅ PassedThe title is concise and accurately captures the main change: adding an agent skills setup flow to the CLI.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description check✅ PassedThe description matches the changeset by summarizing the new agent commands, package-manager runner support, prompts, and documentation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/agent-skills-install
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/agent-skills-install

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

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 8dd0cd5 to ec1d0ceCompareJune 25, 2026 11:16

@coderabbitaicoderabbitaiBot 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: 4

🤖 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 186-198: The child process error handler in the install flow is
treating aborts as failures, so update the `child.on("error")` path to detect an
`AbortError` from `spawn` and re-throw or reject with that abort instead of
wrapping it in `skillsInstallFailed(...)`. Keep `child.on("close")` for real
exit codes, but let cancellations from the `context.runtime.signal` propagate
cleanly so the runtime handles them as user aborts rather than install errors.
In `@packages/cli/src/controllers/app.ts`:
- Around line 4246-4258: The optional agent-setup prompt in app.ts currently
aborts when confirmPrompt is canceled instead of treating cancel like a declined
install. Update the flow around confirmPrompt so Esc/Ctrl+C is handled the same
as a false response, using the existing shouldInstall branch to record
setAgentSetupPromptDismissedAt and continue without throwing, rather than
exiting before the install step.
In `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 135-150: The Windows handling in packageRunner currently routes
every binary through binary(), which incorrectly turns bunx into a .cmd shim.
Update packageRunner to special-case the "bun" branch so it uses bunx.exe on
win32 (or plain bunx when appropriate), while keeping binary() and the existing
.cmd behavior for pnpm, yarn, and npm shims.
In `@packages/cli/src/lib/agent/setup-status.ts`:
- Around line 25-41: The setup status logic in setup-status.ts is duplicating
the skills lock filename between the computed skillsLockPath used by
hasPrismaSkillsLock and the returned skillsLockPath field in the status object.
Update the setup-status flow around readPrismaAgentProjectFileStatus,
hasPrismaSkillsLock, and the returned object to derive both from the same
source, such as a shared constant or path.basename(skillsLockPath), so the value
stays consistent if the filename changes.
🪄 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: 6a6d0fa7-6817-4cd3-a20b-faf56031ffa5

📥 Commits

Reviewing files that changed from the base of the PR and between 7833e62 and 8dd0cd5.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts Outdated
Comment threadpackages/cli/src/controllers/app.ts
Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/src/lib/agent/setup-status.ts Outdated

@coderabbitaicoderabbitaiBot 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 165-178: runChildProcess currently spawns the executable directly,
which fails on Windows when resolveSkillsPackageRunner() returns .cmd/.bat
runners like npx.cmd or pnpm.cmd. Update runChildProcess to detect win32 and
launch these runners through a Windows-compatible path (for example using shell
execution or cmd.exe /c) while preserving args, cwd, env, and signal handling;
use the runChildProcess and resolveSkillsPackageRunner symbols to locate the
fix.
🪄 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: 10e171f8-8039-4f05-b73b-edebb47bf814

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd0cd5 and ec1d0ce.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from ec1d0ce to bd6a348CompareJune 25, 2026 11:28

@coderabbitaicoderabbitaiBot 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

♻️ Duplicate comments (1)
packages/cli/src/controllers/app.ts (1)

4248-4260: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Cancel still aborts the deploy (previously flagged as addressed).

confirmPrompt throws usageError on Esc/Ctrl+C, and the try/catch here only wraps runAgentInstall (Line 4262+), not the confirmPrompt call. So canceling this optional prompt aborts the whole deploy before any deploy work begins. The earlier review marked this resolved in ec1d0ce, but the current code does not handle cancellation — please confirm whether the fix was reverted.

Treat cancel the same as a decline: record the dismissal and continue.

🛡️ Proposed handling
- const shouldInstall = await confirmPrompt({- input: context.runtime.stdin,- output: context.runtime.stderr,- message: "Install Prisma agent guidance for this project?",- initialValue: true,- });-- if (!shouldInstall) {+ let shouldInstall: boolean;+ try {+ shouldInstall = await confirmPrompt({+ input: context.runtime.stdin,+ output: context.runtime.stderr,+ message: "Install Prisma agent guidance for this project?",+ initialValue: true,+ });+ } catch {+ shouldInstall = false;+ }++ if (!shouldInstall) {
await context.stateStore.setAgentSetupPromptDismissedAt(
new Date().toISOString(),
);
return [];
}
#!/bin/bash# Confirm confirmPrompt still throws on cancel and isn't wrapped at the call site.
fd -t f 'prompt.ts' packages/cli/src/shell --exec sed -n '60,95p' {}
printf'\n--- call site ---\n'
rg -nP -C3 'await confirmPrompt' packages/cli/src/controllers/app.ts
🤖 Prompt for 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.
In `@packages/cli/src/controllers/app.ts` around lines 4248 - 4260, The optional
install prompt in app.ts is not handling cancel, so Esc/Ctrl+C from
confirmPrompt still aborts the deploy. Update the confirmPrompt call site around
shouldInstall to catch usageError cancellation and treat it the same as a false
response: setAgentSetupPromptDismissedAt, then continue by returning [] only for
a real decline and otherwise proceed without failing the deploy. Use the
existing runAgentInstall try/catch location as a reference, but move the cancel
handling to the prompt step itself.
🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 2872-3126: Add a deploy test for the cancel path of the agent
guidance prompt, since the current cases only cover accept and decline. In the
`runAppDeploy` flow in `app-controller.test.ts`, make `confirmPrompt` reject to
simulate cancellation and assert it is handled like a decline: `deployApp` still
runs, `runAgentInstall` is not called, and `readAgentSetupPromptDismissedAt` is
recorded. Use the existing interactive deploy test setup and the
`confirmPrompt`, `runAppDeploy`, and `context.stateStore` symbols to place the
new case alongside the current prompt behavior tests.
---
Duplicate comments:
In `@packages/cli/src/controllers/app.ts`:
- Around line 4248-4260: The optional install prompt in app.ts is not handling
cancel, so Esc/Ctrl+C from confirmPrompt still aborts the deploy. Update the
confirmPrompt call site around shouldInstall to catch usageError cancellation
and treat it the same as a false response: setAgentSetupPromptDismissedAt, then
continue by returning [] only for a real decline and otherwise proceed without
failing the deploy. Use the existing runAgentInstall try/catch location as a
reference, but move the cancel handling to the prompt step itself.
🪄 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: d828c377-27dd-4fe7-9674-9565d8830d77

📥 Commits

Reviewing files that changed from the base of the PR and between ec1d0ce and bd6a348.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/tests/app-controller.test.ts Outdated
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 2 times, most recently from c181b4c to 1eb31e9CompareJune 25, 2026 12:02

@coderabbitaicoderabbitaiBot 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: 2

🤖 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 `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 147-164: packageRunnerForPackageManager currently mixes the spawn
runner with the display formatter by always applying binary(), which makes
help/examples emit .cmd on Windows. Split the logic used by
resolvePackageRunner* so resolveSkillsPackageRunner keeps the platform-specific
spawn binary behavior for agent.ts, while
resolvePrismaCliPackageCommandFormatter* returns plain package commands; update
the packageRunnerForPackageManager helper and any related formatter functions to
use the correct output for each path.
In `@packages/cli/tests/agent.test.ts`:
- Around line 54-62: The agent help and managed-file command strings are being
formatted with the Windows .cmd suffix from resolvePackageRunner(), which leaks
npx.cmd/pnpm.cmd into displayed output. Update the display-path in
formatPrismaCliCommand() and the agent command generation used by agent
help/status/install/update so .cmd is stripped for user-facing text, while
keeping the executable name with .cmd only for spawning.
🪄 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: 7894b920-baa6-41f8-a079-ae5770d48413

📥 Commits

Reviewing files that changed from the base of the PR and between c181b4c and 1eb31e9.

📒 Files selected for processing (22)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/cli-command.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/cli-command.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/shell/help.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/tests/agent.test.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 1eb31e9 to 416804cCompareJune 25, 2026 12:17
coderabbitai[bot]
coderabbitaiBot previously approved these changes Jun 25, 2026
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 16 times, most recently from cea395c to 452762bCompareJune 26, 2026 12:15
luanvdw
luanvdw previously approved these changes Jun 26, 2026

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work on this!

Could we make these minor docs changes?

  • agent is now listed in command-spec.md as part of the beta command surface, but command-principles.md still says the preview only includes auth, project, git, branch, database, and app.
  • The implementation adds a new structured error code, AGENT_SKILLS_INSTALL_FAILED, but error-conventions.md doesn’t list or define it yet.

Both are small, but since these docs are the contract for future CLI work and agent-facing behavior, I’d update them in this PR so we don’t leave the model slightly split.

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 076e420 to bfd2d37CompareJune 26, 2026 14:01

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

@AmanVarshney01
AmanVarshney01 merged commit e9666a6 into mainJun 29, 2026
10 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/agent-skills-install branch June 29, 2026 07:55
Sign up for freeto 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.

2 participants

@AmanVarshney01@luanvdw
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

feat(cli): add agent skills setup flow - #100

Merged
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install
Jun 29, 2026
Merged

feat(cli): add agent skills setup flow#100
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install

Conversation

@AmanVarshney01

@AmanVarshney01AmanVarshney01 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds agent install, agent update, and agent status to install/check Prisma skills from prisma/skills.
  • Uses the detected package manager for CLI tips and the Skills CLI runner: bunx, pnpm dlx, yarn dlx, or npx -y.
  • Runs the Skills CLI through Execa, always buffers its output, and shows only Prisma CLI-owned success/failure text.
  • Reads skills-lock.json structurally for status/prompt decisions.
  • Auth can show an agent setup tip, and interactive app deploy can prompt once to install only prisma-compute.
  • Prompts use Clack with the CLI runtime streams and abort signal; selecting No dismisses the deploy prompt, while canceling aborts the command.
  • Dry-run output is honest and shell-safe, e.g. --skill '*'.

Examples

pnpm dlx @prisma/cli@latest agent install
pnpm dlx @prisma/cli@latest agent install --skill prisma-compute
pnpm dlx @prisma/cli@latest agent status --json
pnpm dlx @prisma/cli@latest agent status --global

Without package-manager detection:

npx -y @prisma/cli@latest agent install

Deploy prompt output:

◇ Install the Prisma Compute skill for this project?
│ Yes
✔ Installed the Prisma Compute skill for this project.

Testing

  • pnpm --filter @prisma/cli exec vitest run tests/prompt.test.ts tests/app-controller.test.ts tests/agent.test.ts
  • pnpm --filter @prisma/cli test
  • pnpm --recursive exec tsc --noEmit
  • pnpm lint
  • Manual agent install --skill prisma-compute smoke from /Users/aman/dev/test/prisma-cli-agent-install-quiet
  • Manual deploy prompt smoke from /Users/aman/dev/test/prisma-cli-deploy-quiet

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds the agent command group with install, update, and status subcommands, plus shared types and command metadata. It introduces setup-state detection, managed AGENTS.md/CLAUDE.md updates, package-manager runner resolution, and local dismissed-prompt persistence. auth login can now suggest prisma-cli agent install, and app deploy can prompt to install agent guidance for linked projects. New tests cover the agent commands, auth hinting, and deploy prompting.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.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 nameStatusExplanation
Title check✅ PassedThe title is concise and accurately captures the main change: adding an agent skills setup flow to the CLI.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description check✅ PassedThe description matches the changeset by summarizing the new agent commands, package-manager runner support, prompts, and documentation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/agent-skills-install
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/agent-skills-install

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

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 8dd0cd5 to ec1d0ceCompareJune 25, 2026 11:16

@coderabbitaicoderabbitaiBot 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: 4

🤖 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 186-198: The child process error handler in the install flow is
treating aborts as failures, so update the `child.on("error")` path to detect an
`AbortError` from `spawn` and re-throw or reject with that abort instead of
wrapping it in `skillsInstallFailed(...)`. Keep `child.on("close")` for real
exit codes, but let cancellations from the `context.runtime.signal` propagate
cleanly so the runtime handles them as user aborts rather than install errors.
In `@packages/cli/src/controllers/app.ts`:
- Around line 4246-4258: The optional agent-setup prompt in app.ts currently
aborts when confirmPrompt is canceled instead of treating cancel like a declined
install. Update the flow around confirmPrompt so Esc/Ctrl+C is handled the same
as a false response, using the existing shouldInstall branch to record
setAgentSetupPromptDismissedAt and continue without throwing, rather than
exiting before the install step.
In `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 135-150: The Windows handling in packageRunner currently routes
every binary through binary(), which incorrectly turns bunx into a .cmd shim.
Update packageRunner to special-case the "bun" branch so it uses bunx.exe on
win32 (or plain bunx when appropriate), while keeping binary() and the existing
.cmd behavior for pnpm, yarn, and npm shims.
In `@packages/cli/src/lib/agent/setup-status.ts`:
- Around line 25-41: The setup status logic in setup-status.ts is duplicating
the skills lock filename between the computed skillsLockPath used by
hasPrismaSkillsLock and the returned skillsLockPath field in the status object.
Update the setup-status flow around readPrismaAgentProjectFileStatus,
hasPrismaSkillsLock, and the returned object to derive both from the same
source, such as a shared constant or path.basename(skillsLockPath), so the value
stays consistent if the filename changes.
🪄 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: 6a6d0fa7-6817-4cd3-a20b-faf56031ffa5

📥 Commits

Reviewing files that changed from the base of the PR and between 7833e62 and 8dd0cd5.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts Outdated
Comment threadpackages/cli/src/controllers/app.ts
Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/src/lib/agent/setup-status.ts Outdated

@coderabbitaicoderabbitaiBot 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 165-178: runChildProcess currently spawns the executable directly,
which fails on Windows when resolveSkillsPackageRunner() returns .cmd/.bat
runners like npx.cmd or pnpm.cmd. Update runChildProcess to detect win32 and
launch these runners through a Windows-compatible path (for example using shell
execution or cmd.exe /c) while preserving args, cwd, env, and signal handling;
use the runChildProcess and resolveSkillsPackageRunner symbols to locate the
fix.
🪄 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: 10e171f8-8039-4f05-b73b-edebb47bf814

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd0cd5 and ec1d0ce.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from ec1d0ce to bd6a348CompareJune 25, 2026 11:28

@coderabbitaicoderabbitaiBot 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

♻️ Duplicate comments (1)
packages/cli/src/controllers/app.ts (1)

4248-4260: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Cancel still aborts the deploy (previously flagged as addressed).

confirmPrompt throws usageError on Esc/Ctrl+C, and the try/catch here only wraps runAgentInstall (Line 4262+), not the confirmPrompt call. So canceling this optional prompt aborts the whole deploy before any deploy work begins. The earlier review marked this resolved in ec1d0ce, but the current code does not handle cancellation — please confirm whether the fix was reverted.

Treat cancel the same as a decline: record the dismissal and continue.

🛡️ Proposed handling
- const shouldInstall = await confirmPrompt({- input: context.runtime.stdin,- output: context.runtime.stderr,- message: "Install Prisma agent guidance for this project?",- initialValue: true,- });-- if (!shouldInstall) {+ let shouldInstall: boolean;+ try {+ shouldInstall = await confirmPrompt({+ input: context.runtime.stdin,+ output: context.runtime.stderr,+ message: "Install Prisma agent guidance for this project?",+ initialValue: true,+ });+ } catch {+ shouldInstall = false;+ }++ if (!shouldInstall) {
await context.stateStore.setAgentSetupPromptDismissedAt(
new Date().toISOString(),
);
return [];
}
#!/bin/bash# Confirm confirmPrompt still throws on cancel and isn't wrapped at the call site.
fd -t f 'prompt.ts' packages/cli/src/shell --exec sed -n '60,95p' {}
printf'\n--- call site ---\n'
rg -nP -C3 'await confirmPrompt' packages/cli/src/controllers/app.ts
🤖 Prompt for 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.
In `@packages/cli/src/controllers/app.ts` around lines 4248 - 4260, The optional
install prompt in app.ts is not handling cancel, so Esc/Ctrl+C from
confirmPrompt still aborts the deploy. Update the confirmPrompt call site around
shouldInstall to catch usageError cancellation and treat it the same as a false
response: setAgentSetupPromptDismissedAt, then continue by returning [] only for
a real decline and otherwise proceed without failing the deploy. Use the
existing runAgentInstall try/catch location as a reference, but move the cancel
handling to the prompt step itself.
🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 2872-3126: Add a deploy test for the cancel path of the agent
guidance prompt, since the current cases only cover accept and decline. In the
`runAppDeploy` flow in `app-controller.test.ts`, make `confirmPrompt` reject to
simulate cancellation and assert it is handled like a decline: `deployApp` still
runs, `runAgentInstall` is not called, and `readAgentSetupPromptDismissedAt` is
recorded. Use the existing interactive deploy test setup and the
`confirmPrompt`, `runAppDeploy`, and `context.stateStore` symbols to place the
new case alongside the current prompt behavior tests.
---
Duplicate comments:
In `@packages/cli/src/controllers/app.ts`:
- Around line 4248-4260: The optional install prompt in app.ts is not handling
cancel, so Esc/Ctrl+C from confirmPrompt still aborts the deploy. Update the
confirmPrompt call site around shouldInstall to catch usageError cancellation
and treat it the same as a false response: setAgentSetupPromptDismissedAt, then
continue by returning [] only for a real decline and otherwise proceed without
failing the deploy. Use the existing runAgentInstall try/catch location as a
reference, but move the cancel handling to the prompt step itself.
🪄 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: d828c377-27dd-4fe7-9674-9565d8830d77

📥 Commits

Reviewing files that changed from the base of the PR and between ec1d0ce and bd6a348.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/tests/app-controller.test.ts Outdated
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 2 times, most recently from c181b4c to 1eb31e9CompareJune 25, 2026 12:02

@coderabbitaicoderabbitaiBot 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: 2

🤖 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 `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 147-164: packageRunnerForPackageManager currently mixes the spawn
runner with the display formatter by always applying binary(), which makes
help/examples emit .cmd on Windows. Split the logic used by
resolvePackageRunner* so resolveSkillsPackageRunner keeps the platform-specific
spawn binary behavior for agent.ts, while
resolvePrismaCliPackageCommandFormatter* returns plain package commands; update
the packageRunnerForPackageManager helper and any related formatter functions to
use the correct output for each path.
In `@packages/cli/tests/agent.test.ts`:
- Around line 54-62: The agent help and managed-file command strings are being
formatted with the Windows .cmd suffix from resolvePackageRunner(), which leaks
npx.cmd/pnpm.cmd into displayed output. Update the display-path in
formatPrismaCliCommand() and the agent command generation used by agent
help/status/install/update so .cmd is stripped for user-facing text, while
keeping the executable name with .cmd only for spawning.
🪄 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: 7894b920-baa6-41f8-a079-ae5770d48413

📥 Commits

Reviewing files that changed from the base of the PR and between c181b4c and 1eb31e9.

📒 Files selected for processing (22)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/cli-command.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/cli-command.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/shell/help.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/tests/agent.test.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 1eb31e9 to 416804cCompareJune 25, 2026 12:17
coderabbitai[bot]
coderabbitaiBot previously approved these changes Jun 25, 2026
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 16 times, most recently from cea395c to 452762bCompareJune 26, 2026 12:15
luanvdw
luanvdw previously approved these changes Jun 26, 2026

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work on this!

Could we make these minor docs changes?

  • agent is now listed in command-spec.md as part of the beta command surface, but command-principles.md still says the preview only includes auth, project, git, branch, database, and app.
  • The implementation adds a new structured error code, AGENT_SKILLS_INSTALL_FAILED, but error-conventions.md doesn’t list or define it yet.

Both are small, but since these docs are the contract for future CLI work and agent-facing behavior, I’d update them in this PR so we don’t leave the model slightly split.

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 076e420 to bfd2d37CompareJune 26, 2026 14:01

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

@AmanVarshney01
AmanVarshney01 merged commit e9666a6 into mainJun 29, 2026
10 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/agent-skills-install branch June 29, 2026 07:55
Sign up for freeto 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.

2 participants

@AmanVarshney01@luanvdw
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(cli): add agent skills setup flow - #100

Merged
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install
Jun 29, 2026
Merged

feat(cli): add agent skills setup flow#100
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install

Conversation

@AmanVarshney01

@AmanVarshney01AmanVarshney01 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds agent install, agent update, and agent status to install/check Prisma skills from prisma/skills.
  • Uses the detected package manager for CLI tips and the Skills CLI runner: bunx, pnpm dlx, yarn dlx, or npx -y.
  • Runs the Skills CLI through Execa, always buffers its output, and shows only Prisma CLI-owned success/failure text.
  • Reads skills-lock.json structurally for status/prompt decisions.
  • Auth can show an agent setup tip, and interactive app deploy can prompt once to install only prisma-compute.
  • Prompts use Clack with the CLI runtime streams and abort signal; selecting No dismisses the deploy prompt, while canceling aborts the command.
  • Dry-run output is honest and shell-safe, e.g. --skill '*'.

Examples

pnpm dlx @prisma/cli@latest agent install
pnpm dlx @prisma/cli@latest agent install --skill prisma-compute
pnpm dlx @prisma/cli@latest agent status --json
pnpm dlx @prisma/cli@latest agent status --global

Without package-manager detection:

npx -y @prisma/cli@latest agent install

Deploy prompt output:

◇ Install the Prisma Compute skill for this project?
│ Yes
✔ Installed the Prisma Compute skill for this project.

Testing

  • pnpm --filter @prisma/cli exec vitest run tests/prompt.test.ts tests/app-controller.test.ts tests/agent.test.ts
  • pnpm --filter @prisma/cli test
  • pnpm --recursive exec tsc --noEmit
  • pnpm lint
  • Manual agent install --skill prisma-compute smoke from /Users/aman/dev/test/prisma-cli-agent-install-quiet
  • Manual deploy prompt smoke from /Users/aman/dev/test/prisma-cli-deploy-quiet

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds the agent command group with install, update, and status subcommands, plus shared types and command metadata. It introduces setup-state detection, managed AGENTS.md/CLAUDE.md updates, package-manager runner resolution, and local dismissed-prompt persistence. auth login can now suggest prisma-cli agent install, and app deploy can prompt to install agent guidance for linked projects. New tests cover the agent commands, auth hinting, and deploy prompting.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.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 nameStatusExplanation
Title check✅ PassedThe title is concise and accurately captures the main change: adding an agent skills setup flow to the CLI.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description check✅ PassedThe description matches the changeset by summarizing the new agent commands, package-manager runner support, prompts, and documentation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/agent-skills-install
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/agent-skills-install

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

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 8dd0cd5 to ec1d0ceCompareJune 25, 2026 11:16

@coderabbitaicoderabbitaiBot 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: 4

🤖 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 186-198: The child process error handler in the install flow is
treating aborts as failures, so update the `child.on("error")` path to detect an
`AbortError` from `spawn` and re-throw or reject with that abort instead of
wrapping it in `skillsInstallFailed(...)`. Keep `child.on("close")` for real
exit codes, but let cancellations from the `context.runtime.signal` propagate
cleanly so the runtime handles them as user aborts rather than install errors.
In `@packages/cli/src/controllers/app.ts`:
- Around line 4246-4258: The optional agent-setup prompt in app.ts currently
aborts when confirmPrompt is canceled instead of treating cancel like a declined
install. Update the flow around confirmPrompt so Esc/Ctrl+C is handled the same
as a false response, using the existing shouldInstall branch to record
setAgentSetupPromptDismissedAt and continue without throwing, rather than
exiting before the install step.
In `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 135-150: The Windows handling in packageRunner currently routes
every binary through binary(), which incorrectly turns bunx into a .cmd shim.
Update packageRunner to special-case the "bun" branch so it uses bunx.exe on
win32 (or plain bunx when appropriate), while keeping binary() and the existing
.cmd behavior for pnpm, yarn, and npm shims.
In `@packages/cli/src/lib/agent/setup-status.ts`:
- Around line 25-41: The setup status logic in setup-status.ts is duplicating
the skills lock filename between the computed skillsLockPath used by
hasPrismaSkillsLock and the returned skillsLockPath field in the status object.
Update the setup-status flow around readPrismaAgentProjectFileStatus,
hasPrismaSkillsLock, and the returned object to derive both from the same
source, such as a shared constant or path.basename(skillsLockPath), so the value
stays consistent if the filename changes.
🪄 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: 6a6d0fa7-6817-4cd3-a20b-faf56031ffa5

📥 Commits

Reviewing files that changed from the base of the PR and between 7833e62 and 8dd0cd5.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts Outdated
Comment threadpackages/cli/src/controllers/app.ts
Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/src/lib/agent/setup-status.ts Outdated

@coderabbitaicoderabbitaiBot 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 165-178: runChildProcess currently spawns the executable directly,
which fails on Windows when resolveSkillsPackageRunner() returns .cmd/.bat
runners like npx.cmd or pnpm.cmd. Update runChildProcess to detect win32 and
launch these runners through a Windows-compatible path (for example using shell
execution or cmd.exe /c) while preserving args, cwd, env, and signal handling;
use the runChildProcess and resolveSkillsPackageRunner symbols to locate the
fix.
🪄 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: 10e171f8-8039-4f05-b73b-edebb47bf814

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd0cd5 and ec1d0ce.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from ec1d0ce to bd6a348CompareJune 25, 2026 11:28

@coderabbitaicoderabbitaiBot 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

♻️ Duplicate comments (1)
packages/cli/src/controllers/app.ts (1)

4248-4260: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Cancel still aborts the deploy (previously flagged as addressed).

confirmPrompt throws usageError on Esc/Ctrl+C, and the try/catch here only wraps runAgentInstall (Line 4262+), not the confirmPrompt call. So canceling this optional prompt aborts the whole deploy before any deploy work begins. The earlier review marked this resolved in ec1d0ce, but the current code does not handle cancellation — please confirm whether the fix was reverted.

Treat cancel the same as a decline: record the dismissal and continue.

🛡️ Proposed handling
- const shouldInstall = await confirmPrompt({- input: context.runtime.stdin,- output: context.runtime.stderr,- message: "Install Prisma agent guidance for this project?",- initialValue: true,- });-- if (!shouldInstall) {+ let shouldInstall: boolean;+ try {+ shouldInstall = await confirmPrompt({+ input: context.runtime.stdin,+ output: context.runtime.stderr,+ message: "Install Prisma agent guidance for this project?",+ initialValue: true,+ });+ } catch {+ shouldInstall = false;+ }++ if (!shouldInstall) {
await context.stateStore.setAgentSetupPromptDismissedAt(
new Date().toISOString(),
);
return [];
}
#!/bin/bash# Confirm confirmPrompt still throws on cancel and isn't wrapped at the call site.
fd -t f 'prompt.ts' packages/cli/src/shell --exec sed -n '60,95p' {}
printf'\n--- call site ---\n'
rg -nP -C3 'await confirmPrompt' packages/cli/src/controllers/app.ts
🤖 Prompt for 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.
In `@packages/cli/src/controllers/app.ts` around lines 4248 - 4260, The optional
install prompt in app.ts is not handling cancel, so Esc/Ctrl+C from
confirmPrompt still aborts the deploy. Update the confirmPrompt call site around
shouldInstall to catch usageError cancellation and treat it the same as a false
response: setAgentSetupPromptDismissedAt, then continue by returning [] only for
a real decline and otherwise proceed without failing the deploy. Use the
existing runAgentInstall try/catch location as a reference, but move the cancel
handling to the prompt step itself.
🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 2872-3126: Add a deploy test for the cancel path of the agent
guidance prompt, since the current cases only cover accept and decline. In the
`runAppDeploy` flow in `app-controller.test.ts`, make `confirmPrompt` reject to
simulate cancellation and assert it is handled like a decline: `deployApp` still
runs, `runAgentInstall` is not called, and `readAgentSetupPromptDismissedAt` is
recorded. Use the existing interactive deploy test setup and the
`confirmPrompt`, `runAppDeploy`, and `context.stateStore` symbols to place the
new case alongside the current prompt behavior tests.
---
Duplicate comments:
In `@packages/cli/src/controllers/app.ts`:
- Around line 4248-4260: The optional install prompt in app.ts is not handling
cancel, so Esc/Ctrl+C from confirmPrompt still aborts the deploy. Update the
confirmPrompt call site around shouldInstall to catch usageError cancellation
and treat it the same as a false response: setAgentSetupPromptDismissedAt, then
continue by returning [] only for a real decline and otherwise proceed without
failing the deploy. Use the existing runAgentInstall try/catch location as a
reference, but move the cancel handling to the prompt step itself.
🪄 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: d828c377-27dd-4fe7-9674-9565d8830d77

📥 Commits

Reviewing files that changed from the base of the PR and between ec1d0ce and bd6a348.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/tests/app-controller.test.ts Outdated
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 2 times, most recently from c181b4c to 1eb31e9CompareJune 25, 2026 12:02

@coderabbitaicoderabbitaiBot 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: 2

🤖 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 `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 147-164: packageRunnerForPackageManager currently mixes the spawn
runner with the display formatter by always applying binary(), which makes
help/examples emit .cmd on Windows. Split the logic used by
resolvePackageRunner* so resolveSkillsPackageRunner keeps the platform-specific
spawn binary behavior for agent.ts, while
resolvePrismaCliPackageCommandFormatter* returns plain package commands; update
the packageRunnerForPackageManager helper and any related formatter functions to
use the correct output for each path.
In `@packages/cli/tests/agent.test.ts`:
- Around line 54-62: The agent help and managed-file command strings are being
formatted with the Windows .cmd suffix from resolvePackageRunner(), which leaks
npx.cmd/pnpm.cmd into displayed output. Update the display-path in
formatPrismaCliCommand() and the agent command generation used by agent
help/status/install/update so .cmd is stripped for user-facing text, while
keeping the executable name with .cmd only for spawning.
🪄 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: 7894b920-baa6-41f8-a079-ae5770d48413

📥 Commits

Reviewing files that changed from the base of the PR and between c181b4c and 1eb31e9.

📒 Files selected for processing (22)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/cli-command.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/cli-command.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/shell/help.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/tests/agent.test.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 1eb31e9 to 416804cCompareJune 25, 2026 12:17
coderabbitai[bot]
coderabbitaiBot previously approved these changes Jun 25, 2026
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 16 times, most recently from cea395c to 452762bCompareJune 26, 2026 12:15
luanvdw
luanvdw previously approved these changes Jun 26, 2026

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work on this!

Could we make these minor docs changes?

  • agent is now listed in command-spec.md as part of the beta command surface, but command-principles.md still says the preview only includes auth, project, git, branch, database, and app.
  • The implementation adds a new structured error code, AGENT_SKILLS_INSTALL_FAILED, but error-conventions.md doesn’t list or define it yet.

Both are small, but since these docs are the contract for future CLI work and agent-facing behavior, I’d update them in this PR so we don’t leave the model slightly split.

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 076e420 to bfd2d37CompareJune 26, 2026 14:01

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

@AmanVarshney01
AmanVarshney01 merged commit e9666a6 into mainJun 29, 2026
10 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/agent-skills-install branch June 29, 2026 07:55
Sign up for freeto 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.

2 participants

@AmanVarshney01@luanvdw
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(cli): add agent skills setup flow - #100

Merged
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install
Jun 29, 2026
Merged

feat(cli): add agent skills setup flow#100
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install

Conversation

@AmanVarshney01

@AmanVarshney01AmanVarshney01 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds agent install, agent update, and agent status to install/check Prisma skills from prisma/skills.
  • Uses the detected package manager for CLI tips and the Skills CLI runner: bunx, pnpm dlx, yarn dlx, or npx -y.
  • Runs the Skills CLI through Execa, always buffers its output, and shows only Prisma CLI-owned success/failure text.
  • Reads skills-lock.json structurally for status/prompt decisions.
  • Auth can show an agent setup tip, and interactive app deploy can prompt once to install only prisma-compute.
  • Prompts use Clack with the CLI runtime streams and abort signal; selecting No dismisses the deploy prompt, while canceling aborts the command.
  • Dry-run output is honest and shell-safe, e.g. --skill '*'.

Examples

pnpm dlx @prisma/cli@latest agent install
pnpm dlx @prisma/cli@latest agent install --skill prisma-compute
pnpm dlx @prisma/cli@latest agent status --json
pnpm dlx @prisma/cli@latest agent status --global

Without package-manager detection:

npx -y @prisma/cli@latest agent install

Deploy prompt output:

◇ Install the Prisma Compute skill for this project?
│ Yes
✔ Installed the Prisma Compute skill for this project.

Testing

  • pnpm --filter @prisma/cli exec vitest run tests/prompt.test.ts tests/app-controller.test.ts tests/agent.test.ts
  • pnpm --filter @prisma/cli test
  • pnpm --recursive exec tsc --noEmit
  • pnpm lint
  • Manual agent install --skill prisma-compute smoke from /Users/aman/dev/test/prisma-cli-agent-install-quiet
  • Manual deploy prompt smoke from /Users/aman/dev/test/prisma-cli-deploy-quiet

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds the agent command group with install, update, and status subcommands, plus shared types and command metadata. It introduces setup-state detection, managed AGENTS.md/CLAUDE.md updates, package-manager runner resolution, and local dismissed-prompt persistence. auth login can now suggest prisma-cli agent install, and app deploy can prompt to install agent guidance for linked projects. New tests cover the agent commands, auth hinting, and deploy prompting.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.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 nameStatusExplanation
Title check✅ PassedThe title is concise and accurately captures the main change: adding an agent skills setup flow to the CLI.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description check✅ PassedThe description matches the changeset by summarizing the new agent commands, package-manager runner support, prompts, and documentation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/agent-skills-install
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/agent-skills-install

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

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 8dd0cd5 to ec1d0ceCompareJune 25, 2026 11:16

@coderabbitaicoderabbitaiBot 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: 4

🤖 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 186-198: The child process error handler in the install flow is
treating aborts as failures, so update the `child.on("error")` path to detect an
`AbortError` from `spawn` and re-throw or reject with that abort instead of
wrapping it in `skillsInstallFailed(...)`. Keep `child.on("close")` for real
exit codes, but let cancellations from the `context.runtime.signal` propagate
cleanly so the runtime handles them as user aborts rather than install errors.
In `@packages/cli/src/controllers/app.ts`:
- Around line 4246-4258: The optional agent-setup prompt in app.ts currently
aborts when confirmPrompt is canceled instead of treating cancel like a declined
install. Update the flow around confirmPrompt so Esc/Ctrl+C is handled the same
as a false response, using the existing shouldInstall branch to record
setAgentSetupPromptDismissedAt and continue without throwing, rather than
exiting before the install step.
In `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 135-150: The Windows handling in packageRunner currently routes
every binary through binary(), which incorrectly turns bunx into a .cmd shim.
Update packageRunner to special-case the "bun" branch so it uses bunx.exe on
win32 (or plain bunx when appropriate), while keeping binary() and the existing
.cmd behavior for pnpm, yarn, and npm shims.
In `@packages/cli/src/lib/agent/setup-status.ts`:
- Around line 25-41: The setup status logic in setup-status.ts is duplicating
the skills lock filename between the computed skillsLockPath used by
hasPrismaSkillsLock and the returned skillsLockPath field in the status object.
Update the setup-status flow around readPrismaAgentProjectFileStatus,
hasPrismaSkillsLock, and the returned object to derive both from the same
source, such as a shared constant or path.basename(skillsLockPath), so the value
stays consistent if the filename changes.
🪄 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: 6a6d0fa7-6817-4cd3-a20b-faf56031ffa5

📥 Commits

Reviewing files that changed from the base of the PR and between 7833e62 and 8dd0cd5.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts Outdated
Comment threadpackages/cli/src/controllers/app.ts
Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/src/lib/agent/setup-status.ts Outdated

@coderabbitaicoderabbitaiBot 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 165-178: runChildProcess currently spawns the executable directly,
which fails on Windows when resolveSkillsPackageRunner() returns .cmd/.bat
runners like npx.cmd or pnpm.cmd. Update runChildProcess to detect win32 and
launch these runners through a Windows-compatible path (for example using shell
execution or cmd.exe /c) while preserving args, cwd, env, and signal handling;
use the runChildProcess and resolveSkillsPackageRunner symbols to locate the
fix.
🪄 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: 10e171f8-8039-4f05-b73b-edebb47bf814

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd0cd5 and ec1d0ce.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from ec1d0ce to bd6a348CompareJune 25, 2026 11:28

@coderabbitaicoderabbitaiBot 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

♻️ Duplicate comments (1)
packages/cli/src/controllers/app.ts (1)

4248-4260: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Cancel still aborts the deploy (previously flagged as addressed).

confirmPrompt throws usageError on Esc/Ctrl+C, and the try/catch here only wraps runAgentInstall (Line 4262+), not the confirmPrompt call. So canceling this optional prompt aborts the whole deploy before any deploy work begins. The earlier review marked this resolved in ec1d0ce, but the current code does not handle cancellation — please confirm whether the fix was reverted.

Treat cancel the same as a decline: record the dismissal and continue.

🛡️ Proposed handling
- const shouldInstall = await confirmPrompt({- input: context.runtime.stdin,- output: context.runtime.stderr,- message: "Install Prisma agent guidance for this project?",- initialValue: true,- });-- if (!shouldInstall) {+ let shouldInstall: boolean;+ try {+ shouldInstall = await confirmPrompt({+ input: context.runtime.stdin,+ output: context.runtime.stderr,+ message: "Install Prisma agent guidance for this project?",+ initialValue: true,+ });+ } catch {+ shouldInstall = false;+ }++ if (!shouldInstall) {
await context.stateStore.setAgentSetupPromptDismissedAt(
new Date().toISOString(),
);
return [];
}
#!/bin/bash# Confirm confirmPrompt still throws on cancel and isn't wrapped at the call site.
fd -t f 'prompt.ts' packages/cli/src/shell --exec sed -n '60,95p' {}
printf'\n--- call site ---\n'
rg -nP -C3 'await confirmPrompt' packages/cli/src/controllers/app.ts
🤖 Prompt for 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.
In `@packages/cli/src/controllers/app.ts` around lines 4248 - 4260, The optional
install prompt in app.ts is not handling cancel, so Esc/Ctrl+C from
confirmPrompt still aborts the deploy. Update the confirmPrompt call site around
shouldInstall to catch usageError cancellation and treat it the same as a false
response: setAgentSetupPromptDismissedAt, then continue by returning [] only for
a real decline and otherwise proceed without failing the deploy. Use the
existing runAgentInstall try/catch location as a reference, but move the cancel
handling to the prompt step itself.
🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 2872-3126: Add a deploy test for the cancel path of the agent
guidance prompt, since the current cases only cover accept and decline. In the
`runAppDeploy` flow in `app-controller.test.ts`, make `confirmPrompt` reject to
simulate cancellation and assert it is handled like a decline: `deployApp` still
runs, `runAgentInstall` is not called, and `readAgentSetupPromptDismissedAt` is
recorded. Use the existing interactive deploy test setup and the
`confirmPrompt`, `runAppDeploy`, and `context.stateStore` symbols to place the
new case alongside the current prompt behavior tests.
---
Duplicate comments:
In `@packages/cli/src/controllers/app.ts`:
- Around line 4248-4260: The optional install prompt in app.ts is not handling
cancel, so Esc/Ctrl+C from confirmPrompt still aborts the deploy. Update the
confirmPrompt call site around shouldInstall to catch usageError cancellation
and treat it the same as a false response: setAgentSetupPromptDismissedAt, then
continue by returning [] only for a real decline and otherwise proceed without
failing the deploy. Use the existing runAgentInstall try/catch location as a
reference, but move the cancel handling to the prompt step itself.
🪄 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: d828c377-27dd-4fe7-9674-9565d8830d77

📥 Commits

Reviewing files that changed from the base of the PR and between ec1d0ce and bd6a348.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/tests/app-controller.test.ts Outdated
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 2 times, most recently from c181b4c to 1eb31e9CompareJune 25, 2026 12:02

@coderabbitaicoderabbitaiBot 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: 2

🤖 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 `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 147-164: packageRunnerForPackageManager currently mixes the spawn
runner with the display formatter by always applying binary(), which makes
help/examples emit .cmd on Windows. Split the logic used by
resolvePackageRunner* so resolveSkillsPackageRunner keeps the platform-specific
spawn binary behavior for agent.ts, while
resolvePrismaCliPackageCommandFormatter* returns plain package commands; update
the packageRunnerForPackageManager helper and any related formatter functions to
use the correct output for each path.
In `@packages/cli/tests/agent.test.ts`:
- Around line 54-62: The agent help and managed-file command strings are being
formatted with the Windows .cmd suffix from resolvePackageRunner(), which leaks
npx.cmd/pnpm.cmd into displayed output. Update the display-path in
formatPrismaCliCommand() and the agent command generation used by agent
help/status/install/update so .cmd is stripped for user-facing text, while
keeping the executable name with .cmd only for spawning.
🪄 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: 7894b920-baa6-41f8-a079-ae5770d48413

📥 Commits

Reviewing files that changed from the base of the PR and between c181b4c and 1eb31e9.

📒 Files selected for processing (22)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/cli-command.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/cli-command.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/shell/help.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/tests/agent.test.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 1eb31e9 to 416804cCompareJune 25, 2026 12:17
coderabbitai[bot]
coderabbitaiBot previously approved these changes Jun 25, 2026
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 16 times, most recently from cea395c to 452762bCompareJune 26, 2026 12:15
luanvdw
luanvdw previously approved these changes Jun 26, 2026

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work on this!

Could we make these minor docs changes?

  • agent is now listed in command-spec.md as part of the beta command surface, but command-principles.md still says the preview only includes auth, project, git, branch, database, and app.
  • The implementation adds a new structured error code, AGENT_SKILLS_INSTALL_FAILED, but error-conventions.md doesn’t list or define it yet.

Both are small, but since these docs are the contract for future CLI work and agent-facing behavior, I’d update them in this PR so we don’t leave the model slightly split.

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 076e420 to bfd2d37CompareJune 26, 2026 14:01

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

@AmanVarshney01
AmanVarshney01 merged commit e9666a6 into mainJun 29, 2026
10 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/agent-skills-install branch June 29, 2026 07:55
Sign up for freeto 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.

2 participants

@AmanVarshney01@luanvdw
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

feat(cli): add agent skills setup flow - #100

Merged
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install
Jun 29, 2026
Merged

feat(cli): add agent skills setup flow#100
AmanVarshney01 merged 2 commits into
mainfrom
aman/agent-skills-install

Conversation

@AmanVarshney01

@AmanVarshney01AmanVarshney01 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds agent install, agent update, and agent status to install/check Prisma skills from prisma/skills.
  • Uses the detected package manager for CLI tips and the Skills CLI runner: bunx, pnpm dlx, yarn dlx, or npx -y.
  • Runs the Skills CLI through Execa, always buffers its output, and shows only Prisma CLI-owned success/failure text.
  • Reads skills-lock.json structurally for status/prompt decisions.
  • Auth can show an agent setup tip, and interactive app deploy can prompt once to install only prisma-compute.
  • Prompts use Clack with the CLI runtime streams and abort signal; selecting No dismisses the deploy prompt, while canceling aborts the command.
  • Dry-run output is honest and shell-safe, e.g. --skill '*'.

Examples

pnpm dlx @prisma/cli@latest agent install
pnpm dlx @prisma/cli@latest agent install --skill prisma-compute
pnpm dlx @prisma/cli@latest agent status --json
pnpm dlx @prisma/cli@latest agent status --global

Without package-manager detection:

npx -y @prisma/cli@latest agent install

Deploy prompt output:

◇ Install the Prisma Compute skill for this project?
│ Yes
✔ Installed the Prisma Compute skill for this project.

Testing

  • pnpm --filter @prisma/cli exec vitest run tests/prompt.test.ts tests/app-controller.test.ts tests/agent.test.ts
  • pnpm --filter @prisma/cli test
  • pnpm --recursive exec tsc --noEmit
  • pnpm lint
  • Manual agent install --skill prisma-compute smoke from /Users/aman/dev/test/prisma-cli-agent-install-quiet
  • Manual deploy prompt smoke from /Users/aman/dev/test/prisma-cli-deploy-quiet

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds the agent command group with install, update, and status subcommands, plus shared types and command metadata. It introduces setup-state detection, managed AGENTS.md/CLAUDE.md updates, package-manager runner resolution, and local dismissed-prompt persistence. auth login can now suggest prisma-cli agent install, and app deploy can prompt to install agent guidance for linked projects. New tests cover the agent commands, auth hinting, and deploy prompting.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.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 nameStatusExplanation
Title check✅ PassedThe title is concise and accurately captures the main change: adding an agent skills setup flow to the CLI.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description check✅ PassedThe description matches the changeset by summarizing the new agent commands, package-manager runner support, prompts, and documentation updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aman/agent-skills-install
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch aman/agent-skills-install

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

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 8dd0cd5 to ec1d0ceCompareJune 25, 2026 11:16

@coderabbitaicoderabbitaiBot 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: 4

🤖 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 186-198: The child process error handler in the install flow is
treating aborts as failures, so update the `child.on("error")` path to detect an
`AbortError` from `spawn` and re-throw or reject with that abort instead of
wrapping it in `skillsInstallFailed(...)`. Keep `child.on("close")` for real
exit codes, but let cancellations from the `context.runtime.signal` propagate
cleanly so the runtime handles them as user aborts rather than install errors.
In `@packages/cli/src/controllers/app.ts`:
- Around line 4246-4258: The optional agent-setup prompt in app.ts currently
aborts when confirmPrompt is canceled instead of treating cancel like a declined
install. Update the flow around confirmPrompt so Esc/Ctrl+C is handled the same
as a false response, using the existing shouldInstall branch to record
setAgentSetupPromptDismissedAt and continue without throwing, rather than
exiting before the install step.
In `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 135-150: The Windows handling in packageRunner currently routes
every binary through binary(), which incorrectly turns bunx into a .cmd shim.
Update packageRunner to special-case the "bun" branch so it uses bunx.exe on
win32 (or plain bunx when appropriate), while keeping binary() and the existing
.cmd behavior for pnpm, yarn, and npm shims.
In `@packages/cli/src/lib/agent/setup-status.ts`:
- Around line 25-41: The setup status logic in setup-status.ts is duplicating
the skills lock filename between the computed skillsLockPath used by
hasPrismaSkillsLock and the returned skillsLockPath field in the status object.
Update the setup-status flow around readPrismaAgentProjectFileStatus,
hasPrismaSkillsLock, and the returned object to derive both from the same
source, such as a shared constant or path.basename(skillsLockPath), so the value
stays consistent if the filename changes.
🪄 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: 6a6d0fa7-6817-4cd3-a20b-faf56031ffa5

📥 Commits

Reviewing files that changed from the base of the PR and between 7833e62 and 8dd0cd5.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts Outdated
Comment threadpackages/cli/src/controllers/app.ts
Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/src/lib/agent/setup-status.ts Outdated

@coderabbitaicoderabbitaiBot 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 `@packages/cli/src/controllers/agent.ts`:
- Around line 165-178: runChildProcess currently spawns the executable directly,
which fails on Windows when resolveSkillsPackageRunner() returns .cmd/.bat
runners like npx.cmd or pnpm.cmd. Update runChildProcess to detect win32 and
launch these runners through a Windows-compatible path (for example using shell
execution or cmd.exe /c) while preserving args, cwd, env, and signal handling;
use the runChildProcess and resolveSkillsPackageRunner symbols to locate the
fix.
🪄 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: 10e171f8-8039-4f05-b73b-edebb47bf814

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd0cd5 and ec1d0ce.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/controllers/agent.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from ec1d0ce to bd6a348CompareJune 25, 2026 11:28

@coderabbitaicoderabbitaiBot 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

♻️ Duplicate comments (1)
packages/cli/src/controllers/app.ts (1)

4248-4260: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Cancel still aborts the deploy (previously flagged as addressed).

confirmPrompt throws usageError on Esc/Ctrl+C, and the try/catch here only wraps runAgentInstall (Line 4262+), not the confirmPrompt call. So canceling this optional prompt aborts the whole deploy before any deploy work begins. The earlier review marked this resolved in ec1d0ce, but the current code does not handle cancellation — please confirm whether the fix was reverted.

Treat cancel the same as a decline: record the dismissal and continue.

🛡️ Proposed handling
- const shouldInstall = await confirmPrompt({- input: context.runtime.stdin,- output: context.runtime.stderr,- message: "Install Prisma agent guidance for this project?",- initialValue: true,- });-- if (!shouldInstall) {+ let shouldInstall: boolean;+ try {+ shouldInstall = await confirmPrompt({+ input: context.runtime.stdin,+ output: context.runtime.stderr,+ message: "Install Prisma agent guidance for this project?",+ initialValue: true,+ });+ } catch {+ shouldInstall = false;+ }++ if (!shouldInstall) {
await context.stateStore.setAgentSetupPromptDismissedAt(
new Date().toISOString(),
);
return [];
}
#!/bin/bash# Confirm confirmPrompt still throws on cancel and isn't wrapped at the call site.
fd -t f 'prompt.ts' packages/cli/src/shell --exec sed -n '60,95p' {}
printf'\n--- call site ---\n'
rg -nP -C3 'await confirmPrompt' packages/cli/src/controllers/app.ts
🤖 Prompt for 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.
In `@packages/cli/src/controllers/app.ts` around lines 4248 - 4260, The optional
install prompt in app.ts is not handling cancel, so Esc/Ctrl+C from
confirmPrompt still aborts the deploy. Update the confirmPrompt call site around
shouldInstall to catch usageError cancellation and treat it the same as a false
response: setAgentSetupPromptDismissedAt, then continue by returning [] only for
a real decline and otherwise proceed without failing the deploy. Use the
existing runAgentInstall try/catch location as a reference, but move the cancel
handling to the prompt step itself.
🤖 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 `@packages/cli/tests/app-controller.test.ts`:
- Around line 2872-3126: Add a deploy test for the cancel path of the agent
guidance prompt, since the current cases only cover accept and decline. In the
`runAppDeploy` flow in `app-controller.test.ts`, make `confirmPrompt` reject to
simulate cancellation and assert it is handled like a decline: `deployApp` still
runs, `runAgentInstall` is not called, and `readAgentSetupPromptDismissedAt` is
recorded. Use the existing interactive deploy test setup and the
`confirmPrompt`, `runAppDeploy`, and `context.stateStore` symbols to place the
new case alongside the current prompt behavior tests.
---
Duplicate comments:
In `@packages/cli/src/controllers/app.ts`:
- Around line 4248-4260: The optional install prompt in app.ts is not handling
cancel, so Esc/Ctrl+C from confirmPrompt still aborts the deploy. Update the
confirmPrompt call site around shouldInstall to catch usageError cancellation
and treat it the same as a false response: setAgentSetupPromptDismissedAt, then
continue by returning [] only for a real decline and otherwise proceed without
failing the deploy. Use the existing runAgentInstall try/catch location as a
reference, but move the cancel handling to the prompt step itself.
🪄 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: d828c377-27dd-4fe7-9674-9565d8830d77

📥 Commits

Reviewing files that changed from the base of the PR and between ec1d0ce and bd6a348.

📒 Files selected for processing (19)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/tests/app-controller.test.ts Outdated
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 2 times, most recently from c181b4c to 1eb31e9CompareJune 25, 2026 12:02

@coderabbitaicoderabbitaiBot 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: 2

🤖 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 `@packages/cli/src/lib/agent/package-manager.ts`:
- Around line 147-164: packageRunnerForPackageManager currently mixes the spawn
runner with the display formatter by always applying binary(), which makes
help/examples emit .cmd on Windows. Split the logic used by
resolvePackageRunner* so resolveSkillsPackageRunner keeps the platform-specific
spawn binary behavior for agent.ts, while
resolvePrismaCliPackageCommandFormatter* returns plain package commands; update
the packageRunnerForPackageManager helper and any related formatter functions to
use the correct output for each path.
In `@packages/cli/tests/agent.test.ts`:
- Around line 54-62: The agent help and managed-file command strings are being
formatted with the Windows .cmd suffix from resolvePackageRunner(), which leaks
npx.cmd/pnpm.cmd into displayed output. Update the display-path in
formatPrismaCliCommand() and the agent command generation used by agent
help/status/install/update so .cmd is stripped for user-facing text, while
keeping the executable name with .cmd only for spawning.
🪄 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: 7894b920-baa6-41f8-a079-ae5770d48413

📥 Commits

Reviewing files that changed from the base of the PR and between c181b4c and 1eb31e9.

📒 Files selected for processing (22)
  • docs/product/command-spec.md
  • packages/cli/src/adapters/local-state.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/agent/index.ts
  • packages/cli/src/controllers/agent.ts
  • packages/cli/src/controllers/app.ts
  • packages/cli/src/controllers/auth.ts
  • packages/cli/src/lib/agent/cli-command.ts
  • packages/cli/src/lib/agent/constants.ts
  • packages/cli/src/lib/agent/package-manager.ts
  • packages/cli/src/lib/agent/project-files.ts
  • packages/cli/src/lib/agent/setup-status.ts
  • packages/cli/src/presenters/agent.ts
  • packages/cli/src/presenters/auth.ts
  • packages/cli/src/shell/cli-command.ts
  • packages/cli/src/shell/command-meta.ts
  • packages/cli/src/shell/help.ts
  • packages/cli/src/types/agent.ts
  • packages/cli/src/types/auth.ts
  • packages/cli/tests/agent.test.ts
  • packages/cli/tests/app-controller.test.ts
  • packages/cli/tests/auth.test.ts

Comment threadpackages/cli/src/lib/agent/package-manager.ts Outdated
Comment threadpackages/cli/tests/agent.test.ts
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 1eb31e9 to 416804cCompareJune 25, 2026 12:17
coderabbitai[bot]
coderabbitaiBot previously approved these changes Jun 25, 2026
@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch 16 times, most recently from cea395c to 452762bCompareJune 26, 2026 12:15
luanvdw
luanvdw previously approved these changes Jun 26, 2026

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work on this!

Could we make these minor docs changes?

  • agent is now listed in command-spec.md as part of the beta command surface, but command-principles.md still says the preview only includes auth, project, git, branch, database, and app.
  • The implementation adds a new structured error code, AGENT_SKILLS_INSTALL_FAILED, but error-conventions.md doesn’t list or define it yet.

Both are small, but since these docs are the contract for future CLI work and agent-facing behavior, I’d update them in this PR so we don’t leave the model slightly split.

@AmanVarshney01
AmanVarshney01force-pushed the aman/agent-skills-install branch from 076e420 to bfd2d37CompareJune 26, 2026 14:01

@luanvdwluanvdw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙏

@AmanVarshney01
AmanVarshney01 merged commit e9666a6 into mainJun 29, 2026
10 checks passed
@AmanVarshney01
AmanVarshney01 deleted the aman/agent-skills-install branch June 29, 2026 07:55
Sign up for freeto 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.

2 participants

@AmanVarshney01@luanvdw