Skip to content

feat: mark onboarding steps from CLI commands#178

Merged
jomifepe merged 7 commits intomainfrom
jp/onboarding-steps
May 8, 2026
Merged

feat: mark onboarding steps from CLI commands#178
jomifepe merged 7 commits intomainfrom
jp/onboarding-steps

Conversation

@jomifepe
Copy link
Copy Markdown
Contributor

@jomifepe jomifepe commented May 7, 2026

Summary

  • Extend src/clients/repository.ts with onboarding helpers (getOnboardingState, completeOnboardingSteps, completeOnboardingStepsSilently) wrapping the Repository Service's GET /onboarding and PATCH /onboarding/:stepId/toggle endpoints — same contract as slice-machine's PrismicRepositoryManager.
  • Introduce an OnboardingStep union scoped to the dashboard's current set: createPrismicProject, createPageType, createSlice, connectPrismic.
  • Fire each step from the command that actually performs the corresponding server-side action:
    • prismic repo createcreatePrismicProject
    • prismic pushcreateSlice (when a slice is inserted remotely) and/or createPageType (when an inserted custom type has format: "page")
    • prismic pull and prismic sync (after initial sync) → connectPrismic
  • All calls are fire-and-forget via the silent wrapper, so onboarding failures never block or noise up CLI commands. State is fetched first so already-completed steps aren't toggled off.

How to QA

  • npx prismic@pr-178 repo create marks createPrismicProject (this is a self-completing step, but why not)
  • npx prismic@pr-178 push after slice create marks createSlice complete
  • npx prismic@pr-178 push after type create for page-format type marks createPageType; pushing a non-page type does not
  • npx prismic@pr-178 pull marks connectPrismic complete
  • npx prismic@pr-178 sync --watch marks connectPrismic on the initial sync
  • Running any of the above twice does not un-complete a step (GET-before-PATCH guard)
  • With a stale/missing token, commands still succeed silently

🤖 Generated with Claude Code

Call the Prismic onboarding service after `init`, `slice create`, and
`type create --format page` so CLI-first users see correct onboarding
progress in the dashboard, matching slice-machine's behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jomifepe jomifepe marked this pull request as ready for review May 7, 2026 14:56
The CLI doesn't set up slice-machine, so completing this step from init
would misrepresent user progress.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Comment thread src/commands/init.ts Outdated
Both repository and onboarding endpoints live on the Repository Service,
so colocating them avoids a one-function file and a cross-file helper
export.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jomifepe jomifepe self-assigned this May 7, 2026
@jomifepe jomifepe marked this pull request as draft May 7, 2026 15:37
Local create commands only write files; models exist on the server only
after push. Move onboarding triggers into push so steps complete when
the remote side actually gains a slice or page type.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jomifepe jomifepe marked this pull request as ready for review May 7, 2026 15:47
jomifepe and others added 2 commits May 7, 2026 16:51
Prevents typos at call sites and documents the full set of known steps
(sourced from slice-machine's usage) in one place.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Move `connectPrismic` trigger from init into pull and sync, since
  those commands are what actually wire a codebase to a repository.
- Fire `createPrismicProject` from repo-create after the repository
  is successfully created on the server.
- Scope the `OnboardingStep` union to the current dashboard-tracked
  set: createPrismicProject, createPageType, createSlice, connectPrismic.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d69d16d. Configure here.

Comment thread src/clients/repository.ts
Comment thread src/clients/repository.ts
@jomifepe jomifepe merged commit 9ae5b1d into main May 8, 2026
13 checks passed
@jomifepe jomifepe deleted the jp/onboarding-steps branch May 8, 2026 12:36
@github-actions github-actions Bot mentioned this pull request May 8, 2026
1 task
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.

2 participants