Skip to content

Avoid common App Store and Google Play rejections. Open playbook and pre-submission guard with 117 documented rejection patterns and fixes, privacy manifest and Data safety checks, 95 tracked deadlines (EU AI Act, DSA, COPPA, age laws), and a skill for AI coding agents.

A first-run path a reader can act on in two minutes, and a verdict on every guard run (#841)

Mirza Iqbal7e05c3cc6924
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index dd28c50..12918ed 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -61,6 +61,17 @@ Priority 5: Social Media and AI Summaries
- Never trust secondary sources before official sources.
- Never create compliance pull requests using Priority 4 or Priority 5 sources unless verified by a Priority 1 source. Any citation or claim sourced from Priority 4 or 5 must be traceably corroborated by an official publication from Priority 1.
+## How to fix a wrong citation
+
+1. Find the official page that states the rule (Apple, Google, or the regulator). Read it and copy the exact wording.
+2. Replace the link and the claim in the doc or data file. If a deadline date changes, say what the old date was in `CHANGELOG.md`, never change it silently.
+3. Run the two checks below. Both must pass.
+
+```
+python3 scripts/verify-citations.py --files <the file you changed>
+python3 scripts/check-docs.py
+```
+
## How to add a rejection pattern
1. Add the human facing entry to the matching doc in `docs/`.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 78803fa..ce63490 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -29,6 +29,11 @@ jobs:
- name: Installer test suite
run: bash scripts/install-test.sh
+ - name: Every link, path, script and flag named in the docs exists
+ run: |
+ bash scripts/check-docs-test.sh
+ python3 scripts/check-docs.py
+
- name: Metadata audit test suite
run: bash scripts/metadata-audit-test.sh
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 516b9af..01a712d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,12 @@ All notable changes to this playbook are recorded here. The format follows Keep
### Added
+- README first-run path. A Start here table routes four kinds of reader to one action each, with the time it takes. The two-command check comes first, followed by what each last line of the guard means. The install section lists everything it writes and the undo command before the paste block. New short sections cover troubleshooting and the five words a newcomer has to know. Driven by 40 persona walks (a second model as 24 readers, and two reviewers who ran every README command in a throwaway home folder).
+- `scripts/check-docs.py`. Fails CI when a Markdown file names a link, heading anchor, image, repo path, script or flag that does not exist. 9 tests prove it fails on each kind.
+- The guard ends every run with a verdict. `CLEAR.` when no critical risk was found, `NOT CHECKED.` with exit 1 when the folder holds no iOS or Android project (an empty folder and an Expo app with no native folders used to look like a clean pass), and a `Next.` line after `BLOCKED.`. As a hook it still never blocks a project it could not scan.
+- `monitor.py --full`. A live report over 25 items now opens with a count per track and shows the first 10 (3,503 lines became 194). `--json` is never cut.
+- The checklist opens with the two checks that stop most rejections and says how long a full pass takes. CONTRIBUTING explains how to fix a wrong citation.
+
- README. A second approval proof, a developer's App Store Connect approval mail shared with thanks for the playbook, stored as assets/app-store-approval-thanks.png with the sender's name removed.
- One command install for Claude Code. `scripts/install.sh` copies the guard, the skill (now with `.citation-allowlist`) and the `/app-store-audit` command, adds one PreToolUse hook entry to settings.json while keeping every other key and writing a backup, then runs the guard against a sample app that must be blocked. `doctor` checks an existing install, `uninstall` removes it, `--dry-run` writes nothing. The check runs the registered command string itself, so an entry on the wrong matcher, behind a comment, or with an unquoted path fails it. A settings.json that is read-only, not valid JSON, or repeats a key is never rewritten. Before this the install was a prose prompt with no settings example and no way to tell whether it worked. 27 tests, in CI.
- Apple, September 2026. The EU App Tracking Transparency alternative prompt from iOS 27.2 (the only version in Germany, France, Italy, Poland, and Romania), multiseat subscription purchases enabled by default with Volume Purchasing on 22 October 2026 as deadline APPLE-MULTISEAT-VOLUME-PURCHASING, Bundles and Suites, the 27 August tax and price updates, and the 27.2 betas. Each read from Apple's own post on 30 September 2026.
@@ -27,6 +33,11 @@ All notable changes to this playbook are recorded here. The format follows Keep
### Fixed
+- `monitor.py` fell back to built-in sample announcements without a word when Apple's feed could not be reached. It now says so on stderr.
+- `metadata-audit.py` on a folder with no listing files, or on a path that does not exist, exited 0. It exits 1 and names the files to add.
+- `release-audit.py` ran silently for about two minutes. It now labels its two steps and says how long the first takes.
+- README said four sibling monitors and listed eight commands, showed the manual audit as a relative path, and promised a "clear to submit" line the guard never printed.
+
- Guard submit detection (#836). In hook mode a custom fastlane lane (`fastlane ios beta`, `bundle exec fastlane release`), a Gradle Play Publisher task (`publishBundle`, `publishReleaseBundle`), `eas` with a flag before the subcommand, and a submit wrapped in a package script or a make target all passed with no scan. They are now matched, a lane by its name or by an upload action in its Fastfile block, a wrapper one level deep. A second attack pass added package manager options before `run` (`pnpm --dir`, `npm --prefix`), `make -f`, legacy `expo upload`, and a lane or Gradle task held in a shell variable, which is scanned because it cannot be read. Lane names are matched on whole words, so `restore_state` stays silent, and `npm install bundletool` no longer triggers a scan. 45 new tests pin what blocks and what stays silent. `gh workflow run` and deeper nesting remain out of reach (#837).
- The guard ignored PowerShell tool payloads, so Claude Code on Windows never triggered it. It reads them now.
- `guard.sh /missing/path` exited 0, which read as a clean pass for a path that was never scanned. It exits 1 and says the path is not a directory.
diff --git a/README.md b/README.md
index 0df783b..c3cfcdd 100644
--- a/README.md
+++ b/README.md
@@ -23,13 +23,39 @@ Stop getting your iOS and Android apps rejected. The enterprise reference and au
</div>
+## Start here
+
+Pick one row. The time shown is for that first step.
+
+| You are | Do this first | Time |
+|---|---|---|
+| About to submit, and you can open a terminal | Run the two commands below | 2 minutes |
+| Already rejected | Open [the appeal playbook](docs/MISTAKE-PATTERNS.md#the-appeal-playbook) | 10 minutes |
+| Not a developer | Open [the checklist](docs/PRE-SUBMISSION-CHECKLIST.md) and do its first two checks | 5 minutes |
+| Using Claude Code and want this on every submit | Go to [the install](#paste-this-into-claude-code-codex-or-any-ai-coding-tool) | 1 minute |
+
+The two commands. Needs git and bash. The first downloads this playbook. The second scans your app. Nothing is installed and nothing in your app is changed.
+
+```
+git clone https://github.com/mjmirza/app-store-compliance ~/repositories/app-store-compliance
+bash ~/repositories/app-store-compliance/agent-os/hooks/app-store-compliance-guard.sh /path/to/your/app
+```
+
+Replace only `/path/to/your/app`, with the folder that holds your Xcode project or your Android app. A small project scans in about a second, a large one can take up to a minute, and the guard prints the time it took. The last lines tell you where you stand.
+
+| Last line starts with | It means | Do next |
+|---|---|---|
+| `BLOCKED.` | A critical rejection risk was found | Fix each `[CRITICAL]` line using the `fix.` line under it, then run the same command again |
+| `CLEAR.` | No critical risk in your code | Do the account and listing checks in [the checklist](docs/PRE-SUBMISSION-CHECKLIST.md) |
+| `NOT CHECKED.` | No iOS or Android project was found in that folder. Run by hand this exits 1. As a hook it lets the command through | Point it at the right folder. Expo apps run `npx expo prebuild` first |
+
## What you get
A rejection costs a week. You submit, you wait days in review, you get a one line rejection, you guess at the fix, you resubmit, you wait again. This playbook turns that loop into a check you run before you ever submit.
- **You catch the rejection before Apple or Google does.** The guard runs against your project and names the risk while you can still fix it cheaply, not after a reviewer has already said no.
- **You stop guessing at the cause.** Every rejection pattern maps to the exact guideline and the exact fix, so a one line rejection email becomes a known problem with a known answer.
-- **The two checks that sink most submissions are covered first.** A working demo account with a live backend, and a privacy declaration that matches what your app actually does at runtime, including every SDK. These are the top modern rejection causes and the playbook holds them above everything else.
+- **The two checks that cause most rejections are covered first.** A working demo account with a live backend, and a privacy declaration that matches what your app actually does at runtime, including every SDK. These are the top modern rejection causes and the playbook holds them above everything else.
- **It works whether or not you write code.** A developer wires the guard into the build. A non developer reads the plain English checklist and walks the submission safely.
- **Every claim is real.** Guideline numbers and statistics trace to a live Apple or Google source, never invented, so you are acting on the actual rules, not a guess.
@@ -37,9 +63,17 @@ If it saves you one rejection, it has paid for the ten minutes it takes to read.
## Paste this into Claude Code, Codex, or any AI coding tool
-No setup effort. Copy the block below, paste it into your AI coding tool, and it installs the whole playbook and wires the guard into your flow.
+This is for an always-on check in Claude Code. For a one-time scan, skip this section and use Start here. Copy the block below, paste it into your AI coding tool, and it installs the whole playbook and wires the guard into your flow.
-Read it before you paste it. It only clones this repo and copies files into your agent's skills and hooks directories. It never touches your GitHub account, your credentials, or anything outside those paths. It ends by asking you to consider a star and showing you the link. Tapping it is always your call, never your agent's.
+Read it before you paste it. This is everything it does.
+
+- Clones this repo to `~/repositories/app-store-compliance`.
+- Copies the guard, the skill, and one command into `~/.claude`.
+- Adds one entry to `~/.claude/settings.json` and keeps every other key. When the file already existed, a dated backup is written next to it.
+- Asks your agent to add one standing instruction to its own config.
+- Step 6 makes network requests to check the playbook's sources.
+
+It never touches your GitHub account or your credentials. Undo it with `bash ~/repositories/app-store-compliance/scripts/install.sh uninstall`. If `settings.json` cannot be edited, the uninstall says so and you remove the one hook entry by hand. It ends by asking you to consider a star and showing you the link. Tapping it is always your call, never your agent's.
```
Set up the App Store Compliance Playbook from https://github.com/mjmirza/app-store-compliance so that from now on any iOS or Android app I build is automatically checked against Apple App Store and Google Play rejection rules before I submit it.
@@ -50,7 +84,12 @@ Steps:
bash ~/repositories/app-store-compliance/scripts/install.sh
It must end with "Install verified." If it prints a FAIL line, fix that line and run
bash ~/repositories/app-store-compliance/scripts/install.sh doctor
-3. If I use another tool (Codex, Cursor, or anything else), install by hand. Copy agent-os/skill/SKILL.md, .citation-allowlist, and the docs/, data/, references/, templates/, and scripts/ folders into your agent's skills directory as app-store-compliance/. Copy agent-os/hooks/app-store-compliance-guard.sh into your hooks directory, make it executable, and register it to run before shell commands with a timeout of at least 120 seconds (seconds, not milliseconds). The guard reads the command from JSON on stdin as {"tool_name":"Bash","tool_input":{"command":"..."}}, acts only on submission commands (fastlane lanes that upload, eas submit or build, gradle bundleRelease or publishBundle, xcrun altool, bundletool, xcodebuild archive, and package scripts or make targets that wrap one of them), and exits 2 to block. It uses jq when installed, python3 otherwise, and a built-in fallback when neither is present. When the project holds more than one app, it scans each app on its own and prints one App section per app.
+3. If I use another tool (Codex, Cursor, or anything else), install by hand.
+ a. Copy agent-os/skill/SKILL.md, .citation-allowlist, and the docs/, data/, references/, templates/, and scripts/ folders into your agent's skills directory as app-store-compliance/.
+ b. Copy agent-os/hooks/app-store-compliance-guard.sh into your hooks directory and make it executable.
+ c. Register it to run before shell commands, with a timeout of at least 120 seconds (seconds, not milliseconds).
+ d. The guard reads the command from JSON on stdin as {"tool_name":"Bash","tool_input":{"command":"..."}}. It acts only on submission commands and exits 2 to block.
+ e. Tell me which file you registered it in, so I can check it.
4. Add a standing instruction to your agent config: for any iOS or Android work, always adhere to the Apple App Store Review Guidelines and Google Play policies, run the audit before submission, and never say an app is clear to submit while a critical risk stands.
5. Run the guard against my current project and show me the ranked findings:
bash ~/.claude/hooks/app-store-compliance-guard.sh /path/to/my/app
@@ -79,9 +118,13 @@ git clone https://github.com/mjmirza/app-store-compliance ~/repositories/app-sto
bash ~/repositories/app-store-compliance/scripts/install.sh
```
+### Check, update, or remove it
+
+Each command ends with one line that tells you whether it worked.
+
| Command | What it does |
|---|---|
-| `install.sh` | Installs or updates. Safe to run again, it never adds a second hook entry |
+| `install.sh` | Installs or updates. Safe to run again, a working hook entry is never added twice |
| `install.sh --dry-run` | Prints what would be written and writes nothing |
| `install.sh doctor` | Checks an existing install and runs the guard against a sample app that must be blocked |
| `install.sh uninstall` | Removes the guard, the skill, the command and the hook entry, and keeps your other hooks |
@@ -157,12 +200,12 @@ This works whether you write code or not.
### If you are not a developer
-You are about to submit an app, maybe one an agency or an AI tool built for you, and you do not want it bounced.
+You are about to submit an app, maybe one an agency or an AI tool built for you, and you do not want it rejected.
-1. Open `docs/PRE-SUBMISSION-CHECKLIST.md`.
+1. Open [the checklist](docs/PRE-SUBMISSION-CHECKLIST.md). Start with its first section, two checks, about five minutes.
2. Treat every unchecked box as a reason you will be rejected. Answer each one honestly.
3. The two that catch most people. A working demo account with a live backend, and a privacy form that matches what the app really does.
-4. Read `docs/MISTAKE-PATTERNS.md` for the appeal playbook if a rejection already landed.
+4. Already rejected? Go to [the appeal playbook](docs/MISTAKE-PATTERNS.md#the-appeal-playbook) before you resubmit.
### If you use Claude Code or another AI coding tool
@@ -183,24 +226,29 @@ Your iOS or Android project
|
+-- critical rejection risk found --> BLOCKED, with the exact guideline and fix
|
- +-- clean --------------------------> clear to submit
+ +-- clean --------------------------> CLEAR, then the checklist for what a scan cannot see
```
+The same flow in words. Your AI tool reads the rule while you build. When you are about to ship, the guard scans your project. A critical risk stops the upload and names the fix. A clean scan ends with `CLEAR.` and lets the upload through.
+
The guard fires automatically before submission commands such as fastlane, eas submit, gradle bundleRelease, and xcrun altool. If it finds a critical risk, it stops the upload and tells you the exact fix. Your AI tool now refuses to help you ship a rejection.
-Run a manual audit any time.
+### No AI tool. Run it by hand
+
+No agent is needed. Nothing is installed and nothing is hooked. Skip the install section above if this one-time scan is all you want.
```
-bash agent-os/hooks/app-store-compliance-guard.sh /path/to/your/app
+bash ~/repositories/app-store-compliance/agent-os/hooks/app-store-compliance-guard.sh /path/to/your/app
```
### Apple Developer Requirements Monitor
Keep your projects in sync with Apple's continuously evolving requirements. The monitor tracks changes to 25 critical areas including App Store guidelines, privacy manifests, alternative payments, and child safety.
-Run a requirements check on your repository against the live Apple Developer RSS news feed:
+Run a requirements check on your repository against the live Apple Developer RSS news feed. A long result opens with a count per track and shows the first 10 items. Add `--full` for every item. If the feed cannot be reached, the monitor says its items are samples.
```
+cd ~/repositories/app-store-compliance
python3 scripts/monitor.py --project /path/to/your/app
```
@@ -222,9 +270,10 @@ python3 scripts/monitor.py --project /path/to/your/app --simulate "In-App Purcha
### Other continuous monitors
-Four sibling monitors watch other tracks the same way, each with its own doc and test suite.
+Eight more commands watch other tracks the same way. Run them from the playbook folder. Start with the one that matches your platform.
```
+cd ~/repositories/app-store-compliance
python3 scripts/monitor-regulatory.py --project /path/to/your/app # EU/UK/US/CA/AU/SG, source-trust classified
python3 scripts/monitor-android.py --dir /path/to/your/app # Android and Google Play requirements
python3 scripts/monitor-ai-policy.py --dir /path/to/your/app # generative AI policy (Apple and Google)
@@ -235,6 +284,19 @@ python3 scripts/monitor-security.py --dir /path/to/your/app # 17 mobile
python3 scripts/generate-timeline.py # chronological regulatory timeline
```
+What to expect, measured on 30 September 2026.
+
+| Command | Output and time | Writes a file |
+|---|---|---|
+| `monitor.py` | A count per track and the first 10 items. `--full` prints every item | No |
+| `monitor-android.py`, `monitor-ai-policy.py` | About 200 and 95 lines | Each rewrites its migration doc under `docs/` in the folder you run it from |
+| `monitor-privacy.py`, `monitor-security.py` | About 27 lines each | A PR draft under `docs/` in the folder you run them from |
+| `release-audit.py` | About two minutes. It checks the playbook itself first, then your app | `RELEASE-READINESS-REPORT.md` in your app folder |
+| `generate-timeline.py` | The open deadlines, then one completion line | Rewrites `docs/REGULATORY-TIMELINE.md` in the playbook folder |
+| `deadline-checker.py` | About 175 lines of detail. Add `--brief` for one line per open deadline | No |
+
+The monitors other than `monitor.py` read built-in sample announcements by default. Treat their output as a worked example of the migration tasks, not as news.
+
### Citation integrity
Every rule in this playbook is only as good as the source behind it, so the
@@ -257,6 +319,26 @@ The regulatory deadline check runs on every guard invocation automatically, and
python3 scripts/deadline-checker.py
```
+## If something goes wrong
+
+| You see | Do this |
+|---|---|
+| `NOT CHECKED.` | Point the guard at the folder with your Xcode project or Android app. Expo apps run `npx expo prebuild` first |
+| The install ends with a `FAIL` line | The line names the problem. Fix it, then run `install.sh doctor` |
+| `settings.json` was not changed | It was read-only, not valid JSON, or neither python3 nor jq is installed. The installer printed the block to paste by hand |
+| The guard does not fire in Claude Code | Restart Claude Code once, then run `install.sh doctor` |
+| `verify-citations.py` seems stuck | It checks about 300 links over the network and prints at the end. Give it a few minutes |
+
+## Words used here
+
+| Word | Meaning |
+|---|---|
+| Guard | The script that scans your app and blocks a submit when it finds a critical risk |
+| Hook | A setting that makes your AI tool run the guard before a shell command |
+| Skill | The folder of rules and data your AI tool reads when it audits an app |
+| Privacy manifest | The `PrivacyInfo.xcprivacy` file Apple requires. It declares the data types collected and the required-reason APIs used |
+| Data Safety form | The Google Play Console form where you declare what data your app collects and shares |
+
## What is inside
| Path | What it holds |
diff --git a/agent-os/hooks/app-store-compliance-guard-test.sh b/agent-os/hooks/app-store-compliance-guard-test.sh
index a961125..d2c79e1 100755
--- a/agent-os/hooks/app-store-compliance-guard-test.sh
+++ b/agent-os/hooks/app-store-compliance-guard-test.sh
@@ -197,9 +197,9 @@ OUT="$(bash "$GUARD" /no/such/dir/here 2>&1)"; RC=$?
OUT="$(printf '%s' '{not valid json [[[ command : oops }}}' | bash "$GUARD" 2>&1)"; RC=$?
[ "$RC" -eq 0 ] && ok "Malformed JSON stdin fail-open" || bad "Malformed JSON stdin (got $RC)"
-# 9 stress. Empty stdin does not hang or crash
+# 9 stress. Empty stdin does not hang or crash. /tmp may hold no app at all, which is exit 1 (not checked).
OUT="$(printf '' | bash "$GUARD" /tmp 2>&1)"; RC=$?
-[ "$RC" -eq 0 ] || [ "$RC" -eq 2 ] && ok "Empty stdin handled" || bad "Empty stdin handled (got $RC)"
+[ "$RC" -eq 0 ] || [ "$RC" -eq 1 ] || [ "$RC" -eq 2 ] && ok "Empty stdin handled" || bad "Empty stdin handled (got $RC)"
# 9b fail-open. Hook mode with an empty payload must not fall back to scanning the working directory
D="$(mk_ios_bad)"; OUT="$(cd "$D" && printf '' | bash "$GUARD" 2>&1)"; RC=$?
@@ -1602,6 +1602,22 @@ echo "$OUT" | grep -q "python3: command not found" && bad "836-nopy no raw pytho
echo "$OUT" | grep -q "python3 not found" && [ "$RC" -eq 2 ] && ok "836-nopy2 the skipped deadline list is named and the scan still blocks" || bad "836-nopy2 the skipped deadline list is named and the scan still blocks (rc=$RC)"
rm -rf "$D" "$SHIM"
+# ===== The run always ends with a verdict a person can read. A silent exit 0 is not a verdict. =====
+D="$(mk_ios_clean)"; OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?
+[ "$RC" -eq 0 ] && echo "$OUT" | grep -q '^CLEAR\. 0 critical' && ok "verdict-1 a clean app ends with a CLEAR line" || bad "verdict-1 a clean app ends with a CLEAR line (rc=$RC)"
+rm -rf "$D"
+D="$(mktemp -d)"; OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?
+[ "$RC" -eq 1 ] && echo "$OUT" | grep -q '^NOT CHECKED\.' && ! echo "$OUT" | grep -q '^CLEAR' && ok "verdict-2 an empty folder is NOT CHECKED with exit 1, never a pass" || bad "verdict-2 an empty folder is NOT CHECKED with exit 1 (rc=$RC)"
+printf '{"expo":{"name":"x","slug":"x"}}' > "$D/app.json"; printf '{"dependencies":{"expo":"~52.0.0","react-native":"0.76.0"}}' > "$D/package.json"
+OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?
+[ "$RC" -eq 1 ] && echo "$OUT" | grep -q 'expo prebuild' && ok "verdict-3 an Expo app with no native folders is told to prebuild" || bad "verdict-3 an Expo app with no native folders is told to prebuild (rc=$RC)"
+ERR="$(printf '{"tool_name":"Bash","tool_input":{"command":"eas submit -p ios"}}' | CLAUDE_PROJECT_DIR="$D" bash "$GUARD" 2>&1)"; RC=$?
+[ "$RC" -eq 0 ] && echo "$ERR" | grep -q 'NOT CHECKED' && ok "verdict-4 as a hook an unscannable project is reported and never blocked" || bad "verdict-4 as a hook an unscannable project is reported and never blocked (rc=$RC)"
+rm -rf "$D"
+D="$(mk_ios_bad)"; OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?
+[ "$RC" -eq 2 ] && echo "$OUT" | grep -q 'run the same command again' && ok "verdict-5 a block says what to do next" || bad "verdict-5 a block says what to do next (rc=$RC)"
+rm -rf "$D"
+
echo ""
echo "app-store-compliance-guard-test: $PASS passed, $FAIL failed"
[ "$FAIL" -eq 0 ]
diff --git a/agent-os/hooks/app-store-compliance-guard.sh b/agent-os/hooks/app-store-compliance-guard.sh
index 3b8f9e6..8e3c2b2 100755
--- a/agent-os/hooks/app-store-compliance-guard.sh
+++ b/agent-os/hooks/app-store-compliance-guard.sh
@@ -10,7 +10,7 @@ HOOK_LOG="$HOME/.claude/hooks/hook-log.sh"
[ -f "$HOOK_LOG" ] && source "$HOOK_LOG" 2>/dev/null || true
log_err() { if type hlog_error >/dev/null 2>&1; then hlog_error "app-store-compliance-guard" "$@"; else echo "app-store-compliance-guard: $*" >&2; fi; }
-CRIT=0; HIGH=0; MED=0; DEADLINE_DONE=0
+CRIT=0; HIGH=0; MED=0; DEADLINE_DONE=0; ANY_NATIVE=0; ANY_RN=0; ANY_WEB=0
FILELIST=""
REPORT=""; REPORT_DEGRADED=0
cleanup() { [ -n "$FILELIST" ] && rm -f "$FILELIST" "$FILELIST.blob" "$FILELIST.manifest" 2>/dev/null; [ -n "$REPORT" ] && rm -f "$REPORT" 2>/dev/null; true; }
@@ -343,6 +343,9 @@ IOS_TARGET_ACTIVE=0
[ "$IS_IOS" -eq 1 ] && [ "$CMD_TARGET_ANDROID_ONLY" -eq 0 ] && IOS_TARGET_ACTIVE=1
echo "Platforms. iOS=$IS_IOS Android=$IS_AND Web=$IS_WEB"
+{ [ "$IS_IOS" -eq 1 ] || [ "$IS_AND" -eq 1 ]; } && ANY_NATIVE=1
+[ "$IS_RN" -eq 1 ] && ANY_RN=1
+[ "$IS_WEB" -eq 1 ] && ANY_WEB=1
echo "Frameworks. Flutter=$IS_FLUTTER ReactNative/Expo=$IS_RN Ionic/Capacitor/Cordova=$IS_IONIC"
[ "$CMD_TARGET_ANDROID_ONLY" -eq 1 ] && echo "Command targets Android only. Apple-only framework checks suppressed for this run."
echo ""
@@ -908,7 +911,20 @@ if [ "$CRIT" -gt 0 ]; then
fi
echo ""
echo "BLOCKED. $CRIT critical rejection risk(s) above. Fix them, or set APP_STORE_GUARD_OK=1 to override."
+ echo "Next. Fix each [CRITICAL] line using its fix. line, then run the same command again."
[ "${REPORT_DEGRADED:-0}" = "1" ] && echo "BLOCKED. $CRIT critical rejection risk(s). Full report on stdout (no temp file available for buffering)." >&2
emit_report 2; exit 2
fi
+# A verdict line every time. Exit 0 with nothing scanned reads as a pass, so it is named and, run by hand, exits 1.
+if [ "$ANY_NATIVE" -eq 0 ] && { [ "$ANY_WEB" -eq 0 ] || [ "$ANY_RN" -eq 1 ]; }; then
+ NOTE="NOT CHECKED. No iOS or Android project was found in $DIR, so the store checks did not run."
+ if [ "$ANY_RN" -eq 1 ]; then NEXT="Next. This looks like an Expo or React Native app with no ios or android folder. Run npx expo prebuild, then run the guard again."
+ else NEXT="Next. Point the guard at the folder that holds your Xcode project or your Android app folder."; fi
+ echo ""; echo "$NOTE"; echo "$NEXT"
+ if [ -n "$STDIN_JSON" ]; then emit_report 0; echo "$NOTE $NEXT" >&2; exit 0; fi
+ exit 1
+fi
+echo ""
+[ "$ANY_NATIVE" -eq 0 ] && echo "Web project only. No iOS or Android project was found here, so only the web checks ran."
+echo "CLEAR. 0 critical risks in the code scan. Read any [HIGH] and [MEDIUM] lines above, then walk docs/PRE-SUBMISSION-CHECKLIST.md for the account and listing checks a scan cannot see."
emit_report 0; exit 0
diff --git a/docs/PRE-SUBMISSION-CHECKLIST.md b/docs/PRE-SUBMISSION-CHECKLIST.md
index c7503ce..6815982 100644
--- a/docs/PRE-SUBMISSION-CHECKLIST.md
+++ b/docs/PRE-SUBMISSION-CHECKLIST.md
@@ -2,6 +2,15 @@
Treat every unchecked box as a release blocker. Run this before any upload to App Store Connect or the Play Console. Each item is phrased as a verifiable check.
+## Start here. Two checks, about five minutes
+
+These two stop most rejections on both stores. Do them before anything else.
+
+- [ ] A working demo account with a live backend is in the review notes, and the login works today.
+- [ ] The privacy declaration (Apple privacy labels, Google Data Safety form) matches what the app really collects at runtime, every SDK included.
+
+Then work down the page. Do Shared first, then the store you ship to. Skip any section whose heading says "if" and does not match your app. The full list is about 100 boxes, so plan an hour for a first pass.
+
## Shared (both stores)
### Stability and completeness
diff --git a/scripts/check-docs-test.sh b/scripts/check-docs-test.sh
new file mode 100644
index 0000000..d37107b
--- /dev/null
+++ b/scripts/check-docs-test.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+# Proves check-docs.py fails on each kind of broken instruction and passes a clean tree.
+set -uo pipefail
+cd "$(dirname "$0")/.." || exit 1
+PASS=0; FAIL=0
+ok() { PASS=$((PASS+1)); printf 'PASS %s\n' "$1"; }
+bad() { FAIL=$((FAIL+1)); printf 'FAIL %s\n' "$1"; }
+CHECK="$PWD/scripts/check-docs.py"
+T="$(mktemp -d)"; trap 'rm -rf "$T"' EXIT
+mkdir -p "$T/docs" "$T/scripts" "$T/assets"
+printf '#!/usr/bin/env bash\necho ok\n' > "$T/scripts/install.sh"
+printf 'import argparse\np = argparse.ArgumentParser()\np.add_argument("--files")\n' > "$T/scripts/tool.py"
+printf '# Guide\n\n## First step\n\ntext\n' > "$T/docs/GUIDE.md"
+: > "$T/assets/a.png"
+run() { DOCS_ROOT="$T" python3 "$CHECK" 2>&1; }
+expect_fail() {
+ printf '%s\n' "$2" > "$T/README.md"
+ OUT="$(run)"; RC=$?
+ [ "$RC" -eq 1 ] && echo "$OUT" | grep -q "$3" && ok "$1" || bad "$1 (rc=$RC)"
+}
+
+printf '# T\n\n[guide](docs/GUIDE.md#first-step) and `docs/GUIDE.md`.\n\n<img src="assets/a.png" alt="a" />\n\n```\npython3 scripts/tool.py --files docs/\n```\n' > "$T/README.md"
+OUT="$(run)"; RC=$?
+[ "$RC" -eq 0 ] && echo "$OUT" | grep -q "0 problem" && ok "a clean tree passes" || bad "a clean tree passes (rc=$RC)"
+
+expect_fail "a link to a missing file fails" '[x](docs/NOPE.md)' "docs/NOPE.md"
+expect_fail "a link to a missing heading fails" '[x](docs/GUIDE.md#no-such-part)' "no-such-part"
+expect_fail "a missing image fails" '<img src="assets/gone.png" alt="x" />' "assets/gone.png"
+expect_fail "a path named in prose that does not exist fails" 'Open `docs/MISSING.md` first.' "docs/MISSING.md"
+expect_fail "a command naming a missing script fails" 'Run `python3 scripts/absent.py`.' "scripts/absent.py"
+expect_fail "a flag the script does not accept fails" 'Run `python3 scripts/tool.py --nope docs/`.' "\-\-nope"
+
+printf '# T\n\nSee https://example.org/docs/NOPE.md and `~/other/docs/x.md`.\n' > "$T/README.md"
+OUT="$(run)"; RC=$?
+[ "$RC" -eq 0 ] && ok "a web URL and a path outside the repo are left alone" || bad "a web URL and a path outside the repo are left alone (rc=$RC)"
+
+OUT="$(python3 "$CHECK" 2>&1)"; RC=$?
+[ "$RC" -eq 0 ] && ok "the real repository passes" || bad "the real repository passes (rc=$RC)"
+
+echo ""
+echo "check-docs-test: $PASS passed, $FAIL failed"
+[ "$FAIL" -eq 0 ]
diff --git a/scripts/check-docs.py b/scripts/check-docs.py
new file mode 100644
index 0000000..266453c
--- /dev/null
+++ b/scripts/check-docs.py
@@ -0,0 +1,147 @@
+#!/usr/bin/env python3
+"""Checks that what the docs tell a reader to do can be done. Every relative link,
+heading anchor, image, repo path, script and flag named in a Markdown file must exist."""
+
+import os
+import re
+import subprocess
+import sys
+
+ROOT = os.environ.get(
+ "DOCS_ROOT", os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+)
+SKIP_DIRS = {".git", "node_modules", "__pycache__"}
+TOP = (
+ "docs",
+ "data",
+ "scripts",
+ "agent-os",
+ "references",
+ "templates",
+ "assets",
+ ".github",
+)
+PATH_RE = re.compile(
+ r"(?<![\w./~-])((?:%s)/[A-Za-z0-9_./-]*[A-Za-z0-9_-]\.[a-z]{2,5})(?![\w/-])"
+ % "|".join(re.escape(t) for t in TOP)
+)
+LINK_RE = re.compile(r"(!?)\[[^\]]*\]\(([^)\s]+)(?:\s+\"[^\"]*\")?\)")
+HTML_SRC_RE = re.compile(r"<img[^>]+src=\"([^\"]+)\"")
+CMD_RE = re.compile(
+ r"(?:python3|bash)\s+((?:~/[\w./-]*/)?(scripts/[\w.-]+\.(?:py|sh)))((?:\s+[^\s|;&<>`]+)*)"
+)
+FLAG_RE = re.compile(r"(?<!\S)(--[a-z][a-z0-9-]*)")
+
+
+def markdown_files():
+ out = []
+ for base, dirs, files in os.walk(ROOT):
+ dirs[:] = [d for d in dirs if d not in SKIP_DIRS]
+ for name in files:
+ if name.endswith(".md"):
+ out.append(os.path.join(base, name))
+ return sorted(out)
+
+
+def slug(heading):
+ text = re.sub(r"[`*_]|<[^>]+>", "", heading).strip().lower()
+ text = re.sub(r"\[([^\]]*)\]\([^)]*\)", r"\1", text)
+ text = re.sub(r"[^\w\- ]", "", text)
+ return text.replace(" ", "-")
+
+
+def anchors(path, cache={}):
+ if path not in cache:
+ found, seen, fenced = set(), {}, False
+ with open(path, encoding="utf-8") as f:
+ for line in f:
+ if line.lstrip().startswith("```"):
+ fenced = not fenced
+ match = None if fenced else re.match(r"#{1,6}\s+(.*)", line)
+ if match:
+ base = slug(match.group(1))
+ n = seen.get(base, 0)
+ seen[base] = n + 1
+ found.add(base if n == 0 else f"{base}-{n}")
+ cache[path] = found
+ return cache[path]
+
+
+def flags_of(script, cache={}):
+ if script not in cache:
+ with open(os.path.join(ROOT, script), encoding="utf-8") as f:
+ cache[script] = f.read()
+ return cache[script]
+
+
+def check_file(path):
+ problems = []
+ rel = os.path.relpath(path, ROOT)
+ here = os.path.dirname(path)
+ generated = rel.startswith("references" + os.sep)
+ with open(path, encoding="utf-8") as f:
+ lines = f.read().splitlines()
+ for number, line in enumerate(lines, 1):
+ where = f"{rel}:{number}"
+ targets = [m.group(2) for m in LINK_RE.finditer(line)] + HTML_SRC_RE.findall(
+ line
+ )
+ for target in targets:
+ if re.match(r"[a-z][a-z0-9+.-]*:", target) or target.startswith("//"):
+ continue
+ file_part, _, anchor = target.partition("#")
+ dest = (
+ path
+ if not file_part
+ else os.path.normpath(os.path.join(here, file_part))
+ )
+ if not os.path.exists(dest):
+ problems.append(f"{where} links to {target}, which does not exist")
+ elif (
+ anchor and dest.endswith(".md") and anchor.lower() not in anchors(dest)
+ ):
+ problems.append(
+ f"{where} links to #{anchor}, no such heading in {os.path.relpath(dest, ROOT)}"
+ )
+ if generated:
+ continue
+ for match in PATH_RE.finditer(line):
+ named = match.group(1)
+ if "*" in named or "<" in named:
+ continue
+ if not os.path.exists(os.path.join(ROOT, named)):
+ problems.append(f"{where} names {named}, which does not exist")
+ for match in CMD_RE.finditer(line):
+ script = match.group(2)
+ if not os.path.exists(os.path.join(ROOT, script)):
+ continue
+ source = flags_of(script)
+ for flag in FLAG_RE.findall(match.group(3)):
+ if flag not in source:
+ problems.append(
+ f"{where} runs {script} with {flag}, which the script does not accept"
+ )
+ return problems
+
+
+def main():
+ problems = []
+ files = markdown_files()
+ for path in files:
+ problems.extend(check_file(path))
+ syntax = subprocess.run(
+ ["bash", "-n", os.path.join(ROOT, "scripts", "install.sh")], capture_output=True
+ )
+ if (
+ os.path.exists(os.path.join(ROOT, "scripts", "install.sh"))
+ and syntax.returncode != 0
+ ):
+ problems.append("scripts/install.sh does not parse")
+ for problem in problems:
+ print(problem)
+ print(f"check-docs. {len(files)} files, {len(problems)} problem(s)")
+ return 1 if problems else 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/scripts/metadata-audit-test.sh b/scripts/metadata-audit-test.sh
index 7a6b8cc..a452747 100755
--- a/scripts/metadata-audit-test.sh
+++ b/scripts/metadata-audit-test.sh
@@ -45,5 +45,13 @@ OUT="$($AUDIT --description "Subscribe for premium, auto-renew monthly" 2>&1)"
echo "$OUT" | grep -q 'MISLEADING-PRICING\|Terms' && ok "flags subscription without terms" || bad "subscription terms"
echo ""
+# A folder with no listing files was not audited. That is exit 1 with the file names to add, never a pass.
+E="$(mktemp -d)"
+OUT="$($AUDIT "$E" 2>&1)"; RC=$?
+[ "$RC" -eq 1 ] && echo "$OUT" | grep -q "name.txt" && echo "$OUT" | grep -q "Nothing was audited" && ok "an empty metadata folder exits 1 and names the files to add" || bad "an empty metadata folder exits 1 and names the files to add (rc=$RC)"
+OUT="$($AUDIT "$E/missing" 2>&1)"; RC=$?
+[ "$RC" -eq 1 ] && echo "$OUT" | grep -q "not a directory" && ok "a missing metadata folder exits 1" || bad "a missing metadata folder exits 1 (rc=$RC)"
+rm -rf "$E"
+
echo "metadata-audit-test: $PASS passed, $FAIL failed"
[ "$FAIL" -eq 0 ]
diff --git a/scripts/metadata-audit.py b/scripts/metadata-audit.py
index a85385f..3387bcc 100755
--- a/scripts/metadata-audit.py
+++ b/scripts/metadata-audit.py
@@ -20,7 +20,7 @@ Usage:
metadata-audit.py <dir> --propose write <dir>/.metadata-fixes.md with suggested fixes
metadata-audit.py <dir> --check-urls also HEAD-check URLs (needs network)
-Exit codes: 0 clean or advisory, 2 a critical finding.
+Exit codes: 0 clean or advisory, 1 the directory held nothing to audit, 2 a critical finding.
"""
import os
import sys
@@ -220,17 +220,25 @@ def main():
canon = ALIASES.get(key, key)
fields[canon] = val
i += 2
- elif os.path.isdir(a):
+ elif os.path.isdir(a) or d is None:
d = a
i += 1
else:
i += 1
+ if d and not os.path.isdir(d):
+ print(f"metadata-audit. {d} is not a directory. Nothing was audited.", file=sys.stderr)
+ return 1
if d:
fields.update({k: v for k, v in load_dir(d).items() if k not in fields})
+ if not fields and d:
+ print(f"metadata-audit. no listing files found in {d}. Nothing was audited.")
+ print("Add name.txt, subtitle.txt, keywords.txt and description.txt (the fastlane metadata layout),")
+ print("or pull them with scripts/pull-metadata.sh, or pass --name, --keywords and --description.")
+ return 1
if not fields:
- print("metadata-audit. no metadata found. pass a directory or fields. see --help in the header.")
+ print("metadata-audit. nothing to audit. Pass a metadata directory, or --name, --keywords and --description.")
return 0
findings = audit_fields(fields, check_urls=check_urls)
diff --git a/scripts/monitor-test.sh b/scripts/monitor-test.sh
index 2832ca7..cddb7f5 100644
--- a/scripts/monitor-test.sh
+++ b/scripts/monitor-test.sh
@@ -56,6 +56,23 @@ assert nums == list(range(1, 16)), nums
OUT_MOCK="$($MONITOR --mock 2>&1)"
echo "$OUT_MOCK" | grep -q "TRACK UPDATE: \[Privacy Manifests\]" && ok "mock announcements fallback runs and matches tracks" || bad "mock announcements"
+# A long live report is cut to a readable first screen. --full prints every item.
+T="$(mktemp -d)"
+python3 -c 'import json,sys; json.dump([{"title":"Privacy manifest update %d" % i,"description":"Changes to privacy manifests and required reason APIs.","pubDate":"Mon, 01 Sep 2026 10:00:00 PDT","link":"https://mock.invalid/n/%d" % i} for i in range(40)], open(sys.argv[1],"w"))' "$T/news.json"
+OUT="$($MONITOR --project "$T" --news-file "$T/news.json" 2>&1)"
+N="$(echo "$OUT" | grep -c 'TRACK UPDATE')"
+[ "$N" -eq 10 ] && echo "$OUT" | grep -q "Showing 10 of" && echo "$OUT" | grep -q "\-\-full" && ok "a long report shows 10 items and names --full" || bad "a long report shows 10 items and names --full (got $N)"
+echo "$OUT" | grep -q "By track" && ok "a long report opens with a count per track" || bad "a long report opens with a count per track"
+N="$($MONITOR --project "$T" --news-file "$T/news.json" --full 2>&1 | grep -c 'TRACK UPDATE')"
+[ "$N" -ge 40 ] && ok "--full prints every item" || bad "--full prints every item (got $N)"
+N="$($MONITOR --project "$T" --news-file "$T/news.json" --json 2>/dev/null | python3 -c 'import json,sys; print(len(json.load(sys.stdin)))')"
+[ "$N" -ge 40 ] && ok "--json is never cut" || bad "--json is never cut (got $N)"
+# A failed live fetch must say the items shown are samples, on stderr so --json stays parseable.
+ERR="$(APPLE_NEWS_RSS_URL="http://127.0.0.1:9/none.rss" $MONITOR --project "$T" --json 2>&1 >/dev/null)"
+echo "$ERR" | grep -q "sample announcements" && ok "a failed live fetch says the items are samples" || bad "a failed live fetch says the items are samples"
+APPLE_NEWS_RSS_URL="http://127.0.0.1:9/none.rss" $MONITOR --project "$T" --json 2>/dev/null | python3 -c 'import json,sys; json.load(sys.stdin)' && ok "--json stays valid when the fetch fails" || bad "--json stays valid when the fetch fails"
+rm -rf "$T"
+
echo ""
echo "monitor-test: $PASS passed, $FAIL failed"
[ "$FAIL" -eq 0 ]
diff --git a/scripts/monitor.py b/scripts/monitor.py
index 57d33d6..f9f0483 100644
--- a/scripts/monitor.py
+++ b/scripts/monitor.py
@@ -535,7 +535,10 @@ def clean_xml_tag(tag):
return tag
-def fetch_apple_rss(url="https://developer.apple.com/news/rss/news.rss", verbose=False):
+def fetch_apple_rss(url=None, verbose=False):
+ url = url or os.environ.get(
+ "APPLE_NEWS_RSS_URL", "https://developer.apple.com/news/rss/news.rss"
+ )
if verbose:
print(f"[*] Fetching Apple Developer News from {url}...")
try:
@@ -1031,10 +1034,11 @@ def run_monitor(
if rss_content:
announcements = parse_rss_items(rss_content)
else:
- if verbose:
- print(
- "[*] Falling back to mock announcements due to missing or failed RSS fetch."
- )
+ print(
+ "monitor. Apple's news feed could not be reached. The items below are sample "
+ "announcements, not real ones. Check your network and run again.",
+ file=sys.stderr,
+ )
announcements = MOCK_ANNOUNCEMENTS
if verbose:
@@ -1072,7 +1076,10 @@ def run_monitor(
return report_items, processed_tracks
-def print_text_report(report_items, project_path):
+REPORT_LIMIT = 10
+
+
+def print_text_report(report_items, project_path, full=True):
print("=" * 80)
print(" APPLE DEVELOPER REQUIREMENTS MONITOR REPORT")
print(f" Target Project: {os.path.abspath(project_path)}")
@@ -1087,6 +1094,20 @@ def print_text_report(report_items, project_path):
print(f"\nFound {len(report_items)} matched compliance requirement update(s):\n")
+ total = len(report_items)
+ if not full and total > 25:
+ counts = {}
+ for item in report_items:
+ counts[item["track"]] = counts.get(item["track"], 0) + 1
+ print("By track.")
+ for track, n in sorted(counts.items(), key=lambda kv: (-kv[1], kv[0])):
+ print(f" {n:>3} {track}")
+ print(
+ f"\nShowing {REPORT_LIMIT} of {total}. Run again with --full for every item, "
+ "or --json for machine output.\n"
+ )
+ report_items = report_items[:REPORT_LIMIT]
+
for i, item in enumerate(report_items, 1):
print(f"{i}. TRACK UPDATE: [{item['track']}]")
print(f" - Announcement: {item['announcement_title']}")
@@ -1145,6 +1166,11 @@ def main():
action="store_true",
help="Print verbose execution and scanning logs",
)
+ parser.add_argument(
+ "--full",
+ action="store_true",
+ help="Print every matched item. Without it a report over 25 items shows a count per track and the first 10",
+ )
args = parser.parse_args()
@@ -1159,7 +1185,7 @@ def main():
if args.json:
print(json.dumps(report_items, indent=2))
else:
- print_text_report(report_items, args.project)
+ print_text_report(report_items, args.project, full=args.full)
if __name__ == "__main__":
diff --git a/scripts/release-audit-test.sh b/scripts/release-audit-test.sh
index 281e76e..67825c3 100755
--- a/scripts/release-audit-test.sh
+++ b/scripts/release-audit-test.sh
@@ -37,5 +37,9 @@ IDS="$(grep -oE '\b[A-Z]+(-[A-Z0-9.]+)+\b' "$REPORT" 2>/dev/null | sort -u | wc
OUT="$(python3 scripts/release-audit.py "$FX/no-such-app" 2>&1)"; RC=$?
[ "$RC" -eq 1 ] && echo "$OUT" | grep -q "not a directory" && ! echo "$OUT" | grep -q "Starting Release Readiness" && ok "a missing target path is rejected before any scan" || bad "a missing target path is rejected before any scan (rc=$RC)"
+# The audit runs the playbook's own tests first, which is slow. The reader is told how long before the wait.
+FIRST="$(python3 scripts/release-audit.py "$FX/no-such-app" 2>&1; sed -n '/Starting Release Readiness/,/Scanning your app/p' scripts/release-audit.py)"
+echo "$FIRST" | grep -q "about two minutes" && ok "the slow self-check step says how long it takes" || bad "the slow self-check step says how long it takes"
+
echo "release-audit-test: $PASS passed, $FAIL failed"
[ "$FAIL" -eq 0 ]
diff --git a/scripts/release-audit.py b/scripts/release-audit.py
index a183cdc..e79c2d5 100755
--- a/scripts/release-audit.py
+++ b/scripts/release-audit.py
@@ -302,7 +302,7 @@ def main():
print("")
# --- Step 1. Run Internal Validation and Test Engines ---
- print("Running internal validation and test engines...")
+ print("Step 1 of 2. Checking the playbook itself first. This takes about two minutes.", flush=True)
val_code, val_out, val_err = run_command(["python3", "scripts/validate.py"])
if val_code != 0:
@@ -333,7 +333,7 @@ def main():
print("")
# --- Step 2. Execute Compliance Scanners ---
- print("Executing compliance scanners on target...")
+ print("Step 2 of 2. Scanning your app...", flush=True)
# Run the compliance guard
guard_code, guard_out, guard_err = run_command(