Skip to content

feat(cli): finalize zero-friction beta setup - #18

Merged
aetosdios27 merged 2 commits into
mainfrom
aetosdios/aet-75-finalize-zero-friction-beta-onboarding-and-studio-launch
Jul 28, 2026
Merged

aetosdios27 merged 2 commits into
mainfrom
aetosdios/aet-75-finalize-zero-friction-beta-onboarding-and-studio-launch

Conversation

@aetosdios27

@aetosdios27 aetosdios27 commented Jul 28, 2026 •

Copy link
Copy Markdown
Owner

Linear

Fixes AET-75

Summary

  • split zero-friction content setup into scribe init and existing-site integration into scribe integrate
  • make Studio launch frictionless with automatic port fallback, nonfatal browser-open handling, and source-location preview pulses
  • release the fixed public package group as 0.1.0-alpha.7 with synchronized documentation and changelogs

Verification

  • Focused tests pass
  • Type checking passes
  • Meaningful consumer-facing changes include a Changeset, or no Changeset is required
  • Documentation is updated when required, or no documentation change is needed
  • Existing coverage was not weakened or skipped

Additional release gates passed locally:

  • 192 unit/integration tests
  • public package builds and documentation/release checks
  • tarball packing and inspection
  • Bun/Vite and npm/Next packed consumers, including next-mdx-remote/rsc
  • portable CLI and repository portability scans
  • Chromium and Firefox Studio behavior
  • browser bundle scan with no compiler/highlighter runtime leaks

Visual evidence

The Studio changes preserve the approved shell and add a brief cobalt target pulse when the preview follows sustained Markdown edits. No visual baseline was regenerated.

Summary by CodeRabbit

  • New Features

    • Added scribe integrate for project inspection, package setup, MDX wiring, stylesheet selection, and safe integration plans.
    • Simplified scribe init to create an empty content launchpad only.
    • Studio now automatically advances to an available port and provides clearer browser and startup feedback.
    • Added improved preview source-line highlighting.
  • Bug Fixes

    • Improved CLI error handling without exposing internal stack traces.
    • Heavy commands now load only when invoked.
  • Documentation

    • Updated integration, migration, CLI, and Studio guidance across project documentation.

@linear-code

linear-code Bot commented Jul 28, 2026

Copy link
Copy Markdown

AET-75

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aetosdios27, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b15075d-55cf-4278-ada7-6a35ec542a42

📥 Commits

Reviewing files that changed from the base of the PR and between 8cdebd7 and c1714db.

📒 Files selected for processing (19)
  • README.md
  • SKILL.md
  • packages/cli/README.md
  • packages/cli/SKILL.md
  • packages/cli/src/index.test.ts
  • packages/cli/src/init.test.ts
  • packages/cli/src/init.ts
  • packages/cli/src/integrate.test.ts
  • packages/cli/src/integrate.ts
  • packages/cli/src/studio.ts
  • packages/mdx/README.md
  • packages/mdx/SKILL.md
  • packages/react/README.md
  • packages/react/SKILL.md
  • packages/styles/README.md
  • packages/styles/SKILL.md
  • scripts/test-portable-cli.mjs
  • tests/release/documentation.test.ts
  • tests/studio-browser/studio.spec.ts
📝 Walkthrough

Walkthrough

scribe init now creates only content and asset directories, while scribe integrate handles project inspection and integration changes. The CLI adds lazy loading and centralized errors, and Studio adds port fallback, browser status reporting, Sonner styling, and preview reveal-state handling. Documentation and packages are updated for alpha.7.

Changes

CLI workflow and Studio runtime

