@daemux/store-automator 0.3.0 → 0.5.0

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.
Files changed (38) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/README.md +11 -13
  3. package/bin/cli.mjs +69 -10
  4. package/package.json +7 -8
  5. package/plugins/store-automator/.claude-plugin/plugin.json +1 -1
  6. package/plugins/store-automator/agents/app-designer.md +320 -0
  7. package/plugins/store-automator/agents/appstore-meta-creator.md +37 -1
  8. package/plugins/store-automator/agents/appstore-reviewer.md +66 -5
  9. package/plugins/store-automator/agents/architect.md +144 -0
  10. package/plugins/store-automator/agents/developer.md +249 -0
  11. package/plugins/store-automator/agents/devops.md +396 -0
  12. package/plugins/store-automator/agents/product-manager.md +258 -0
  13. package/plugins/store-automator/agents/reviewer.md +386 -0
  14. package/plugins/store-automator/agents/simplifier.md +192 -0
  15. package/plugins/store-automator/agents/tester.md +284 -0
  16. package/scripts/check_changed.sh +23 -0
  17. package/scripts/check_google_play.py +139 -0
  18. package/scripts/codemagic-setup.mjs +44 -0
  19. package/scripts/generate.sh +107 -0
  20. package/scripts/manage_version_ios.py +168 -0
  21. package/src/codemagic-api.mjs +73 -0
  22. package/src/codemagic-setup.mjs +164 -0
  23. package/src/github-setup.mjs +52 -0
  24. package/src/install.mjs +32 -7
  25. package/src/prompt.mjs +7 -2
  26. package/src/templates.mjs +13 -0
  27. package/src/uninstall.mjs +37 -21
  28. package/templates/CLAUDE.md.template +293 -223
  29. package/templates/ci.config.yaml.template +14 -1
  30. package/templates/codemagic.template.yaml +15 -6
  31. package/templates/fastlane/android/Fastfile.template +11 -4
  32. package/templates/fastlane/ios/Fastfile.template +27 -11
  33. package/templates/fastlane/ios/Snapfile.template +3 -1
  34. package/templates/github/workflows/codemagic-trigger.yml +68 -0
  35. package/templates/scripts/create_app_record.py +172 -0
  36. package/templates/scripts/generate.sh +6 -0
  37. package/plugins/store-automator/agents/appstore-media-designer.md +0 -195
  38. package/src/dependency-check.mjs +0 -26
@@ -4,53 +4,43 @@
4
4
 
5
5
  This is a Flutter app with Firebase backend, automated for App Store and Google Play publishing via Codemagic CI/CD. This repository MUST be PRIVATE as it contains credential files.
6
6
 
7
+ ## Mandatory Rules
8
+
9
+ ### Agent Delegation (NEVER violate)
10
+ - ALWAYS delegate ALL tasks to agents - use either plugin agents or built-in agents (via Task tool)
11
+ - NEVER perform any work directly - the main agent's role is ONLY to coordinate and delegate
12
+ - This includes verification: if you need to confirm an agent's claims, delegate verification to another agent (e.g., tester) — do NOT run commands yourself
13
+ - This applies to ALL task types: coding, research, exploration, file operations, testing, deployment, and any other work
14
+ - If unsure which agent to use, use the Task tool with a general-purpose, explore or any other built-in agent
15
+
16
+ ### DevOps Agent Required
17
+ ALL deployment and infrastructure operations SHOULD use the devops agent (codemagic, firebase, cloudflare, database/migrate, database/optimize).
18
+ Prefer using the devops agent over direct Bash/SSH for structured operations.
19
+
20
+ ### Code Quality (enforced by agents)
21
+ - No TODO/FIXME in committed code
22
+ - No Mock/placeholder code
23
+ - No hardcoded secrets
24
+ - Use appropriate data types for precision requirements
25
+ - Sanitize and validate all external inputs
26
+ - Follow language-specific security best practices
27
+
28
+ ## Code Limits (MANDATORY)
29
+
30
+ | Limit | Value | Action if Exceeded |
31
+ |-------|-------|-------------------|
32
+ | File size | 400 lines | Split into modules |
33
+ | Functions per file | 10 | Group by domain/feature |
34
+ | Function length | 50 lines | Extract helper functions |
35
+ | Line width | 120 chars | Wrap or refactor |
36
+ | Max nesting | 5 levels | Use early returns |
37
+
7
38
  ## Configuration Files
8
39
 
9
40
  ### ci.config.yaml
