Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# AGENTS.md

Guidance for agents working in the **CheckList** repository.

## Project overview

CheckList is a native **iOS** app (Swift 3.0, iOS 10.3 deployment target) generated
from Xcode's "Single View App" template. It uses UIKit with Interface Builder
storyboards and a Core Data stack (`NSPersistentContainer` in
`CheckList/AppDelegate.swift`; the model at `CheckList/CheckList.xcdatamodeld` has
no entities yet). It is early-stage scaffolding — `ViewController.swift` is empty.

- Single app target `CheckList` (bundle id `Summer-2017.CheckList`).
- **No** dependency manager (no `Podfile`, `Package.swift`, or `Cartfile`).
- **No** test target and **no** lint configuration in the repo.
- **No** backend/services — data is local via Core Data.

## Cursor Cloud specific instructions

Cloud agents run on **Linux**, and this app **cannot be built, linted, tested, or
run here**. It depends on Apple-only tooling and frameworks that exist exclusively
on macOS + Xcode:

- `import UIKit` / iOS `CoreData` are not in the Linux Swift toolchain.
- Storyboards and asset catalogs need `ibtool`/`actool` (Xcode-only).
- Build/run need `xcodebuild` and the iOS Simulator (macOS + Xcode only).

The VM has `clang`, `python3`, and `xmllint` but **no** `swift`/`swiftc`/
`xcodebuild`/`swiftlint`, and `download.swift.org` is blocked by egress policy.
Installing the Linux Swift toolchain would not help anyway (no UIKit/iOS SDK).

### What you CAN do on Linux
- Edit Swift source, storyboards, `Info.plist`, Core Data model, and `project.pbxproj`.
- Run the structural integrity check (the closest thing to a build on Linux):
```bash
bash scripts/validate-project.sh
```
It confirms referenced source files exist and every XML/plist asset is
well-formed, then prints key project settings. Exit 0 = structure valid.

### What requires macOS + Xcode (do NOT expect these to work on the cloud VM)
- Build: `xcodebuild -project CheckList.xcodeproj -scheme CheckList -sdk iphonesimulator -configuration Debug build`
- Run: open `CheckList.xcodeproj` in Xcode and press ⌘R on an iOS Simulator.
- Test: no test target exists, so there is nothing to run.
- Lint/analyze: Xcode → Product → Analyze (or SwiftLint if installed on macOS).

For any 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 edits.
Swift 3.0 syntax may prompt automatic migration in a modern Xcode.

### Update script note
There are no dependencies to install, so the VM startup/update script is a no-op.
85 changes: 85 additions & 0 deletions scripts/validate-project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/usr/bin/env bash
#
# validate-project.sh
#
# Linux-friendly integrity check for the CheckList iOS project.
#
# This project is a native iOS (Swift/UIKit/Core Data) app that can only be
# built and run on macOS with Xcode. On a Linux VM there is no Swift/iOS
# toolchain, so the closest available "build" is verifying that the Xcode
# project is internally consistent: referenced source files exist and every
# XML/plist asset is well-formed.
#
# Exit code 0 means the project structure is valid.

set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"

fail=0
pass() { printf ' [ OK ] %s\n' "$1"; }
err() { printf ' [FAIL] %s\n' "$1"; fail=1; }

echo "==> CheckList project validation (Linux structural check)"
echo " root: $ROOT"

echo
echo "==> Required files present"
for f in \
"CheckList.xcodeproj/project.pbxproj" \
"CheckList/AppDelegate.swift" \
"CheckList/ViewController.swift" \
"CheckList/Info.plist" \
"CheckList/Base.lproj/Main.storyboard" \
"CheckList/Base.lproj/LaunchScreen.storyboard" \
"CheckList/CheckList.xcdatamodeld/CheckList.xcdatamodel/contents"
do
if [ -f "$f" ]; then pass "$f"; else err "missing: $f"; fi
done

echo
echo "==> XML / plist assets are well-formed"
xml_files=(
"CheckList/Info.plist"
"CheckList/Base.lproj/Main.storyboard"
"CheckList/Base.lproj/LaunchScreen.storyboard"
"CheckList/CheckList.xcdatamodeld/CheckList.xcdatamodel/contents"
"CheckList.xcodeproj/project.xcworkspace/contents.xcworkspacedata"
"CheckList/Assets.xcassets/AppIcon.appiconset/Contents.json"
)
for f in "${xml_files[@]}"; do
[ -f "$f" ] || { err "missing (cannot parse): $f"; continue; }
case "$f" in
*.json)
if python3 -c "import json,sys; json.load(open(sys.argv[1]))" "$f" 2>/dev/null; then
pass "valid JSON: $f"
else
err "invalid JSON: $f"
fi
;;
*)
if xmllint --noout "$f" 2>/dev/null; then
pass "well-formed XML: $f"
else
err "malformed XML: $f"
fi
;;
esac
done

echo
echo "==> Project settings (from project.pbxproj)"
grep -m1 'SWIFT_VERSION' CheckList.xcodeproj/project.pbxproj | sed 's/^[[:space:]]*/ /'
grep -m1 'IPHONEOS_DEPLOYMENT_TARGET' CheckList.xcodeproj/project.pbxproj | sed 's/^[[:space:]]*/ /'
grep -m1 'PRODUCT_BUNDLE_IDENTIFIER' CheckList.xcodeproj/project.pbxproj | sed 's/^[[:space:]]*/ /'

echo
if [ "$fail" -eq 0 ]; then
echo "==> RESULT: PASS — project structure is valid."
echo " NOTE: Building/running the app requires macOS + Xcode (see AGENTS.md)."
exit 0
else
echo "==> RESULT: FAIL — see [FAIL] lines above."
exit 1
fi