Skip to content

feat(create-helpbase): login-first scaffolder (funnel capture) - #13

Merged
Codehagen merged 2 commits into
mainfrom
feat/login-first-scaffolder
Apr 19, 2026
Merged

Codehagen merged 2 commits into
mainfrom
feat/login-first-scaffolder

Conversation

@Codehagen

@Codehagen Codehagen commented Apr 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes the Skip-path funnel leak caught in the 2026-04-19 cold-start dogfood: users who picked Skip walked through the whole scaffolder without ever being asked to claim a subdomain — no email captured, no retargeting hook, no reserved docs-<hex>.helpbase.dev.

Change: move the login prompt from after-source-selection to step 1 (right after project-name validation). Fires on every cold scaffold. Reframe copy to lead with the concrete subdomain URL.

create-helpbase 0.4.0 → 0.5.0.

UX before (0.4.0)

1. What is your project called? test3
2. Seed content from? Skip
3. Scaffold
4. Dev server                              ← user gone, no trace

UX after (0.5.0)

1. What is your project called? test3
2. Claim your free docs URL? Y             ← NEW: browser device-flow
     (docs-<hex>.helpbase.dev + 500k AI tokens/day, no card)
3. Seed content from? Skip
4. Scaffold
5. What next: deploy / ingest / new        ← subdomain reserved, ready for later

Other changes bundled

  • BYOK users see the prompt too. Subdomain reservation is orthogonal to ANTHROPIC_API_KEY / OPENAI_API_KEY / AI_GATEWAY_API_KEY.
  • HELPBASE_TOKEN env var skips the prompt silently. CI users pre-issue tokens; no point making them browser-flow.
  • "What next" block adapts to auth state. Declined-login users see npx helpbase login as the first line with a clear subdomain-claim hint; logged-in users skip the redundant line.

Test plan

  • pnpm -F create-helpbase typecheck — green
  • pnpm -F create-helpbase test — 47 tests green
  • pnpm typecheck (monorepo) — 5/5 green
  • node scripts/sync-templates.mjs — no drift
  • Non-interactive Skip probe: no prompt fires, "What next" leads with npx helpbase login hint
  • Interactive Skip probe (via expect): "Claim your free docs URL?" fires as the FIRST prompt before source selection
  • Cold-start dogfood with a fresh account to time the full TTHW (target: ~90s interactive, ~60s with --deploy)

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes - v0.5.0

  • New Features
    • Login prompt now appears earlier in the setup flow with messaging emphasizing your free docs URL subdomain benefit.
    • Users can decline authentication and continue with project setup; guidance provided to claim your subdomain later.
    • Updated post-setup instructions to show login steps when authentication is pending.

Moves the login prompt from after-source-selection to step 1, right
after project-name validation. Fires on every cold scaffold regardless
of source kind — previously gated on `source.kind !== "skip"`, which
meant Skip users (picking sample content) walked through the whole
scaffolder without ever being asked to claim a subdomain. 100% funnel
leak on that path.

Reframed the prompt copy as a perk, not a gate:
  was: "Log in to helpbase free? (500k tokens/day, no card — 30s browser flow)"
  now: "Claim your free docs URL? (docs-<hex>.helpbase.dev + 500k AI tokens/day, no card)"

Leading with the concrete subdomain URL converts better than the
abstract "sign in" ask — founders told us as much during the first cold
dogfood of 0.4.0 this morning.

Other changes:
- BYOK users (ANTHROPIC_API_KEY / OPENAI_API_KEY / AI_GATEWAY_API_KEY)
  no longer skip the prompt. Subdomain reservation is orthogonal to AI
  creds; BYOK users benefit from a reserved deploy target.
- HELPBASE_TOKEN env var skips the prompt (CI users pre-issue tokens).
- Declined-login users see `npx helpbase login` as the first line of
  the end-of-scaffold "What next" block so the path to a subdomain
  stays visible. Logged-in users don't see the redundant hint.

create-helpbase 0.4.0 → 0.5.0.

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

vercel Bot commented Apr 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
helpbase Ready Ready Preview, Comment Apr 19, 2026 8:04am

Request Review

@coderabbitai

coderabbitai Bot commented Apr 19, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Codehagen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 46 minutes and 30 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 46 minutes and 30 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f71f0480-3a3e-434f-aa50-c9337b839d6a

📥 Commits

Reviewing files that changed from the base of the PR and between bb4575d and 06bde0e.

