<!-- source-hash: 6c9cba8f9dc37e2eede2b2e2a71052b8 -->
Utility module for managing user onboarding state in localStorage with atomic writes and cross-tab synchronization. Provides persistent storage for tracking completed steps, skipped steps, and dismissal status.

## Key Components

- **OnboardingState Interface** - Type definition for onboarding state structure
- **saveOnboardingState()** - Atomic localStorage write with event dispatch
- **loadOnboardingState()** - Safe state loading with fallback to defaults
- **markStepComplete()** - Mark individual steps as completed
- **markMultipleComplete()** - Batch complete multiple steps atomically
- **markStepSkipped()** - Track skipped onboarding steps
- **dismissOnboarding()** - Permanently dismiss the onboarding flow
- **isStepComplete()** - Check completion status of specific steps
- **isStepSkipped()** - Check skip status of specific steps
- **isOnboardingDismissed()** - Check if user has dismissed onboarding

## Usage Example

```typescript
import { 
  markStepComplete, 
  isStepComplete, 
  dismissOnboarding,
  loadOnboardingState 
} from './onboarding-storage'

// Track step completion
markStepComplete('app-onboarding', 'welcome-step')
markStepComplete('app-onboarding', 'profile-setup')

// Check progress
if (isStepComplete('app-onboarding', 'welcome-step')) {
  console.log('Welcome step completed')
}

// Batch operations
markMultipleComplete('app-onboarding', ['step1', 'step2', 'step3'])

// Dismiss onboarding
dismissOnboarding('app-onboarding')

// Load current state
const state = loadOnboardingState('app-onboarding')
console.log(`Completed: ${state.completedSteps.length} steps`)
```

The module handles SSR compatibility, prevents race conditions through atomic updates, and dispatches custom events for cross-tab state synchronization.