10
-
11
- Fill this file with your project-specific values. This is the single source of truth for all CI/CD configuration:
12
-
13
- ```yaml
14
- credentials:
15
- apple:
16
- p8_key_path: creds/AuthKey.p8
17
- key_id: "YOUR_KEY_ID"
18
- issuer_id: "YOUR_ISSUER_ID"
19
- google:
20
- service_account_json_path: creds/play-service-account.json
21
- android:
22
- keystore_password: "YOUR_KEYSTORE_PASSWORD"
23
-
24
- app:
25
- name: "Your App Name"
26
- bundle_id: "com.yourcompany.yourapp"
27
- package_name: "com.yourcompany.yourapp"
28
- sku: "yourapp001"
29
- apple_id: "your@email.com"
30
-
31
- ios:
32
- primary_category: "UTILITIES"
33
- secondary_category: "PRODUCTIVITY"
34
- price_tier: 0
35
- submit_for_review: true
36
- automatic_release: true
37
-
38
- android:
39
- track: "internal"
40
- rollout_fraction: ""
41
- in_app_update_priority: 3
42
-
43
- metadata:
44
- languages:
45
- - en-US
46
-
47
- web:
48
- domain: "yourapp-pages.pages.dev" # *.pages.dev domain is sufficient, no custom DNS needed
49
- cloudflare_project_name: "yourapp-pages"
50
- ```
41
+ Single source of truth: credentials, app identity, store settings, web domain, Codemagic CI/CD (app_id for GitHub Actions auto-trigger, workflow IDs).
51
42
 
52
43
  ### fastlane/metadata/ Structure
53
-
54
44
  All store listing texts are stored in fastlane directories and managed by the appstore-meta-creator agent:
55
45
 
56
46
  **iOS** (fastlane/metadata/ios/{locale}/):
@@ -60,43 +50,12 @@ name.txt, subtitle.txt, description.txt, keywords.txt, promotional_text.txt, rel
60
50
  title.txt, short_description.txt, full_description.txt, changelogs/default.txt
61
51
 
62
52
  ### fastlane/iap_config.json
53
+ IAP and subscription configuration. Durations: ONE_WEEK to ONE_YEAR. Intro offers: FREE, PAY_AS_YOU_GO, PAY_UP_FRONT.
63
54
 
64
- In-app purchase and subscription configuration:
65
-
66
- ```json
67
- {
68
- "subscription_groups": [
69
- {
70
- "reference_name": "Premium",
71
- "localizations": { "en-US": { "name": "Premium" } },
72
- "subscriptions": [
73
- {
74
- "product_id": "com.yourcompany.yourapp.premium.monthly",
75
- "reference_name": "Premium Monthly",
76
- "duration": "ONE_MONTH",
77
- "group_level": 1,
78
- "localizations": { "en-US": { "name": "Monthly", "description": "Full access" } },
79
- "prices": { "USD": "9.99" },
80
- "introductory_offer": { "type": "FREE", "duration": "ONE_WEEK", "periods": 1 }
81
- }
82
- ]
83
- }
84
- ],
85
- "in_app_purchases": []
86
- }
87
- ```
55
+ ### fastlane/screenshots/
56
+ Store screenshots by platform and device size. Generated by app-designer via Stitch MCP.
88
57
 
89
- Valid durations: ONE_WEEK, ONE_MONTH, TWO_MONTHS, THREE_MONTHS, SIX_MONTHS, ONE_YEAR.
90
- Intro offer types: FREE, PAY_AS_YOU_GO, PAY_UP_FRONT.
91
-
92
- ## Flutter Development Standards
93
-
94
- ### Architecture
95
- - **State management**: Riverpod (recommended) or BLoC/Cubit
96
- - Repository pattern for data access
97
- - **Dependency injection**: Riverpod providers (recommended) or get_it + injectable
98
- - Feature-first folder structure
99
- - Code generation: build_runner + riverpod_generator (or freezed + json_serializable)
58
+ ## Flutter Project Structure
100
59
 
101
60
  ### Folder Structure
102
61
  ```
@@ -122,162 +81,273 @@ lib/
122
81
  api/
123
82
  ```
124
83
 
125
- ### Code Limits
84
+ ### Recommended Stack
85
+ - **Riverpod** (recommended): flutter_riverpod + riverpod_annotation + riverpod_generator, go_router, dio, freezed + json_serializable, Firebase suite, in_app_purchase (use RevenueCat/Adapty if TASK.md specifies)
86
+ - **BLoC** (alternative): flutter_bloc, go_router, get_it + injectable, dio, freezed + json_serializable, Firebase suite, in_app_purchase (use RevenueCat/Adapty if TASK.md specifies)
126
87
 
