onboarding-state-architecture

Governs server-driven nextStep onboarding routing across web and WeChat mini-program clients.

Updated Dec 24, 2025
One-click install
npx skills add https://github.com/JoyJoin-Tech-Limited/JoyJoin_app_v0.1 --skill onboarding-state-architecture-joyjoin-tech-limited
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: onboarding-state-architecture
Source: https://github.com/JoyJoin-Tech-Limited/JoyJoin_app_v0.1/tree/main/.github/skills/onboarding-state-architecture
Command: npx skills add https://github.com/JoyJoin-Tech-Limited/JoyJoin_app_v0.1 --skill onboarding-state-architecture-joyjoin-tech-limited

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Onboarding flows break when clients reconstruct progress locally, producing routing loops, stale steps, and stuck users. This Skill enforces a single source of truth: the nextStep value computed server-side by GET /api/auth/user, so web and mini-program clients always navigate from authoritative server state. ## Core Features & Use Cases - Server-driven step authority: Defines the authority chain from routes/domains/auth.ts through useAuth.ts and AuthenticatedRouter, with shared helpers in packages/shared/src/onboarding.ts. - Step and flag mapping: Documents the active onboarding steps (personality-test, essential-data, extended-data, profile-review, discover) and their completion signals such as hasCompletedInterestsCarousel and profileEssentialComplete. - Stress-test checklist: Ships a grill-me interview covering nextStep computation, completion flags, restart idempotency, swipe-back recovery, and legacy quarantine. - Use Case: When adding a photo-upload step after essential-data, follow the Skill to add the server-side nextStep value, persist a new completion flag on the users table, register the route, and update the shared flow mapping. ## Quick Start Ask the AI to add a new onboarding step or debug why a user is stuck in onboarding, and it will apply the server-driven nextStep model from this Skill.

Frequently Asked Questions about onboarding-state-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new onboarding step to a server-driven flow?▼

Add the nextStep value to the server computation in routes/domains/auth.ts, persist a new completion flag on the users table, register the route under the onboarding pages directory, and update the shared nextStep-to-route mapping in packages/shared/src/onboarding.ts.

Why is a user stuck on an onboarding step after completing it?▼

The client is not re-fetching GET /api/auth/user after the step completion call, so nextStep stays stale. Invalidate the auth query and re-fetch before navigating, and verify the POST handler persists the completion flag.

What causes onboarding routing loops and how do I fix them?▼

Routing loops happen when the completion flag is not persisted server-side or the nextStep computation ignores the updated flag. Check the POST handler and the auth.ts computation; never let the client derive position from local state.

Does the WeChat mini-program use the same onboarding logic as the web client?▼

Yes. Mini-program pages under apps/mini-program/src/pages/onboarding/ must obey the same server nextStep, using shared helpers from packages/shared/src/onboarding.ts. Do not invent a separate progression model.

When should I not use this onboarding architecture guidance?▼

Do not use it for personality assessment question or scoring changes, post-onboarding profile page work, or auth login failures that occur before nextStep is reached. Those belong to the personality-system, frontend-component-architecture, and auth-session skills respectively.