diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..f02ca02 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,46 @@ +# AGENTS.md + +Guidance for AI agents working in the CheckList repository. + +## Project overview + +CheckList is a native **iOS UIKit** application (Swift 3, iOS 10.3+). It uses storyboards, an empty Core Data model, and a single app target (`Summer-2017.CheckList`). There is no backend, no package manager (CocoaPods/SPM), and no automated test or lint configuration in the repo. + +## Local development (macOS required) + +Building and running the app requires **macOS with Xcode**. UIKit and `xcodebuild` are not available on Linux cloud agent VMs. + +| Task | Command / action | +|------|------------------| +| Open project | `open CheckList.xcodeproj` | +| Run in simulator | Xcode → Product → Run (⌘R), scheme **CheckList** | +| CLI build (simulator) | `xcodebuild -project CheckList.xcodeproj -scheme CheckList -sdk iphonesimulator -configuration Debug build` | +| Static analysis | Xcode → Product → Analyze | + +There are no `npm`, `docker compose`, or `make` workflows in this repository. + +## Cursor Cloud specific instructions + +Cloud agents run on **Linux** and cannot compile or launch this iOS app. Treat the following as the supported cloud workflow: + +1. **Validate repo integrity** after checkout or edits: + ```bash + bash scripts/validate-project.sh + ``` +2. **Do not expect** `xcodebuild`, SwiftLint, or unit tests to run in the cloud VM unless the environment is macOS with Xcode installed. +3. **No services to start** — this is a single native app with embedded Core Data (no external database or API). +4. **No dependency install step** — the project has no Podfile, Package.swift, or Gemfile. The VM update script only re-runs project validation. +5. For end-to-end verification (simulator launch, UI interaction), use a **macOS machine with Xcode** or ask the user to run the app locally after cloud-side code changes. + +### What agents can do on Linux + +- Edit Swift, storyboards, plist, and Xcode project files +- Run `scripts/validate-project.sh` to confirm referenced files exist and XML assets parse +- Review project structure and `project.pbxproj` settings + +### What requires macOS + +- Building `CheckList.app` +- Running on iOS Simulator or device +- Xcode Interface Builder for visual storyboard edits +- Adding/running XCTest targets diff --git a/scripts/validate-project.sh b/scripts/validate-project.sh new file mode 100755 index 0000000..3a44c54 --- /dev/null +++ b/scripts/validate-project.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +# Validates CheckList Xcode project structure on any host (including Linux). +# Full build/run requires macOS with Xcode; this script checks repo integrity only. +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$ROOT" + +pass=0 +fail=0 + +ok() { + echo "PASS: $1" + pass=$((pass + 1)) +} + +err() { + echo "FAIL: $1" >&2 + fail=$((fail + 1)) +} + +require_file() { + if [[ -f "$1" ]]; then + ok "file exists: $1" + else + err "missing file: $1" + fi +} + +require_dir() { + if [[ -d "$1" ]]; then + ok "directory exists: $1" + else + err "missing directory: $1" + fi +} + +echo "== CheckList project validation ==" +echo "Root: $ROOT" +echo + +require_file "CheckList.xcodeproj/project.pbxproj" +require_file "CheckList/AppDelegate.swift" +require_file "CheckList/ViewController.swift" +require_file "CheckList/Info.plist" +require_file "CheckList/Base.lproj/Main.storyboard" +require_file "CheckList/Base.lproj/LaunchScreen.storyboard" +require_file "CheckList/CheckList.xcdatamodeld/CheckList.xcdatamodel/contents" +require_dir "CheckList/Assets.xcassets" + +if command -v xmllint >/dev/null 2>&1; then + for xml in \ + CheckList/Info.plist \ + CheckList/Base.lproj/Main.storyboard \ + CheckList/Base.lproj/LaunchScreen.storyboard \ + CheckList.xcodeproj/xcuserdata/Aaditya.xcuserdatad/xcschemes/CheckList.xcscheme; do + if xmllint --noout "$xml" 2>/dev/null; then + ok "well-formed XML: $xml" + else + err "invalid XML: $xml" + fi + done +else + echo "SKIP: xmllint not available for XML validation" +fi + +if grep -q 'PRODUCT_BUNDLE_IDENTIFIER = "Summer-2017.CheckList"' CheckList.xcodeproj/project.pbxproj; then + ok "bundle identifier present in project.pbxproj" +else + err "bundle identifier not found in project.pbxproj" +fi + +if grep -q 'IPHONEOS_DEPLOYMENT_TARGET = 10.3' CheckList.xcodeproj/project.pbxproj; then + ok "iOS deployment target 10.3 configured" +else + err "expected iOS deployment target not found" +fi + +if command -v xcodebuild >/dev/null 2>&1; then + echo + echo "== xcodebuild detected; attempting simulator build ==" + if xcodebuild \ + -project CheckList.xcodeproj \ + -scheme CheckList \ + -sdk iphonesimulator \ + -configuration Debug \ + -destination 'platform=iOS Simulator,name=iPhone 15' \ + build; then + ok "xcodebuild simulator build succeeded" + else + err "xcodebuild simulator build failed" + fi +else + echo + echo "SKIP: xcodebuild not available (expected on Linux cloud VMs)" + echo " Open CheckList.xcodeproj in Xcode on macOS and press Cmd+R to run." +fi + +echo +echo "== Summary ==" +echo "Passed: $pass" +echo "Failed: $fail" + +if [[ "$fail" -gt 0 ]]; then + exit 1 +fi + +exit 0