agentic-mobile-kit 0.7.5 → 0.7.6

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/lib/init.js CHANGED
@@ -111,7 +111,7 @@ function checkProject(cwd) {
111
111
  // a folder with nothing but these can get a new app: system and editor files, and the .git of an empty clone
112
112
  const EMPTY_OK = ['.git', '.DS_Store', 'Thumbs.db', '.vscode', '.idea'];
113
113
  const emptyFolder = cwd => fs.readdirSync(cwd).every(f => EMPTY_OK.includes(f));
114
- // the React Native CLI wants an identifier: a folder "full-tank-log" gives FullTankLog
114
+ // the React Native CLI wants an identifier: a folder "my-new-app" gives MyNewApp
115
115
  const appName = folder => {
116
116
  const n = (folder.match(/[A-Za-z0-9]+/g) || []).map(w => w[0].toUpperCase() + w.slice(1)).join('');
117
117
  return /^[A-Za-z]/.test(n) ? n : `App${n}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-mobile-kit",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "One setup for AI-assisted development of React Native apps, bare or Expo: shared rules and workflows for Claude Code, Codex and Antigravity, git hooks, device checks with screenshots, and release tooling for the App Store and Google Play.",
5
5
  "license": "MIT",
6
6
  "author": "prakashpro1",
@@ -14,4 +14,5 @@ Input: $ARGUMENTS (a problem, a question about how something works, or an idea t
14
14
  2. **Explain what's there today:** the screens, state, API calls and native parts involved, and where iOS and Android differ.
15
15
  3. **When there's a choice, lay out options:** two or three, each with its trade-offs (effort, risk, both platforms, native changes, store review, what it leaves unsolved). Say which one you'd pick and why. Diagrams help when the flow is complicated.
16
16
  4. **Change nothing.** Exploring never edits code, config or project files. Write notes only when the user asks: a draft in `specs/<id>/requirements.md` for `m-feature`, or a decision in `docs/amk/decisions.md`.
17
- 5. **Hand off when it's clear.** Suggest the next step: `m-feature <one-line summary>`, `m-change <one-line summary>` for a small change, `m-prototype <one-line summary>` when it needs a demo or a design before it's built, or `m-bugfix <one-line summary>`, carrying over what you found. If the idea turns out not to be worth doing, say so; learning that cheaply is a good outcome.
17
+ 5. **Confirm what's final, and write it down in one place.** When the exploration settled or changed what the app must do, ask the user whether these requirements are now final; don't assume it. Once they say yes, write them where the next workflow reads them, and tell the user the path: for the whole app, every feature with its rules in `docs/amk/product.md`, each marked planned until `m-feature` ships it; for one feature, a draft in `specs/<id>/requirements.md`. `decisions.md` logs choices and their reasons; it isn't the requirements document.
18
+ 6. **Hand off when it's clear.** Suggest the next step: `m-feature <one-line summary>`, `m-change <one-line summary>` for a small change, `m-prototype <one-line summary>` when it needs a demo or a design before it's built, or `m-bugfix <one-line summary>`, carrying over what you found. If the idea turns out not to be worth doing, say so; learning that cheaply is a good outcome.
@@ -10,6 +10,11 @@ The user chose this workflow: follow its steps for this task, even where other w
10
10
 
11
11
  Input: $ARGUMENTS (the requirement text, a file path, or a task link plus pasted details).
12
12
 
13
+ With no input, don't guess what to build:
14
+ 1. Run `node scripts/amk/specs.js status`. If a spec is in progress, say which one and where it stopped, and suggest `m-continue`. Start something new only if the user says so.
15
+ 2. Otherwise list the features marked planned in `docs/amk/product.md` and recommend the next one: the first in the list whose dependencies are built. Wait for the user to pick.
16
+ 3. If nothing is planned, ask what to build, or suggest `m-explore` when the requirements aren't settled yet.
17
+
13
18
  ## 1. Always use the full flow
14
19
 
15
20
  The user chose `m-feature`, so follow every step below, however small the change looks. Never skip the spec or the approval stops on your own judgment. (For a small change to behavior the app already has, suggest `m-change`. A change with nothing to record, such as fixing a typo, can just be asked for directly.)
@@ -57,7 +62,7 @@ When all tasks are done:
57
62
 
58
63
  Run `node scripts/amk/specs.js merge <id>`. It applies the ADDED, MODIFIED and REMOVED requirements to `specs/current/` and notes the source of each. If it refuses, the reason is usually that a requirement listed as ADDED already exists, or one listed as MODIFIED doesn't. Fix `requirements.md` and run it again. Commit `specs/current/` with the feature, so reviewers see the change in behavior.
59
64
 
60
- Then update the `docs/amk/` files the feature made untrue: a new key journey in `product.md`, a new library or service in `tech.md`, a new folder or shared component in `structure.md`, a new pattern in `conventions.md`. Commit them with the feature too.
65
+ Then update the `docs/amk/` files the feature made untrue: a new key journey in `product.md` or, for a planned feature there, its rules replaced by one line without the planned mark, a new library or service in `tech.md`, a new folder or shared component in `structure.md`, a new pattern in `conventions.md`. Commit them with the feature too.
61
66
 
62
67
  ## 7. Review and pull request
63
68
 
@@ -44,11 +44,12 @@ A prototype answers questions before the real build: what the client wants, how
44
44
 
45
45
  ## 5. Take in the feedback
46
46
 
47
- After the demo, write what was settled into `requirements.md`: answered questions become requirements and scenarios, and the choices go under `## Decisions`. If the client asked for changes, change the prototype and run step 4 again. Repeat until the user approves the requirements.
47
+ After the demo, write what was settled into `requirements.md`: answered questions become requirements and scenarios, and the choices go under `## Decisions`. If the client asked for changes, change the prototype and run step 4 again. Repeat until the user approves the requirements: **stop and ask for that approval**, and record it under `## Decisions` with the date. Step 6 doesn't start without it.
48
48
 
49
49
  ## 6. Hand off to m-feature
50
50
 
51
51
  1. Create the feature branch from the main branch and bring the spec over: `git checkout prototype/<id> -- specs/<id>`. Leave the prototype code behind.
52
52
  2. Add the decisions from `## Decisions` to `docs/amk/decisions.md`, with the date. Run `node scripts/amk/specs.js check specs/<id>/requirements.md`, and commit.
53
- 3. Suggest `m-feature specs/<id>/requirements.md`. In `design.md` it names the `prototype/<id>` branch as the agreed flow and look, and it builds the real screens properly: real data, error, loading and empty states, and tests, on both platforms.
54
- 4. Delete the `prototype/<id>` branch once the feature has shipped.
53
+ 3. If the prototype covered more than one feature, such as an app's first version, also write every feature with its rules in `docs/amk/product.md`, in the order to build them, each marked planned, and tell the user the path. `decisions.md` logs choices and their reasons; it isn't the requirements document.
54
+ 4. Suggest `m-feature specs/<id>/requirements.md`, or one `m-feature` per feature when there are several. In `design.md` it names the `prototype/<id>` branch as the agreed flow and look, and it builds the real screens properly: real data, error, loading and empty states, and tests, on both platforms.
55
+ 5. Delete the `prototype/<id>` branch once the feature has shipped.
@@ -4,4 +4,5 @@
4
4
  - What the app does.
5
5
  - Who uses it.
6
6
  - The key user journeys (sign-up, checkout, …).
7
- - Anything that must never break (payments, data sync, …). -->
7
+ - Anything that must never break (payments, data sync, …).
8
+ - Features that are planned but not built yet, in the order to build them, each marked planned, with its rules. When `m-feature` ships one, its rules move to `specs/current/` and one line stays here. -->
@@ -13,7 +13,8 @@
13
13
  # --scheme <name> iOS scheme to check (default: the one named like the workspace)
14
14
  # (no flows found: a smoke check that launches the app and takes a screenshot)
15
15
  # Env: AMK_ANDROID_FLAVOR, AMK_IOS_SCHEME (defaults for the two options), AMK_IOS_DEVICE (simulator name
16
- # or UDID), AMK_ANDROID_DEVICE (adb serial, when several are connected), AMK_ANDROID_AVD (emulator to start)
16
+ # or UDID), AMK_ANDROID_DEVICE (adb serial: the only way to check on a phone while an emulator exists),
17
+ # AMK_ANDROID_AVD (the emulator to use, started if it isn't running; other devices are left alone)
17
18
  # Flows that log in read ${MAESTRO_EMAIL} and the like from a local, gitignored .maestro/.env.local (never committed).
18
19
  set -eu
19
20
 
@@ -136,6 +137,13 @@ ios() {
136
137
  run_flows ios "$device" "$app_id"
137
138
  }
138
139
 
140
+ # a running emulator's adb serial, of the AVD named in $1 if one is
141
+ running_emulator() {
142
+ for d in $("$adb" devices | awk 'NR > 1 && $2 == "device" && /^emulator-/ { print $1 }'); do
143
+ if [ -z "$1" ] || [ "$("$adb" -s "$d" emu avd name 2> /dev/null | head -n 1 | tr -d '\r')" = "$1" ]; then echo "$d"; return; fi
144
+ done
145
+ }
146
+
139
147
  android() {
140
148
  command -v maestro > /dev/null || { echo "android: Maestro isn't installed (https://maestro.dev)"; status=1; return; }
141
149
  case $(uname -s) in # where Android Studio puts the SDK by default
@@ -162,15 +170,31 @@ android() {
162
170
  [ -z "$flavor" ] || echo "android: checking the \"$flavor\" flavor (the app has: $(echo $flavors)); --flavor <name> checks another"
163
171
  fi
164
172
  variant=$(printf %s "$flavor" | awk '{ print toupper(substr($0, 1, 1)) substr($0, 2) }')
165
- # the device first: the build only needs its CPU type, and an emulator boots while Gradle builds
166
- device=${AMK_ANDROID_DEVICE:-$("$adb" devices | awk 'NR > 1 && $2 == "device" { print $1; exit }')}
173
+ # the device first: the build only needs its CPU type, and an emulator boots while Gradle builds.
174
+ # The flows clear the app's data, so an emulator comes before a phone plugged in over USB: a phone is used
175
+ # only when AMK_ANDROID_DEVICE names it, or when there's no emulator at all
176
+ device=${AMK_ANDROID_DEVICE:-$(running_emulator "${AMK_ANDROID_AVD:-}")}
167
177
  if [ -z "$device" ]; then
168
- avd=${AMK_ANDROID_AVD:-$("$sdk/emulator/emulator" -list-avds | head -n 1)}
169
- [ -n "$avd" ] || { echo "android: no emulator found (create one in Android Studio)"; status=1; return; }
170
- nohup "$sdk/emulator/emulator" -avd "$avd" -no-snapshot-save -no-boot-anim > /dev/null 2>&1 &
171
- "$adb" wait-for-device
172
- device=$("$adb" devices | awk 'NR > 1 && $2 == "device" { print $1; exit }')
178
+ avds=$("$sdk/emulator/emulator" -list-avds 2> /dev/null || true)
179
+ avd=${AMK_ANDROID_AVD:-$(echo "$avds" | head -n 1)}
180
+ if [ -n "$avd" ]; then
181
+ echo "$avds" | grep -qxF "$avd" || { echo "android: there's no emulator named $avd (see: emulator -list-avds)"; status=1; return; }
182
+ nohup "$sdk/emulator/emulator" -avd "$avd" -no-snapshot-save -no-boot-anim > /dev/null 2>&1 &
183
+ tries=0
184
+ until device=$(running_emulator "$avd") && [ -n "$device" ]; do
185
+ tries=$((tries + 1))
186
+ [ "$tries" -le 150 ] || { echo "android: emulator $avd didn't start"; status=1; return; }
187
+ sleep 2
188
+ done
189
+ else
190
+ device=$("$adb" devices | awk 'NR > 1 && $2 == "device" { print $1; exit }')
191
+ [ -n "$device" ] || { echo "android: no emulator found (create one in Android Studio)"; status=1; return; }
192
+ fi
173
193
  fi
194
+ case $device in
195
+ emulator-*) echo "android: checking on $device" ;;
196
+ *) echo "android: checking on the phone $device; the flows clear the app's data on it" ;;
197
+ esac
174
198
  abi=$("$adb" -s "$device" shell getprop ro.product.cpu.abi 2> /dev/null | tr -d '\r')
175
199
  [ -n "$abi" ] || { echo "android: device $device isn't connected (see: adb devices)"; status=1; return; }
176
200
  # native code for that CPU type only, as run-android --active-arch-only does: much faster than all four