📒 Files selected for processing (1)
  • packages/create-helpbase/src/index.ts
📝 Walkthrough

Walkthrough

The create-helpbase CLI authentication flow is restructured: login prompting moves earlier (before source selection), the prompt copy refocuses on claiming a free docs URL, and BYOK users are no longer exempted from auth prompts. Post-scaffold messaging conditionally includes login instructions based on auth state.

Changes

Cohort / File(s) Summary
Version Bump & Changelog
CHANGELOG.md, package.json
Documentation entry for v0.5.0 and version increment reflecting auth flow adjustments and messaging updates.
Auth Flow Restructuring
packages/create-helpbase/src/index.ts
Moved login prompt earlier (before source selection), removed isByokMode gating to include BYOK users, updated prompt copy to emphasize free docs URL claim, and made post-scaffold "What next" message auth-state dependent with conditional login instructions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Hops early to claim your doc-URL so fine,
No BYOK exclusions—all users align,
The prompt's reworded with perks on display,
And "What next?" adapts to show the right way! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(create-helpbase): login-first scaffolder (funnel capture)' directly summarizes the main change—moving login prompting to the first step of the scaffolder to capture user emails and claim subdomains.
Description check ✅ Passed The description comprehensively covers the problem, solution, UX flow comparison, bundled changes, and test plan, meeting all template requirements with concrete examples and clear scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/login-first-scaffolder

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 and usage tips.

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/create-helpbase/src/index.ts`:
- Around line 428-429: Refresh the auth state immediately before computing
loggedIn for the "What next" render: instead of relying on the in-memory
authToken, re-read the persisted token from disk (the same function used
elsewhere to load/write the saved auth token that the ship-it-now/login path
uses) and use that fresh value when computing loggedIn (i.e., compute loggedIn =
!!freshDiskToken || !!process.env.HELPBASE_TOKEN?.trim()). Update the code
around the existing authToken / HELPBASE_TOKEN usage so the UI reflects a user
who logged in via the ship-it-now path.
- Around line 193-198: authToken is only read from disk via
readHelpbaseAuthToken(), so when HELPBASE_TOKEN is set the prompt is skipped but
the token isn't passed into generation functions and loggedIn is computed
incorrectly; fix by initializing authToken to prefer
process.env.HELPBASE_TOKEN?.trim() fallback to readHelpbaseAuthToken(), ensure
runRepoGeneration(...) and runUrlGeneration(...) are invoked with that resolved
authToken (and modify runUrlGeneration to accept a token parameter instead of
re-reading disk), and recompute the loggedIn state after any fallback login so
it reflects the final auth token value (referencing readHelpbaseAuthToken,
process.env.HELPBASE_TOKEN, runRepoGeneration, runUrlGeneration, and loggedIn).
🪄 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

Run ID: b8837e93-2490-4d12-a856-e8d8ec8081eb

📥 Commits

Reviewing files that changed from the base of the PR and between dd5e3b6 and bb4575d.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • packages/create-helpbase/package.json
  • packages/create-helpbase/src/index.ts

Comment thread packages/create-helpbase/src/index.ts Resolved
Comment thread packages/create-helpbase/src/index.ts Resolved
…h state

Two CodeRabbit findings on PR #13:

CR#1 (Major): `authToken` was initialized only from ~/.helpbase/auth.json
via readHelpbaseAuthToken(). When a CI user set `HELPBASE_TOKEN`, the
step-1 login prompt was correctly skipped, but the env token never
reached `generateArticlesFromContent` / `generateFromRepo` — AI gen
failed MissingApiKey and the scaffolder silently fell back to sample
content. Now: initialize with disk-OR-env, and thread the resolved
token through `runUrlGeneration` (which was re-reading disk) and
`runRepoGeneration` (already accepted it).

CR#2 (Minor): the "What next" block computed `loggedIn` from the
in-memory `authToken` variable, which stays undefined if the user
declined step-1 but logged in later via the ship-it-now subprocess
(that path writes the token file but doesn't mutate the outer
variable). Now re-read disk when computing `loggedIn` so the redundant
"run helpbase login" hint doesn't show to users who just logged in.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Codehagen
Codehagen merged commit 43dd1a4 into main Apr 19, 2026
3 of 5 checks passed
@Codehagen
Codehagen deleted the feat/login-first-scaffolder branch April 19, 2026 08:04

This branch was successfully deployed

1 active deployment
Preview — 06bde0e4 Deployed Apr 19, 2026 by vercel[bot]
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