127
- | Limit | Value | Action |
128
- |-------|-------|--------|
129
- | File size | 400 lines | Split into modules |
130
- | Functions per file | 10 | Group by domain |
131
- | Function length | 50 lines | Extract helpers |
132
- | Line width | 120 chars | Wrap or refactor |
133
- | Max nesting | 5 levels | Use early returns |
88
+ ## Workflow
134
89
 
135
- ### Code Standards
136
- - Null safety enforced throughout
137
- - Use const constructors wherever possible
138
- - Prefer composition over inheritance
139
- - All public APIs documented with /// comments
140
- - No TODO/FIXME in committed code
141
- - No hardcoded secrets anywhere
142
-
143
- ### Dependencies
144
-
145
- **Riverpod stack (recommended):**
146
- - flutter_riverpod + riverpod_annotation + riverpod_generator -- state management & DI
147
- - go_router -- navigation
148
- - dio -- HTTP client
149
- - freezed + json_serializable -- data classes
150
- - firebase_core, firebase_auth, cloud_firestore -- Firebase
151
- - in_app_purchase -- client-only IAP (no backend needed)
152
-
153
- **BLoC stack (alternative):**
154
- - flutter_bloc / bloc -- state management
155
- - go_router -- navigation
156
- - get_it + injectable -- dependency injection
157
- - dio -- HTTP client
158
- - freezed + json_serializable -- data classes
159
- - firebase_core, firebase_auth, cloud_firestore -- Firebase
160
- - in_app_purchase -- client-only IAP (no backend needed)
161
-
162
- ### Testing
163
- - Unit tests for all business logic (cubits, repositories, use cases)
164
- - Widget tests for custom widgets
165
- - Integration tests for critical user flows
166
- - Minimum 80% coverage target
167
-
168
- ### Mandatory UI Testing (MUST run before publishing)
169
- - **Flutter analyze**: `flutter analyze` must pass with zero issues
170
- - **iOS build test**: `flutter build ios --no-codesign` must succeed
171
- - **Android build test**: `flutter build appbundle` must succeed
172
- - **Run all unit tests**: `flutter test` must pass
173
- - **Widget/integration tests**: Run full test suite on both platforms
174
- - All builds and tests MUST pass before proceeding to store metadata or publishing
175
-
176
- ### In-App Purchases (in_app_purchase — Client-Only, No Backend)
177
-
178
- Use the `in_app_purchase` Flutter package for all IAP/subscription functionality. No backend server validation is needed — all purchase handling is client-only.
179
-
180
- #### Store Setup
181
- - **App Store Connect**: Create products (consumable / non-consumable / subscription) with unique IDs
182
- - **Google Play Console**: Create matching product IDs
183
-
184
- #### App Setup
185
- - Add `in_app_purchase` to `pubspec.yaml`
186
- - iOS: set bundle ID in Xcode
187
- - Android: set application ID in `build.gradle`
188
-
189
- #### Runtime Flow
190
- 1. **Listen early** subscribe to `purchaseStream` in `initState()` (catches pending purchases from previous sessions)
191
- 2. **Check availability** — `InAppPurchase.instance.isAvailable()`
192
- 3. **Query products** `queryProductDetails()` with your product IDs
193
- 4. **Buy** `buyNonConsumable()` or `buyConsumable()`; native store UI appears automatically
194
- 5. **Handle result** listen to `purchaseStream` for `PurchaseStatus.purchased`
195
- 6. **Deliver content** unlock feature / add currency locally (update Firestore user doc)
196
- 7. **Complete** call `completePurchase()` **mandatory within 3 days or auto-refund**
197
-
198
- #### Restore Purchases
199
- - Call `restorePurchases()` results come through `purchaseStream`
200
- - Works for non-consumables and active subscriptions
201
- - **Consumables cannot be restored** without a backend
202
-
203
- #### Key Rules
204
- - Subscribe to `purchaseStream` **before anything else** — or you'll miss events
205
- - **Always** call `completePurchase()` after delivering content
206
- - Store product IDs locally (hardcoded constants)
207
- - Update the user's subscription tier in Firestore directly from the client after successful purchase
208
- - No backend validation Cloud Function needed trust the store receipt on-device
209
-
210
- ## Firebase Backend
211
-
212
- ### Services
213
- - Firebase Authentication (email/password, Google Sign-In, Apple Sign-In)
214
- - Cloud Firestore (NoSQL database)
215
- - Firebase Storage (file uploads)
216
- - Firebase Cloud Messaging (push notifications)
217
- - Firebase Analytics
218
- - Firebase Crashlytics
219
-
220
- ### Security Rules
221
- - Firestore: authenticated read/write with per-document ownership checks
222
- - Storage: authenticated upload, public read for profile images
223
- - All rules must be tested before deployment
224
-
225
- ### Setup
226
- 1. Create Firebase project via Firebase Console
227
- 2. Add iOS and Android apps with correct bundle ID / package name
228
- 3. Download google-services.json and GoogleService-Info.plist
229
- 4. Configure via `flutterfire configure` CLI
90
+ ### Task Type Detection
91
+
92
+ Detect from user request:
93
+ - **flutter** - App UI, widgets, screens, Dart code, state management
94
+ - **backend** - Firebase Cloud Functions, Firestore rules, server-side logic
95
+ - **design** - App design, store screenshots, web page design (Stitch MCP)
96
+ - **metadata** - Store listing texts, IAP config, app rating
97
+ - **database** - Firestore schema, indexes, data migration
98
+ - **infra** - Codemagic CI/CD, Firebase deploy, Cloudflare web deploy
99
+ - **standard** - Mixed or unclear scope
100
+
101
+ ### Agent Flows
102
+
103
+ #### Standard Flow
104
+ ```
105
+ architect → product-manager(PRE) developer simplifier → reviewer → tester → product-manager(POST) → [devops]
106
+ ```
107
+
108
+ #### Flutter Flow
109
+ ```
110
+ architect → product-manager(PRE) [app-designer] → developer(flutter) → simplifier → reviewer → tester(flutter) → tester(mobile-ui) → product-manager(POST) → [devops(codemagic)]
111
+ ```
112
+
113
+ #### Backend Flow
114
+ ```
115
+ architect → product-manager(PRE) developer(backend) simplifier → reviewer → tester(backend) → product-manager(POST) → [devops(firebase)]
116
+ ```
117
+
118
+ #### Design Flow
119
+ ```
120
+ app-designer appstore-reviewer
121
+ ```
122
+
123
+ #### Metadata Flow
124
+ ```
125
+ appstore-meta-creator appstore-reviewer
126
+ ```
127
+
128
+ #### Database Flow
129
+ ```
130
+ devops(database,migrate) → simplifier → reviewer → product-manager(POST) → [devops(firebase)]
131
+ ```
132
+
133
+ #### Infra Flow
134
+ ```
135
+ devops (standalone)
136
+ ```
137
+
138
+ #### Full Publishing Flow (Design to App Store)
139
+ ```
140
+ architect → product-manager(PRE) app-designer developer(flutter) → simplifier → reviewer → tester(flutter) → tester(mobile-ui) → appstore-meta-creator → appstore-reviewer → product-manager(POST) → devops(codemagic)
141
+ ```
142
+
143
+ ### Agents Reference
144
+
145
+ | Agent | When to use |
146
+ |-------|-------------|
147
+ | architect | BEFORE developer - designs Flutter architecture |
148
+ | product-manager | PRE-DEV: validates approach. POST-DEV: after tests pass |
149
+ | developer | Code implementation (type: flutter/backend/fullstack) |
150
+ | simplifier | AFTER developer - simplifies Dart/Flutter code |
151
+ | reviewer | After ANY code changes - Dart/Flutter quality review |
152
+ | tester | After review passes (type: flutter/mobile-ui/web/backend/integration) |
153
+ | devops | Operations (mode: codemagic/firebase/cloudflare/database+migrate/database+optimize) |
154
+ | app-designer | Stitch MCP design: app screens + store screenshots + web page design |
155
+ | appstore-meta-creator | Generate store listing texts for all configured languages |
156
+ | appstore-reviewer | Full App Store/Play compliance review including live app UI testing via mobile-mcp |
157
+ | Explore (Task tool) | Read/understand code |
158
+
159
+ ### Optional Agents
160
+
161
+ | Agent | When to Skip |
162
+ |-------|--------------|
163
+ | [devops] | No deployment configured (workflow ends at product-manager(POST)) |
164
+ | [app-designer] | App designs already exist or minor code changes |
165
+ | [appstore-meta-creator] | Metadata already exists and unchanged |
166
+ | [appstore-reviewer] | No store submission in this iteration |
167
+
168
+ ### Autonomous Iteration Philosophy
169
+
170
+ **Self-Correction (MANDATORY):** Before each fix attempt:
171
+ 1. Read previous error output carefully
172
+ 2. Check git diff to see what was already tried
173
+ 3. Identify WHY it failed, not just WHAT failed
174
+ 4. Try a DIFFERENT approach if same fix failed twice
175
+
176
+ **Persistence Wins:** Keep iterating until success.
177
+
178
+ ### Fix-and-Verify Loops
179
+
180
+ **review-loop:** reviewer → PASS? → EXIT | ISSUES? → developer → reviewer (repeat)
181
+
182
+ **manager-loop:** product-manager COMPLETE? EXIT | ISSUES? developer product-manager (repeat)
183
+
184
+ **test-loop:** tester PASS? EXIT | FAIL? → developer → simplifier → reviewer → tester (repeat)
185
+
186
+ If the same error persists unchanged after one full fix cycle, try a fundamentally different approach. If an agent crashes or returns empty output, re-run it once. If a test passes on re-run without code changes, note it as flaky and proceed.
187
+
188
+ ### Gates & Prerequisites
189
+
190
+ **Before product-manager (POST-DEV):**
191
+ - `TESTS: PASSED` from tester
192
+ - `Review: NO ISSUES` from reviewer
193
+
194
+ **Before devops:**
195
+ - `APPROVED` or `COMPLETE` from product-manager
196
+ - Deployment is optional when not configured
197
+
198
+ **Before devops(codemagic):**
199
+ - appstore-reviewer APPROVED (if publishing)
200
+ - All metadata files present for configured languages
201
+ - All screenshots present and verified (dimensions match requirements)
202
+
203
+ Missing evidence means run that agent first. Do NOT proceed without it.
204
+
205
+ **Verification rule:** Trust agent output at face value. If an agent reports PASS/COMPLETE, proceed to the next stage. Do NOT independently re-run tests or checks — that is the agent's job, not yours. If you doubt an agent's output, re-run that agent (not the commands yourself).
206
+
207
+ ### Parallel Execution
208
+
209
+ **Launch multiple agents in ONE message when possible.**
210
+
211
+ **Parallel OK:** Independent features, backend + frontend, tester(flutter) + tester(mobile-ui), appstore-meta-creator + app-designer (if designs ready)
212
+
213
+ **Sequential ONLY:** Same-file changes, simplifier → reviewer, review-fix cycles, deployer after tests
230
214
 
