AgentSkillsCN

onboarding-and-re-onboarding

TryRamadan 中的新手引导与重新引导流程。涵盖步骤顺序、持久化机制(草稿与最终偏好设置的区分)、重定向至仪表板,以及各种边缘场景(中途放弃、跳过定位、穆斯林与非穆斯林用户的不同路径)。适用于调整新手引导步骤、路由设计,或优化完成逻辑时使用。

SKILL.md
--- frontmatter
name: onboarding-and-re-onboarding
description: Onboarding and re-onboarding flows in TryRamadan. Covers step order, persistence (draft vs final preferences), redirect to dashboard, and edge cases (abandonment, skip location, Muslim vs Non-Muslim path). Use when changing onboarding steps, routes, or completion logic.

Onboarding and Re-onboarding (TryRamadan)

Use this skill when changing onboarding steps, completion logic, or redirect to dashboard so flows and persistence stay correct.


1. Step order and routes

#StepRouteRequired?
1Welcome/onboarding/welcome
2Mode/onboarding/modeYes (Muslim vs Non-Muslim; Muslim skips Knowledge)
3Knowledge/onboarding/knowledgeYes if Non-Muslim
4Health/onboarding/healthYes
5Location/onboarding/locationNo (can "Skip for now"; Dashboard shows reminder if missing)
6Schedule/onboarding/scheduleYes
7Notifications/onboarding/notificationsNo
8Priorities/onboarding/prioritiesYes (defaults pre-filled)
9Goals/onboarding/goalsGoals optional

Doc: docs/ONBOARDING-REONBOARDING-FLOWS.md (information order, time-of-Ramadan variants, abandonment, re-onboarding).


2. Persistence

  • Draft: Onboarding state (mode, location, schedule, notifications, priorities, goals) is saved to tryramadan-onboarding-draft on every change. Not written to final preferences until completion.
  • On completion: User clicks "Go to dashboard" on Goals. Then: persistPreferencesSync(...) (including onboardingComplete: true), persistQuickActionsSync(...) (from priorities). Redirect to /dashboard.
  • Dashboard redirect: Dashboard redirects to /onboarding/welcome only when !preferences.onboardingComplete && !hasTime (and not still loading location). Once onboardingComplete is true, user is not forced back into onboarding.
  • local-storage-and-persistence skill: Call persistPreferencesSync and persistQuickActionsSync before navigating away so Dashboard reads fresh data.

3. Edge cases

  • Location skipped: Dashboard shows reminder until location is set or dismissed; prayer times need location for accuracy.
  • Abandonment mid-flow: Draft remains in localStorage; user can resume or clear. No partial write to tryramadan-preferences until completion.
  • Re-onboarding: If product supports "Redo onboarding," clear or merge preferences and ensure redirect and draft behavior are defined (see ONBOARDING-REONBOARDING-FLOWS).

4. Tests

  • Files: src/test/onboardingFlow.test.tsx, src/test/onboardingCritical.test.tsx. Complete onboarding → land on dashboard; preferences persisted; no redirect loop.
  • When adding or reordering steps, update tests and doc so order and required/skippable stay in sync.