Skip to content

Commit 196cfa4

Browse files
abdoutclaude
andcommitted
docs: lead Onboarding with single-paste flow; mark scripts Shipping
Reflects the reality on the ground after PRs #29/#30/#31 land the v2 scripts: onboarding.mdx: - Promotes 'irm https://kun.databayt.org/install | iex' to the recommended path (one paste, one UAC, three OAuth sign-ins) - Demotes Cowork-driven flow to "Alternative" — still works for Pro/Max users who want narration over a bare paste - Manual fallback updated to use databayt/kun raw URL (the codebase one is now tombstoned in databayt/codebase#2) - Adds 'doctor' to Daily entry points and 'maintain -Install' to the manual fallback chain - "What you end up with" mentions the scheduled task onboarding-reference.mdx: - Scripts contract table flipped: bootstrap, doctor, maintain are now Shipping (no longer 'Planned v2'); health.ps1 marked Deprecated; finish.ps1 reduced to 'Planned (alias for bootstrap)' - Source-of-truth URL changed from databayt/codebase to databayt/kun - Migration order section refreshed — 4 of 6 items checked off, fresh-VM test + team comms remaining Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bd3137b commit 196cfa4

2 files changed

Lines changed: 85 additions & 111 deletions

File tree

content/docs/onboarding-reference.mdx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,18 @@ Pre-authorizes the common tool set so even default `claude` doesn't prompt for r
5656

5757
## Scripts contract
5858

