feat(cli): "Add to CI" handoff option + default CI setup in install#658
feat(cli): "Add to CI" handoff option + default CI setup in install#658aidenybai wants to merge 5 commits into
Conversation
…tall The post-scan handoff prompt now leads with an "Add to CI" choice (the new default) that installs the dev dependency + `doctor` script and writes a `.github/workflows/react-doctor.yml` workflow so every PR is scanned. The agent-handoff prompt asks the agent to offer CI setup first. The `install` subcommand pre-selects the workflow and `install --yes` now writes it by default. Extract the workflow writer into `install-github-workflow.ts` and pin the action to the `@v1` floating major (never `@main`, per issue #299).
|
✅ Parity OK — no diagnostic differences. Baseline:
trace |
commit: |
|
React Doctor found 10 files changed in this pull request, but none matched the files covered by its enabled checks. Scope: 10 files changed on Generated by React Doctor. Questions? Contact founders@million.dev. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 4 total unresolved issues (including 3 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cfc8878. Configure here.
Address thermo review findings on the "Add to CI" change: - Record `install.workflow` for handoff-initiated CI setups (was only the install command), via a shared `reportWorkflowResult` helper that both paths use, so the spinner wording + metric stay in one place. - Guard `setUpCi`'s package install so a read-only/permission-denied FS can't turn a successful scan into a crash; correct the misleading comment. - Make `buildWorkflowContent` module-private, rename the result interface to `InstallGitHubWorkflowResult`, and drop the redundant `!skipPrompts` guard.
…root Address Bugbot findings on the "Add to CI" change: - setUpCi resolves the nearest package root before installing (mirrors install), so a nested scan dir no longer drops the workflow in the wrong place. - On a failed workflow write, the handoff points to the setup guide instead of claiming CI is scanning every PR. - install.completed reports the actual workflow outcome (from reportWorkflowResult) rather than intent, so a failed write isn't logged as installed.
Switch `execFileSync` → async `execFile` in the dependency installer so the ora spinner can tick while the package manager runs. Also reduce the welcome-scene explanation hold from 2s to 800ms.

Summary
react-doctordev dependency +doctorscript and writes.github/workflows/react-doctor.yml, then shows a short value pitch + link toreact.doctor/ci.installsubcommand now pre-selects the GitHub Actions workflow, andinstall --yeswrites it by default (mirroring the git-hook behavior).install-github-workflow.tsand pinned the action to the@v1floating major (never@main, per Consider using a release tag instead of @main in GitHub Actions examples #299). The workflow write now degrades gracefully instead of throwing, and never overwrites an existing workflow.Notes
installReactDoctorPackageSetupis now exported and reused by the handoff path (it already degrades gracefully on package-manager failure).agent.handofftelemetry gains a new"ci"outcome.Test plan
pnpm typecheckpnpm lint(0 errors)pnpm format:checkreact-doctorpackage suite (1623 tests; the lone failure is the ambientCURSOR_AGENTenv leaking "Agent guidance" into a spawned-CLI assertion — passes withenv -u CURSOR_AGENT)build-handoff-payload.test.ts(CI ask + link) andinstall-react-doctor.test.ts(@v1)react.doctor/cipage exists before/at release (PR only links to it)Note
Medium Risk
The CLI now writes repo files and changes the default post-scan action to CI setup; the workflow still grants PR/issue write permissions, though pinning
@v1reduces supply-chain risk versus@main.Overview
Post-scan handoff now asks “What would you like to do next?” with Add to CI first and selected by default. That path installs the dev dependency +
doctorscript (reusing exportedinstallReactDoctorPackageSetup) and writes.github/workflows/react-doctor.yml, with failures degrading to thereact.doctor/ciguide instead of failing the scan.installpre-selects the GitHub Actions workflow in the optional-setup prompt, andinstall --yesinstalls it by default (like the git hook). Workflow generation moves toinstall-github-workflow.tswith sharedreport-workflow-resultmessaging/metrics; existing workflows are never overwritten.Generated agent prompts now lead with offering CI setup (trust copy +
CI_URL) before the top-issue fix list. The workflow pinsmillionco/react-doctor@v1instead of@main.agent.handofftelemetry adds acioutcome.Reviewed by Cursor Bugbot for commit 6ae7007. Bugbot is set up for automated code reviews on this repo. Configure here.