Skip to content

refactor(onboarding): collapse wizard to 2 questions + 1 click, add test suite#106

Open
abdout wants to merge 1 commit into
mainfrom
refactor/onboarding-simplify-and-tests
Open

refactor(onboarding): collapse wizard to 2 questions + 1 click, add test suite#106
abdout wants to merge 1 commit into
mainfrom
refactor/onboarding-simplify-and-tests

Conversation

@abdout
Copy link
Copy Markdown
Contributor

@abdout abdout commented May 24, 2026

Summary

  • Wizard: 11 pre-flight questions → 2 dialogs; 3 Act-3 round-trip dialogs → 0. Total user touches 15 → 3 (identity card · GitHub Authorize · Hogwarts Y/N).
  • Doc: content/docs/onboarding.mdx 566 → 226 lines (-60%), with a new "Manual fallback" section (2-3 commands per OS) replacing 155 lines of duplicated Path-B blocks.
  • Tests: 143 assertions across 4 suites under tests/onboarding/, full green in ~1s with no extra deps.

Wizard changes

Surface Before After
Pre-flight questions 11 2 (identity card + Hogwarts Y/N, engineer-only)
Act-3 round-trip dialogs 3 (Desktop sign-in, computer-use, WebStorm) 0 — deferred to final "Optional follow-ups" panel
External clicks 1 hidden inside "silent" batch 1 named upfront ("Authorize at ~2 min")
  • Auto-detect aggressively: git name/email from git config --global, role from existing ~/.claude/mcp.json (shadcn → engineer, linear → business, figma → content, posthog → ops). When everything autofills, Act 1 is just the Hogwarts Y/N for engineers, or zero dialogs for non-engineers.
  • Cut + deferred: Welcome, Has-GitHub, Has-Anthropic, Repos-dir, Pro/Max, Tailscale, Gist-ID. Anything still relevant surfaces as a command snippet in the final panel.
  • Linux uses zenity --forms for a true single-window identity card; Windows uses WPF (TextBox×2 + ComboBox); macOS chains autofill-aware prompts (1/3, 2/3, 3/3) only for fields not in git config or mcp.json.
  • Honest messaging: wrapper banner now reads "Installing — minimize the terminal and walk away (one Authorize click in the browser ~2 min in)" instead of claiming pure silence.

Doc changes (content/docs/onboarding.mdx)

  • New "What happens" 4-row table replaces the three-acts narrative (62 → 8 lines).
  • Deliverables + Verify + Modify collapsed into one matrix.
  • Manual fallback added — clone kun, run the backend directly (2 commands on macOS, 3 on Linux/Windows). Replaces 155 lines of duplicated install steps that linked out to claude-code.mdx.
  • Dropped Tailscale + Apple Notes Dispatch — use Anthropic's native remote (claude.ai/code from mobile/web) and the Cowork ↔ Code bridge instead.

Tests (tests/onboarding/)

Suite Asserts Validates
lint 33 shellcheck clean · wizard-steps.json parses · doc ≤300 lines · Manual fallback present with all 3 OSes · no stale Tailscale / Apple Notes refs · Act 1 ≤ {macOS 5, Linux 3, Win 3} · Act 3 ≤ 1
behavior 18 state_get/state_set round-trip · git autofill reads sandbox $HOME · mcp.json → role for all 4 roles · BACKEND_ARGS shape
parity 72 all 3 installers forward same flags + persist same state keys · 6 cut keys absent · 3 cut Act-3 dialogs absent · final panel parallels · same docs/kun URLs · wizard-steps.json version=2
links 20 every (/docs/<x>) resolves · external GH URLs well-formed · anti-regression on self-hosting/dispatch links
Total 143 full pass in 1s

No npm packages or test framework added. Pure bash + python3 + shellcheck (all already present). Bash 3.2 compatible.

Test plan

  • bash tests/onboarding/run.sh exits 0 with ✓ ALL GREEN — 143/143
  • bash tests/onboarding/run.sh lint exits 0 (filter works)
  • On a clean macOS VM: curl -fsSL https://kun.databayt.org/install | bash shows ≤4 dialogs (identity 1/3, 2/3, 3/3, hogwarts) on a truly fresh machine; ≤2 on a machine with git config preset; exactly 1 external click (Authorize)
  • Re-run the installer: state file resumes → 0 dialogs
  • Linux VM (zenity): identity card shows as a single --forms window
  • Windows VM: WPF identity window shows name + email + role combo
  • Manual fallback: git clone … && bash onboarding-mac.sh engineer produces the same end state as the wizard

🤖 Generated with Claude Code

…est suite

Cut the install wizard surface and shrink the entry doc to match the new
flow. Total user touches: 15 → 3 (identity card · GitHub Authorize · Hogwarts Y/N).

Wizard surface

- Pre-flight: 11 questions → 2 dialogs. Welcome cut, GitHub/Anthropic
  account checks auto-handled by gh status + Claude first-run, repos-dir
  defaulted to $HOME, role/name/email merged into one identity card
  (autofilled from git config + ~/.claude/mcp.json), Pro/Max & Tailscale &
  Gist deferred to the final panel.
- Act 3: 3 round-trip dialogs → 0. Desktop sign-in, computer-use toggle,
  WebStorm plugin moved to the post-install "things to do later" list.
- Final panel: single Done/Open-Docs acknowledge dialog with optional
  follow-ups listed as commands.
- Wrapper messaging honest about the one unavoidable click ("1 GitHub
  Authorize click around minute 2") instead of claiming pure silence.
- Linux uses zenity --forms for a true single-window identity card;
  Windows uses WPF with TextBox + ComboBox; macOS chains autofill-aware
  prompts.

Doc rewrite (content/docs/onboarding.mdx)

- 566 → 226 lines (-60%).
- New "What happens" table replaces the three-acts narrative.
- Deliverables + Verify + Modify collapsed into one matrix.
- Added "Manual fallback" section: clone kun, run the backend directly
  (2-3 commands per OS) — replaces 155 lines of duplicated Path-B blocks
  that linked out to claude-code.mdx.
- Dropped Tailscale / Apple Notes Dispatch references — use Anthropic's
  native remote (claude.ai/code + mobile apps) and Cowork bridge.

Test suite (tests/onboarding/)

- 143 assertions across 4 suites, full pass in 1s, no extra deps.
- lint: shellcheck + JSON parse + doc structure + dialog-count budgets
- behavior: state file round-trip, git/mcp autofill, BACKEND_ARGS shape
- parity: all 3 installers expose same flags + state keys + final-panel
  bullets; cut keys verified absent
- links: every /docs/<x> resolves; anti-regression on self-hosting/dispatch
- run.sh orchestrator + lib.sh assertion library (bash 3.2 compatible)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kun Building Building Preview May 24, 2026 4:11am

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