This file provides agent instructions for Codex and other AI tools that read AGENTS.md.
When the user asks to set up App Store screenshots, integrate Screenshot Factory, or mentions /setup-screenshots, follow this workflow exactly.
Before anything else, ensure the CLI is available:
- Run
which screenshot-factory. If found, proceed to Phase 1. - If not found, check
./fastlane/ScreenshotFactory/.build/release/screenshot-factory. If found, use it and proceed to Phase 1. - If neither exists:
- Run:
git clone https://github.com/iMark21/ScreenshotFactory ./fastlane/ScreenshotFactory - Run:
cd ./fastlane/ScreenshotFactory && swift build -c release
- Run:
- Inform the user with a single line:
Screenshot Factory ready at ./fastlane/ScreenshotFactoryand immediately proceed to Phase 1.
CRITICAL: Do NOT create, modify, or write ANY files during Phase 1. Wait for the user to reply at each stop before continuing.
Run silently, then present results:
- Is
screenshot-factoryCLI available? (from Phase 0) - Does the project have a UITests target? (
*UITestsdirectory or Xcode target) - Does
fastlane/exist? - What is the
.xcodeproj/.xcworkspaceand scheme name?
Show a checklist with ✅/❌ for each item. If anything is missing, explain how to fix it.
Ask: "Everything look correct? Should I fix anything before continuing?" Then wait.
Analyze the project (read files, do not write):
- Supported locales (from
Localizable.xcstrings,.strings, orInfo.plist) - Brand colors (from
Assets.xcassets) - 5 key screens for App Store screenshots
- iPad support (from
Info.plistor target settings)
Present the analysis and proposed 5 screens.
Ask: "Are these the right screens? Want to change, add, or remove any? Are the detected locales correct?" Then wait.
Present the 6 templates and ask the user to choose:
| # | Template | Best for |
|---|---|---|
| 1 | dark-teal-accent | Games, social, entertainment |
| 2 | space-navy | Meditation, lifestyle, health |
| 3 | obsidian-minimal | Premium, e-commerce, productivity |
| 4 | dark-atmospheric | Atmospheric, immersive apps |
| 5 | light-clean | Utilities, tools, professional |
| 6 | vibrant-gradient | Fitness, social, creative |
Ask: "Which template fits your app? Reply with a number (1–6)." Then wait.
Show a summary of all files that will be created (SnapshotHelper.swift, capture.sh, pipeline.sh, Snapfile, screenshots.json, --screenshot-mode entry point, UITest file).
Ask: "Ready to proceed? (yes/no)" Then wait.
-
Copy infrastructure from
./fastlane/ScreenshotFactory/Capture/:SnapshotHelper.swift→{UITests target}/capture.sh→fastlane/(chmod +x)pipeline.sh→fastlane/(chmod +x)
-
Create
fastlane/Snapfilewith project name, scheme, devices (iPhone 17 Pro Max, optionally iPad), and detected languages. -
Create
fastlane/screenshots.jsonbased on./fastlane/ScreenshotFactory/Templates/{chosen-template}.json. Adjust brand colors. Generate localized benefit-focused text for each screen and each locale in the locale's native language.keyword: 3–5 words, benefit-focused, use{word}syntax to highlight the hero wordsubtitle: 1 short sentence- es-ES: use Spain Spanish tuteo, never Latin American voseo
-
Add
--screenshot-modehandling to the app's entry point. CreateScreenshotData.swiftwith realistic mock data. -
Create UITest
{Scheme}UITests.swiftwith class{Scheme}UITests, methodtestGenerateAppStoreScreenshots, usingsetupSnapshot(app)andsnapshot("01-{Name}")calls. UseaccessibilityIdentifierfor navigation. -
Verify: create
fastlane/screenshots/andfastlane/screenshots_framed/directories.
- Write BENEFITS, not features ("Perfect Messages" not "AI Generator")
- Every locale's text in that locale's native language
- Raw and framed screenshots in separate directories
- Each device class needs its own captures (never reuse iPhone for iPad)
When the user says "uninstall", "remove", or "desinstalar" Screenshot Factory, follow this workflow.
Silently check which files/directories exist in the project:
fastlane/Snapfile,fastlane/screenshots.json,fastlane/capture.sh,fastlane/pipeline.shfastlane/screenshots/,fastlane/screenshots_framed/fastlane/ScreenshotFactory/(cloned repo){UITests target}/SnapshotHelper.swift{UITests target}/{Scheme}UITests.swift--screenshot-modeblock in the app entry pointScreenshotData.swift
Show what will be removed and ask two extra questions:
- "Also remove
./fastlane/ScreenshotFactory/(the cloned tool)? (yes/no)" - "Also remove
{Scheme}UITests.swift? (only if it contains ONLY screenshot tests)"
Ask: "Confirm uninstall? (yes/no)" Do NOT delete anything until confirmed.
- Delete confirmed files and directories.
{Scheme}UITests.swift: if it only hastestGenerateAppStoreScreenshots→ delete file. If it has other tests → remove only that method andtapTabhelper.- App entry point: remove the
--screenshot-modeblock. DeleteScreenshotData.swiftif it exists. fastlane/ScreenshotFactory/: delete only if user said yes.
Show a summary of what was removed and what was skipped.