All examples for Feature Decomposition Assistant

Cross-Platform Offline Support

Offline functionality for mobile and web platforms addressing data loss during connection drops. Demonstrates handling of ambiguous requirements through investigation stories, platform-specific decomposition (iOS vs web), and complex sync/conflict resolution. Shows how to identify technical unknowns and parallel track platform work.

Input

What you provide to the skill

We need to make our app work offline. Users complain about losing data when connection drops. Mobile and web platforms.

Output

What the skill generates for you

Feature Decomposition: Offline Support

Total Stories: 9 stories
Estimated Timeline: ~18 days (assuming 1 team)
Dependencies: Stories 1-2 must complete before Stories 3-8


🔍 Story 1: Offline Capabilities Investigation [Foundation]

Estimated Size: 2 days
Priority: MUST HAVE (blocks technical decisions)

As a technical lead,
I want to understand current data loss scenarios and offline storage options,
So that we can choose the right offline strategy for mobile and web.

Acceptance Criteria (starters):

  • Document all current data loss scenarios reported by users
  • Audit mobile app for existing local storage (Core Data, SQLite, etc.)
  • Audit web app for existing storage (LocalStorage, IndexedDB, etc.)
  • Evaluate sync conflict resolution strategies (last-write-wins, operational transform, CRDT)
  • Measure typical data sizes per user session
  • Recommend storage approach per platform (mobile vs web)
  • Define sync architecture (polling vs WebSocket vs background sync)
  • Document security considerations (encryption at rest)

Technical Notes:

  • iOS: Consider Core Data + CloudKit or custom SQLite
  • Web: IndexedDB preferred over LocalStorage for large data
  • Need to understand network reliability patterns from analytics
  • Consider offline-first frameworks (Realm, PouchDB, WatermelonDB)

INVEST Check:

  • Independent: Can be completed without implementation
  • Negotiable: Investigation scope is flexible
  • Valuable: Prevents costly rework by making informed decisions
  • Estimable: Timeboxed to 2 days
  • Small: 2-day spike
  • Testable: Delivers decision document with recommendations

Story 2: Data Sync Infrastructure [Foundation]

Estimated Size: 3 days
Priority: MUST HAVE (blocks other stories)
Dependency: Requires Story 1 (investigation)

As a backend developer,
I want a sync API that handles offline data uploads and conflict resolution,
So that mobile and web clients can reliably sync when reconnected.

Acceptance Criteria (starters):

  • Sync endpoint accepts batches of offline actions with timestamps
  • Server assigns definitive timestamps to resolve clock skew
  • Conflict resolution strategy implemented (based on Story 1 decision)
  • Idempotency keys prevent duplicate operations
  • Returns sync status per item (accepted, rejected, conflicted)
  • API versioning supports client upgrades
  • Rate limiting prevents sync abuse
  • [Add more based on chosen sync strategy]

Technical Notes:

  • Consider event sourcing pattern for audit trail
  • Need database transactions for consistency
  • Queue system for async processing if large batches
  • Metrics for sync success/failure rates

INVEST Check: All criteria met


Story 3: Mobile Local Storage Layer [Foundation - Mobile]

Estimated Size: 3 days
Priority: MUST HAVE (mobile platform)
Dependency: Requires Story 1 (investigation)

As a mobile developer,
I want a local database to persist user data offline,
So that the app remains functional without connectivity.

Acceptance Criteria (starters):

  • Local database implemented (Core Data / SQLite / Realm based on Story 1)
  • Schema mirrors backend data models for key entities
  • CRUD operations work offline with local storage
  • Data encrypted at rest (using device keychain)
  • Migration strategy for schema updates
  • Query performance acceptable for typical datasets (<100ms)
  • [Add more based on storage technology choice]

Technical Notes:

  • iOS: Core Data with CloudKit or SQLite.swift
  • Consider write-through vs write-back caching
  • Need garbage collection for old offline data
  • Test with airplane mode enabled

INVEST Check: All criteria met


Story 4: Web Local Storage Layer [Foundation - Web]

Estimated Size: 2 days
Priority: MUST HAVE (web platform)
Dependency: Requires Story 1 (investigation)

As a web developer,
I want to persist user data locally in the browser,
So that web users don’t lose work when disconnected.

Acceptance Criteria (starters):

  • IndexedDB wrapper implemented with promise-based API
  • Stores key user actions (form submissions, edits, uploads)
  • Schema versioning for database migrations
  • Storage quota management (warn at 80% capacity)
  • CRUD operations work offline with IndexedDB
  • Fallback to in-memory storage if IndexedDB unavailable (privacy mode)
  • [Add more based on data volume]

Technical Notes:

  • Consider Dexie.js or localForage for IndexedDB wrapper
  • Service Worker registration prerequisite
  • Test in incognito/private browsing mode
  • Handle storage quota exceeded errors

INVEST Check: All criteria met


Story 5: Mobile Offline Queue [Core - Mobile]

Estimated Size: 3 days
Priority: MUST HAVE (mobile platform)
Dependencies: Stories 2 + 3

As a mobile user,
I want my actions to be saved locally when offline,
So that nothing is lost when my connection drops.

Acceptance Criteria (starters):

  • User actions queued in local database when offline
  • Queue items include action type, payload, timestamp, retry count
  • Visual indicator shows pending sync items count
  • Queue persists across app restarts
  • Queue processes automatically when online
  • Failed sync items retry with exponential backoff
  • User can manually trigger sync from settings
  • [Add more based on action types]

Technical Notes:

  • Reachability observer detects connectivity changes
  • Background sync when app returns to foreground
  • Consider operation priority (user vs system actions)
  • Handle app termination during sync

INVEST Check: All criteria met


Story 6: Web Offline Queue with Service Worker [Core - Web]

Estimated Size: 3 days
Priority: MUST HAVE (web platform)
Dependencies: Stories 2 + 4

As a web user,
I want my form submissions and edits saved when offline,
So that I can continue working without connectivity.

Acceptance Criteria (starters):

  • Service Worker intercepts API requests when offline
  • Failed requests queued in IndexedDB
  • Queue includes request method, URL, body, headers, timestamp
  • Background sync API replays queue when reconnected
  • Visual badge shows pending sync count
  • Sync notification shows success/failure
  • User can view pending changes in UI
  • [Add more based on request types]

Technical Notes:

  • Service Worker registration and activation lifecycle
  • Background Sync API (fallback to polling if unavailable)
  • Consider request deduplication
  • Handle CORS and auth tokens in replayed requests

INVEST Check: All criteria met


Story 7: Conflict Resolution UI [Core]

Estimated Size: 2 days
Priority: MUST HAVE (both platforms)
Dependencies: Stories 5 + 6

As a user,
I want to see when my offline changes conflict with server data,
So that I can decide which version to keep.

Acceptance Criteria (starters):

  • Modal shows conflicting versions side-by-side
  • User can choose “Keep mine”, “Use server”, or “Merge”
  • Merge option available for non-destructive conflicts
  • Preview shows result before confirming
  • Conflict automatically resolved if no overlap (auto-merge)
  • User notified of resolved conflicts in activity log
  • [Add more based on conflict types]

Technical Notes:

  • Diff algorithm to highlight changes
  • Consider field-level vs document-level conflicts
  • Accessibility: keyboard navigation, screen reader support
  • Conflicts stored until user resolves (no silent data loss)

INVEST Check: All criteria met


Story 8: Offline Indicator & Status [Core]

Estimated Size: 1 day
Priority: MUST HAVE (both platforms)
Dependencies: Stories 5 + 6

As a user,
I want clear indicators of offline mode and sync status,
So that I understand when my data is being saved locally vs synced.

Acceptance Criteria (starters):

  • Offline mode banner appears at top when disconnected
  • Sync status icon shows “synced”, “syncing”, “offline”, “error” states
  • Toast notification when transitioning online/offline
  • Pending changes count visible in status bar
  • Last successful sync timestamp shown
  • Tapping status opens sync detail view

Technical Notes:

  • Use platform-native connectivity APIs
  • Debounce rapid connection state changes
  • Persistent notification vs transient toast
  • Icon design for accessibility (colorblind-friendly)

INVEST Check: All criteria met


Story 9: Offline Data Pruning [Enhancement]

Estimated Size: 2 days
Priority: SHOULD HAVE (storage management)
Dependencies: Stories 3 + 4

As a user with limited device storage,
I want old offline data automatically cleaned up,
So that the app doesn’t consume excessive storage.

Acceptance Criteria (starters):

  • Data older than 30 days automatically pruned
  • Synced items deleted from local storage after confirmation
  • User can manually clear offline cache from settings
  • Storage usage shown in settings (MB used)
  • Warning shown if storage exceeds threshold (100MB)
  • [Add more based on data retention policy]

Technical Notes:

  • Background job for pruning (iOS: BGTaskScheduler, Web: Service Worker)
  • Keep unsynced data indefinitely (warn user)
  • Test with low storage scenarios
  • Respect user privacy (clear on app uninstall)

INVEST Check: All criteria met


Implementation Strategy

Phase 1: Investigation & Foundation (Days 1-8)

  • Story 1 (investigation) - 2 days [BLOCKING]
  • After Story 1 completes:
    • Story 2 (sync API) - 3 days
    • Story 3 (mobile storage) + Story 4 (web storage) in parallel - 3 days (2 developers)
  • Enables: Core infrastructure for offline support

Phase 2: Offline Queues (Days 9-14)

  • Story 5 (mobile queue) + Story 6 (web queue) in parallel - 3 days each (2 developers)
  • Story 7 (conflict UI) - 2 days
  • Enables: MVP offline functionality, shippable

Phase 3: Polish (Days 15-17)

  • Story 8 (indicators) - 1 day
  • Story 9 (pruning) - 2 days (can run parallel with Story 8)
  • Enables: Production-ready offline experience

MVP Definition: Stories 1-7 = Full offline support with conflict resolution (14 days)
Full Feature: All 9 stories (17 days)

Parallelization Opportunities:

  • Phase 1: Stories 3 + 4 in parallel → 3 days instead of 5
  • Phase 2: Stories 5 + 6 in parallel → 3 days instead of 6
  • Phase 3: Stories 8 + 9 in parallel → 2 days instead of 3
  • Best case with 2 developers (1 mobile, 1 web): 14 days total

Risk Mitigation

Technical Risks:

  • Storage quota on web → Implement quota warnings, graceful degradation
  • Sync conflicts complex → Start with last-write-wins, iterate based on user feedback
  • Background sync unreliable → Fallback to foreground sync with manual trigger
  • Large data volumes → Implement pagination, partial sync, compression
  • Clock skew on devices → Use server timestamps as source of truth

Scope Risks:

  • Story 1 reveals complexity → May need to split Story 2 into smaller pieces
  • Conflict resolution UX complex → Consider deferring advanced merge features
  • Platform differences → May need separate stories for iOS/Android if very different
  • Third-party dependencies → Have backup plan if chosen library insufficient

User Experience Risks:

  • Users don’t understand offline mode → Comprehensive onboarding, tooltips
  • False positives on connectivity → Debounce and validate connectivity checks
  • Data loss anxiety → Clear status indicators, confirmation messages

Recommendation: Build Phase 1 + 2 first (14 days), beta test with power users, validate sync reliability and conflict resolution UX before rolling out Phase 3.


Definition of Done

Each story is complete when:

  • Code reviewed and merged
  • Unit tests written and passing (>80% coverage for sync logic)
  • Integration tests cover offline → online transitions
  • Manual QA completed on both platforms (airplane mode testing)
  • Performance benchmarks met (sync time <5s for typical session)
  • Documentation updated (offline behavior in user guide)
  • Security review passed (Stories 2-4)
  • Analytics instrumented (sync success rate, conflict frequency)

Platform-Specific DoD:

  • Mobile: Tested on iOS 15+, low storage scenarios
  • Web: Tested on Chrome/Safari/Firefox, private browsing mode, service worker activation