231
215
  ## Workflow: Design to Publish
232
216
 
233
- ### Phase 1: App Design + Store Screenshots (FIRST — before development)
234
- All design work happens in a single Stitch MCP project. Complete the full app design AND store screenshots before writing any code.
235
-
236
- 1. **Create Stitch project** — name it `{app-name}-design` via Stitch MCP
237
- 2. **Design all app screens** in the Stitch project using the designer agent:
238
- - All core screens (home, main feature, detail views, settings, profile)
239
- - Paywall/subscription screen
240
- - Onboarding screens
241
- - Review designs before proceeding
242
- 3. **Create all store screenshots** in the SAME Stitch project using the **appstore-media-designer** agent:
243
- - 5 screenshot scenes per device size for all required Apple and Google device sizes
244
- - Screenshots are designed entirely in Stitch MCP — no simulator screenshots needed
245
- - See the appstore-media-designer agent for full details on ASO-optimized screenshots
246
- 4. Save all screenshots to `fastlane/screenshots/` in the correct directory structure
217
+ ### Phase 1: App Design + Store Screenshots
218
+ app-designer creates all screens and screenshots in Stitch MCP. Complete design before code. Save to fastlane/screenshots/.
247
219
 
248
220
  ### Phase 2: Develop
249
- 1. Implement Flutter app following the standards above, using the Stitch designs as reference
250
- 2. Set up Firebase backend services
251
- 3. Fill ci.config.yaml with real values
252
- 4. Add creds/AuthKey.p8 (Apple) and creds/play-service-account.json (Google)
221
+ Implement Flutter app matching designs. Set up Firebase. Fill ci.config.yaml. Add credential files.
253
222
 