Layer / File(s) Summary
Launchpad-only init
packages/cli/src/init.ts, packages/cli/src/init.test.ts
scribe init resolves content directories, optionally adds assets, supports dry runs and idempotent creation, and rejects unsafe or ambiguous paths.
Project integration planner and executor
packages/cli/src/integrate.ts, packages/cli/src/integrate.test.ts
scribe integrate detects project stacks, selects or accepts a style mode, plans package/CSS/MDX changes, reports warnings, and applies confirmed changes atomically.
Command dispatch and failure handling
packages/cli/src/index.ts, packages/cli/src/index.test.ts, packages/cli/src/command-help.ts
Command help is centralized, heavy commands load dynamically, validation loads MDX at runtime, and top-level failures use standardized diagnostics and exit status.
Studio startup and preview behavior
packages/cli/src/studio.ts, packages/cli/src/studio-ui.ts, packages/cli/src/studio.test.ts, packages/cli/src/studio-ui.test.ts, tests/studio-browser/studio.spec.ts
Studio uses integration style detection, retries non-explicit occupied ports, reports browser-launch failures, loads Sonner styles, and manages timed preview reveal highlighting.
Workflow documentation and release metadata
README.md, SKILL.md, packages/*/README.md, packages/*/SKILL.md, packages/*/package.json, packages/*/CHANGELOG.md, .changeset/*, scripts/test-portable-cli.mjs, tests/release/*
Documentation, package versions, changesets, smoke tests, and release checks describe and validate the separated init/integrate workflow and alpha.7 release.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI
  participant Inspector
  participant PackageManager
  participant Project
  User->>CLI: run scribe integrate
  CLI->>Inspector: inspect project
  Inspector-->>CLI: return stack and style plan
  CLI->>PackageManager: install missing packages
  CLI->>Project: apply stylesheet and MDX changes
  CLI-->>User: report integration result
Loading
sequenceDiagram
  participant User
  participant Studio
  participant Server
  participant Browser
  User->>Studio: start with optional port
  Studio->>Server: bind preferred or available port
  Server-->>Studio: return serving origin
  Studio->>Browser: open preview URL
  Browser-->>User: display Studio preview
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring 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 name Status Explanation
Title check ✅ Passed The title is concise and clearly captures the main CLI beta setup split and release-focused changes.
Description check ✅ Passed The description matches the required template with Linear, Summary, Verification, and Visual evidence sections filled in.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aetosdios/aet-75-finalize-zero-friction-beta-onboarding-and-studio-launch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (5)
packages/cli/README.md (1)

59-62: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Make every npm example fail closed or pin the CLI.

All three README copies use unpinned npx scribe commands. If the local CLI is unavailable, npx may fetch a remote, unscoped package instead of the reviewed @scribe-sdk/cli@0.1.0-alpha.7. Apply one consistent policy to all examples: use a no-install form for local workflows or pin the scoped package and exact version for remote execution. (docs.npmjs.com)

  • packages/cli/README.md#L59-L62: update the npm dry-run command.
  • packages/cli/README.md#L139-L140: update the npm integration commands.
  • packages/mdx/README.md#L59-L62: apply the same npm dry-run change.
  • packages/mdx/README.md#L139-L140: apply the same npm integration change.
  • packages/react/README.md#L59-L62: apply the same npm dry-run change.
  • packages/react/README.md#L139-L140: apply the same npm integration change.
🤖 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/README.md` around lines 59 - 62, Replace every unpinned npm `npx
scribe` example with one consistent safe form: use no-install execution for
local workflows or pin `@scribe-sdk/cli@0.1.0-alpha.7` for remote execution.
Apply the same policy to the dry-run and integration examples in
packages/cli/README.md (lines 59-62 and 139-140), packages/mdx/README.md (lines
59-62 and 139-140), and packages/react/README.md (lines 59-62 and 139-140).

Sources: MCP tools, Linters/SAST tools

packages/cli/src/integrate.ts (2)

420-425: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider unlinking the temp file when the write or rename fails.

A failed writeFile/rename leaves .<name>.scribe-*.tmp beside the user's source file.

🤖 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/integrate.ts` around lines 420 - 425, Update atomicWrite to
clean up the temporary file when writeFile or rename fails. Ensure the generated
path in temporary is unlinked during error handling, while preserving the
existing successful atomic rename behavior and propagating the original failure.

88-93: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Unbounded parallel reads and a loose Tailwind version match.

Two small robustness points in inspectProject:

  • Line 89 opens up to 1,000 files concurrently; a small concurrency limit (or sequential read) avoids EMFILE on restrictive systems and costs nothing here since this runs once per command.
  • Line 93's regex matches any 3/4 preceded by a non-digit, so a future 10.3.x range would be reported as Tailwind 3. Matching only the leading major (e.g. after stripping range prefixes) is more precise.
🤖 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/integrate.ts` around lines 88 - 93, Update inspectProject
around the entries construction and Tailwind version parsing: limit readFile
concurrency when mapping over files to avoid opening all files simultaneously,
and derive tailwindMajor from the leading major version after removing supported
range prefixes so versions such as 10.3.x are not classified as Tailwind 3.
packages/cli/src/index.test.ts (1)

39-53: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Source-text regexes will break on harmless reformatting.

Lines 50-52 encode exact brace/newline layout of main(). The toContain('await import("./init.js")') assertions already prove the lazy boundary; a cheaper and more durable guard for "no static import of heavy modules" would be asserting on the module graph (e.g. that importing ./index.js does not pull ./studio.js) rather than pattern-matching formatting.

🤖 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/index.test.ts` around lines 39 - 53, Replace the
formatting-sensitive regex assertions in the `keeps heavyweight commands behind
dynamic import boundaries` test with module-graph checks verifying that
importing `./index.js` does not statically load `./studio.js`, `./init.js`,
`./integrate.js`, or `@scribe-sdk/mdx`. Retain the dynamic-import assertions as
the direct lazy-boundary validation, and remove the exact `main()` layout
regexes.
packages/cli/src/init.test.ts (1)

77-85: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Assertion depends on POSIX separators.

existingAbsoluteDirectories throws with the raw absolute path (packages/cli/src/init.ts line 210), so this toContain("content/blog exists…") only matches on POSIX. Formatting that message with displayPath(root, path) would make both the error and this assertion platform-independent.

🤖 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/init.test.ts` around lines 77 - 85, Update
existingAbsoluteDirectories to format the conflicting path with
displayPath(root, path) before constructing its error message, so the “exists
but is not a directory” output uses platform-independent display paths and the
test assertion remains portable.
🤖 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/init.test.ts`:
- Around line 62-64: Sort each fs.readdir result before comparing it in the
initialization test, including the top-level content directory and its
assets/blog subdirectories, while preserving the expected entries and
empty-directory assertions.

In `@packages/cli/src/integrate.ts`:
- Around line 273-278: Update the change-application loop in the try/catch
around atomicWrite to track each successfully written change path, then include
that list in the catch error reported by stderr when a later write fails.
Preserve the existing return code and error-detail formatting while clearly
identifying the files already written.

In `@packages/cli/src/studio.ts`:
- Line 970: Update studioRuntimePaths() to define the sonnerStyle entry via
studioImportPath("sonner/dist/styles.css"), then change the corresponding Vite
alias to reference the sonnerStyle variable instead of an undefined alias.
Preserve the existing alias key and other runtime path mappings.

In `@scripts/test-portable-cli.mjs`:
- Around line 57-69: Strengthen the portable CLI test around the init and
integrate flows by snapshotting the relevant fixture tree before each operation
and comparing it afterward, rather than checking only globalStyle. Verify init
--dry-run and integrate --dry-run leave the entire fixture unchanged, and
confirm init --yes leaves host files unchanged while still producing an empty
content/blog launchpad.

In `@tests/release/changesets.test.ts`:
- Line 36: Update the changeset fragment assertion in the changesets test to
require exact set equality with pre.changesets rather than allowing additional
files. Also update scripts/check-release-alignment.mjs to reject unexpected
prerelease fragments, or explicitly constrain permitted extras to a defined
allowlist.

In `@tests/studio-browser/studio.spec.ts`:
- Around line 125-126: Make the reveal assertion in the synchronizedCode test
deterministic instead of relying on the 1.1-second data-scribe-reveal-active
window. Trigger the reveal immediately before asserting, or assert a
monotonically increasing reveal counter attribute if available, while preserving
the subsequent check that the active attribute is eventually cleared.

---

Nitpick comments:
In `@packages/cli/README.md`:
- Around line 59-62: Replace every unpinned npm `npx scribe` example with one
consistent safe form: use no-install execution for local workflows or pin
`@scribe-sdk/cli@0.1.0-alpha.7` for remote execution. Apply the same policy to
the dry-run and integration examples in packages/cli/README.md (lines 59-62 and
139-140), packages/mdx/README.md (lines 59-62 and 139-140), and
packages/react/README.md (lines 59-62 and 139-140).

In `@packages/cli/src/index.test.ts`:
- Around line 39-53: Replace the formatting-sensitive regex assertions in the
`keeps heavyweight commands behind dynamic import boundaries` test with
module-graph checks verifying that importing `./index.js` does not statically
load `./studio.js`, `./init.js`, `./integrate.js`, or `@scribe-sdk/mdx`. Retain
the dynamic-import assertions as the direct lazy-boundary validation, and remove
the exact `main()` layout regexes.

In `@packages/cli/src/init.test.ts`:
- Around line 77-85: Update existingAbsoluteDirectories to format the
conflicting path with displayPath(root, path) before constructing its error
message, so the “exists but is not a directory” output uses platform-independent
display paths and the test assertion remains portable.

In `@packages/cli/src/integrate.ts`:
- Around line 420-425: Update atomicWrite to clean up the temporary file when
writeFile or rename fails. Ensure the generated path in temporary is unlinked
during error handling, while preserving the existing successful atomic rename
behavior and propagating the original failure.
- Around line 88-93: Update inspectProject around the entries construction and
Tailwind version parsing: limit readFile concurrency when mapping over files to
avoid opening all files simultaneously, and derive tailwindMajor from the
leading major version after removing supported range prefixes so versions such
as 10.3.x are not classified as Tailwind 3.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d54aa21c-aff9-4599-b90f-cc72b470b0a9

📥 Commits

Reviewing files that changed from the base of the PR and between 1a4db97 and 8cdebd7.

📒 Files selected for processing (36)
  • .changeset/empty-writers-integrate.md
  • .changeset/friendly-studios-follow.md
  • .changeset/pre.json
  • README.md
  • SKILL.md
  • packages/cli/CHANGELOG.md
  • packages/cli/README.md
  • packages/cli/SKILL.md
  • packages/cli/package.json
  • packages/cli/src/command-help.ts
  • packages/cli/src/index.test.ts
  • packages/cli/src/index.ts
  • packages/cli/src/init.test.ts
  • packages/cli/src/init.ts
  • packages/cli/src/integrate.test.ts
  • packages/cli/src/integrate.ts
  • packages/cli/src/studio-ui.test.ts
  • packages/cli/src/studio-ui.ts
  • packages/cli/src/studio.test.ts
  • packages/cli/src/studio.ts
  • packages/mdx/CHANGELOG.md
  • packages/mdx/README.md
  • packages/mdx/SKILL.md
  • packages/mdx/package.json
  • packages/react/CHANGELOG.md
  • packages/react/README.md
  • packages/react/SKILL.md
  • packages/react/package.json
  • packages/styles/CHANGELOG.md
  • packages/styles/README.md
  • packages/styles/SKILL.md
  • packages/styles/package.json
  • scripts/test-portable-cli.mjs
  • tests/release/changesets.test.ts
  • tests/release/documentation.test.ts
  • tests/studio-browser/studio.spec.ts

Comment thread packages/cli/src/init.test.ts Resolved
Comment thread packages/cli/src/integrate.ts Resolved
Comment thread packages/cli/src/studio.ts Resolved
Comment thread scripts/test-portable-cli.mjs Resolved
Comment thread tests/release/changesets.test.ts Resolved
Comment thread tests/studio-browser/studio.spec.ts Resolved
@aetosdios27
aetosdios27 merged commit 1278821 into main Jul 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant