prizmkit 1.1.53 → 1.1.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create-prizmkit.js +2 -0
- package/bundled/VERSION.json +3 -3
- package/bundled/rules/_rules-metadata.json +6 -1
- package/bundled/rules/general/cohesive-modeling.md +27 -0
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +114 -4
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +609 -0
- package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +285 -0
- package/bundled/skills/app-planner/references/rules/backend/question-bank.md +249 -0
- package/bundled/skills/app-planner/references/rules/backend/template.md +173 -0
- package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +373 -0
- package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +211 -0
- package/bundled/skills/app-planner/references/rules/database/question-bank.md +184 -0
- package/bundled/skills/app-planner/references/rules/database/template.md +158 -0
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +810 -0
- package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +188 -0
- package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +302 -0
- package/bundled/skills/app-planner/references/rules/frontend/template.md +320 -0
- package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +639 -0
- package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +290 -0
- package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +232 -0
- package/bundled/skills/app-planner/references/rules/mobile/template.md +175 -0
- package/bundled/skills/prizm-kit/SKILL.md +1 -1
- package/bundled/skills/prizmkit-init/SKILL.md +47 -6
- package/bundled/skills/prizmkit-init/references/config-schema.md +7 -3
- package/bundled/skills/prizmkit-init/references/rules/layer-detection.md +41 -0
- package/package.json +1 -1
- package/src/index.js +10 -0
- package/src/scaffold.js +124 -7
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# Fixed Rules — Complete Mobile Fixed Rules
|
|
2
|
+
|
|
3
|
+
> This file is read by the `mobile-rules` skill in Phase 1 and injected directly into `mobile-rules.md`.
|
|
4
|
+
> These rules are industry consensus / best practices — **do not ask the user**.
|
|
5
|
+
> Every rule includes RATIONALE so the AI understands intent, not just constraints.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## F1. Project Structure
|
|
10
|
+
|
|
11
|
+
### F1.1 Platform Directory Conventions
|
|
12
|
+
|
|
13
|
+
- **Rule**: Project root must clearly separate platform-specific code from shared code:
|
|
14
|
+
- Flutter: `lib/` (Dart), `test/`, `ios/`, `android/`
|
|
15
|
+
- React Native: `src/`, `ios/`, `android/`, `app.json`
|
|
16
|
+
- iOS: `AppName/` (Swift sources), `AppNameTests/`, `AppName.xcodeproj`
|
|
17
|
+
- Android: `app/src/main/java/`, `app/src/test/`, `app/build.gradle`
|
|
18
|
+
- **Rule**: Shared cross-platform code goes in `shared/` or `core/` directory.
|
|
19
|
+
- **Forbidden**: Mixing platform-specific and cross-platform code in the same directory.
|
|
20
|
+
- **RATIONALE**: Clean platform separation is the first defense against accidental platform coupling.
|
|
21
|
+
|
|
22
|
+
### F1.2 Module Organization
|
|
23
|
+
|
|
24
|
+
- **Rule**: Organize source by feature/module, not by technical layer (e.g., `features/auth/`, not `models/` + `views/` + `controllers/`).
|
|
25
|
+
- **Rule**: Within each feature directory, enforce the chosen architecture pattern (MVVM/Clean Architecture/MVI).
|
|
26
|
+
- **Forbidden**: Circular dependencies between feature modules.
|
|
27
|
+
- **RATIONALE**: Feature-based organization keeps related code together and limits blast radius of changes.
|
|
28
|
+
|
|
29
|
+
### F1.3 Naming Conventions
|
|
30
|
+
|
|
31
|
+
- **Flutter**: File names snake_case (`user_profile_screen.dart`). Widget classes PascalCase.
|
|
32
|
+
- **React Native**: Component files PascalCase (`UserProfileScreen.tsx`). Hooks `useXxx.ts`.
|
|
33
|
+
- **iOS/Swift**: Files PascalCase (`UserProfileView.swift`). Protocols start with describable verb.
|
|
34
|
+
- **Android/Kotlin**: Files PascalCase (`UserProfileScreen.kt`). Layout XML snake_case.
|
|
35
|
+
- **RATIONALE**: Consistent naming lets AI and developers find files by convention alone.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## F2. UI Development
|
|
40
|
+
|
|
41
|
+
### F2.1 Component/Widget Principles
|
|
42
|
+
|
|
43
|
+
- **Rule**: UI components must be single-responsibility. One component does one visual unit.
|
|
44
|
+
- **Rule**: Pass data down, emit events up. Forbid bidirectional data binding between parent and child.
|
|
45
|
+
- **Rule**: Every UI component must specify explicit sizing behavior (intrinsic, expanded, fixed). Forbid relying on implicit defaults.
|
|
46
|
+
- **Forbidden**: Hardcoding colors, font sizes, or spacing values in UI code. Use design tokens or theme.
|
|
47
|
+
- **RATIONALE**: UI is the most change-prone layer. Single-responsibility components make changes localized.
|
|
48
|
+
|
|
49
|
+
### F2.2 Platform UI Conventions
|
|
50
|
+
|
|
51
|
+
- **Rule**: Follow platform HIG (Human Interface Guidelines) for navigation patterns:
|
|
52
|
+
- iOS: tab bar at bottom, back swipe gesture, navigation bar with large titles
|
|
53
|
+
- Android: navigation drawer or bottom nav, back button (system), app bar
|
|
54
|
+
- **Rule**: Touch targets must be ≥ 44pt (iOS) / 48dp (Android). Smaller targets need padding.
|
|
55
|
+
- **Forbidden**: Copying UI patterns from one platform to another without adapting to HIG.
|
|
56
|
+
- **RATIONALE**: Users expect platform-native behavior. Violating HIG causes rejection from App Store review.
|
|
57
|
+
|
|
58
|
+
### F2.3 Adaptive Layout
|
|
59
|
+
|
|
60
|
+
- **Rule**: UI must adapt to safe areas (notch, home indicator, camera cutout).
|
|
61
|
+
- **Rule**: Support both portrait and landscape on iPad/tablet. Phone may lock to portrait.
|
|
62
|
+
- **Rule**: Text must support Dynamic Type / font scaling (1x–3x). Test with largest accessibility text size.
|
|
63
|
+
- **Forbidden**: Using fixed pixel dimensions for text containers.
|
|
64
|
+
- **RATIONALE**: Device fragmentation is orders of magnitude worse on mobile than on web.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## F3. Navigation & Deep Linking
|
|
69
|
+
|
|
70
|
+
### F3.1 Navigation Patterns
|
|
71
|
+
|
|
72
|
+
- **Rule**: Navigation flow must be predictable. Back button/gesture always goes to the previous screen.
|
|
73
|
+
- **Rule**: Deep links must resolve to a specific screen regardless of app launch state (cold start, background, foreground).
|
|
74
|
+
- **Rule**: Navigation state must survive process death (save/restore navigation stack).
|
|
75
|
+
- **Forbidden**: Modifying the navigation stack during transition animations.
|
|
76
|
+
- **RATIONALE**: Broken navigation is the #1 cause of mobile app user frustration and 1-star reviews.
|
|
77
|
+
|
|
78
|
+
### F3.2 Deep Linking
|
|
79
|
+
|
|
80
|
+
- **Rule**: All deep link routes must be validated before navigation. Forbid navigating to arbitrary URLs.
|
|
81
|
+
- **Rule**: Universal Links (iOS) / App Links (Android) must be configured with the correct `apple-app-site-association` / `assetlinks.json`.
|
|
82
|
+
- **Rule**: Deep link handling must work with both custom scheme (`myapp://`) and HTTPS (`https://myapp.com/`).
|
|
83
|
+
- **RATIONALE**: Deep links are an attack surface (open redirect). Unvalidated deep links can expose sensitive screens.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## F4. State Management Principles
|
|
88
|
+
|
|
89
|
+
- **Rule**: UI state must be separated from business state. UI state belongs in the View/Widget. Business state belongs in ViewModel/Bloc/Store.
|
|
90
|
+
- **Rule**: State changes must be observable and traceable. Forbid silently mutating shared state.
|
|
91
|
+
- **Rule**: Long-lived state (user session, cached data) must survive configuration changes / process death.
|
|
92
|
+
- **Forbidden**: Using global mutable variables as state containers.
|
|
93
|
+
- **RATIONALE**: Uncontrolled shared mutable state is the root of all mobile app heisenbugs — bugs that vanish when you try to reproduce them.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## F5. Networking
|
|
98
|
+
|
|
99
|
+
### F5.1 API Communication
|
|
100
|
+
|
|
101
|
+
- **Rule**: All API calls must handle: success, network error, timeout, server error (4xx/5xx), and empty response.
|
|
102
|
+
- **Rule**: Network requests must be cancellable (dispose on screen exit to prevent memory leaks and stale UI updates).
|
|
103
|
+
- **Rule**: Sensitive data in transit must use HTTPS with certificate pinning for production builds.
|
|
104
|
+
- **Forbidden**: Making network calls on the main/UI thread.
|
|
105
|
+
- **RATIONALE**: Mobile networks are unreliable by nature. Every network call needs full error handling or it will crash your app.
|
|
106
|
+
|
|
107
|
+
### F5.2 Offline & Caching
|
|
108
|
+
|
|
109
|
+
- **Rule**: Critical flows must work offline or show graceful degradation (not a white screen).
|
|
110
|
+
- **Rule**: Network responses should be cached with TTL. Stale cache is better than no data.
|
|
111
|
+
- **Rule**: Offline mutations must be queued and synced when connectivity returns, with conflict resolution.
|
|
112
|
+
- **RATIONALE**: Airplane mode, tunnels, elevators — mobile apps must assume connectivity is intermittent.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## F6. Data Persistence
|
|
117
|
+
|
|
118
|
+
### F6.1 Local Storage
|
|
119
|
+
|
|
120
|
+
- **Rule**: Choose the right storage for the data type: structured → SQLite, KV → DataStore/MMKV/Hive, files → app sandbox, credentials → Keychain/Keystore.
|
|
121
|
+
- **Rule**: Database migrations must be versioned and tested. Forbid destructive migrations (drop column/table) without a backup step.
|
|
122
|
+
- **Forbidden**: Storing sensitive data (tokens, passwords, PII) in plaintext in any local storage.
|
|
123
|
+
- **RATIONALE**: Local storage is not encrypted by default on all platforms. Assume the device can be compromised.
|
|
124
|
+
|
|
125
|
+
### F6.2 Encryption
|
|
126
|
+
|
|
127
|
+
- **Rule**: Authentication tokens must be stored in Keychain (iOS) / EncryptedSharedPreferences or Keystore (Android).
|
|
128
|
+
- **Rule**: Local databases containing PII must use SQLCipher or platform-level encryption.
|
|
129
|
+
- **Forbidden**: Hardcoding encryption keys in source code.
|
|
130
|
+
- **RATIONALE**: The mobile device is a hostile environment — jailbroken/rooted devices can access app sandboxes.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## F7. Platform Features
|
|
135
|
+
|
|
136
|
+
### F7.1 Permissions
|
|
137
|
+
|
|
138
|
+
- **Rule**: Request permissions at the time of use, not at app launch (except for critically required permissions with explanation).
|
|
139
|
+
- **Rule**: Handle all permission outcomes: granted, denied, denied permanently ("Don't ask again").
|
|
140
|
+
- **Rule**: When a permission is permanently denied, guide the user to system Settings with a clear explanation of why it's needed.
|
|
141
|
+
- **Forbidden**: Crashing or silently failing when a permission is denied.
|
|
142
|
+
- **RATIONALE**: Permission rejection rates are high (30-50% for camera/mic). Crashing on denial is a guaranteed crash report.
|
|
143
|
+
|
|
144
|
+
### F7.2 Background Tasks
|
|
145
|
+
|
|
146
|
+
- **Rule**: Background work must use the platform's recommended API:
|
|
147
|
+
- iOS: BGTaskScheduler (short, scheduled) or BGAppRefreshTask
|
|
148
|
+
- Android: WorkManager (deferrable) or Foreground Service (user-visible)
|
|
149
|
+
- **Rule**: Background tasks must be battery-efficient. Forbid polling every few seconds in the background.
|
|
150
|
+
- **Rule**: Background task results must be persisted before task completion (system may kill the process).
|
|
151
|
+
- **RATIONALE**: Mobile OSes aggressively kill background processes. Using the wrong background API means your task never runs.
|
|
152
|
+
|
|
153
|
+
### F7.3 Push Notifications
|
|
154
|
+
|
|
155
|
+
- **Rule**: Notification content must be localized. Forbid hardcoding notification text in English only.
|
|
156
|
+
- **Rule**: Notification tap must navigate to the relevant screen, not just open the app.
|
|
157
|
+
- **Rule**: Handle FCM/APNs token refresh. Stale tokens cause silent notification delivery failure.
|
|
158
|
+
- **Forbidden**: Sending sensitive data (passwords, PII) in notification payloads.
|
|
159
|
+
- **RATIONALE**: Notifications are the primary re-engagement channel. Broken deep links from notifications mean lost users.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## F8. Performance
|
|
164
|
+
|
|
165
|
+
### F8.1 Main Thread
|
|
166
|
+
|
|
167
|
+
- **Rule**: UI thread (main thread) must stay at 60fps (16ms/frame) or 120fps (8ms/frame). Any work > 1ms offloads to background.
|
|
168
|
+
- **Rule**: JSON parsing, image decoding, database queries must run off the main thread.
|
|
169
|
+
- **Forbidden**: Synchronous I/O on the main thread.
|
|
170
|
+
- **RATIONALE**: Jank (dropped frames) is immediately visible to users. A single 100ms main-thread block drops 6 frames at 60fps.
|
|
171
|
+
|
|
172
|
+
### F8.2 Memory
|
|
173
|
+
|
|
174
|
+
- **Rule**: Avoid memory leaks: unregister listeners/observers in dispose/deinit/onDestroy.
|
|
175
|
+
- **Rule**: Image memory: load scaled images (not full resolution into a thumbnail). Use image caching libraries.
|
|
176
|
+
- **Rule**: Monitor memory warnings. Release cached data when the system sends a memory warning.
|
|
177
|
+
- **Forbidden**: Holding references to Activity/Fragment/ViewController after they're destroyed.
|
|
178
|
+
- **RATIONALE**: Mobile OSes kill apps that exceed memory limits. Memory leaks accumulate and eventually cause OOM crashes.
|
|
179
|
+
|
|
180
|
+
### F8.3 App Size
|
|
181
|
+
|
|
182
|
+
- **Rule**: App download size target < 100MB (cellular download limit for many regions).
|
|
183
|
+
- **Rule**: Use App Bundles (Android) / App Thinning (iOS) for platform-optimized delivery.
|
|
184
|
+
- **Rule**: Large assets (videos, models) should be downloaded on-demand after install, not bundled.
|
|
185
|
+
- **RATIONALE**: App size directly impacts install conversion. Every 10MB above 100MB loses ~1% of potential installs.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## F9. Accessibility
|
|
190
|
+
|
|
191
|
+
- **Rule**: All interactive elements must have accessibility labels (contentDescription / accessibilityLabel).
|
|
192
|
+
- **Rule**: Decorative images must be marked as not important for accessibility.
|
|
193
|
+
- **Rule**: Color must not be the sole means of conveying information (pair with icon or text).
|
|
194
|
+
- **Rule**: Minimum contrast ratio: 4.5:1 for normal text, 3:1 for large text (≥18pt bold or ≥24pt).
|
|
195
|
+
- **Rule**: Support system font scaling up to 2x without layout breaking or text truncation.
|
|
196
|
+
- **RATIONALE**: 15% of the world's population has some form of disability. Accessibility is not optional — it's also increasingly an App Store review requirement.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## F10. Security
|
|
201
|
+
|
|
202
|
+
### F10.1 App Hardening
|
|
203
|
+
|
|
204
|
+
- **Rule**: Release builds must enable code minification/obfuscation (ProGuard/R8 for Android, strip symbols for iOS).
|
|
205
|
+
- **Rule**: Jailbreak/root detection recommended for financial, healthcare, or enterprise apps.
|
|
206
|
+
- **Rule**: Screenshot/screen recording prevention for sensitive screens (banking, health records).
|
|
207
|
+
- **Forbidden**: Leaving debug logs, debug menus, or development endpoints in release builds.
|
|
208
|
+
- **RATIONALE**: A released app is a binary that anyone can decompile. Defense in depth is the only strategy.
|
|
209
|
+
|
|
210
|
+
### F10.2 Data Protection
|
|
211
|
+
|
|
212
|
+
- **Rule**: App sandbox file protection: `NSFileProtectionComplete` (iOS) / device-encrypted storage (Android).
|
|
213
|
+
- **Rule**: API keys must not be stored in the app bundle. Use server-side proxy or secure enclave.
|
|
214
|
+
- **Rule**: User sessions must expire. Token refresh must require re-authentication for sensitive operations.
|
|
215
|
+
- **RATIONALE**: The app binary is distributed to attacker-controlled devices. Assume everything in the binary is public knowledge.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## F11. Testing
|
|
220
|
+
|
|
221
|
+
- **Rule**: Testing has three tiers:
|
|
222
|
+
- Unit tests: ViewModels/Blocs/UseCases/Repositories (fast, no UI)
|
|
223
|
+
- Widget/Component tests: individual UI components in isolation (medium speed, fake dependencies)
|
|
224
|
+
- Integration/E2E tests: critical user flows through real screens (slow, real or staged backend)
|
|
225
|
+
- **Rule**: Tests must be deterministic. Forbid relying on real network calls, real time, or random values without seeding.
|
|
226
|
+
- **Rule**: Golden/image snapshot tests must use the same OS version and device configuration for consistency.
|
|
227
|
+
- **RATIONALE**: Mobile testing is harder than backend testing because it spans UI, platform APIs, and network. Clear tiers prevent confusion about what to test where.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## F12. App Distribution
|
|
232
|
+
|
|
233
|
+
- **Rule**: Version code/number must be incremented for every build submitted to store.
|
|
234
|
+
- **Rule**: Staged rollout: 10% → 50% → 100% over 48 hours. Monitor crash rate at each stage.
|
|
235
|
+
- **Rule**: Release notes must be localized for all supported languages.
|
|
236
|
+
- **Rule**: Keep a version history document: what changed, why, and the minimal OS version bump if any.
|
|
237
|
+
- **RATIONALE**: A bad release can't be undone instantly (store rollback takes hours). Staged rollout is the cheapest insurance.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## F13. AI Vibecoding Baseline Constraints (project-agnostic, always active)
|
|
242
|
+
|
|
243
|
+
### F13.1 Search First
|
|
244
|
+
- **Rule**: Before creating a new widget/component/screen, AI must search existing code for similar implementations.
|
|
245
|
+
- **Rule**: Before adding a new dependency, AI must check if an existing dependency already covers that use case.
|
|
246
|
+
|
|
247
|
+
### F13.2 Platform Awareness
|
|
248
|
+
- **Rule**: AI must know which platform it's writing code for. iOS patterns in Android code (or vice versa) must be flagged explicitly.
|
|
249
|
+
- **Rule**: AI-generated code that uses platform-specific APIs must include the API level/iOS version availability annotation.
|
|
250
|
+
|
|
251
|
+
### F13.3 Dependency Control
|
|
252
|
+
- **Rule**: AI must not modify `pubspec.yaml` / `package.json` / `Podfile` / `build.gradle` on its own.
|
|
253
|
+
- **Rule**: If a new dependency is needed, AI must list: package name, version, reason, alternative comparison.
|
|
254
|
+
|
|
255
|
+
### F13.4 Breaking Changes
|
|
256
|
+
- **Rule**: Before modifying a shared widget/component/utility, AI must list all callers and assess platform impact.
|
|
257
|
+
- **Rule**: Changing navigation routes or deep link schemes requires assessing all entry points.
|
|
258
|
+
|
|
259
|
+
### F13.5 Context Honesty
|
|
260
|
+
- **Rule**: When uncertain about a platform API availability, behavior, or deprecation status, AI must explicitly say "I'm not sure" and suggest the developer verify against the platform documentation.
|
|
261
|
+
|
|
262
|
+
### F13.6 Security
|
|
263
|
+
- **Rule**: AI must not generate code that stores secrets in the app bundle, logs sensitive data, or disables ATS/SSL verification.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Injection Instructions (for the AI executing this skill)
|
|
268
|
+
|
|
269
|
+
Each chapter in this file corresponds to a `{{ FIXED_RULES_* }}` placeholder in the template:
|
|
270
|
+
|
|
271
|
+
| Chapter | Inject Into Placeholder | Template Section |
|
|
272
|
+
|---------|------------------------|-------------------|
|
|
273
|
+
| F1 Project Structure | `{{ FIXED_RULES_STRUCTURE }}` | §1 Project Structure |
|
|
274
|
+
| F2 UI Development | `{{ FIXED_RULES_UI }}` | §2 UI Development |
|
|
275
|
+
| F3 Navigation | `{{ FIXED_RULES_NAVIGATION }}` | §3 Navigation & Deep Linking |
|
|
276
|
+
| F4 State Management | `{{ FIXED_RULES_STATE }}` | §4 State Management |
|
|
277
|
+
| F5 Networking | `{{ FIXED_RULES_NETWORKING }}` | §5 Networking |
|
|
278
|
+
| F6 Data Persistence | `{{ FIXED_RULES_PERSISTENCE }}` | §6 Data Persistence |
|
|
279
|
+
| F7 Platform Features | `{{ FIXED_RULES_PLATFORM_FEATURES }}` | §7 Platform Features |
|
|
280
|
+
| F8 Performance | `{{ FIXED_RULES_PERFORMANCE }}` | §8 Performance |
|
|
281
|
+
| F9 Accessibility | `{{ FIXED_RULES_A11Y }}` | §9 Accessibility |
|
|
282
|
+
| F10 Security | `{{ FIXED_RULES_SECURITY }}` | §10 Security |
|
|
283
|
+
| F11 Testing | `{{ FIXED_RULES_TEST }}` | §11 Testing |
|
|
284
|
+
| F12 Distribution | `{{ FIXED_RULES_DISTRIBUTION }}` | §12 Distribution |
|
|
285
|
+
| F13 AI Constraints | `{{ FIXED_RULES_AI_BASE }}` | §13 AI Behavior Constraints |
|
|
286
|
+
|
|
287
|
+
**Rendering rules**:
|
|
288
|
+
1. Copy each chapter's full body (including RATIONALE) directly into the corresponding placeholder.
|
|
289
|
+
2. RATIONALE must be preserved — it lets AI understand intent rather than follow mechanically.
|
|
290
|
+
3. Keep the original markdown list structure. Do not rewrite as prose paragraphs.
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# Question Bank — Mobile Interactive Question Bank
|
|
2
|
+
|
|
3
|
+
> This file is read on demand by SKILL.md in Phase 2. The AI must strictly follow the group order defined in this file, asking **one group at a time (1–3 questions)**, never dumping all questions at once.
|
|
4
|
+
> For every question, show the user: question number, question text, options, **recommended choice (marked "Recommended")**, and a one-line description.
|
|
5
|
+
> After each user response, immediately record the choice to internal state `answers[Qx] = ...` and proceed to the next group.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Asking Rules
|
|
10
|
+
|
|
11
|
+
1. **Group order**: G1 → G2 → G3 → G4 → G5 → G6 → G7 → G8 → G9 → G10. Do not skip.
|
|
12
|
+
2. **Shortcut commands** (respond immediately when user types these at any point):
|
|
13
|
+
- `recommended` / `default` → skip current group, adopt all recommended options
|
|
14
|
+
- `all recommended` / `one-click` → skip all remaining groups, adopt all recommended options
|
|
15
|
+
- `strict` / `strictest` → adopt the strictest option for the current group
|
|
16
|
+
- `skip` / `don't need this` → mark current group as N/A
|
|
17
|
+
- `custom: xxx` → record user's custom content
|
|
18
|
+
3. **Abbreviation recognition**: `A` / `a` / `1` all mean option A. `A,C` means multi-select (only for multi-select questions).
|
|
19
|
+
4. **Follow-up rule**: If the user gives an answer outside the options, first confirm whether to classify as an "other" branch.
|
|
20
|
+
5. **Forbidden behaviors**:
|
|
21
|
+
- Must not make choices for the user before they explicitly answer.
|
|
22
|
+
- Must not fabricate user preferences to complete the answer set.
|
|
23
|
+
- Must not output more than 3 questions in a single message.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Group Overview
|
|
28
|
+
|
|
29
|
+
| Group | Topic | Questions | Count |
|
|
30
|
+
|-------|-------|-----------|-------|
|
|
31
|
+
| G1 | Platform & Language | Q1–Q2 | 2 |
|
|
32
|
+
| G2 | Architecture | Q3 | 1 |
|
|
33
|
+
| G3 | UI Framework | Q4 | 1 |
|
|
34
|
+
| G4 | Navigation & State | Q5–Q6 | 2 |
|
|
35
|
+
| G5 | Networking & Data | Q7–Q8 | 2 |
|
|
36
|
+
| G6 | Platform Features | Q9–Q11 | 3 |
|
|
37
|
+
| G7 | Testing | Q12–Q14 | 3 |
|
|
38
|
+
| G8 | App Distribution | Q15 | 1 |
|
|
39
|
+
| G9 | Performance & Accessibility | Q16–Q17 | 2 |
|
|
40
|
+
| G10 | AI Constraints | Q18–Q20 | 3 |
|
|
41
|
+
|
|
42
|
+
Total: 20 questions.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## G1 — Platform & Language
|
|
47
|
+
|
|
48
|
+
### Q1. Target Platform
|
|
49
|
+
- **Options**:
|
|
50
|
+
- A) Flutter (Dart) **【Recommended: best cross-platform coverage, single codebase】**
|
|
51
|
+
- B) React Native (TypeScript)
|
|
52
|
+
- C) iOS native (Swift)
|
|
53
|
+
- D) Android native (Kotlin)
|
|
54
|
+
- E) Both native (Swift + Kotlin, separate codebases)
|
|
55
|
+
- **Note**: Determines all subsequent framework, tooling, and platform-specific rule injections.
|
|
56
|
+
- **Dual-native note**: If Q1=E (Both native): present Q4/Q6/Q7/Q8/Q13/Q14 for iOS first, then ask the user if they want to repeat for Android (or apply same choices).
|
|
57
|
+
- **Maps to**: `{{ platform }}` + `{{ tech_stack_rules }}`
|
|
58
|
+
|
|
59
|
+
### Q2. Minimum OS Version
|
|
60
|
+
- **Options**:
|
|
61
|
+
- A) Latest - 1 (iOS 17+ / Android 14+) **【Recommended: covers ~90% of active devices】**
|
|
62
|
+
- B) Latest - 2 (iOS 16+ / Android 13+)
|
|
63
|
+
- C) Latest - 3 (wider compatibility, more legacy handling)
|
|
64
|
+
- **Note**: Determines API availability and deprecation handling rules.
|
|
65
|
+
- **Maps to**: `{{ min_os_version }}` + `{{ tech_stack_rules }}`
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## G2 — Architecture
|
|
70
|
+
|
|
71
|
+
### Q3. Architecture Pattern
|
|
72
|
+
- **Options**:
|
|
73
|
+
- A) MVVM (Model-View-ViewModel) **【Recommended: platform-agnostic, testable】**
|
|
74
|
+
- B) Clean Architecture (Use Case / Repository / Data Source layers)
|
|
75
|
+
- C) Redux-style / MVI (unidirectional data flow)
|
|
76
|
+
- D) Simple MVC (small projects, no over-engineering)
|
|
77
|
+
- **Note**: Determines directory structure, layer boundaries, and dependency rules.
|
|
78
|
+
- **Maps to**: `{{ architecture }}` + `{{ arch_rules }}`
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## G3 — UI Framework
|
|
83
|
+
|
|
84
|
+
### Q4. UI Framework (varies by Q1)
|
|
85
|
+
- **For Flutter**: A) Material Design 3 **【Recommended】** — B) Cupertino (iOS-style) — C) Adaptive (auto-switch by platform)
|
|
86
|
+
- **For React Native**: A) React Native core components + StyleSheet **【Recommended】** — B) Tamagui / NativeWind — C) Custom design system
|
|
87
|
+
- **For iOS**: A) SwiftUI **【Recommended: modern, declarative】** — B) UIKit (programmatic) — C) UIKit + Storyboards
|
|
88
|
+
- **For Android**: A) Jetpack Compose **【Recommended: modern, declarative】** — B) XML + Material 3 — C) Hybrid (Compose + Views)
|
|
89
|
+
- **Maps to**: `{{ ui_framework }}` + `{{ ui_rules }}`
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## G4 — Navigation & State
|
|
94
|
+
|
|
95
|
+
### Q5. Navigation Strategy
|
|
96
|
+
- **Options**:
|
|
97
|
+
- A) Platform-default deep linking capable (GoRouter / NavigationStack / Compose Navigation) **【Recommended】**
|
|
98
|
+
- B) URL-based routing with deep linking as first-class citizen
|
|
99
|
+
- C) Simple stack navigation (no deep linking needed)
|
|
100
|
+
- **Note**: Determines routing conventions, deep link handling, and navigation testing rules.
|
|
101
|
+
- **Maps to**: `{{ navigation }}` + `{{ navigation_rules }}`
|
|
102
|
+
|
|
103
|
+
### Q6. State Management (varies by Q1)
|
|
104
|
+
- **For Flutter**: A) Riverpod **【Recommended】** — B) Bloc — C) Provider — D) GetX
|
|
105
|
+
- **For React Native**: A) Zustand **【Recommended】** — B) Redux Toolkit — C) Jotai — D) React Context only
|
|
106
|
+
- **For iOS**: A) @Observable / @State (SwiftUI native) **【Recommended】** — B) Combine — C) Manual KVO/NotificationCenter
|
|
107
|
+
- **For Android**: A) ViewModel + StateFlow **【Recommended】** — B) MutableState (Compose) — C) LiveData
|
|
108
|
+
- **Maps to**: `{{ state_management }}` + `{{ state_rules }}`
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## G5 — Networking & Data
|
|
113
|
+
|
|
114
|
+
### Q7. Networking Library (varies by Q1)
|
|
115
|
+
- **For Flutter**: A) Dio **【Recommended】** — B) http package — C) Chopper (code-gen)
|
|
116
|
+
- **For React Native**: A) Axios **【Recommended】** — B) fetch + TanStack Query — C) React Native built-in fetch
|
|
117
|
+
- **For iOS**: A) URLSession + async/await **【Recommended】** — B) Alamofire
|
|
118
|
+
- **For Android**: A) Retrofit + OkHttp **【Recommended】** — B) Ktor Client
|
|
119
|
+
- **Maps to**: `{{ networking }}` + `{{ networking_rules }}`
|
|
120
|
+
|
|
121
|
+
### Q8. Local Persistence (varies by Q1)
|
|
122
|
+
- **For Flutter**: A) Drift (SQLite, type-safe) **【Recommended】** — B) Hive (KV store) — C) Isar (NoSQL)
|
|
123
|
+
- **For React Native**: A) MMKV (KV) + WatermelonDB (relational) **【Recommended】** — B) AsyncStorage + SQLite — C) Realm
|
|
124
|
+
- **For iOS**: A) SwiftData **【Recommended】** — B) CoreData — C) GRDB (SQLite)
|
|
125
|
+
- **For Android**: A) Room **【Recommended】** — B) DataStore (Preferences/Proto) — C) SQLDelight (multi-platform)
|
|
126
|
+
- **Maps to**: `{{ persistence }}` + `{{ persistence_rules }}`
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## G6 — Platform Features
|
|
131
|
+
|
|
132
|
+
### Q9. Push Notifications
|
|
133
|
+
- **Options**:
|
|
134
|
+
- A) Yes, needed (remote push via FCM/APNs) **【Recommended: production apps】**
|
|
135
|
+
- B) Not required yet
|
|
136
|
+
- **Note**: Determines notification channel configuration, token management, and foreground/background handling rules.
|
|
137
|
+
- **Maps to**: `{{ push_notifications }}` + `{{ platform_features_rules }}`
|
|
138
|
+
|
|
139
|
+
### Q10. Background Tasks
|
|
140
|
+
- **Options**:
|
|
141
|
+
- A) Yes, needed (data sync, file upload, periodic refresh) **【Recommended: data-heavy apps】**
|
|
142
|
+
- B) Not required
|
|
143
|
+
- **Note**: Determines background execution constraints, battery optimization, and platform-specific background mode rules.
|
|
144
|
+
- **Maps to**: `{{ background_tasks }}` + `{{ platform_features_rules }}`
|
|
145
|
+
|
|
146
|
+
### Q11. Permissions Strategy
|
|
147
|
+
- **Options**:
|
|
148
|
+
- A) Ask-on-use with rationale dialog **【Recommended: highest acceptance rate】**
|
|
149
|
+
- B) Ask-on-launch (only for critically required permissions)
|
|
150
|
+
- **Note**: Determines permission request flow, denied-permission handling, and platform-specific manifest rules.
|
|
151
|
+
- **Maps to**: `{{ permissions_strategy }}`
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## G7 — Testing
|
|
156
|
+
|
|
157
|
+
### Q12. Test Coverage Requirements
|
|
158
|
+
- **Options**:
|
|
159
|
+
- A) Unit tests + Widget/Component tests + Integration tests **【Recommended】**
|
|
160
|
+
- B) Unit tests + Widget/Component tests only
|
|
161
|
+
- C) Critical path integration tests only
|
|
162
|
+
- D) Not required yet
|
|
163
|
+
- **Maps to**: `{{ test_coverage }}` + `{{ test_rules }}`
|
|
164
|
+
|
|
165
|
+
### Q13. Unit Test Framework (only ask if Q12 = A or B; varies by Q1)
|
|
166
|
+
- **For Flutter**: A) flutter_test + mocktail **【Recommended】**
|
|
167
|
+
- **For React Native**: A) Jest + React Native Testing Library **【Recommended】**
|
|
168
|
+
- **For iOS**: A) XCTest + Swift Testing **【Recommended】**
|
|
169
|
+
- **For Android**: A) JUnit 5 + MockK **【Recommended】**
|
|
170
|
+
- **Maps to**: `{{ unit_test_framework }}`
|
|
171
|
+
|
|
172
|
+
### Q14. UI/E2E Test Framework (only ask if Q12 = A or C; varies by Q1)
|
|
173
|
+
- **For Flutter**: A) flutter_test (widget) + Patrol (integration) **【Recommended】**
|
|
174
|
+
- **For React Native**: A) Detox **【Recommended】** — B) Maestro
|
|
175
|
+
- **For iOS**: A) XCUITest **【Recommended】**
|
|
176
|
+
- **For Android**: A) Compose Test + Espresso **【Recommended】**
|
|
177
|
+
- **Maps to**: `{{ e2e_framework }}`
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## G8 — App Distribution
|
|
182
|
+
|
|
183
|
+
### Q15. Distribution Method
|
|
184
|
+
- **Options**:
|
|
185
|
+
- A) App Store (TestFlight) + Google Play (Internal Testing) **【Recommended】**
|
|
186
|
+
- B) Enterprise / internal distribution (MDM / private store)
|
|
187
|
+
- C) Not determined yet (development phase)
|
|
188
|
+
- **Note**: Determines code signing, version management, staged rollout, and app review guideline rules.
|
|
189
|
+
- **Maps to**: `{{ distribution }}` + `{{ distribution_rules }}`
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## G9 — Performance & Accessibility
|
|
194
|
+
|
|
195
|
+
### Q16. Performance Targets
|
|
196
|
+
- **Options**:
|
|
197
|
+
- A) 60fps smooth scrolling, < 100MB app download, < 150MB memory **【Recommended】**
|
|
198
|
+
- B) 120fps ProMotion, < 50MB download, < 100MB memory (premium experience)
|
|
199
|
+
- C) Not required yet
|
|
200
|
+
- **Note**: Determines frame budget, image optimization, lazy loading, and CI performance gate rules.
|
|
201
|
+
- **Maps to**: `{{ performance_target }}` + `{{ performance_rules }}`
|
|
202
|
+
|
|
203
|
+
### Q17. Accessibility Targets
|
|
204
|
+
- **Options**:
|
|
205
|
+
- A) Platform defaults: VoiceOver/TalkBack + Dynamic Type + minimum contrast **【Recommended】**
|
|
206
|
+
- B) WCAG 2.1 AA equivalent + platform a11y + screen reader testing
|
|
207
|
+
- C) Basic only (touch targets + labels)
|
|
208
|
+
- **Note**: Determines accessibility audit rules and testing requirements.
|
|
209
|
+
- **Maps to**: `{{ a11y_target }}` + `{{ a11y_rules }}`
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## G10 — AI Constraints
|
|
214
|
+
|
|
215
|
+
### Q18. AI Permission to Add Dependencies
|
|
216
|
+
- **Options**:
|
|
217
|
+
- A) Forbid AI from modifying dependency manifests on its own; human review required **【Recommended】**
|
|
218
|
+
- B) Allowed, but must declare in PR description with alternative comparison
|
|
219
|
+
- C) Fully allowed
|
|
220
|
+
- **Maps to**: `{{ ai_dependency_rule }}`
|
|
221
|
+
|
|
222
|
+
### Q19. AI Impact Analysis Before Modifying Shared Code
|
|
223
|
+
- **Options**:
|
|
224
|
+
- A) Must list all callers and assess platform impact first **【Recommended】**
|
|
225
|
+
- B) Not required
|
|
226
|
+
- **Maps to**: `{{ ai_breaking_change_rule }}`
|
|
227
|
+
|
|
228
|
+
### Q20. AI Platform-Specific Code Generation
|
|
229
|
+
- **Options**:
|
|
230
|
+
- A) Must not mix platform paradigms without explicit justification (iOS patterns in Android code, Flutter widgets used like Android Views) **【Recommended】**
|
|
231
|
+
- B) Flexible, as long as it compiles
|
|
232
|
+
- **Maps to**: `{{ ai_platform_rule }}`
|