254
223
  ### Phase 3: Store Metadata + Texts
255
- 1. Run appstore-meta-creator to generate all metadata texts for configured languages
256
- 2. Fill fastlane/iap_config.json if the app has subscriptions or IAP
257
-
258
- ### Phase 4: Web Pages (after screenshots are ready)
259
- 1. Customize marketing landing page (web/marketing.html) -- **include app screenshots** from Phase 1
260
- 2. Customize privacy policy page (web/privacy.html)
261
- 3. Customize terms of service page (web/terms.html)
262
- 4. Customize support page (web/support.html)
263
- 5. Deploy all via Cloudflare Pages (node web/deploy-cloudflare.mjs)
264
- 6. The default `*.pages.dev` domain is sufficient -- no custom DNS records needed. Use the generated URL (e.g., `yourapp-pages.pages.dev`) for privacy_url, support_url, and marketing_url in store metadata
265
-
266
- ### Phase 5: CI/CD Setup
267
- 1. Run scripts/generate.sh to create codemagic.yaml from ci.config.yaml
268
- 2. Commit all files to the private repository
269
- 3. Push to GitHub
270
- 4. Codemagic builds and deploys automatically on push to main
224
+ appstore-meta-creator generates texts. Fill fastlane/iap_config.json if needed.
225
+
226
+ ### Phase 4: Web Pages + Deployment
227
+ app-designer designs marketing page in Stitch MCP. Develop web pages. Deploy via Cloudflare Pages (*.pages.dev domain sufficient).
228
+
229
+ ### Phase 5: Finalize and CI/CD
230
+ Create .gitignore (.claude/.tasks/, Flutter ignores; do NOT ignore *.g.dart). Run scripts/generate.sh. Fill codemagic.app_id. Push to private repo. GitHub Actions auto-triggers on push.
271
231
 
