@haposoft/cafekit 0.15.3 → 0.16.0-rc.1
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/README.md +4 -2
- package/bin/__tests__/codex-hooks.test.js +140 -0
- package/bin/__tests__/codex-native.test.js +2 -2
- package/bin/__tests__/develop-contract.test.js +1120 -0
- package/bin/__tests__/installer-safety.test.js +510 -2
- package/bin/__tests__/package-inventory.test.js +258 -0
- package/bin/__tests__/secret-scanner.test.js +157 -0
- package/bin/__tests__/validator-grounding.test.js +713 -0
- package/bin/install.js +5 -1
- package/bin/lib/codex-install.js +21 -6
- package/bin/lib/context.js +17 -6
- package/bin/lib/copy-utils.js +31 -0
- package/bin/lib/instruction-blocks.js +85 -0
- package/bin/lib/managed-writer.js +4 -1
- package/bin/lib/opencode-install.js +75 -30
- package/bin/phases/claude-runtime.js +103 -4
- package/bin/phases/codex-runtime.js +9 -5
- package/bin/phases/post-install.js +29 -22
- package/bin/phases/root-config.js +89 -10
- package/package.json +14 -4
- package/src/claude/CLAUDE.md +6 -122
- package/src/claude/agents/code-auditor.md +21 -22
- package/src/claude/agents/debugger.md +3 -3
- package/src/claude/agents/deployer.md +1 -1
- package/src/claude/agents/{god-developer.md → implementer.md} +2 -2
- package/src/claude/agents/project-manager.md +1 -1
- package/src/claude/agents/spec-maker.md +2 -2
- package/src/claude/hooks/__tests__/spec-gate.test.js +356 -5
- package/src/claude/hooks/agent.cjs +7 -14
- package/src/claude/hooks/rules.cjs +33 -53
- package/src/claude/hooks/spec-gate.cjs +66 -21
- package/src/claude/hooks/spec-state.cjs +5 -0
- package/src/claude/migration-manifest.json +9 -2
- package/src/claude/runtime.json +0 -3
- package/src/claude/scripts/generate-skill-catalog.cjs +1 -1
- package/src/claude/scripts/scan-staged-secrets.cjs +170 -0
- package/src/claude/scripts/spec-ground.cjs +189 -83
- package/src/claude/scripts/validate-spec-output.cjs +294 -30
- package/src/claude/scripts/workflow-policy.cjs +609 -0
- package/src/claude/skills/ai-multimodal/SKILL.md +2 -2
- package/src/claude/skills/ai-multimodal/references/audio-processing.md +6 -6
- package/src/claude/skills/ai-multimodal/references/video-analysis.md +1 -1
- package/src/claude/skills/backend-development/SKILL.md +4 -4
- package/src/claude/skills/backend-development/references/backend-architecture.md +1 -1
- package/src/claude/skills/backend-development/references/backend-devops.md +2 -2
- package/src/claude/skills/backend-development/references/backend-mindset.md +3 -3
- package/src/claude/skills/backend-development/references/backend-performance.md +5 -5
- package/src/claude/skills/backend-development/references/backend-security.md +3 -3
- package/src/claude/skills/backend-development/references/backend-technologies.md +5 -5
- package/src/claude/skills/backend-development/references/backend-testing.md +2 -2
- package/src/claude/skills/brainstorm/SKILL.md +2 -3
- package/src/claude/skills/code-review/SKILL.md +12 -8
- package/src/claude/skills/code-review/references/verification-gate.md +4 -4
- package/src/claude/skills/debug/SKILL.md +2 -0
- package/src/claude/skills/develop/SKILL.md +100 -52
- package/src/claude/skills/develop/references/parallel-waves.md +105 -26
- package/src/claude/skills/develop/references/quality-gate.md +58 -38
- package/src/claude/skills/develop/references/subagent-patterns.md +2 -2
- package/src/claude/skills/git/SKILL.md +44 -50
- package/src/claude/skills/hotfix/SKILL.md +10 -8
- package/src/claude/skills/hotfix/references/parallel-patterns.md +2 -2
- package/src/claude/skills/hotfix/references/review-cycle.md +26 -21
- package/src/claude/skills/inspect/SKILL.md +12 -30
- package/src/claude/skills/mobile-development/SKILL.md +12 -12
- package/src/claude/skills/mobile-development/references/mobile-android.md +7 -7
- package/src/claude/skills/mobile-development/references/mobile-best-practices.md +22 -23
- package/src/claude/skills/mobile-development/references/mobile-frameworks.md +13 -13
- package/src/claude/skills/mobile-development/references/mobile-ios.md +1 -1
- package/src/claude/skills/mobile-development/references/mobile-mindset.md +17 -19
- package/src/claude/skills/question/SKILL.md +13 -13
- package/src/claude/skills/research/SKILL.md +2 -2
- package/src/claude/skills/specs/SKILL.md +32 -15
- package/src/claude/skills/specs/references/review.md +3 -3
- package/src/claude/skills/specs/rules/tasks-generation.md +1 -1
- package/src/claude/skills/specs/templates/spec-state.json +7 -3
- package/src/claude/skills/sync/SKILL.md +26 -1
- package/src/claude/skills/sync/references/sync-protocols.md +3 -3
- package/src/claude/skills/test/SKILL.md +12 -4
- package/src/claude/skills/test/references/failure-triage.md +17 -17
- package/src/claude/skills/test/references/test-memory.md +2 -2
- package/src/codex/AGENTS.md +16 -24
- package/src/codex/hooks/lib/spec-receipt.cjs +57 -4
- package/src/codex/hooks/rules.cjs +27 -26
- package/src/codex/hooks/spec-gate.cjs +19 -8
- package/src/codex/hooks/spec-state.cjs +10 -1
- package/src/common/AGENTS.md +43 -0
- package/src/opencode/AGENTS.md +21 -121
- package/src/opencode/plugins/rules.ts +26 -34
- package/src/opencode/plugins/spec-gate.ts +283 -0
- package/src/claude/skills/inspect/references/external-gemini-inspection.md +0 -169
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hapo:inspect
|
|
3
|
-
description: "Fast codebase discovery using parallel agents. Use for file discovery, task context gathering, quick searches across directories. Supports internal
|
|
3
|
+
description: "Fast codebase discovery using parallel agents. Use for file discovery, task context gathering, quick searches across directories. Supports internal Explore agents."
|
|
4
4
|
user-invocable: true
|
|
5
5
|
when_to_use: "Invoke for fast parallel codebase discovery and file location."
|
|
6
6
|
category: discovery
|
|
7
7
|
keywords: [discovery, search, explore, context]
|
|
8
|
-
argument-hint: "[search-target]
|
|
8
|
+
argument-hint: "[search-target]"
|
|
9
9
|
metadata:
|
|
10
10
|
author: haposoft
|
|
11
|
-
version: "2.
|
|
11
|
+
version: "2.1.0"
|
|
12
12
|
---
|
|
13
13
|
# Inspect
|
|
14
14
|
|
|
@@ -16,7 +16,6 @@ Fast, token-efficient codebase discovery using parallel agents to find files nee
|
|
|
16
16
|
|
|
17
17
|
## Arguments
|
|
18
18
|
- Default: Inspect using built-in Explore subagents in parallel (`./references/internal-inspection.md`)
|
|
19
|
-
- `ext`: Inspect using external Gemini CLI tool in parallel (`./references/external-gemini-inspection.md`)
|
|
20
19
|
|
|
21
20
|
## When to Use
|
|
22
21
|
|
|
@@ -24,9 +23,9 @@ Fast, token-efficient codebase discovery using parallel agents to find files nee
|
|
|
24
23
|
- Debugging that needs file relationships; project structure questions
|
|
25
24
|
- Before multi-area changes, review, debug, or impact analysis
|
|
26
25
|
|
|
27
|
-
## Preflight Scope Gate (MANDATORY
|
|
26
|
+
## Preflight Scope Gate (MANDATORY)
|
|
28
27
|
|
|
29
|
-
Before scanning
|
|
28
|
+
Before scanning:
|
|
30
29
|
1. Detect repo-root or root-wide scans such as `.`, `/`, `./`, `**/*`, `**/*.ts`, or similar broad patterns without a scoped directory.
|
|
31
30
|
2. Apply the built-in no-scan lists below.
|
|
32
31
|
3. Prefer file-type or glob hints whenever possible.
|
|
@@ -38,14 +37,14 @@ Before scanning with ANY mode (internal or external):
|
|
|
38
37
|
Spawn **one scout** to map top-level layout before dividing work:
|
|
39
38
|
1. List immediate children of the scope root (dirs + key config; monorepo markers)
|
|
40
39
|
2. Rough file count per discovered directory
|
|
41
|
-
3. Return a division plan of 1–
|
|
40
|
+
3. Return a division plan of 1–10 logical sub-scopes (path/glob, est. files, focus)
|
|
42
41
|
|
|
43
42
|
Wait for Scout before Phase 2.
|
|
44
43
|
|
|
45
44
|
### Phase 2 — Parallel Explore Agents (Based on Scout Results)
|
|
46
45
|
|
|
47
46
|
1. Follow Scout's plan; merge scopes < 10 files; split scopes > 100 files
|
|
48
|
-
2. Spawn parallel Explore agents
|
|
47
|
+
2. Spawn parallel Explore agents, one per sub-scope
|
|
49
48
|
3. Aggregate into the Inspect Report; offer deeper follow-up on specific areas
|
|
50
49
|
|
|
51
50
|
**Fallback to AskUserQuestion:** if Scout is ambiguous (flat layout, < 3 areas), offer 2–4 concrete scopes from findings, then re-invoke with the chosen scope.
|
|
@@ -60,19 +59,6 @@ Wait for Scout before Phase 2.
|
|
|
60
59
|
- private keys, token dumps, credential exports, `.env` secrets
|
|
61
60
|
- generated bundles, binary blobs
|
|
62
61
|
|
|
63
|
-
## Configuration
|
|
64
|
-
|
|
65
|
-
Read from `.claude/runtime.json`:
|
|
66
|
-
```json
|
|
67
|
-
{
|
|
68
|
-
"gemini": {
|
|
69
|
-
"model": "gemma-4-31b-it"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Default model: `gemma-4-31b-it` (installed with `npx @haposoft/cafekit`).
|
|
75
|
-
|
|
76
62
|
## Workflow
|
|
77
63
|
|
|
78
64
|
### 1. Analyze Task
|
|
@@ -86,7 +72,7 @@ SCALE = ceil(estimated_files_to_scan / 50)
|
|
|
86
72
|
|
|
87
73
|
- Min SCALE = 1; Max SCALE = 10
|
|
88
74
|
- SCALE 1-2: focused (< 100 files)
|
|
89
|
-
- SCALE 3-5: medium
|
|
75
|
+
- SCALE 3-5: medium
|
|
90
76
|
- SCALE 6-10: large (internal Explore agents)
|
|
91
77
|
|
|
92
78
|
### 2. Divide and Conquer
|
|
@@ -101,16 +87,13 @@ SCALE = ceil(estimated_files_to_scan / 50)
|
|
|
101
87
|
|
|
102
88
|
| Condition | Mode |
|
|
103
89
|
|---|---|
|
|
104
|
-
|
|
|
105
|
-
| `ext` + SCALE ≤ 5 | Gemini CLI (if available + scope gate passed) |
|
|
106
|
-
| `ext` + SCALE ≥ 6 | Internal Explore agents |
|
|
107
|
-
| Gemini unavailable/fails | Fallback to internal Explore |
|
|
90
|
+
| Always | Internal Explore agents |
|
|
108
91
|
|
|
109
|
-
Load: **Internal** `./references/internal-inspection.md
|
|
92
|
+
Load: **Internal** `./references/internal-inspection.md`.
|
|
110
93
|
|
|
111
94
|
### 5. Spawn Parallel Agents
|
|
112
95
|
|
|
113
|
-
|
|
96
|
+
Dispatch native Explore agents with breadth medium/very-thorough + the Scope Gate above. Details: `./references/internal-inspection.md`.
|
|
114
97
|
|
|
115
98
|
- `TaskUpdate` each task to `in_progress` before spawn
|
|
116
99
|
- Prompt each subagent with exact directories/files; each has < 200K context
|
|
@@ -147,5 +130,4 @@ Load: **Internal** `./references/internal-inspection.md` or **External** `./refe
|
|
|
147
130
|
|
|
148
131
|
## References
|
|
149
132
|
|
|
150
|
-
- `./references/internal-inspection.md` - Using Explore subagents
|
|
151
|
-
- `./references/external-gemini-inspection.md` - Using Gemini CLI
|
|
133
|
+
- `./references/internal-inspection.md` - Using Explore subagents
|
|
@@ -31,8 +31,8 @@ Production-ready mobile development with modern frameworks, best practices, and
|
|
|
31
31
|
## Technology Selection Guide
|
|
32
32
|
|
|
33
33
|
**Cross-Platform Frameworks:**
|
|
34
|
-
- **React Native**: JavaScript expertise, web code sharing, mature ecosystem
|
|
35
|
-
- **Flutter**: Performance-critical apps, complex animations, fastest-growing
|
|
34
|
+
- **React Native**: JavaScript expertise, web code sharing, mature ecosystem
|
|
35
|
+
- **Flutter**: Performance-critical apps, complex animations, fastest-growing
|
|
36
36
|
|
|
37
37
|
**Native Development:**
|
|
38
38
|
- **iOS (Swift/SwiftUI)**: Maximum iOS performance, latest features, Apple ecosystem integration
|
|
@@ -44,7 +44,7 @@ See: `references/mobile-frameworks.md` for detailed framework comparisons
|
|
|
44
44
|
|
|
45
45
|
**The 10 Commandments of Mobile Development:**
|
|
46
46
|
|
|
47
|
-
1. **Performance is Foundation, Not Feature** -
|
|
47
|
+
1. **Performance is Foundation, Not Feature** - Slow load times can drive users away
|
|
48
48
|
2. **Every Kilobyte, Every Millisecond Matters** - Mobile constraints are real
|
|
49
49
|
3. **Offline-First by Default** - Network is unreliable, design for it
|
|
50
50
|
4. **User Context > Developer Environment** - Think real-world usage scenarios
|
|
@@ -72,7 +72,7 @@ See: `references/mobile-mindset.md` for thinking patterns and decision framework
|
|
|
72
72
|
## Key Best Practices (2024-2025)
|
|
73
73
|
|
|
74
74
|
**Performance Targets:**
|
|
75
|
-
- App launch: <2 seconds
|
|
75
|
+
- App launch: <2 seconds; slow launches risk abandonment
|
|
76
76
|
- Memory usage: <100MB for typical screens
|
|
77
77
|
- Network requests: Batch and cache aggressively
|
|
78
78
|
- Battery impact: Respect Doze Mode and background restrictions
|
|
@@ -92,7 +92,7 @@ See: `references/mobile-mindset.md` for thinking patterns and decision framework
|
|
|
92
92
|
- Implement proper session management
|
|
93
93
|
|
|
94
94
|
**Testing Strategy:**
|
|
95
|
-
- Unit tests:
|
|
95
|
+
- Unit tests: meaningful coverage for business logic
|
|
96
96
|
- Integration tests: Critical user flows
|
|
97
97
|
- E2E tests: Detox (React Native), Appium (cross-platform), XCUITest (iOS), Espresso (Android)
|
|
98
98
|
- Real device testing mandatory before release
|
|
@@ -101,7 +101,7 @@ See: `references/mobile-mindset.md` for thinking patterns and decision framework
|
|
|
101
101
|
- Fastlane for automation across platforms
|
|
102
102
|
- Staged rollouts: Internal → Closed → Open → Production
|
|
103
103
|
- Mandatory: iOS 17 SDK (2024), Android 15 API 35 (Aug 2025)
|
|
104
|
-
- CI/CD saves
|
|
104
|
+
- CI/CD saves development time
|
|
105
105
|
|
|
106
106
|
## Quick Decision Matrix
|
|
107
107
|
|
|
@@ -121,9 +121,9 @@ See: `references/mobile-mindset.md` for thinking patterns and decision framework
|
|
|
121
121
|
|
|
122
122
|
| Criterion | React Native | Flutter | Swift/SwiftUI | Kotlin/Compose |
|
|
123
123
|
|-----------|--------------|---------|---------------|----------------|
|
|
124
|
-
| **
|
|
125
|
-
| **Adoption** |
|
|
126
|
-
| **Performance** |
|
|
124
|
+
| **Community footprint** | Large | Large | Apple ecosystem | Android ecosystem |
|
|
125
|
+
| **Adoption** | Established | Established | iOS only | Android only |
|
|
126
|
+
| **Performance** | Near-native when profiled | Near-native when profiled | Native baseline | Native baseline |
|
|
127
127
|
| **Dev Speed** | Fast (hot reload) | Very fast (hot reload) | Fast (Xcode Previews) | Fast (Live Edit) |
|
|
128
128
|
| **Learning Curve** | Easy (JavaScript) | Medium (Dart) | Medium (Swift) | Medium (Kotlin) |
|
|
129
129
|
| **UI Paradigm** | Component-based | Widget-based | Declarative | Declarative |
|
|
@@ -148,7 +148,7 @@ See: `references/mobile-mindset.md` for thinking patterns and decision framework
|
|
|
148
148
|
- Image optimization → Lazy loading → Memory profiling → Network optimization → Battery testing → Launch time optimization
|
|
149
149
|
|
|
150
150
|
**Quality:**
|
|
151
|
-
- Unit tests
|
|
151
|
+
- Unit tests → Integration tests → E2E tests → Accessibility testing → Performance testing → Security audit
|
|
152
152
|
|
|
153
153
|
**Security:**
|
|
154
154
|
- Secure storage → Authentication flow → Network security → Input validation → Session management → Encryption
|
|
@@ -179,7 +179,7 @@ See: `references/mobile-mindset.md` for thinking patterns and decision framework
|
|
|
179
179
|
3. **No offline handling** - Network failures will happen
|
|
180
180
|
4. **Poor memory management** - Leads to crashes and poor UX
|
|
181
181
|
5. **Hardcoded credentials** - Security vulnerability
|
|
182
|
-
6. **No accessibility** -
|
|
182
|
+
6. **No accessibility** - Can exclude users
|
|
183
183
|
7. **Premature optimization** - Optimize based on metrics, not assumptions
|
|
184
184
|
8. **Over-engineering** - Start simple, scale as needed
|
|
185
185
|
9. **Skipping real device testing** - Simulators don't show battery/network issues
|
|
@@ -193,7 +193,7 @@ See: `references/mobile-mindset.md` for thinking patterns and decision framework
|
|
|
193
193
|
- **Screen load**: <1 second for cached data
|
|
194
194
|
- **Network request**: <3 seconds for API calls
|
|
195
195
|
- **Memory**: <100MB for typical screens, <200MB peak
|
|
196
|
-
- **Battery**:
|
|
196
|
+
- **Battery**: Minimize drain during active use
|
|
197
197
|
- **Frame rate**: 60 FPS (16.67ms per frame)
|
|
198
198
|
|
|
199
199
|
## Resources
|
|
@@ -74,8 +74,8 @@ when (uiState) {
|
|
|
74
74
|
|
|
75
75
|
### Why Compose?
|
|
76
76
|
- **Declarative**: Describe UI state, not imperative commands
|
|
77
|
-
- **
|
|
78
|
-
- **Less code**:
|
|
77
|
+
- **Adoption**: Used in many top 1,000 apps
|
|
78
|
+
- **Less code**: Reduction vs Views
|
|
79
79
|
- **Modern**: Built for Kotlin and coroutines
|
|
80
80
|
- **Material 3**: First-class support
|
|
81
81
|
|
|
@@ -310,7 +310,7 @@ class UserViewModel(
|
|
|
310
310
|
|
|
311
311
|
**Hilt vs Koin:**
|
|
312
312
|
- **Hilt**: Compile-time, type-safe, Google-backed, complex setup
|
|
313
|
-
- **Koin**: Runtime, simple DSL,
|
|
313
|
+
- **Koin**: Runtime, simple DSL, faster setup, reflection-based
|
|
314
314
|
|
|
315
315
|
## Performance Optimization
|
|
316
316
|
|
|
@@ -335,14 +335,14 @@ android {
|
|
|
335
335
|
```
|
|
336
336
|
|
|
337
337
|
**Impact:**
|
|
338
|
-
-
|
|
339
|
-
-
|
|
338
|
+
- Smaller app size
|
|
339
|
+
- Faster startup
|
|
340
340
|
- Harder to reverse engineer
|
|
341
341
|
|
|
342
342
|
### Baseline Profiles
|
|
343
343
|
|
|
344
344
|
**Performance boost:**
|
|
345
|
-
-
|
|
345
|
+
- Faster startup
|
|
346
346
|
- Reduced jank in critical paths
|
|
347
347
|
- AOT compilation of hot code
|
|
348
348
|
|
|
@@ -572,7 +572,7 @@ android {
|
|
|
572
572
|
```
|
|
573
573
|
|
|
574
574
|
**Benefits:**
|
|
575
|
-
-
|
|
575
|
+
- Smaller downloads
|
|
576
576
|
- Dynamic feature modules
|
|
577
577
|
- Instant apps support
|
|
578
578
|
|
|
@@ -86,8 +86,8 @@ User opens screen
|
|
|
86
86
|
- Background App Refresh (iOS)
|
|
87
87
|
|
|
88
88
|
**Targets:**
|
|
89
|
-
- Active use:
|
|
90
|
-
- Background:
|
|
89
|
+
- Active use: minimize foreground energy use
|
|
90
|
+
- Background: minimize background energy use
|
|
91
91
|
|
|
92
92
|
## Offline-First Architecture
|
|
93
93
|
|
|
@@ -315,8 +315,8 @@ messaging().onNotificationOpenedApp(remoteMessage => {
|
|
|
315
315
|
```
|
|
316
316
|
|
|
317
317
|
**Impact:**
|
|
318
|
-
-
|
|
319
|
-
-
|
|
318
|
+
- Personalization can increase revenue
|
|
319
|
+
- Pre-permission modal can improve opt-in rate
|
|
320
320
|
|
|
321
321
|
## Authentication & Authorization
|
|
322
322
|
|
|
@@ -443,10 +443,10 @@ const token = credentials.password;
|
|
|
443
443
|
- Expedited: 1-2 hours (emergencies only)
|
|
444
444
|
|
|
445
445
|
**Rejection Reasons:**
|
|
446
|
-
- Crashes
|
|
447
|
-
- Privacy violations
|
|
448
|
-
- Incomplete information
|
|
449
|
-
- Guideline violations
|
|
446
|
+
- Crashes
|
|
447
|
+
- Privacy violations
|
|
448
|
+
- Incomplete information
|
|
449
|
+
- Guideline violations
|
|
450
450
|
|
|
451
451
|
### Google Play (Android)
|
|
452
452
|
|
|
@@ -460,7 +460,7 @@ const token = credentials.password;
|
|
|
460
460
|
1. Build signed AAB (Android App Bundle)
|
|
461
461
|
2. Upload to Play Console
|
|
462
462
|
3. Submit to production track
|
|
463
|
-
4. Staged rollout (
|
|
463
|
+
4. Staged rollout (pilot → partial → full)
|
|
464
464
|
|
|
465
465
|
**Review Time:**
|
|
466
466
|
- Average: 1-3 days
|
|
@@ -468,22 +468,21 @@ const token = credentials.password;
|
|
|
468
468
|
|
|
469
469
|
### Staged Rollout Strategy
|
|
470
470
|
|
|
471
|
-
**
|
|
472
|
-
-
|
|
471
|
+
**Pilot:**
|
|
472
|
+
- Release to a small audience
|
|
473
473
|
- Monitor crash-free rate
|
|
474
474
|
- Watch for critical bugs
|
|
475
475
|
|
|
476
|
-
**
|
|
477
|
-
-
|
|
476
|
+
**Partial rollout:**
|
|
477
|
+
- Expand audience after pilot
|
|
478
478
|
- Validate performance metrics
|
|
479
479
|
- Check user feedback
|
|
480
480
|
|
|
481
|
-
**
|
|
482
|
-
-
|
|
483
|
-
- Full release if metrics healthy
|
|
481
|
+
**Full rollout:**
|
|
482
|
+
- Release to all users when metrics are healthy
|
|
484
483
|
|
|
485
484
|
**Rollback Triggers:**
|
|
486
|
-
- Crash-free rate
|
|
485
|
+
- Crash-free rate shows a material drop
|
|
487
486
|
- Critical bug discovered
|
|
488
487
|
- Major user complaints
|
|
489
488
|
|
|
@@ -493,12 +492,12 @@ const token = credentials.password;
|
|
|
493
492
|
|
|
494
493
|
| Metric | React Native | Flutter |
|
|
495
494
|
|--------|--------------|---------|
|
|
496
|
-
| **Adoption** |
|
|
497
|
-
| **Performance** |
|
|
498
|
-
| **App Size** |
|
|
499
|
-
| **Dev Speed** | Fast | Very
|
|
500
|
-
| **Commercial** |
|
|
501
|
-
| **Developers** |
|
|
495
|
+
| **Adoption** | Established | Established |
|
|
496
|
+
| **Performance** | Near-native when profiled | Near-native when profiled |
|
|
497
|
+
| **App Size** | Moderate | Moderate |
|
|
498
|
+
| **Dev Speed** | Fast | Very fast |
|
|
499
|
+
| **Commercial footprint** | Established | Established |
|
|
500
|
+
| **Developers** | Broad ecosystem | Broad ecosystem |
|
|
502
501
|
| **Best For** | JS teams | Performance |
|
|
503
502
|
|
|
504
503
|
### Architecture Comparison
|
|
@@ -7,8 +7,8 @@ Comprehensive guide to mobile development frameworks: React Native, Flutter, and
|
|
|
7
7
|
### React Native
|
|
8
8
|
- **Language**: JavaScript/TypeScript
|
|
9
9
|
- **Stars**: 121,000+ on GitHub
|
|
10
|
-
- **Adoption**:
|
|
11
|
-
- **Performance**:
|
|
10
|
+
- **Adoption**: Broad adoption and familiarity among mobile developers
|
|
11
|
+
- **Performance**: Near-native performance
|
|
12
12
|
- **Architecture**: Bridge-based (legacy) → New Architecture (JSI, Fabric, Codegen)
|
|
13
13
|
- **Rendering**: Native components
|
|
14
14
|
- **Hot Reload**: Yes
|
|
@@ -17,8 +17,8 @@ Comprehensive guide to mobile development frameworks: React Native, Flutter, and
|
|
|
17
17
|
### Flutter
|
|
18
18
|
- **Language**: Dart
|
|
19
19
|
- **Stars**: 170,000+ on GitHub (fastest-growing)
|
|
20
|
-
- **Adoption**:
|
|
21
|
-
- **Performance**:
|
|
20
|
+
- **Adoption**: Broad adoption among mobile developers
|
|
21
|
+
- **Performance**: Near-native performance
|
|
22
22
|
- **Architecture**: "Everything is a widget"
|
|
23
23
|
- **Rendering**: Custom Impeller rendering engine (eliminates jank)
|
|
24
24
|
- **Hot Reload**: Yes (fastest in industry)
|
|
@@ -26,7 +26,7 @@ Comprehensive guide to mobile development frameworks: React Native, Flutter, and
|
|
|
26
26
|
|
|
27
27
|
### Native iOS (Swift/SwiftUI)
|
|
28
28
|
- **Language**: Swift
|
|
29
|
-
- **Performance**:
|
|
29
|
+
- **Performance**: Native performance
|
|
30
30
|
- **UI Framework**: SwiftUI (declarative) or UIKit (imperative)
|
|
31
31
|
- **Latest**: Swift 6 with compile-time data race detection
|
|
32
32
|
- **Tooling**: Xcode 16, Swift Package Manager
|
|
@@ -34,7 +34,7 @@ Comprehensive guide to mobile development frameworks: React Native, Flutter, and
|
|
|
34
34
|
|
|
35
35
|
### Native Android (Kotlin/Jetpack Compose)
|
|
36
36
|
- **Language**: Kotlin
|
|
37
|
-
- **Performance**:
|
|
37
|
+
- **Performance**: Native performance
|
|
38
38
|
- **UI Framework**: Jetpack Compose (declarative) or Views (imperative)
|
|
39
39
|
- **Latest**: Kotlin 2.1, Compose 1.7
|
|
40
40
|
- **Tooling**: Android Studio Hedgehog+
|
|
@@ -51,7 +51,7 @@ Comprehensive guide to mobile development frameworks: React Native, Flutter, and
|
|
|
51
51
|
- **Turbo Modules**: Lazy-loaded native modules
|
|
52
52
|
|
|
53
53
|
**Performance Optimizations**
|
|
54
|
-
- **Hermes Engine**:
|
|
54
|
+
- **Hermes Engine**: Faster startup, reduced memory
|
|
55
55
|
- **Native Driver Animations**: Offloaded to UI thread (60 FPS)
|
|
56
56
|
- **FlatList Virtualization**: Renders only visible items
|
|
57
57
|
- **Image Optimization**: FastImage library, progressive loading
|
|
@@ -81,14 +81,14 @@ src/
|
|
|
81
81
|
4. **Context API**: Simple apps, avoid prop drilling
|
|
82
82
|
|
|
83
83
|
**Navigation**
|
|
84
|
-
- **React Navigation**: Industry standard
|
|
84
|
+
- **React Navigation**: Industry standard
|
|
85
85
|
- Type-safe navigation with TypeScript
|
|
86
86
|
- Deep linking configuration
|
|
87
87
|
- Tab, stack, drawer navigators
|
|
88
88
|
|
|
89
89
|
**TypeScript Adoption**
|
|
90
|
-
-
|
|
91
|
-
- Type safety
|
|
90
|
+
- TypeScript is common in new React Native projects
|
|
91
|
+
- Type safety helps prevent runtime errors
|
|
92
92
|
- Better IDE support and autocomplete
|
|
93
93
|
|
|
94
94
|
### Testing Strategy
|
|
@@ -130,7 +130,7 @@ test('login button should be enabled when form is valid', async () => {
|
|
|
130
130
|
- Rapid prototyping and MVPs
|
|
131
131
|
- Strong community support needed
|
|
132
132
|
- npm ecosystem integration
|
|
133
|
-
- Commercial apps
|
|
133
|
+
- Commercial apps
|
|
134
134
|
|
|
135
135
|
**❌ Not Ideal For:**
|
|
136
136
|
- Heavy graphics/gaming (use native or Unity)
|
|
@@ -254,7 +254,7 @@ testWidgets('Counter increments', (WidgetTester test-runner) async {
|
|
|
254
254
|
- Move semantics for performance
|
|
255
255
|
|
|
256
256
|
**SwiftUI vs UIKit**
|
|
257
|
-
- **SwiftUI**: Declarative,
|
|
257
|
+
- **SwiftUI**: Declarative, less code, iOS 13+, modern approach
|
|
258
258
|
- **UIKit**: Imperative, fine-grained control, legacy support, complex customizations
|
|
259
259
|
- Both work together in same project
|
|
260
260
|
|
|
@@ -318,7 +318,7 @@ struct LoginView: View {
|
|
|
318
318
|
|
|
319
319
|
**Jetpack Compose**
|
|
320
320
|
- Declarative UI (like SwiftUI/React)
|
|
321
|
-
-
|
|
321
|
+
- Widely adopted in top 1,000 apps
|
|
322
322
|
- Material Design 3 integration
|
|
323
323
|
- Compose compiler with Kotlin 2.0+
|
|
324
324
|
|
|
@@ -5,7 +5,7 @@ Essential thinking patterns and decision-making frameworks for successful mobile
|
|
|
5
5
|
## The 10 Commandments of Mobile Development
|
|
6
6
|
|
|
7
7
|
### 1. Performance is Foundation, Not Feature
|
|
8
|
-
- **Reality**:
|
|
8
|
+
- **Reality**: Users may abandon apps when load time exceeds 3s
|
|
9
9
|
- **Mindset**: Optimize from day one, not "later"
|
|
10
10
|
- **Action**: Set performance budgets before writing code
|
|
11
11
|
|
|
@@ -50,7 +50,7 @@ Essential thinking patterns and decision-making frameworks for successful mobile
|
|
|
50
50
|
- **Action**: MVVM for small apps, Clean Architecture when complexity demands
|
|
51
51
|
|
|
52
52
|
### 10. Continuous Learning is Survival
|
|
53
|
-
- **Reality**:
|
|
53
|
+
- **Reality**: AI tools are widely used by developers (2024), frameworks evolve constantly
|
|
54
54
|
- **Mindset**: Embrace change, allocate learning time
|
|
55
55
|
- **Action**: 1+ hour weekly for new tech/patterns
|
|
56
56
|
|
|
@@ -131,7 +131,7 @@ Essential thinking patterns and decision-making frameworks for successful mobile
|
|
|
131
131
|
- "It just works" expectation = zero tolerance for crashes
|
|
132
132
|
|
|
133
133
|
**Fragmentation**: LOW
|
|
134
|
-
-
|
|
134
|
+
- Most users on iOS 16+ (2024)
|
|
135
135
|
- Only ~50 device models to test
|
|
136
136
|
- Predictable hardware specs
|
|
137
137
|
|
|
@@ -165,7 +165,7 @@ Essential thinking patterns and decision-making frameworks for successful mobile
|
|
|
165
165
|
- Handle back button properly
|
|
166
166
|
|
|
167
167
|
**When to Go Native Android:**
|
|
168
|
-
- Global market focus (
|
|
168
|
+
- Global market focus (Android dominates)
|
|
169
169
|
- Emerging markets (Android dominates)
|
|
170
170
|
- Enterprise/B2B (customization needs)
|
|
171
171
|
|
|
@@ -177,7 +177,7 @@ Essential thinking patterns and decision-making frameworks for successful mobile
|
|
|
177
177
|
|--------|-----------|-----------------|
|
|
178
178
|
| **Launch time** | <2s | Acceptable |
|
|
179
179
|
| **Launch time** | 2-3s | Noticeable delay |
|
|
180
|
-
| **Launch time** | >3s |
|
|
180
|
+
| **Launch time** | >3s | Users may abandon |
|
|
181
181
|
| **Screen load** | <1s | Instant (cached) |
|
|
182
182
|
| **Screen load** | 1-3s | Acceptable (network) |
|
|
183
183
|
| **Screen load** | >3s | Frustrating |
|
|
@@ -259,46 +259,44 @@ Week 2: Polish + Ship
|
|
|
259
259
|
8. Merge to develop
|
|
260
260
|
|
|
261
261
|
**CI/CD Impact:**
|
|
262
|
-
-
|
|
263
|
-
- 50% fewer production bugs
|
|
264
|
-
- 3x faster deployment
|
|
262
|
+
- Faster development and deployment with fewer production bugs
|
|
265
263
|
|
|
266
264
|
### Common Pitfalls & Avoidance
|
|
267
265
|
|
|
268
266
|
#### 1. Testing Only on Simulators
|
|
269
267
|
**Problem**: Simulators don't show real performance (battery, memory, network)
|
|
270
268
|
**Solution**: Real device testing mandatory before every release
|
|
271
|
-
**Impact**:
|
|
269
|
+
**Impact**: Some bugs only appear on real devices
|
|
272
270
|
|
|
273
271
|
#### 2. Ignoring Platform Conventions
|
|
274
272
|
**Problem**: Custom navigation confuses users
|
|
275
273
|
**Solution**: Follow iOS HIG and Material Design
|
|
276
|
-
**Impact**:
|
|
274
|
+
**Impact**: Non-standard UIs can lower engagement
|
|
277
275
|
|
|
278
276
|
#### 3. No Offline Handling
|
|
279
277
|
**Problem**: Network failures = blank screens, errors
|
|
280
278
|
**Solution**: Offline-first architecture, cached data
|
|
281
|
-
**Impact**:
|
|
279
|
+
**Impact**: Users can experience network issues daily
|
|
282
280
|
|
|
283
281
|
#### 4. Poor Memory Management
|
|
284
282
|
**Problem**: Memory leaks → crashes, poor performance
|
|
285
283
|
**Solution**: ARC/GC understanding, profile regularly
|
|
286
|
-
**Impact**: Memory issues
|
|
284
|
+
**Impact**: Memory issues are a leading crash cause
|
|
287
285
|
|
|
288
286
|
#### 5. Hardcoded Credentials
|
|
289
287
|
**Problem**: Security vulnerability, API key exposure
|
|
290
288
|
**Solution**: Environment variables, secure storage
|
|
291
|
-
**Impact**:
|
|
289
|
+
**Impact**: Apps can leak sensitive data; follow OWASP guidance.
|
|
292
290
|
|
|
293
291
|
#### 6. No Accessibility
|
|
294
|
-
**Problem**: Excludes
|
|
292
|
+
**Problem**: Excludes users with disabilities or situational needs
|
|
295
293
|
**Solution**: VoiceOver/TalkBack testing, semantic labels
|
|
296
294
|
**Impact**: Accessibility = 1.3B global market
|
|
297
295
|
|
|
298
296
|
#### 7. Premature Optimization
|
|
299
297
|
**Problem**: Wasted time optimizing non-bottlenecks
|
|
300
298
|
**Solution**: Measure first, optimize biggest impact
|
|
301
|
-
**Impact**:
|
|
299
|
+
**Impact**: Many performance issues come from a small part of the code
|
|
302
300
|
|
|
303
301
|
#### 8. Over-Engineering
|
|
304
302
|
**Problem**: Complex architecture for simple apps
|
|
@@ -308,7 +306,7 @@ Week 2: Polish + Ship
|
|
|
308
306
|
#### 9. Skipping Real Device Testing
|
|
309
307
|
**Problem**: Missed battery drain, thermal issues
|
|
310
308
|
**Solution**: Device farm in CI/CD, manual testing
|
|
311
|
-
**Impact**:
|
|
309
|
+
**Impact**: Some performance issues are device-specific
|
|
312
310
|
|
|
313
311
|
#### 10. Not Respecting Battery
|
|
314
312
|
**Problem**: Background processing drains battery
|
|
@@ -460,12 +458,12 @@ if (isLowEndDevice) {
|
|
|
460
458
|
|
|
461
459
|
**Example Architecture:**
|
|
462
460
|
```
|
|
463
|
-
React Native / Flutter
|
|
461
|
+
React Native / Flutter
|
|
464
462
|
├─ UI and business logic
|
|
465
463
|
├─ Standard features
|
|
466
464
|
└─ API integration
|
|
467
465
|
|
|
468
|
-
Native Modules
|
|
466
|
+
Native Modules
|
|
469
467
|
├─ Performance-critical (video processing)
|
|
470
468
|
├─ Platform-specific (HealthKit, Android Auto)
|
|
471
469
|
└─ Third-party SDKs (payment, analytics)
|
|
@@ -535,7 +533,7 @@ v4.0: Extract microservices if justified
|
|
|
535
533
|
- Discord (React Native, Flutter official)
|
|
536
534
|
- Twitter: Follow framework creators and contributors
|
|
537
535
|
|
|
538
|
-
**AI Tools (
|
|
536
|
+
**AI Tools (widely adopted in 2024):**
|
|
539
537
|
- GitHub Copilot: Code completion, boilerplate
|
|
540
538
|
- ChatGPT/Claude: Architecture questions, debugging
|
|
541
539
|
- Tabnine: Context-aware suggestions
|
|
@@ -30,14 +30,14 @@ The output is an answer, evidence, confidence, and a follow-up only when needed.
|
|
|
30
30
|
## When To Use
|
|
31
31
|
|
|
32
32
|
Use `hapo:question` when the user asks:
|
|
33
|
-
- "
|
|
34
|
-
- "
|
|
35
|
-
- "
|
|
36
|
-
- "
|
|
37
|
-
- "
|
|
38
|
-
- "
|
|
39
|
-
- "
|
|
40
|
-
- "
|
|
33
|
+
- "What does X do in this system?"
|
|
34
|
+
- "Where is this flow handled?"
|
|
35
|
+
- "What is the current config/version/package?"
|
|
36
|
+
- "Does it use a particular library/technology/approach?"
|
|
37
|
+
- "Does this requirement/spec match the code?"
|
|
38
|
+
- "How should I use this tool/library/framework?"
|
|
39
|
+
- "What does best practice or the current docs say?"
|
|
40
|
+
- "How should I understand this part?"
|
|
41
41
|
|
|
42
42
|
Do not use it when:
|
|
43
43
|
- The user asks to implement, fix, debug, test, commit, or publish.
|
|
@@ -131,14 +131,14 @@ Use `templates/question.md` when the user asks to save or document the answer.
|
|
|
131
131
|
- Separate "confirmed by source" from "inferred".
|
|
132
132
|
- Keep the answer proportional: concise for simple questions, structured for complex ones.
|
|
133
133
|
- If external sources were used, include source links or names.
|
|
134
|
-
- If no evidence exists, say "
|
|
134
|
+
- If no evidence exists, say "no evidence found in the current source" and explain what was checked.
|
|
135
135
|
|
|
136
136
|
## Examples
|
|
137
137
|
|
|
138
138
|
### Source Question
|
|
139
139
|
|
|
140
140
|
```text
|
|
141
|
-
/hapo:question "
|
|
141
|
+
/hapo:question "In this system, which file does cafekit use to toggle skill routing?"
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
Expected behavior:
|
|
@@ -149,7 +149,7 @@ Expected behavior:
|
|
|
149
149
|
### Mixed Source + Web Question
|
|
150
150
|
|
|
151
151
|
```text
|
|
152
|
-
/hapo:question "
|
|
152
|
+
/hapo:question "Which React version does this project use, and does that version still match current best practice?" --both
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
Expected behavior:
|
|
@@ -160,8 +160,8 @@ Expected behavior:
|
|
|
160
160
|
### Ask Back
|
|
161
161
|
|
|
162
162
|
```text
|
|
163
|
-
/hapo:question "
|
|
163
|
+
/hapo:question "Is this system stable?"
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
Expected behavior:
|
|
167
|
-
- ask one narrowing question because "
|
|
167
|
+
- ask one narrowing question because "stable" could mean architecture, security, performance, UX, tests, or deploy readiness.
|
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
---
|
|
13
13
|
# Research (Delegation Facade)
|
|
14
14
|
|
|
15
|
-
**Mantra:**
|
|
15
|
+
**Mantra:** Return ranked recommendations with sources; never an unsorted list of options.
|
|
16
16
|
|
|
17
17
|
This skill acts as a **Command Facade**. When invoked, the main Orchestrator MUST NOT attempt to run WebSearch itself. Instead, it must instantly delegate the operation to the Specialized Subagent.
|
|
18
18
|
|
|
@@ -40,7 +40,7 @@ Output Format: Must strictly follow the 'Standard Research Report' layout.
|
|
|
40
40
|
The subagent MUST return the findings formatted EXACTLY according to the built-in specification template.
|
|
41
41
|
|
|
42
42
|
Instruct the Researcher Subagent with this strict requirement:
|
|
43
|
-
> "
|
|
43
|
+
> "Use the template at .claude/skills/specs/templates/research.md verbatim. Do not add sections beyond it."
|
|
44
44
|
|
|
45
45
|
## Post-Execution
|
|
46
46
|
Once the `researcher` completes the Task and returns the Markdown output, save it based on context:
|