agentic-mobile-kit 0.7.19 → 0.14.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.
- package/README.md +18 -3
- package/bin/cli.js +5 -3
- package/lib/doctor.js +31 -5
- package/lib/init.js +17 -22
- package/lib/menu.js +3 -3
- package/package.json +1 -1
- package/stacks/react-native/expo/.eas/workflows/pr-preview.yml +54 -0
- package/stacks/react-native/expo/AGENTS.md +30 -17
- package/stacks/react-native/expo/docs/amk/expo.md +11 -1
- package/stacks/react-native/template/.agents/skills/m-bugfix/SKILL.md +8 -5
- package/stacks/react-native/template/.agents/skills/m-change/SKILL.md +3 -2
- package/stacks/react-native/template/.agents/skills/m-continue/SKILL.md +6 -4
- package/stacks/react-native/template/.agents/skills/m-explore/SKILL.md +1 -1
- package/stacks/react-native/template/.agents/skills/m-feature/SKILL.md +29 -26
- package/stacks/react-native/template/.agents/skills/m-feature/build.md +35 -0
- package/stacks/react-native/template/.agents/skills/m-feature/plan.md +43 -0
- package/stacks/react-native/template/.agents/skills/m-learn/SKILL.md +3 -1
- package/stacks/react-native/template/.agents/skills/m-onboard/SKILL.md +3 -1
- package/stacks/react-native/template/.agents/skills/m-pause/SKILL.md +2 -0
- package/stacks/react-native/template/.agents/skills/m-prototype/SKILL.md +1 -1
- package/stacks/react-native/template/.agents/skills/m-release/SKILL.md +5 -4
- package/stacks/react-native/template/.agents/skills/m-report/SKILL.md +25 -0
- package/stacks/react-native/template/.agents/skills/m-review/SKILL.md +4 -3
- package/stacks/react-native/template/.agents/skills/m-test/SKILL.md +24 -0
- package/stacks/react-native/template/.agents/skills/m-test/agents/openai.yaml +3 -0
- package/stacks/react-native/template/.githooks/pre-commit +12 -0
- package/stacks/react-native/template/.github/pull_request_template.md +4 -0
- package/stacks/react-native/template/.github/workflows/amk-ai-deps.yml +90 -0
- package/stacks/react-native/template/.github/workflows/amk-ai-review.yml +82 -0
- package/stacks/react-native/template/.github/workflows/amk-kit-update.yml +95 -0
- package/stacks/react-native/template/.github/workflows/amk-ready.yml +39 -0
- package/stacks/react-native/template/.github/workflows/ci.yml +79 -13
- package/stacks/react-native/template/.github/workflows/e2e.yml +10 -1
- package/stacks/react-native/template/.rulesync/hooks.jsonc +3 -1
- package/stacks/react-native/template/.rulesync/subagents/m-device-checker.md +2 -1
- package/stacks/react-native/template/.rulesync/subagents/m-reviewer.md +4 -2
- package/stacks/react-native/template/.rulesync/subagents/m-spec-writer.md +15 -0
- package/stacks/react-native/template/.rulesync/subagents/m-tester.md +23 -0
- package/stacks/react-native/template/AGENTS.md +23 -10
- package/stacks/react-native/template/codemagic.yaml +82 -1
- package/stacks/react-native/template/docs/amk/codemagic.md +8 -0
- package/stacks/react-native/template/docs/amk/react-native.md +11 -1
- package/stacks/react-native/template/docs/amk/team-process.md +33 -1
- package/stacks/react-native/template/rulesync.jsonc +1 -1
- package/stacks/react-native/template/scripts/amk/ai-job.js +106 -0
- package/stacks/react-native/template/scripts/amk/autopilot.js +837 -0
- package/stacks/react-native/template/scripts/amk/baseline.js +19 -7
- package/stacks/react-native/template/scripts/amk/ci-scope.js +59 -0
- package/stacks/react-native/template/scripts/amk/coverage.js +111 -0
- package/stacks/react-native/template/scripts/amk/guard.js +42 -0
- package/stacks/react-native/template/scripts/amk/handoff-check.js +87 -14
- package/stacks/react-native/template/scripts/amk/issue.js +31 -0
- package/stacks/react-native/template/scripts/amk/metrics.js +164 -0
- package/stacks/react-native/template/scripts/amk/pr.js +244 -0
- package/stacks/react-native/template/scripts/amk/redact.js +57 -0
- package/stacks/react-native/template/scripts/amk/release-build.sh +14 -0
- package/stacks/react-native/template/scripts/amk/report.js +48 -11
- package/stacks/react-native/template/scripts/amk/rn-check.js +195 -47
- package/stacks/react-native/template/scripts/amk/shots.js +131 -0
- package/stacks/react-native/template/scripts/amk/specs.js +717 -34
- package/stacks/react-native/template/scripts/amk/tool-configs.js +41 -0
- package/stacks/react-native/template/scripts/amk/verify.sh +127 -23
- package/stacks/react-native/template/specs/_templates/design.md +22 -0
- package/stacks/react-native/template/specs/_templates/flow.yaml +2 -1
- package/stacks/react-native/template/specs/_templates/plan.md +54 -0
- package/stacks/react-native/template/specs/_templates/progress.md +1 -1
- package/stacks/react-native/template/specs/_templates/requirements.md +40 -0
- package/stacks/react-native/template/specs/_templates/test-report.md +25 -0
- package/stacks/react-native/template/.github/workflows/ios.yml +0 -41
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# agentic-mobile-kit: the kit's next version as a pull request, once a week (added with --ci github). One job runs the
|
|
2
|
+
# latest kit's sync with read-only rights and no secrets, and keeps the change it makes as a patch; the other, which runs
|
|
3
|
+
# no code from npm, puts the patch on a branch of its own, amk/kit-<version>, and opens the pull request with what sync
|
|
4
|
+
# said: the files it updated or merged, and any it couldn't merge (their .mine copy holds your version). It never
|
|
5
|
+
# merges and never rewrites a branch: a version that has its branch already is skipped, so a person's fixes there stay.
|
|
6
|
+
# With the AI jobs' GitHub App (AMK_APP_CLIENT_ID variable, AMK_APP_PRIVATE_KEY secret), the pull request gets CI like
|
|
7
|
+
# any other; with the workflow's own token it gets none (GitHub's rule: push an empty commit to start it), and the
|
|
8
|
+
# repository must let GitHub Actions create pull requests (Settings > Actions > General).
|
|
9
|
+
name: amk-kit-update
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
schedule:
|
|
13
|
+
- cron: '0 6 * * 1' # Mondays, 06:00 UTC
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
sync:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
outputs:
|
|
23
|
+
version: ${{ steps.sync.outputs.version }}
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
26
|
+
with:
|
|
27
|
+
persist-credentials: false
|
|
28
|
+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
29
|
+
with:
|
|
30
|
+
node-version: 24
|
|
31
|
+
- id: sync
|
|
32
|
+
run: |
|
|
33
|
+
before=$(grep -o 'agentic-mobile-kit [0-9.]*' AGENTS.md | head -1 | cut -d' ' -f2)
|
|
34
|
+
npx -y agentic-mobile-kit@latest sync < /dev/null > "$RUNNER_TEMP/sync.txt" 2>&1 || true
|
|
35
|
+
cat "$RUNNER_TEMP/sync.txt"
|
|
36
|
+
version=$(grep -o 'agentic-mobile-kit [0-9.]*' AGENTS.md | head -1 | cut -d' ' -f2)
|
|
37
|
+
git add -A
|
|
38
|
+
if [ "$version" = "$before" ] || git diff --cached --quiet; then echo "kit $before is the latest: nothing to do"; exit 0; fi
|
|
39
|
+
mkdir -p "$RUNNER_TEMP/kit"
|
|
40
|
+
git diff --cached --binary > "$RUNNER_TEMP/kit/kit.patch"
|
|
41
|
+
cp "$RUNNER_TEMP/sync.txt" "$RUNNER_TEMP/kit/sync.txt"
|
|
42
|
+
echo "$before" > "$RUNNER_TEMP/kit/before"
|
|
43
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
44
|
+
- if: steps.sync.outputs.version != ''
|
|
45
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
46
|
+
with:
|
|
47
|
+
name: kit-update
|
|
48
|
+
path: ${{ runner.temp }}/kit
|
|
49
|
+
retention-days: 7
|
|
50
|
+
|
|
51
|
+
pull-request:
|
|
52
|
+
needs: sync
|
|
53
|
+
if: needs.sync.outputs.version != ''
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
permissions:
|
|
56
|
+
contents: write
|
|
57
|
+
pull-requests: write
|
|
58
|
+
env:
|
|
59
|
+
VERSION: ${{ needs.sync.outputs.version }}
|
|
60
|
+
BASE: ${{ github.event.repository.default_branch }}
|
|
61
|
+
steps:
|
|
62
|
+
- id: app
|
|
63
|
+
if: vars.AMK_APP_CLIENT_ID != ''
|
|
64
|
+
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
|
|
65
|
+
with:
|
|
66
|
+
client-id: ${{ vars.AMK_APP_CLIENT_ID }}
|
|
67
|
+
private-key: ${{ secrets.AMK_APP_PRIVATE_KEY }}
|
|
68
|
+
permission-contents: write
|
|
69
|
+
permission-pull-requests: write
|
|
70
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
71
|
+
with:
|
|
72
|
+
token: ${{ steps.app.outputs.token || github.token }}
|
|
73
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
74
|
+
with:
|
|
75
|
+
name: kit-update
|
|
76
|
+
path: ${{ runner.temp }}/kit
|
|
77
|
+
- env:
|
|
78
|
+
GH_TOKEN: ${{ steps.app.outputs.token || github.token }}
|
|
79
|
+
run: |
|
|
80
|
+
branch="amk/kit-$VERSION"
|
|
81
|
+
if git ls-remote --exit-code --heads origin "$branch" > /dev/null; then echo "$branch is there already: its pull request has this version"; exit 0; fi
|
|
82
|
+
git switch -c "$branch"
|
|
83
|
+
git apply --index "$RUNNER_TEMP/kit/kit.patch"
|
|
84
|
+
git -c user.name='github-actions[bot]' -c user.email='41898282+github-actions[bot]@users.noreply.github.com' commit -qm "chore: update agentic-mobile-kit to $VERSION"
|
|
85
|
+
git push origin "$branch"
|
|
86
|
+
{
|
|
87
|
+
echo "The kit's update from $(cat "$RUNNER_TEMP/kit/before") to $VERSION, as \`npx agentic-mobile-kit@latest sync\` makes it. What changes: https://github.com/prakashpro3/agentic-mobile-kit/releases/tag/v$VERSION"
|
|
88
|
+
echo
|
|
89
|
+
echo "A file listed as not merged has the kit's version in place and yours beside it, as <file>.mine: bring your changes back, then delete the .mine copy. Review it like any change; it merges only when a person merges it."
|
|
90
|
+
echo
|
|
91
|
+
echo '```'
|
|
92
|
+
tail -n 60 "$RUNNER_TEMP/kit/sync.txt"
|
|
93
|
+
echo '```'
|
|
94
|
+
} > "$RUNNER_TEMP/body.md"
|
|
95
|
+
gh pr create --base "$BASE" --head "$branch" --title "Update agentic-mobile-kit to $VERSION" --body-file "$RUNNER_TEMP/body.md"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# agentic-mobile-kit, for a developer who works alone (Reviewers: solo in docs/amk/team-process.md): GitHub doesn't let
|
|
2
|
+
# you approve your own pull request, so once you've reviewed one, add the "amk-ready" label. That turns on auto-merge,
|
|
3
|
+
# and it merges as soon as its checks pass. A new commit takes the label off, and auto-merge with it, so nothing you
|
|
4
|
+
# haven't seen merges. AI tools never add or remove the label (the kit's guard refuses it).
|
|
5
|
+
# It runs on the label and on new commits only, never runs the pull request's code (it checks out the base branch, for
|
|
6
|
+
# the kit's script), and works for pull requests from this repository only.
|
|
7
|
+
name: amk-ready
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
pull_request_target:
|
|
11
|
+
types: [labeled, synchronize]
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: amk-ready-${{ github.event.pull_request.number }}
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write # auto-merge, once the checks pass
|
|
18
|
+
pull-requests: write
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
label:
|
|
22
|
+
if: github.event.pull_request.head.repo.full_name == github.repository
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
env:
|
|
25
|
+
GH_TOKEN: ${{ github.token }}
|
|
26
|
+
PR: ${{ github.event.pull_request.html_url }}
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
29
|
+
with:
|
|
30
|
+
ref: ${{ github.event.pull_request.base.sha }} # the base branch's scripts, never the pull request's
|
|
31
|
+
- name: The label turns auto-merge on
|
|
32
|
+
if: github.event.action == 'labeled' && github.event.label.name == 'amk-ready'
|
|
33
|
+
run: gh pr merge "$PR" --auto --"$(node scripts/amk/pr.js method)"
|
|
34
|
+
- name: A new commit takes the label off, and auto-merge with it
|
|
35
|
+
if: github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'amk-ready')
|
|
36
|
+
run: |
|
|
37
|
+
gh pr edit "$PR" --remove-label amk-ready
|
|
38
|
+
gh pr merge "$PR" --disable-auto || true
|
|
39
|
+
gh pr comment "$PR" --body "A new commit came in after the amk-ready label, so auto-merge is off and the label is removed. Review the new commit, then add the label again."
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
# agentic-mobile-kit CI: checks every PR, whichever person or AI tool wrote it.
|
|
1
|
+
# agentic-mobile-kit CI: checks every PR, whichever person or AI tool wrote it, by what it changes (scripts/amk/ci-scope.js):
|
|
2
|
+
# only specs or docs skip the tests and builds; native files (and an Expo app's config, config plugins and native
|
|
3
|
+
# dependencies) add the iOS build; anything else runs the tests and the Android build. The "checks" job sums them up:
|
|
4
|
+
# it's the one to require in branch protection. A job skipped because the change doesn't call for it counts as passed,
|
|
5
|
+
# so a protection that also requires "android", as older setups do, keeps working.
|
|
2
6
|
name: ci
|
|
3
7
|
|
|
4
8
|
on:
|
|
@@ -15,7 +19,22 @@ permissions:
|
|
|
15
19
|
contents: read
|
|
16
20
|
|
|
17
21
|
jobs:
|
|
18
|
-
|
|
22
|
+
scope:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
outputs:
|
|
25
|
+
code: ${{ steps.scope.outputs.code }}
|
|
26
|
+
native: ${{ steps.scope.outputs.native }}
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0 # the base, to see what changed
|
|
31
|
+
- id: scope
|
|
32
|
+
env:
|
|
33
|
+
BASE: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event.before }}
|
|
34
|
+
run: node scripts/amk/ci-scope.js "$BASE" >> "$GITHUB_OUTPUT"
|
|
35
|
+
|
|
36
|
+
# on every change, docs too
|
|
37
|
+
basics:
|
|
19
38
|
runs-on: ubuntu-latest
|
|
20
39
|
steps:
|
|
21
40
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
@@ -24,18 +43,9 @@ jobs:
|
|
|
24
43
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
25
44
|
with:
|
|
26
45
|
node-version: 24
|
|
27
|
-
-
|
|
28
|
-
# each passes when the app's script passes, or when all its failures were already on the base branch
|
|
29
|
-
- name: Lint, typecheck and tests
|
|
30
|
-
env:
|
|
31
|
-
AMK_BASE: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event.before }}
|
|
32
|
-
run: |
|
|
33
|
-
node scripts/amk/baseline.js lint
|
|
34
|
-
node scripts/amk/baseline.js typecheck
|
|
35
|
-
node scripts/amk/baseline.js test
|
|
36
|
-
- name: Tool configs match .rulesync/ (run "npx -y rulesync@27.0.0 generate" and commit if this fails)
|
|
46
|
+
- name: Tool configs match .rulesync/ (run "npx -y rulesync@27.0.0 generate && node scripts/amk/tool-configs.js" and commit if this fails)
|
|
37
47
|
if: hashFiles('rulesync.jsonc') != ''
|
|
38
|
-
run: npx -y rulesync@27.0.0 generate > /dev/null && git diff --exit-code -- .claude .codex .agents .antigravity
|
|
48
|
+
run: npx -y rulesync@27.0.0 generate > /dev/null && node scripts/amk/tool-configs.js && git diff --exit-code -- .claude .codex .agents .antigravity
|
|
39
49
|
- name: Secret scan
|
|
40
50
|
run: docker run --rm -v "$PWD:/repo" ghcr.io/gitleaks/gitleaks:v8.30.1 git /repo --no-banner --redact
|
|
41
51
|
- name: PR size (max 600 changed lines; label "large-pr" to override)
|
|
@@ -45,7 +55,33 @@ jobs:
|
|
|
45
55
|
echo "$lines changed lines"
|
|
46
56
|
[ "$lines" -le 600 ] || { echo "This PR changes more than 600 lines. Split it, or add the 'large-pr' label."; exit 1; }
|
|
47
57
|
|
|
58
|
+
tests:
|
|
59
|
+
needs: scope
|
|
60
|
+
if: needs.scope.outputs.code == 'true'
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
64
|
+
with:
|
|
65
|
+
fetch-depth: 0 # the base, to compare failures with
|
|
66
|
+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
67
|
+
with:
|
|
68
|
+
node-version: 24
|
|
69
|
+
- run: sh scripts/amk/install-deps.sh
|
|
70
|
+
# each passes when the app's script passes, or when all its failures were already on the base branch
|
|
71
|
+
- name: Lint, typecheck and tests
|
|
72
|
+
env:
|
|
73
|
+
AMK_BASE: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event.before }}
|
|
74
|
+
run: |
|
|
75
|
+
node scripts/amk/baseline.js lint
|
|
76
|
+
node scripts/amk/baseline.js typecheck
|
|
77
|
+
node scripts/amk/baseline.js test
|
|
78
|
+
- name: Coverage floors (.amk-coverage; tests deleted or weakened fail it)
|
|
79
|
+
if: hashFiles('.amk-coverage') != ''
|
|
80
|
+
run: node scripts/amk/coverage.js check
|
|
81
|
+
|
|
48
82
|
android:
|
|
83
|
+
needs: scope
|
|
84
|
+
if: needs.scope.outputs.code == 'true'
|
|
49
85
|
runs-on: ubuntu-latest
|
|
50
86
|
steps:
|
|
51
87
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
@@ -64,3 +100,33 @@ jobs:
|
|
|
64
100
|
- name: Build debug APK
|
|
65
101
|
working-directory: android
|
|
66
102
|
run: ./gradlew assembleDebug --no-daemon
|
|
103
|
+
|
|
104
|
+
# macOS runners cost several times more than Linux, so only when native code, dependencies or the app config change
|
|
105
|
+
ios:
|
|
106
|
+
needs: scope
|
|
107
|
+
if: needs.scope.outputs.native == 'true'
|
|
108
|
+
runs-on: macos-latest
|
|
109
|
+
steps:
|
|
110
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
111
|
+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
112
|
+
with:
|
|
113
|
+
node-version: 24
|
|
114
|
+
- run: sh scripts/amk/install-deps.sh
|
|
115
|
+
- name: Generate the native project (Expo apps without ios/ in git)
|
|
116
|
+
run: sh scripts/amk/prebuild.sh ios
|
|
117
|
+
- name: Install pods
|
|
118
|
+
run: sh scripts/amk/pod-install.sh
|
|
119
|
+
- name: Build for the simulator (no signing)
|
|
120
|
+
run: sh scripts/amk/ios-build.sh
|
|
121
|
+
|
|
122
|
+
# the one required check: every job this change calls for passed
|
|
123
|
+
checks:
|
|
124
|
+
needs: [scope, basics, tests, android, ios]
|
|
125
|
+
if: always()
|
|
126
|
+
runs-on: ubuntu-latest
|
|
127
|
+
steps:
|
|
128
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
129
|
+
- name: Every job this change calls for passed
|
|
130
|
+
env:
|
|
131
|
+
NEEDS: ${{ toJSON(needs) }}
|
|
132
|
+
run: node scripts/amk/ci-scope.js verdict
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# agentic-mobile-kit end-to-end check: runs the Maestro flows in .maestro/ on an Android emulator
|
|
2
2
|
# with a release build, the same way `sh scripts/amk/verify.sh android` does locally.
|
|
3
|
-
# Runs nightly, on demand, and on pull requests labelled "e2e". Screenshots are uploaded as an artifact.
|
|
3
|
+
# Runs nightly, on demand, and on pull requests labelled "e2e". Screenshots are uploaded as an artifact. A nightly run's
|
|
4
|
+
# flows that fail twice (a flow that fails runs once more) open an issue, or a comment on the one still open.
|
|
4
5
|
name: e2e
|
|
5
6
|
|
|
6
7
|
on:
|
|
@@ -26,6 +27,9 @@ jobs:
|
|
|
26
27
|
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'e2e')
|
|
27
28
|
runs-on: ubuntu-latest
|
|
28
29
|
timeout-minutes: 45
|
|
30
|
+
permissions:
|
|
31
|
+
contents: read
|
|
32
|
+
issues: write # the nightly run's issue, when flows fail twice
|
|
29
33
|
steps:
|
|
30
34
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
31
35
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
@@ -68,6 +72,11 @@ jobs:
|
|
|
68
72
|
- name: Summary (each flow's result, from verify.sh's report)
|
|
69
73
|
if: always()
|
|
70
74
|
run: if [ -d .amk/evidence/ci ]; then node scripts/amk/report.js .amk/evidence/ci --summary >> "$GITHUB_STEP_SUMMARY"; fi
|
|
75
|
+
- name: An issue for the flows that failed twice (nightly; a comment when it's open already)
|
|
76
|
+
if: failure() && github.event_name == 'schedule'
|
|
77
|
+
env:
|
|
78
|
+
GH_TOKEN: ${{ github.token }}
|
|
79
|
+
run: node scripts/amk/report.js .amk/evidence/ci --issue "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
71
80
|
- name: Upload screenshots and logs
|
|
72
81
|
if: always()
|
|
73
82
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
// isn't found there, which turns the guard off (or, in Antigravity, blocks every command). No shell variables,
|
|
7
7
|
// so it also runs in PowerShell. No matcher: runs for every tool call; guard.js decides from the payload
|
|
8
8
|
"preToolUse": [{ "command": "node -e \"require(require('child_process').execSync('git rev-parse --show-toplevel').toString().trim() + '/scripts/amk/guard.js')\"" }],
|
|
9
|
-
"stop": [{ "command": "node -e \"require(require('child_process').execSync('git rev-parse --show-toplevel').toString().trim() + '/scripts/amk/handoff-check.js')\"" }]
|
|
9
|
+
"stop": [{ "command": "node -e \"require(require('child_process').execSync('git rev-parse --show-toplevel').toString().trim() + '/scripts/amk/handoff-check.js')\"" }],
|
|
10
|
+
// after a compaction (Claude Code, and Codex where it calls it), the spec's handoff, next task and definition of done
|
|
11
|
+
"sessionStart": [{ "matcher": "compact", "command": "node -e \"require(require('child_process').execSync('git rev-parse --show-toplevel').toString().trim() + '/scripts/amk/handoff-check.js')\"" }]
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -10,9 +10,10 @@ You check the app on one device with fresh eyes, and hand the evidence back. You
|
|
|
10
10
|
|
|
11
11
|
1. Run the one command you were given exactly as it is, for example `sh scripts/amk/verify.sh ios --no-build --screens tablet --spec <id>`: no pipes, redirects or other commands added. Its output is short, and the plain command is the one people allow, so you don't wait on a permission prompt while the other checkers run. It installs the build that's there, runs the feature's Maestro flows on that device's screens (upright and turned), and saves screenshots in `.amk/evidence/<id>/<screen>/`. A command with `--part k/n` runs only its share of the flows, on a device of its own (a temporary copy for the parts after the first, deleted afterwards), and saves them in `.amk/evidence/<id>/<screen>/part-k/`. Don't build, and don't run anything else on a device: other checkers are using the other devices. A check takes several minutes, up to about 15 when a flow has to run again: give the command a timeout that long, or run it in the background and wait for it to end, never stopping it early.
|
|
12
12
|
2. If a flow failed, the output says at which step and what Maestro said, and shows the screen then (`report.md` in the evidence folder has it too); read its log and Maestro's own log for more, and say why, and whether the app or the flow is wrong: on a turned screen, a flow often checks or taps something further down without scrolling to it first. Don't fix anything.
|
|
13
|
-
3. On Android screens, the output may list accessibility warnings from the screens' view trees (controls without a label, tap areas under 48 dp; `report.md` says which screenshot): report them as they are, they don't fail the check. Open every screenshot in your screens' folders and check each against its scenario in `specs/<id>/requirements.md
|
|
13
|
+
3. On Android screens, the output may list accessibility warnings from the screens' view trees (controls without a label, tap areas under 48 dp; `report.md` says which screenshot): report them as they are, they don't fail the check. Open every screenshot in your screens' folders and check each against its scenario in `specs/<id>/requirements.md` (without a spec, the flow's `# Scenario` comments and `specs/current/`), and against the screen rules in the React Native rules file that `AGENTS.md` names: the right content, nothing cut off or covered, a layout made for that screen. A turned screen's screenshots are landscape; a portrait one means the app didn't turn.
|
|
14
14
|
4. Report, and say only what you saw in this run:
|
|
15
15
|
- the command, and its last lines of output;
|
|
16
16
|
- per screen: flows passed out of total, and the evidence folder;
|
|
17
17
|
- per screenshot: its path, and "matches" or the problem;
|
|
18
|
+
- per scenario: passed, failed, flaky (passed only when run again), blocked (and why) or not run, the words `m-tester` uses;
|
|
18
19
|
- anything you couldn't check, and why.
|
|
@@ -9,7 +9,9 @@ claudecode:
|
|
|
9
9
|
You review code changes with fresh eyes. You never edit files. Use the shell only for read-only commands such as `git diff`, `git log`, `git show`, `node scripts/amk/baseline.js base` and `node scripts/amk/rn-check.js`.
|
|
10
10
|
|
|
11
11
|
1. Get the changes since the base branch the kit's checks use: `node scripts/amk/baseline.js base` prints it, then `git diff <base>...HEAD`. If a spec exists in `specs/<id>/`, read its `requirements.md`. Run `node scripts/amk/rn-check.js`: what it reports is a finding, and each `// amk-ok: <reason>` it lists needs a reason that holds.
|
|
12
|
-
2. Check scope, tests (added, deleted, weakened), iOS vs Android differences, the design system (`docs/amk/design-system.md`: no colours, sizes or controls outside it), forms (labels, keyboard and autofill, errors under fields, no double submit), nothing invented on screens (figures, ratings, placeholder names), screens (the keyboard covering a field or button, content under the system bars, lists that don't scroll, text cut off at large sizes), tablets and landscape for the screens AGENTS.md lists (layouts that adapt to the window width, turned screens that scroll), accessibility (labels and roles, state on checkboxes, switches and tabs, contrast, text sizes, messages announced to screen readers), platform guidelines (44/48 tap areas, back gestures and the back button, permissions asked in context, native controls, dark mode, Reduce Motion), store review (account deletion, Sign in with Apple next to a social login, in-app purchase for digital goods, permission texts, restricted Android permissions), TypeScript (new `any` or `@ts-ignore`, a loosened tsconfig), removed or deprecated React Native APIs, errors (an error boundary, no empty `catch`, failed actions shown), error and empty states, effects that don't clean up, secrets and tokens in plain storage, native file changes, and performance.
|
|
12
|
+
2. Check first what `AGENTS.md`'s Review guidelines list, then the test assessment (the tests added for new logic, changed for modified requirements and retired for removed ones, as the PR or `specs/<id>/test-report.md` lists them, and a report from this branch), scope, tests (added, deleted, weakened), iOS vs Android differences, the design system (`docs/amk/design-system.md`: no colours, sizes or controls outside it), forms (labels, keyboard and autofill, errors under fields, no double submit), nothing invented on screens (figures, ratings, placeholder names), screens (the keyboard covering a field or button, content under the system bars, lists that don't scroll, text cut off at large sizes), tablets and landscape for the screens AGENTS.md lists (layouts that adapt to the window width, turned screens that scroll), accessibility (labels and roles, state on checkboxes, switches and tabs, contrast, text sizes, messages announced to screen readers), platform guidelines (44/48 tap areas, back gestures and the back button, permissions asked in context, native controls, dark mode, Reduce Motion), store review (account deletion, Sign in with Apple next to a social login, in-app purchase for digital goods, permission texts, restricted Android permissions), TypeScript (new `any` or `@ts-ignore`, a loosened tsconfig), removed or deprecated React Native APIs, errors (an error boundary, no empty `catch`, failed actions shown), error and empty states, effects that don't clean up, secrets and tokens in plain storage, native file changes, and performance.
|
|
13
13
|
3. Confirm each finding in the code before reporting it.
|
|
14
14
|
4. Report each finding as: severity (blocker or should fix), file:line, the problem, and a suggested fix. No style nits.
|
|
15
|
-
5. End with "Ready for PR" or "Not ready: N blockers".
|
|
15
|
+
5. End with "Ready for PR" or "Not ready: N blockers". A check that couldn't run (no device here, a script the app doesn't have) is a note for the PR, not a blocker.
|
|
16
|
+
|
|
17
|
+
**A plan review**, when `m-feature plan` asks for one: no diff. Read `specs/plan.md` and the batch's specs against the rest of the plan and the living spec on main (`git show <main>:specs/current/<area>.md`). Report at most 10 findings, each naming the features involved and with its severity: contradictions between features (one lets guests check out, another needs a login), gaps (a feature needs data no feature creates), overlaps (two features build the same thing), and stories no requirement fulfils. End with "Plan ready" or "Not ready: N blockers".
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: m-spec-writer
|
|
3
|
+
targets: ["*"]
|
|
4
|
+
description: Drafts the detail of one planned feature (requirements, design with its tests, tasks) in a fresh context. Use when m-feature plan hands over a feature of a batch.
|
|
5
|
+
claudecode:
|
|
6
|
+
tools: ["Read", "Grep", "Glob", "Bash", "Write", "Edit"]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You draft the detail of one feature of the plan in `specs/plan.md`, on the `plan` branch, for the planning session to review with the user. Write only `requirements.md`, `design.md` and `tasks.md` in `specs/<id>/`: its status is the planning session's to set, in `specs/plan.md`, and `progress.md` stays as it is until the build. Never ask the user (nobody sees you; questions go in your report), never commit, and use the shell only for `git show`, `git grep`, `git log`, `node scripts/amk/baseline.js base` and `node scripts/amk/specs.js`.
|
|
10
|
+
|
|
11
|
+
1. **Read** the feature's row and the shared design in `specs/plan.md`; its stories and use cases in `specs/<id>/requirements.md` (approved: keep their meaning); the specs of the features it depends on; and `specs/_templates/`. Read the living spec, the docs (`glossary.md`, `design-system.md`, `structure.md`, `conventions.md`) and the code as they are on main: `node scripts/amk/baseline.js base` names it, then `git show <main>:<path>` and `git grep <text> <main>`. This branch's copies are old.
|
|
12
|
+
2. **Requirements** in `requirements.md`: under `## ADDED`, `## MODIFIED` (copied from the living spec on main, then edited) and `## REMOVED Requirements: <area>`, one SHALL each, scenarios with WHEN and THEN for the cases that matter, every edge-case line (or n/a), and what's out of scope. Name them in the stories' Requirements lines, and the scenarios in the use cases. Use the glossary's words and the plan's new words. Run `node scripts/amk/specs.js check specs/<id>/requirements.md` until it passes.
|
|
13
|
+
3. **Design** in `design.md`: the UI/UX level from the plan, the code on main to reuse, the approach, the files to change, the risks, and `## Tests`: run `node scripts/amk/specs.js tests <id>` and give each scenario its check, as `specs/_templates/design.md` says.
|
|
14
|
+
4. **Tasks** in `tasks.md`, as step 3.4 of `.agents/skills/m-feature/SKILL.md` says: about an hour each, thin slices, each naming its requirement, `after:` and check, its flow last.
|
|
15
|
+
5. **Report back**, in this order: the open questions, each with the answer you recommend and who can answer it (the user, or the client, a designer, the backend team); the assumptions you made; the risk (low, medium or high, and why); the size (the number of tasks); the story titles, with the counts of requirements and scenarios. A story that can't be met as approved is a question, not a change.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: m-tester
|
|
3
|
+
targets: ["*"]
|
|
4
|
+
description: Read-only tester. Use when m-test hands over a test run - gives each scenario a status from this run's evidence, lists the failures and coverage gaps, and ends with Ready or Not ready.
|
|
5
|
+
claudecode:
|
|
6
|
+
tools: ["Read", "Grep", "Glob", "Bash"]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You judge a test run with fresh eyes. You never edit files. Use the shell only for read-only commands: `git diff`, `git log`, `git show`, `node scripts/amk/baseline.js base` and `node scripts/amk/specs.js tests`, and `sh scripts/amk/verify.sh quick` only when this run's output of it is missing.
|
|
10
|
+
|
|
11
|
+
1. **This run's evidence only:** the evidence folder you're given (`.amk/evidence/<label>/`): `lint.log`, `typecheck.log`, `test.log` and `rn-check.log`, and from each device check `report.md` and `junit.xml`. Not a checker's summary. Run `node scripts/amk/specs.js tests <id>` (a release: `specs.js tests`) yourself.
|
|
12
|
+
2. **A status for each scenario** of the spec and of the areas it touches:
|
|
13
|
+
- passed: a Jest test named after it passed, or its flow block passed and the screenshot shows its THEN;
|
|
14
|
+
- passed (mock API): its flow passed in a run whose `report.md` says "API: mock", so the backend wasn't reached;
|
|
15
|
+
- failed;
|
|
16
|
+
- flaky: it passed only when run again;
|
|
17
|
+
- blocked: it couldn't run (no Mac, no test login, no device), and why;
|
|
18
|
+
- not run, and why;
|
|
19
|
+
- no check: nothing tests it.
|
|
20
|
+
3. **Each failure:** steps to reproduce (the flow up to the failing step, or the test), expected (the scenario's THEN), actual (Maestro's message and the screen when it failed, or the test's error), severity (blocker or should fix) and the evidence path.
|
|
21
|
+
4. **Coverage gaps:** scenarios with no check; logic the branch changed (`git diff <base>...HEAD`, the base from `baseline.js base`) without a test; requirements this change modifies or removes whose old tests weren't changed or retired; tests deleted, skipped or weakened (fewer assertions, a looser threshold); coverage under its floors.
|
|
22
|
+
5. **Tests to add:** for each gap, the positive, negative and boundary cases worth a test, each named after its scenario. The main session writes them.
|
|
23
|
+
6. **Verdict:** "Ready", or "Not ready: N blockers". A failure in what the change touches, failing code checks or coverage under its floors is a blocker; a flaky flow, an accessibility warning or a gap outside the change is should fix. A check that couldn't run (no device on this machine, a lint or typecheck script the app doesn't have) is blocked or not run, with its reason, and isn't a blocker on its own: the report and the PR say so. Nothing counts as passed without this run's evidence.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- KIT:START agentic-mobile-kit {{KIT_VERSION}} ci={{KIT_CI}} stack={{KIT_STACK}} (edit outside these markers; the kit updates what's inside) -->
|
|
2
2
|
# {{APP_NAME}}: instructions for AI agents
|
|
3
3
|
|
|
4
|
-
Read by Claude Code (through CLAUDE.md), Codex, Cursor, OpenCode, Kiro and Antigravity
|
|
4
|
+
Read by Claude Code (through CLAUDE.md), Codex, Cursor, OpenCode, Kiro and Antigravity; details live in `docs/amk/`.
|
|
5
5
|
|
|
6
6
|
This project may also use other AI workflow frameworks (for example Superpowers, BMAD or proAgents). They keep working for everything else. When the user starts a task with an `m-` skill (`/m-feature`, `$m-feature`, …), follow that skill's steps for the whole task; where another framework's instructions differ, the `m-` skill wins.
|
|
7
7
|
|
|
@@ -22,37 +22,50 @@ This project may also use other AI workflow frameworks (for example Superpowers,
|
|
|
22
22
|
| iOS pods (after native dependency changes) | `sh scripts/amk/pod-install.sh` |
|
|
23
23
|
| iOS build (simulator, no signing) | `sh scripts/amk/ios-build.sh` |
|
|
24
24
|
| Android build | `cd android && ./gradlew assembleDebug` |
|
|
25
|
-
| Check on devices (release builds, Maestro flows, screenshots) | `sh scripts/amk/verify.sh all --spec <id>`; with product flavors it checks the first unless `--flavor <name>`; another iOS scheme: `--scheme <name>`; only some screens: `--screens phone` (or `tablet`, `landscape`, …);
|
|
26
|
-
| Check devices at the same time | `sh scripts/amk/verify.sh plan --spec <id>`
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
25
|
+
| Check on devices (release builds, Maestro flows, screenshots) | `sh scripts/amk/verify.sh all --spec <id>`; with product flavors it checks the first unless `--flavor <name>`; another iOS scheme: `--scheme <name>`; only some screens: `--screens phone` (or `tablet`, `landscape`, …); smoke flows only: `--tags smoke`; with the app's mock API: `--mock`; on a real iPhone or iPad the user names: `AMK_IOS_DEVICE=<its UDID>` (the flows clear the app's data on it) |
|
|
26
|
+
| Check devices at the same time | `sh scripts/amk/verify.sh plan --spec <id>` prints a command per device, each for an `m-device-checker` subagent |
|
|
27
|
+
| After each task: lint, typecheck and the tests of the changed files | `sh scripts/amk/verify.sh quick --related` |
|
|
28
|
+
| React Native mistakes, flow problems and oversized files or functions in this branch's changes (`verify.sh quick` runs it) | `node scripts/amk/rn-check.js` |
|
|
29
|
+
| Specs and the plan: progress, checks, the tests of the areas a spec touches, flows, the living spec, planning | `node scripts/amk/specs.js status` (or `check`, `tests <id>`, `flow <id>`, `merge <id>`, `check --plan`, `plan-folder`, `import <file>`, `start [<id>]`) |
|
|
30
|
+
| Unattended (a person starts it; never skipping permission prompts): its PRs' review fixes, `amk-fix` bugs, then approved features | `node scripts/amk/autopilot.js [--reviews \| --bugs \| --features]`; first `node scripts/amk/autopilot.js check` |
|
|
31
|
+
| A feature's PR: checks (with a failure's log), review comments, auto-merge, main merged into stacked branches | `node scripts/amk/pr.js checks` (or `comments`, `automerge`, `forward`) |
|
|
32
|
+
| Check a release before tagging it (versions, store review rules, debug leftovers) | `node scripts/amk/release-check.js` |
|
|
30
33
|
| Signed release builds (a person runs them: they use the signing keys) | `sh scripts/amk/release-build.sh android [flavor]`, `sh scripts/amk/release-build.sh ios [scheme]` |
|
|
31
34
|
|
|
32
35
|
## Definition of done
|
|
33
36
|
|
|
34
37
|
A task is done only when:
|
|
35
38
|
1. `sh scripts/amk/verify.sh quick` passes (lint, typecheck, tests) and you show its output from this session. In an app whose base branch already fails some of them, it passes when your change adds no new failure, and lists the old ones: leave those alone unless the task is to fix them;
|
|
36
|
-
2. UI changes were checked with `sh scripts/amk/verify.sh all --spec <id>` on
|
|
39
|
+
2. UI changes were checked with `sh scripts/amk/verify.sh all --spec <id>` on iOS and Android, on each screen listed above, and you looked at the screenshots. Off a Mac it covers Android only: say in `progress.md` and the PR that iOS still needs a Mac, for a teammate to check before merging;
|
|
37
40
|
3. the change stays inside the task's scope;
|
|
38
|
-
4. `specs/<id>/progress.md` is updated, when working from a spec
|
|
41
|
+
4. `specs/<id>/progress.md` is updated, when working from a spec;
|
|
42
|
+
5. tests are assessed (added, changed or retired, or why none), the flows of the areas it touches ran, and what didn't run is listed with its reason, in `specs/<id>/test-report.md` (`m-test`).
|
|
39
43
|
|
|
40
44
|
Never say a check passed unless you ran it in this session.
|
|
41
45
|
|
|
42
46
|
## Rules
|
|
43
47
|
|
|
44
48
|
- Stay inside the task. Ask before touching unrelated files.
|
|
45
|
-
- Ask the user in rounds: every question you can ask now
|
|
49
|
+
- Ask the user in rounds: every question you can ask now, each with the answer you recommend. With a question tool (`AskUserQuestion`, `request_user_input`, `question`), give each 2 to 4 options, the recommended one first and marked "(Recommended)", multiple choice where several can apply; suggestions too. Without one, number them, each worded so "yes" takes it. An approval is always a question of its own, never part of a round. The answers can open the next round. Look facts up in the code yourself; ask only for decisions. A question only someone else can answer (the client, a designer, the backend team) goes into `specs/<id>/questions-<who>.md` for the user to send; go on with the rest.
|
|
46
50
|
- Before designing a feature's screens, ask the user which UI/UX level they want: Simple (the default), Mixed or Premium (`specs/_templates/design.md` describes each). Build them to it.
|
|
47
51
|
- Ask before adding or upgrading dependencies, and before editing `package.json`, lockfiles, `Podfile`, `build.gradle`, `Info.plist`, `AndroidManifest.xml` or `.github/workflows/`.
|
|
48
52
|
- Don't hand-edit `ios/*.xcodeproj/project.pbxproj`. If a native file must be added to the Xcode project, stop and ask.
|
|
49
53
|
- Never read, print or commit `.env` files, keystores, signing files or the files `.amk-secrets` lists. Secrets don't belong in this repo.
|
|
50
54
|
- Never use `git commit --no-verify`, `git push --force`, `git reset --hard` or `rm -rf`, and never throw away work that can't be brought back (uncommitted changes with `git checkout .` or `git restore .`, stashes with `git stash drop` or `clear`, unmerged commits with `git branch -D`): ask first. To undo your own edit to a file, `git checkout -- <that file>`.
|
|
51
|
-
- When `rn-check` (in `verify.sh quick`) reports a problem (✗), show it to the user and let them choose, for each one: fix it, or keep the line with `// amk-ok <today's date>: <their reason>`. Never add an `amk-ok
|
|
55
|
+
- When `rn-check` (in `verify.sh quick`) reports a problem (✗), show it to the user and let them choose, for each one: fix it, or keep the line with `// amk-ok <today's date>: <their reason>`. Never add an `amk-ok`, or a cap in `.amk-size-caps`, on your own. One kept over two weeks ago comes back when its file changes: ask again. Fix the warnings (!) in code the task changed, or tell the user why one stays.
|
|
56
|
+
- Run shell commands one at a time, as the skills write them, not joined with `&&` or `;`: a tool asks about a joined line, or refuses it, as a whole. When one is refused, run its parts on their own before deciding anything is blocked.
|
|
52
57
|
- After 2 failed attempts at the same fix, stop and report what you found.
|
|
53
58
|
- Chat is not memory: write decisions into the spec or `docs/amk/decisions.md` straight away.
|
|
54
59
|
- Follow `docs/amk/react-native.md`. Before fixing a build error, check `docs/amk/known-issues.md`.
|
|
55
60
|
|
|
61
|
+
## Review guidelines
|
|
62
|
+
|
|
63
|
+
Reviews, AI reviewers' too, check these first (more in `m-review`):
|
|
64
|
+
- No secrets or personal data in code, logs or analytics; tokens only in the Keychain or Keystore.
|
|
65
|
+
- Nothing lost: older saved data still loads, and typed input survives errors, going offline and a restart.
|
|
66
|
+
- The code does what its spec says, on both platforms and each screen listed above, and its tests changed with it.
|
|
67
|
+
<!-- This app's own, a line each. -->
|
|
68
|
+
|
|
56
69
|
## Skills
|
|
57
70
|
|
|
58
71
|
`react-native-best-practices`, `react-navigation`, `upgrading-react-native` (from Callstack, in `.agents/skills/`).
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Signed release builds on Codemagic (codemagic.io). One-time setup for each app: docs/amk/codemagic.md
|
|
2
|
-
# Both workflows start when a version tag is pushed (git push origin v1.2.0); you can also start them in Codemagic.
|
|
2
|
+
# Both release workflows start when a version tag is pushed (git push origin v1.2.0); you can also start them in Codemagic.
|
|
3
|
+
# The two test workflows give testers a build of main (Firebase App Distribution, TestFlight's internal testing): they
|
|
4
|
+
# start only from Codemagic until you turn on their triggering, below, for each merge to main (macOS minutes cost).
|
|
3
5
|
# Build numbers are set on the build machine only (one more than the store's latest), so the repo never needs a bump for them.
|
|
4
6
|
workflows:
|
|
5
7
|
android-release:
|
|
@@ -87,3 +89,82 @@ workflows:
|
|
|
87
89
|
app_store_connect:
|
|
88
90
|
auth: integration
|
|
89
91
|
submit_to_testflight: true
|
|
92
|
+
|
|
93
|
+
android-test:
|
|
94
|
+
name: Android test build (Firebase App Distribution)
|
|
95
|
+
instance_type: mac_mini_m2
|
|
96
|
+
max_build_duration: 60
|
|
97
|
+
# for a build of each merge to main, uncomment:
|
|
98
|
+
# triggering:
|
|
99
|
+
# events:
|
|
100
|
+
# - push
|
|
101
|
+
# branch_patterns:
|
|
102
|
+
# - pattern: main
|
|
103
|
+
# include: true
|
|
104
|
+
# source: true
|
|
105
|
+
# cancel_previous_builds: true
|
|
106
|
+
environment:
|
|
107
|
+
android_signing:
|
|
108
|
+
- upload_keystore
|
|
109
|
+
groups:
|
|
110
|
+
- firebase_credentials # FIREBASE_SERVICE_ACCOUNT: a service account with the Firebase App Distribution Admin role
|
|
111
|
+
node: 24
|
|
112
|
+
java: 17
|
|
113
|
+
scripts:
|
|
114
|
+
- name: Install dependencies
|
|
115
|
+
script: sh scripts/amk/install-deps.sh
|
|
116
|
+
- name: Build the signed APK
|
|
117
|
+
script: |
|
|
118
|
+
sh scripts/amk/prebuild.sh android # Expo apps without android/ in git
|
|
119
|
+
echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties
|
|
120
|
+
sed -i '' -E "s/versionCode( =)? [0-9]+/versionCode\1 $BUILD_NUMBER/" android/app/build.gradle*
|
|
121
|
+
cd android && ./gradlew assembleRelease \
|
|
122
|
+
-Pandroid.injected.signing.store.file="$CM_KEYSTORE_PATH" \
|
|
123
|
+
-Pandroid.injected.signing.store.password="$CM_KEYSTORE_PASSWORD" \
|
|
124
|
+
-Pandroid.injected.signing.key.alias="$CM_KEY_ALIAS" \
|
|
125
|
+
-Pandroid.injected.signing.key.password="$CM_KEY_PASSWORD"
|
|
126
|
+
artifacts:
|
|
127
|
+
- android/app/build/outputs/apk/release/*.apk
|
|
128
|
+
publishing:
|
|
129
|
+
firebase:
|
|
130
|
+
firebase_service_account: $FIREBASE_SERVICE_ACCOUNT
|
|
131
|
+
android:
|
|
132
|
+
app_id: 1:000000000000:android:0000000000000000 # Firebase console > Project settings > your Android app's App ID
|
|
133
|
+
groups:
|
|
134
|
+
- testers
|
|
135
|
+
artifact_type: apk
|
|
136
|
+
|
|
137
|
+
ios-test:
|
|
138
|
+
name: iOS test build (TestFlight, internal testing)
|
|
139
|
+
instance_type: mac_mini_m2
|
|
140
|
+
max_build_duration: 60
|
|
141
|
+
# for a build of each merge to main, uncomment the same triggering as android-test
|
|
142
|
+
integrations:
|
|
143
|
+
app_store_connect: codemagic
|
|
144
|
+
environment:
|
|
145
|
+
ios_signing:
|
|
146
|
+
distribution_type: app_store # Firebase for iOS takes ad_hoc builds instead, for registered devices only
|
|
147
|
+
bundle_identifier: {{IOS_BUNDLE_ID}}
|
|
148
|
+
vars:
|
|
149
|
+
APP_STORE_APPLE_ID: 0 # App Store Connect > the app > App Information > Apple ID
|
|
150
|
+
node: 24
|
|
151
|
+
xcode: latest
|
|
152
|
+
cocoapods: default
|
|
153
|
+
scripts:
|
|
154
|
+
- name: Install dependencies
|
|
155
|
+
script: sh scripts/amk/install-deps.sh && sh scripts/amk/prebuild.sh ios && sh scripts/amk/pod-install.sh
|
|
156
|
+
- name: Use the signing files, for internal testers only
|
|
157
|
+
script: |
|
|
158
|
+
xcode-project use-profiles --custom-export-options='{"testFlightInternalTestingOnly": true}'
|
|
159
|
+
- name: Build the signed ipa
|
|
160
|
+
script: |
|
|
161
|
+
if last=$(app-store-connect get-latest-build-number "$APP_STORE_APPLE_ID") && [ -n "$last" ]; then build=$((last + 1)); else build=$BUILD_NUMBER; fi
|
|
162
|
+
(cd ios && agvtool new-version -all "$build")
|
|
163
|
+
workspace=$(ls -d ios/*.xcworkspace | head -1)
|
|
164
|
+
xcode-project build-ipa --workspace "$workspace" --scheme "$(basename "$workspace" .xcworkspace)"
|
|
165
|
+
artifacts:
|
|
166
|
+
- build/ios/ipa/*.ipa
|
|
167
|
+
publishing:
|
|
168
|
+
app_store_connect:
|
|
169
|
+
auth: integration
|
|
170
|
+
submit_to_testflight: true
|
|
@@ -30,6 +30,14 @@ You need admin rights in the Codemagic team (or your personal account). Menus ar
|
|
|
30
30
|
|
|
31
31
|
Then start `android-release` by hand and check that the signed `.aab` appears in the build's artifacts. Do the same for `ios-release`.
|
|
32
32
|
|
|
33
|
+
## Test builds for testers
|
|
34
|
+
|
|
35
|
+
`android-test` builds a signed APK and sends it to Firebase App Distribution; `ios-test` builds a signed ipa for TestFlight's internal testing. They start only by hand until you uncomment their `triggering` (a build of each merge to `main`, which costs macOS minutes). Once, for Android:
|
|
36
|
+
1. In the Firebase console, add the Android app (its package name) if it isn't there, and copy its App ID (Project settings) into `app_id` in `codemagic.yaml`. Under App Distribution, make a group of testers named `testers`, or change `groups` to yours.
|
|
37
|
+
2. In Google Cloud, a service account with the **Firebase App Distribution Admin** role, its JSON key in a Codemagic variable `FIREBASE_SERVICE_ACCOUNT`, in a group named `firebase_credentials`, marked Secret.
|
|
38
|
+
|
|
39
|
+
iOS uses the same key and App Store profile as `ios-release`; the build reaches TestFlight's internal testers only. For Firebase on iOS instead, it needs an ad hoc profile with each tester's device registered: `distribution_type: ad_hoc`, and a `firebase: ios:` block beside Android's.
|
|
40
|
+
|
|
33
41
|
## Apps with more than one target
|
|
34
42
|
|
|
35
43
|
When one repo ships several apps (for example a main app and a kiosk app, or product flavors), copy the workflow once per app. In each copy, set the bundle ID, the scheme (iOS) and the Gradle task and package (Android).
|
|
@@ -28,7 +28,7 @@ Rules for things AI agents commonly get wrong in current React Native. Each one
|
|
|
28
28
|
|
|
29
29
|
## Tablets and landscape
|
|
30
30
|
|
|
31
|
-
`AGENTS.md` lists
|
|
31
|
+
`AGENTS.md` lists which screens this app supports, out of phones and tablets, portrait and landscape. Build every screen for each one it lists, and skip the others. `verify.sh` checks each one.
|
|
32
32
|
|
|
33
33
|
- One set of screens for every device: layouts adapt to the window. No separate tablet copies of screens, and no phone-width column centered on a tablet.
|
|
34
34
|
- Read the window size with `useWindowDimensions()`, which updates on rotation, split view and resizable windows. `Dimensions.get` read once at startup goes stale.
|
|
@@ -65,6 +65,7 @@ These changed after most AI training data was written: check them instead of wri
|
|
|
65
65
|
- Mock only what the app doesn't own: the network, storage, native modules, time and randomness. Not the app's own components, hooks or modules: a test of mocks passes whatever the code does.
|
|
66
66
|
- Expected values come from the spec or a worked example (`expect(total([10, 5])).toBe(15)`), never computed the way the code computes them, or the test can't fail.
|
|
67
67
|
- A bug fix comes with a test that failed before the fix.
|
|
68
|
+
- A test that checks a spec's scenario is named after it, word for word (`it('Rejects an expired code', …)`), so `specs.js tests` and reviews can tell what checks each scenario.
|
|
68
69
|
|
|
69
70
|
## Platform guidelines and accessibility
|
|
70
71
|
|
|
@@ -99,6 +100,15 @@ What App Store review and Google Play reject. `node scripts/amk/release-check.js
|
|
|
99
100
|
- Android foreground services declare their type (`android:foregroundServiceType`) and its `FOREGROUND_SERVICE_<TYPE>` permission, and each type is declared in Play Console.
|
|
100
101
|
- From 1 February 2027, Google Play takes updates to apps targeting Android 15 or later only with 16 KB page size support, which React Native has from 0.77.
|
|
101
102
|
|
|
103
|
+
## Texts in several languages
|
|
104
|
+
|
|
105
|
+
In an app with language files (JSON under `i18n/`, `locales/`, `translations/` or `lang/`), every text a change adds or changes goes into each language's file, under the same key:
|
|
106
|
+
- the source language as written;
|
|
107
|
+
- each other language as a machine translation, listed in `specs/<id>/translations.md` (the key, the language, the text) for a translator to review, and marked there once reviewed. `m-release` lists those still waiting;
|
|
108
|
+
- where a translation service (Lokalise, Crowdin, Phrase and the like) syncs the language files, change only the source language, and list the new keys in `translations.md` for the service instead.
|
|
109
|
+
|
|
110
|
+
`rn-check` warns about a key the branch left out of one language's file.
|
|
111
|
+
|
|
102
112
|
## TypeScript
|
|
103
113
|
|
|
104
114
|
- Keep the checks `tsconfig.json` has. Don't loosen them, or get past one with `any`, `@ts-ignore` or a non-null `!`.
|