272
232
  ### Phase 6: First Publish
273
- - **iOS**: fully automated from first push -- builds, signs, uploads metadata + screenshots + binary
274
- - **Android**: first build creates AAB + HOW_TO_GOOGLE_PLAY.md artifact
275
- - Complete the manual steps listed in HOW_TO_GOOGLE_PLAY.md via Play Console
276
- - Push again for full automation on subsequent builds
233
+ iOS: fully automated. Android: first build creates AAB + manual steps guide; subsequent builds fully automated.
277
234
 
278
235
  ### Phase 7: Ongoing Updates
279
- - Edit code, metadata, or screenshots as needed
280
- - Push to main branch
281
- - Codemagic detects what changed and only uploads modified assets
282
- - Version numbers are auto-incremented
283
- - Conditional uploads: metadata only re-uploaded if fastlane/metadata/ changed
236
+ Push to main. Codemagic detects changes and uploads modified assets. Version auto-incremented.
237
+
238
+ ---
239
+ ## FOR ORCHESTRATORS ONLY
240
+ **If you are a TEAMMATE, skip to "For Teammates" section below.**
241
+ ---
242
+
243
+ ### Agent Teams (Evaluate per stage)
244
+
245
+ **You MUST evaluate team suitability for EACH workflow stage and print your decision in the output format.**
246
+
247
+ Evaluate each stage independently — a task may use single agents for some stages and teams for others.
248
+
249
+ **Use team for a stage when:**
250
+ - Multiple perspectives improve quality
251
+ - Competing approaches find better solutions
252
+ - Stage work splits into independent file groups
253
+
254
+ **Use single agent for a stage when:**
255
+ - Work touches the same files
256
+ - Stage is a single focused operation
257
+ - Adding perspectives adds no value
258
+
259
+ **Team Enforcement (MANDATORY):**
260
+ If `TEAMS:` output includes any stage using teams, you MUST call `TeamCreate` before spawning agents for that stage. Spawning agents via `Task` without `team_name` does NOT count as using teams. Violation = workflow non-compliance.
261
+
262
+ **When creating a team:**
263
+
264
+ ```
265
+ Create agent team with [N] teammates, all using Opus model:
266
+ - [role-1]: [Specific responsibility and task details]
267
+ - [role-2]: [Specific responsibility and task details]
268
+ - [role-3]: [Specific responsibility and task details]
269
+ ...
270
+
271
+ Spawn each teammate with detailed prompt including:
272
+ - Their specific role and responsibilities
273
+ - The task details
274
+ - How to coordinate with other teammates
275
+ ```
276
+
277
+ **Guidelines:**
278
+ - Use 2-10 teammates per stage
279
+ - Always specify Opus model for all teammates
280
+ - Assign distinct, non-overlapping scopes to each teammate
281
+ - Include full instructions in spawn prompts (don't reference external files)
282
+ - One team at a time - dissolve before next stage
283
+ - Assign 5-6 tasks per teammate
284
+
285
+ ---
286
+ ## FOR TEAMMATES ONLY
287
+ **If you are the ORCHESTRATOR, skip this section.**
288
+ ---
289
+
290
+ ### Teammate Instructions
291
+
292
+ **Ignore orchestration workflows above.**
293
+
294
+ 1. Your spawn prompt contains your full instructions
295
+ 2. Message teammates directly to coordinate
296
+ 3. Focus only on your assigned scope
297
+ 4. Complete your work, let team dissolve
298
+
299
+ ---
300
+
301
+ ### Large Task Protocol
302
+
303
+ For tasks with 5+ requirements:
304
+
305
+ 1. **Save requirements** to `.claude/.tasks/{short-topic}.md` before starting any agent (create `.claude/.tasks/` directory if it doesn't exist)
306
+ 2. **Each session:** pass the exact file path (e.g., `.claude/.tasks/auth-system.md`) to architect and product-manager
307
+ 3. **After each batch:** `/clear` and continue — tell user which task file to reference
308
+ 4. **Done when:** product-manager confirms zero remaining and deletes the task file
309
+
310
+ Rules:
311
+ - ALWAYS pass the exact `.claude/.tasks/` file path when calling architect and product-manager agents
312
+ - Architect and product-manager will read ONLY the specified file — never guess the filename
313
+ - Add `.claude/.tasks/` to `.gitignore`
314
+
315
+ ### Output Format and Continuation
316
+
317
+ **CRITICAL: Copy the EXACT flow from the Agent Flows section above. Include ALL agents, including optional ones in `[brackets]`. Do NOT abbreviate or skip agents.**
318
+
319
+ Output the analysis in this format:
320
+
321
+ ```
322
+ TASK TYPE: [flutter/backend/design/metadata/database/infra/standard]
323
+
324
+ RECOMMENDED FLOW:
325
+ <copy the EXACT flow from Agent Flows section - include ALL agents with [optional] ones>
326
+
327
+ TEAMS: [per-stage evaluation: which stages use teams and why, or NO if all stages use single agents]
328
+
329
+ DEPLOYMENT: [AVAILABLE - deployment configured | NOT CONFIGURED - workflow ends at product-manager(POST)]
330
+
331
+ TASK TRACKING: ALWAYS use TaskCreate/TaskUpdate/TaskList tools for multi-step tasks (3+ steps)
332
+
333
+ NOTES:
334
+ - [any special considerations]
335
+
336
+ LAUNCHING: [first-agent-name]
337
+ ```
338
+
339
+ **Expected RECOMMENDED FLOW outputs (copy exactly):**
340
+
341
+ - **flutter**: `architect → product-manager(PRE) → [app-designer] → developer(flutter) → simplifier → reviewer → tester(flutter) → tester(mobile-ui) → product-manager(POST) → [devops(codemagic)]`
342
+ - **backend**: `architect → product-manager(PRE) → developer(backend) → simplifier → reviewer → tester(backend) → product-manager(POST) → [devops(firebase)]`
343
+ - **design**: `app-designer → appstore-reviewer`
344
+ - **metadata**: `appstore-meta-creator → appstore-reviewer`
345
+ - **database**: `devops(database,migrate) → simplifier → reviewer → product-manager(POST) → [devops(firebase)]`
346
+ - **infra**: `devops (standalone)`
347
+ - **standard**: `architect → product-manager(PRE) → developer → simplifier → reviewer → tester → product-manager(POST) → [devops]`
348
+
349
+ **MANDATORY: After outputting the workflow analysis above, you MUST:**
350
+ 1. **Create tasks** using TaskCreate for each major step in the workflow (if 3+ steps)
351
+ 2. **Immediately invoke** the first agent using the Task tool in the same response
352
+
353
+ Do NOT stop. Do NOT wait for user confirmation. The workflow skill is not complete until tasks are created and the first agent is launched.
@@ -1,3 +1,7 @@
1
+ # === FLUTTER PROJECT ===
2
+ # Set to subdirectory if Flutter project is not at repo root (e.g., "app")
3
+ flutter_root: "."
4
+
1
5
  # === CREDENTIALS ===
2
6
  credentials:
3
7
  apple:
@@ -28,7 +32,7 @@ ios:
28
32
  # === ANDROID SETTINGS ===
29
33
  android:
30
34
  track: "internal"
31
- rollout_fraction: ""
35
+ rollout_fraction: "1.0"
32
36
  in_app_update_priority: 3
33
37
 
34
38
  # === METADATA LANGUAGES ===
@@ -49,3 +53,12 @@ web:
49
53
  jurisdiction: "State of California, United States"
50
54
  app_store_url: ""
51
55
  google_play_url: ""
56
+
57
+ # === CODEMAGIC CI/CD ===
58
+ # Fill after creating app in Codemagic (https://codemagic.io/apps)
59
+ # Find app_id in your Codemagic dashboard URL: codemagic.io/app/{app_id}
60
+ codemagic:
61
+ app_id: ""
62
+ workflows:
63
+ - ios-release
64
+ - android-release
@@ -2,7 +2,7 @@ workflows:
2
2
  ios-release:
3
3
  name: iOS Release
4
4
  max_build_duration: 90
5
- instance_type: mac_mini_m2
5
+ instance_type: mac_mini_m4
6
6
  environment:
7
7
  flutter: stable
8
8
  xcode: latest
@@ -46,6 +46,7 @@ workflows:
46
46
  fi
47
47
  echo "CERTIFICATE_PRIVATE_KEY<<DELIMITER" >> $CM_ENV
48
48
  cat "$KEY_FILE" >> $CM_ENV
49
+ echo "" >> $CM_ENV
49
50
  echo "DELIMITER" >> $CM_ENV
50
51
 
51
52
  - name: Set up App Store Connect API key
@@ -54,6 +55,7 @@ workflows:
54
55
  echo "APP_STORE_CONNECT_ISSUER_ID=$APPLE_ISSUER_ID" >> $CM_ENV
55
56
  echo "APP_STORE_CONNECT_PRIVATE_KEY<<KEYDELIMITER" >> $CM_ENV
56
57
  cat "$CM_BUILD_DIR/$P8_KEY_PATH" >> $CM_ENV
58
+ echo "" >> $CM_ENV
57
59
  echo "KEYDELIMITER" >> $CM_ENV
58
60
 
59
61
  - name: Set up iOS code signing
@@ -70,10 +72,10 @@ workflows:
70
72
  - name: Manage iOS version
71
73
  script: |
72
74
  pip3 install PyJWT cryptography requests
73
- VERSION_JSON=$(python3 scripts/manage_version_ios.py)
75
+ VERSION_JSON=$(python3 scripts/manage_version_ios.py 2>/dev/null || echo '{"version":"1.0.0","version_id":"","state":"NEW"}')
74
76
  APP_VERSION=$(echo "$VERSION_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['version'])")
75
- APP_VERSION_ID=$(echo "$VERSION_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['version_id'])")
76
- APP_STATUS=$(echo "$VERSION_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['state'])")
77
+ APP_VERSION_ID=$(echo "$VERSION_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin).get('version_id',''))")
78
+ APP_STATUS=$(echo "$VERSION_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin).get('state','NEW'))")
77
79
  echo "APP_VERSION=$APP_VERSION" >> $CM_ENV
78
80
  echo "APP_VERSION_ID=$APP_VERSION_ID" >> $CM_ENV
79
81
  echo "APP_STATUS=$APP_STATUS" >> $CM_ENV
@@ -82,6 +84,9 @@ workflows:
82
84
  - name: Set Flutter version
83
85
  script: |
84
86
  BUILD_NUMBER=$(($(app-store-connect get-latest-app-store-build-number "$BUNDLE_ID" 2>/dev/null || echo "0") + 1))
87
+ if [ -z "$APP_VERSION" ] || [ "$APP_VERSION" = "" ]; then
88
+ APP_VERSION="1.0.0"
89
+ fi
85
90
  sed -i '' "s/^version:.*/version: ${APP_VERSION}+${BUILD_NUMBER}/" pubspec.yaml
86
91
  echo "Building: $APP_VERSION+$BUILD_NUMBER"
87
92
 
@@ -128,7 +133,7 @@ workflows:
128
133
  android-release:
129
134
  name: Android Release
130
135
  max_build_duration: 60
131
- instance_type: mac_mini_m2
136
+ instance_type: mac_mini_m4
132
137
  environment:
133
138
  flutter: stable
134
139
  vars:
@@ -218,8 +223,9 @@ workflows:
218
223
  echo "APP_STORE_CONNECT_ISSUER_ID=$APPLE_ISSUER_ID" >> $CM_ENV
219
224
  echo "APP_STORE_CONNECT_PRIVATE_KEY<<KEYDELIMITER" >> $CM_ENV
220
225
  cat "$CM_BUILD_DIR/$P8_KEY_PATH" >> $CM_ENV
226
+ echo "" >> $CM_ENV
221
227
  echo "KEYDELIMITER" >> $CM_ENV
222
- VERSION_JSON=$(python3 scripts/manage_version_ios.py)
228
+ VERSION_JSON=$(python3 scripts/manage_version_ios.py 2>/dev/null || echo '{"version":"1.0.0","version_id":"","state":"NEW"}')
223
229
  APP_VERSION=$(echo "$VERSION_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['version'])")
224
230
  echo "APP_VERSION=$APP_VERSION" >> $CM_ENV
225
231
  if [ "$GOOGLE_PLAY_READY" != "true" ]; then
@@ -230,6 +236,9 @@ workflows:
230
236
  --tracks=production,beta,alpha,internal 2>/dev/null || echo "0")
231
237
  fi
232
238
  NEW_BUILD=$(($LATEST_BUILD + 1))
239
+ if [ -z "$APP_VERSION" ] || [ "$APP_VERSION" = "" ]; then
240
+ APP_VERSION="1.0.0"
241
+ fi
233
242
  sed -i '' "s/^version:.*/version: ${APP_VERSION}+${NEW_BUILD}/" pubspec.yaml
234
243
  echo "ANDROID_VERSION_CODE=$NEW_BUILD" >> $CM_ENV
235
244
  echo "Android versionCode: $NEW_BUILD, versionName: $APP_VERSION"