59-
The executable layer lives at `~/.claude/scripts/`. Today's scripts are authoritative — Cowork and Claude Code only invoke them. The v2 column documents the bootstrap layer that will land in `databayt/codebase` to collapse the cold-start paste further.
59+
The executable layer lives at `~/.claude/scripts/`. All scripts are authoritative — Cowork and Claude Code only invoke them. Source of truth is [databayt/kun/.claude/scripts](https://github.com/databayt/kun/tree/main/.claude/scripts). Any PR that changes a script must touch the matching row below.
6060

6161
| Script | Status | Purpose |
6262
|---|---|---|
63-
| `install.ps1` | Shipping | Installs Claude Code CLI if missing, copies kun config to `~/.claude/`, clones `databayt/codebase` to `~/codebase`. Role-aware (`engineer`, `business`, `content`, `ops`). |
63+
| `bootstrap.ps1` | Shipping | Single-paste cold start: ExecutionPolicy → self-elevate → winget bundle → PATH refresh → pnpm → WebStorm → plugin pre-drop → install.ps1 → `$PROFILE` → batched OAuth → secrets → sync-repos → `maintain -Install``doctor`. 16 idempotent steps. |
64+
| `install.ps1` | Shipping | Installs Claude Code CLI if missing, copies kun config to `~/.claude/`, clones `databayt/codebase` to `~/codebase`. Role-aware. Copies `lib/` recursively. |
6465
| `secrets.ps1` | Shipping | Pulls `.env` from the team Gist into `~/.claude/.env`. Idempotent. |
65-
| `sync-repos.ps1` | Shipping | Clones all active org repos: `codebase` to `~/codebase`, others to `~/oss/<name>`. `--status` prints branch/commit per repo. |
66-
| `health.ps1` | Shipping | Audits `~/.claude/` — files exist, JSON valid, agent/command/MCP counts, config age. `-Report` posts to `databayt/kun#health`. |
67-
| `bootstrap.ps1` | Planned (v2) | Single-paste cold start: ExecutionPolicy fix, winget bundle, install, secrets, sync-repos, WebStorm via Toolbox, plugin pre-drop, scheduled task. Exits with codes documented in `databayt/codebase`. |
68-
| `finish.ps1` | Planned (v2) | Idempotent re-runner — same shape as bootstrap but skips installs if tools are already on PATH. Used to repair interrupted runs. |
69-
| `doctor.ps1` | Planned (v2) | Rename of `health.ps1` with extra org-specific checks: `.env` freshness, repo layout, scheduled task armed, plugin loaded in WebStorm. |
70-
| `maintain.ps1` | Planned (v2) | Daily scheduled task: sync-repos, self-update `~/.claude/`, run doctor, notify Slack on red. |
71-
72-
Each shipping script lives in [databayt/codebase/.claude/scripts](https://github.com/databayt/codebase/tree/main/.claude/scripts). Any PR that changes a script must touch the matching row above.
66+
| `sync-repos.ps1` | Shipping | Clones all active org repos. Reads `~/.claude/memory/repositories.json` as source of truth (with a hardcoded fallback for cold-bootstrap). |
67+
| `doctor.ps1` | Shipping | Health audit + update check + self-repair. 7 check modules (Core, Shell, Identity, Repos, Updates, Scheduled, IDE) + 1 fix module. Flags `-Fix`, `-Update`, `-Report`, `-Json`, `-Quiet`. Exits 0/1/2/3. |
68+
| `maintain.ps1` | Shipping | Daily Windows scheduled task. Composes `sync-repos → self-update → doctor → notify → log`. Silent on green; toast on warnings/updates; toast + Slack on errors. `-Install` / `-Uninstall` / `-Status` / `-Run` / `-DryRun`. |
69+
| `health.ps1` | Deprecated | 5-line back-compat shim → `doctor.ps1`. Removed in a follow-up after a 2-week co-existence window. |
70+
| `finish.ps1` | Planned | Alias for `bootstrap.ps1` (every step is already idempotent). Ships as a one-line wrapper. |
7371

7472
## `.claude` layout
7573

@@ -154,13 +152,14 @@ Anything else can be automated, and probably should be.
154152

155153
## Migration order
156154

157-
For the person rolling out the v2 scripts:
155+
The v2 rollout, mostly done. Remaining items are flagged.
158156

159-
1. Land scripts in `databayt/codebase/.claude/scripts/` (`bootstrap`, `finish`, `doctor`, `maintain`). They work standalone — the current doc keeps functioning while these exist alongside it.
160-
2. Cut a redirect at `kun.databayt.org/install``raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/bootstrap.ps1`. Same for `/finish`.
161-
3. Collapse the [Onboarding](/docs/onboarding) paste block to the single-line `irm https://kun.databayt.org/install | iex`. Keep Manual fallback as the existing chain for Team/Enterprise plans.
162-
4. Update the team channel topic and joiner doc to point at the new flow.
163-
5. **Run the new bootstrap on one volunteer's fresh VM** before any new hire sees it. The current doc shipped without this step — that's how we ended up with the lessons below.
157+
1. ✅ Land scripts in `databayt/kun/.claude/scripts/``bootstrap`, `doctor`, `maintain`, `install`, `secrets`, `sync-repos`, plus 9 lib modules. All idempotent, syntax-checked, smoke-tested.
158+
2. ✅ Redirect set in `next.config.ts`: `kun.databayt.org/install``raw.githubusercontent.com/databayt/kun/main/.claude/scripts/bootstrap.ps1`. Same for `/doctor` and `/finish`.
159+
3. ✅ Tombstone `databayt/codebase/.claude/scripts/install.ps1` — prevents duplicate-edit drift.
160+
4.[Onboarding](/docs/onboarding) collapsed to single-paste, with Cowork-driven and Manual as alternatives.
161+
5.**Run on one volunteer's fresh Windows 11 VM** before pointing new hires at it. Validates: direct `winget install JetBrains.WebStorm` ships intact JBR (vs. needing Toolbox fallback), Marketplace plugin pre-drop loads on first IDE launch, OAuth batch survives the actual sign-in screens.
162+
6. ⏳ Update team channel topic + joiner doc to cite the new flow.
164163

165164
## Lessons from first run
166165

content/docs/onboarding.mdx

Lines changed: 70 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,82 @@
11
---
22
title: Onboarding
3-
description: Three actions, ~90 minutes to your first PR
3+
description: One paste, one UAC, three sign-ins
44
---
55

66
# Onboarding
77

8-
> Three actions. Cowork drives the rest.
8+
> One paste. One UAC. Three sign-ins. ~90 minutes wall-clock, ~10 minutes of your attention.
99
10-
The fastest path from a fresh Windows laptop to a databayt PR: install Claude Desktop, paste the team prompt into the Code tab, stay near the keyboard while it sets your machine up. Wall-clock ~90 minutes, mostly downloads. Human time ~10.
10+
The canonical path from fresh Windows laptop to a databayt PR. Paste a single line, click Yes on one UAC prompt, walk away. Come back at the OAuth batch at the end, sign in to GitHub + Claude + JetBrains, done.
1111

1212
## What you end up with
1313

1414
- Claude Code CLI on `PATH`
15-
- Full `~/.claude/` config — every agent, command, MCP server, rule, hook, memory file
15+
- Full `~/.claude/` config — agents, commands, MCP servers, rules, hooks, memory
1616
- The `c` function — `claude --dangerously-skip-permissions` in one keystroke
17-
- WebStorm with the Claude Code [Beta] plugin
18-
- `databayt/codebase` cloned to `~\codebase`
19-
- Every other active org repo cloned under `~\oss\<name>`
20-
- `claude doctor` green
17+
- WebStorm with the Claude Code [Beta] plugin pre-installed
18+
- `databayt/codebase` at `~\codebase` + every other active org repo under `~\oss\<name>`
19+
- Daily `kun-maintain` scheduled task armed for 09:00 — auto sync, doctor, notify
20+
- `doctor` exits green
2121

2222
## Before you start
2323

2424
| Requirement | Why |
2525
|---|---|
26-
| **Pro or Max plan** | Computer use isn't on Team or Enterprise. Without it, jump to [Manual fallback](#manual-fallback). |
27-
| Windows 11, admin rights | `winget` installs and `$PROFILE` edits need them. |
28-
| ~3 GB free disk | Claude Desktop + Node + WebStorm + org repos. |
26+
| **Pro or Max plan** | The CLI needs a paid account; Cowork (if you use the alternative path below) needs computer use, which is Pro/Max only |
27+
| Windows 11, admin rights | `winget` installs and `$PROFILE` edits need elevation |
28+
| ~3 GB free disk | Claude Desktop + Node + WebStorm + org repos |
2929

30-
If any row is missing, sort it before pasting — Cowork can't fix a Team plan.
30+
## Recommended: single-paste
3131

32-
## The three actions
32+
Open PowerShell and paste:
3333

34-
### 1. Install Claude Desktop and turn on computer use
35-
36-
Download and run the [Windows x64 installer](https://claude.ai/api/desktop/win32/x64/setup/latest/redirect) (or [ARM64](https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect)).
37-
38-
Launch it. Sign in with your Anthropic account. Confirm the bottom-left badge says **Pro** or **Max** — if it says Team or Enterprise, the rest of this flow won't work; use [Manual fallback](#manual-fallback).
34+
```powershell
35+
irm https://kun.databayt.org/install | iex
36+
```
3937

40-
Settings → General → scroll to **Desktop app** → toggle **Allow Claude to use your computer**. The first time Claude controls the screen, Windows prompts for accessibility access. Grant it. Reference: [Anthropic — computer use in Desktop](https://code.claude.com/docs/en/desktop#let-claude-use-your-computer).
38+
That's the whole flow. The script:
4139

42-
### 2. Open the Code tab and paste the team prompt
40+
1. Sets `ExecutionPolicy CurrentUser RemoteSigned` and re-launches elevated (one UAC prompt).
41+
2. Installs the CLI tools via `winget`: Git, Node-LTS, gh, PowerShell 7, Claude Code CLI, Claude Desktop, WebStorm.
42+
3. Refreshes `PATH`, installs `pnpm`, pre-drops the Claude Code [Beta] plugin into WebStorm.
43+
4. Copies the kun config into `~/.claude/` and pulls secrets from the team Gist.
44+
5. Appends the `c` / `cc` functions to your `$PROFILE` (idempotent — re-runs skip if present).
45+
6. Pauses at the **OAuth batch** — three sign-ins, one tab at a time:
46+
- `gh auth login` device code (clipboard-copied)
47+
- `claude` first run (browser sign-in)
48+
- WebStorm first launch (sign in or click "Start trial")
49+
7. Clones every active org repo via `sync-repos.ps1`.
50+
8. Arms the daily `kun-maintain` scheduled task.
51+
9. Runs `doctor` for final verification.
4352

44-
Claude Desktop has three tabs — **Chat**, **Cowork**, **Code**. Computer use lives in Code. Start a new Code session. Paste the block below.
53+
Press **Esc** at any point during the OAuth pause to abort cleanly. Re-running the same paste resumes where it left off (every step is idempotent).
4554

46-
```text
47-
Set up this fresh Windows laptop for databayt with computer use.
48-
49-
End state I want:
50-
- GitHub, JetBrains, and Claude (Pro/Max) accounts ready
51-
- Side-tools installed: git, Node 22, pnpm, gh CLI, PowerShell 7
52-
- Claude Code CLI installed and signed in
53-
- The `c` function added to my $PROFILE so it survives new terminals
54-
- The databayt config installed at %USERPROFILE%\.claude\ (install.ps1 + secrets.ps1)
55-
- WebStorm installed with the Claude Code [Beta] plugin
56-
- Every active databayt repo cloned via sync-repos.ps1
57-
(codebase to ~\codebase, others to ~\oss\<name>)
58-
- `claude doctor` all green
59-
60-
Walk me through each step. Open the right app for me. Pause at every OAuth
61-
or browser screen so I sign in myself — your browser is view-only. Ask for
62-
my confirmation before any destructive command. I can press Esc to stop you.
63-
64-
One-liners you can use when you reach them:
65-
66-
winget install Git.Git OpenJS.NodeJS.LTS GitHub.cli Microsoft.PowerShell
67-
npm install -g pnpm
68-
winget install Anthropic.ClaudeCode
69-
irm https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.ps1 | iex
70-
& "$env:USERPROFILE\.claude\scripts\secrets.ps1" -GistId 68453b25fa9d28c94426c55c179b3838
71-
winget install JetBrains.WebStorm
72-
& "$env:USERPROFILE\.claude\scripts\sync-repos.ps1"
73-
74-
The `c` function block for $PROFILE:
75-
76-
function c { claude --dangerously-skip-permissions $args }
77-
function cc { claude $args }
78-
if (Test-Path "$env:USERPROFILE\.claude\.env") {
79-
Get-Content "$env:USERPROFILE\.claude\.env" | ForEach-Object {
80-
if ($_ -and -not $_.StartsWith("#")) {
81-
$parts = $_ -split "=", 2
82-
if ($parts.Length -eq 2) {
83-
[Environment]::SetEnvironmentVariable($parts[0], $parts[1], "Process")
84-
}
85-
}
86-
}
87-
}
88-
$env:Path = "$env:USERPROFILE\.claude\bin;" + $env:Path
89-
90-
When done, run `claude doctor`, screenshot the result, and list anything
91-
still pending or anything I owe (OAuth completions, plan upgrades, etc.).
92-
```
55+
## Alternative: Cowork-driven
9356

94-
### 3. Stay near the keyboard
57+
If you'd rather have an agent narrate every step (and you're on Pro/Max), use Claude Desktop's Code tab and paste the prompt below.
9558

96-
Cowork drives the installs. Your job is the irreducible human bits:
59+
Download [Claude Desktop](https://claude.ai/api/desktop/win32/x64/setup/latest/redirect), sign in, turn on **Settings → General → Allow Claude to use your computer**. Open the **Code** tab, start a new session, paste:
9760

98-
- **One UAC prompt** when `winget` first elevates — click Yes.
99-
- **OAuth sign-ins.** Cowork pauses on browser screens for GitHub (`gh auth login` device code), Claude (`claude` sign-in), and JetBrains (WebStorm first launch). Type the codes, click Authorize, return to Code, tell it to continue.
100-
- **Plugin trust** if WebStorm prompts to trust the Claude Code [Beta] plugin.
61+
```text
62+
Set up this fresh Windows laptop for databayt.
10163
102-
Total human time: ~10 minutes spread over ~30–45 minutes of installs. Press **Esc** anywhere on screen to abort — Claude releases control and unhides your apps.
64+
End state: everything in https://kun.databayt.org/docs/onboarding "What you end up with".
10365
104-
## When you're done
66+
Use the kun bootstrap as your reference, run as much from PowerShell as
67+
possible. Open browser tabs for OAuth and pause for me to sign in.
68+
Press Esc to abort at any time.
10569
106-
Open a fresh PowerShell and run:
70+
irm https://kun.databayt.org/install | iex
10771
108-
```powershell
109-
claude --version # CLI installed
110-
claude doctor # all checks pass
111-
Get-Command c # c function loaded from $PROFILE
112-
Test-Path ~\codebase # codebase cloned
113-
(Get-ChildItem ~\oss).Count # org repos cloned (>= 6)
72+
When done, run `doctor` and report any non-green rows.
11473
```
11574

116-
If every line returns a non-empty result and `claude doctor` is green, you're done. Open WebStorm in any cloned repo and press `Ctrl+Esc` to start a Claude session in the IDE.
117-
118-
## If something fails
119-
120-
- **Esc aborts computer use** at any time. Apps unhide, control returns to you.
121-
- **`claude doctor` is the single source of truth.** Re-run it after any fix; the output names what's missing.
122-
- **Secrets out of date or missing?** Re-run `& "$env:USERPROFILE\.claude\scripts\secrets.ps1" -GistId 68453b25fa9d28c94426c55c179b3838` — it's idempotent.
123-
- **Deeper failures?** [Onboarding reference](/docs/onboarding-reference) covers the orchestration model, the scripts contract, and the lessons from the first real run.
75+
The Cowork path costs more tokens than the bare PowerShell paste (Cowork narrates each step) but gives you live commentary, the ability to interrupt with "stop, do X first," and a record of decisions in the chat history.
12476

12577
## Manual fallback
12678

127-
For Team or Enterprise plans (no computer use), or when you'd rather type. Run these in PowerShell.
79+
For Team or Enterprise plans (no computer use), or when you'd rather drive every command yourself. Paste these in PowerShell:
12880

12981
```powershell
13082
# Side-tools
@@ -152,7 +104,7 @@ if (Test-Path "$env:USERPROFILE\.claude\.env") {
152104
$env:Path = "$env:USERPROFILE\.claude\bin;" + $env:Path
153105
154106
# databayt config + secrets
155-
irm https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.ps1 | iex
107+
irm https://raw.githubusercontent.com/databayt/kun/main/.claude/scripts/install.ps1 | iex
156108
& "$env:USERPROFILE\.claude\scripts\secrets.ps1" -GistId 68453b25fa9d28c94426c55c179b3838
157109
158110
# WebStorm + plugin (install plugin from the Marketplace inside WebStorm)
@@ -161,14 +113,36 @@ winget install JetBrains.WebStorm
161113
# Clone every active databayt repo
162114
& "$env:USERPROFILE\.claude\scripts\sync-repos.ps1"
163115
116+
# Arm the daily heartbeat
117+
& "$env:USERPROFILE\.claude\scripts\maintain.ps1" -Install
118+
164119
# Verify
165-
claude --version
166-
claude doctor
167-
Get-Command c
120+
& "$env:USERPROFILE\.claude\scripts\doctor.ps1"
168121
```
169122

170123
For hogwarts and other private secrets, your team contact shares the `.env` out-of-band.
171124

125+
## When you're done
126+
127+
Open a fresh PowerShell and run:
128+
129+
```powershell
130+
doctor # all checks pass (or run from ~/.claude/scripts/doctor.ps1)
131+
claude --version # CLI installed
132+
Get-Command c # c function loaded from $PROFILE
133+
(Get-ChildItem ~\oss).Count # org repos cloned (>= 9)
134+
```
135+
136+
If `doctor` is green, open WebStorm in any cloned repo and press `Ctrl+Esc` to start a Claude session in the IDE.
137+
138+
## If something fails
139+
140+
- **Re-run the same paste.** Every step is idempotent — second run skips what's done.
141+
- **`doctor` is the single source of truth.** Output names exactly what's missing and how to fix it.
142+
- **`doctor -Fix`** repairs the trivially-fixable: missing `c` function in `$PROFILE`, `~/.claude/bin` not on PATH.
143+
- **OAuth aborted?** Re-paste; the script resumes at the OAuth step.
144+
- **Deeper failures?** [Onboarding reference](/docs/onboarding-reference) covers the orchestration model, the scripts contract, and the lessons from the first real run.
145+
172146
## Daily entry points
173147

174148
| Action | How |
@@ -181,6 +155,7 @@ For hogwarts and other private secrets, your team contact shares the `.env` out-
181155
| Send a note to the team | `c "/dispatch <message>"` |
182156
| Open a GitHub issue | `c "/issue"` |
183157
| Verify a production deploy | `c "/watch"` |
158+
| Re-audit machine health | `doctor` |
184159

185160
Full keyword list: [keywords](/docs/keywords).
186161

0 commit comments

Comments
 (0)