Skip to content
Open
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
5 changes: 5 additions & 0 deletions .agents/external-skills.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@
"repo": "twostraws/SwiftData-Agent-Skill",
"path": "swiftdata-pro",
"ref": "922d989473a9914210b41529a1ac5636aff4b8c1"
},
"simple-english": {
"repo": "AminBlg/SimpleEnglish",
"path": "skills/simple-english",
"ref": "59bf6702197a5aadc96d197ea17f290d8d50dcd3"
}
}
1 change: 1 addition & 0 deletions .agents/skills/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# External skills — fetched via ./sync-agents --install
/simple-english/
/swift-concurrency-pro/
/swift-testing-pro/
/swiftdata-pro/
Expand Down
185 changes: 50 additions & 135 deletions .agents/skills/building-ui/SKILL.md

Large diffs are not rendered by default.

188 changes: 55 additions & 133 deletions .agents/skills/github-workflow/SKILL.md

Large diffs are not rendered by default.

68 changes: 22 additions & 46 deletions .agents/skills/running-tests/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
---
name: running-tests
description: Runs the test suite via ./test, picks the right tier, and manages the per-checkout simulator. Use when running tests, choosing a test scope, debugging simulator launch failures, or reviewing snapshot diffs.
description: Run the test suite with ./test. Pick the right tier. Manage the per-checkout simulator. Use when you run tests, pick scope, debug simulator launch failures, or review snapshot diffs.
---

How to run tests in this repo. Read root [`AGENTS.md`](../../../AGENTS.md) for
always-on rules: **use [`./test`](../../../test)** — never hand-roll `tuist test`
or `xcodebuild`; validate in proportion to the change.
Canonical flag list: `./test --help`. Rationale for `./test` over alternatives:
header comment in [`test`](../../../test).
This skill tells you how to run tests in this repo. Read root [`AGENTS.md`](../../../AGENTS.md) for always-on rules. Use [`./test`](../../../test). Do not hand-roll `tuist test` or `xcodebuild`. Validate in proportion to the change. The canonical flag list is `./test --help`. The header comment in [`test`](../../../test) explains why `./test` is the entry point.

## Documentation-only changes

Pure documentation or comment-only changes may skip `./test`. Skip
`./swiftformat --lint` too when the changed files are outside the formatter's
scope. Record skipped checks and the reason in the commit or PR validation.
You may skip `./test` for pure documentation or comment-only changes. You may skip `./swiftformat --lint` when changed files are outside the formatter scope. Record skipped checks and the reason in the commit or PR validation.

Do not classify a semantic change to configuration, scripts, generator inputs,
executable examples, or app-rendered copy as documentation-only. Run the
narrowest applicable checks below instead.
Do not classify a semantic change to configuration, scripts, generator inputs, executable examples, or app-rendered copy as documentation-only. Run the narrowest applicable checks below instead.

## Pick a tier

Pick the **narrowest tier that covers the change**:
Pick the narrowest tier that covers the change:

| Tier | Command | When |
|------|---------|------|
Expand All @@ -37,25 +29,17 @@ Examples:
- Edited `WhereCore` + `WhereUI` → `./test` or `./test --all` before committing
- Changed a stylesheet token that renders → `./test --snapshots` (or `./test` if the graph already pulls snapshots in)

Compare against a ref other than `origin/main`: `./test --base REF`.
To compare against a ref other than `origin/main`, run `./test --base REF`.

## Snapshots

**Opt-in, not part of "done" by default.** Run `./test --snapshots` when the
change touches a **view or its appearance**, a **stylesheet token**, a **string
that renders**, **`SnapshotKit` / `SnapshotKitTesting`**, or a **reference
image**. `./test` with no arguments already includes image bundles when the
dependency graph says they're affected.
Snapshots are opt-in. They are not part of "done" by default. Run `./test --snapshots` when the change touches a view or its appearance, a stylesheet token, a string that renders, `SnapshotKit` / `SnapshotKitTesting`, or a reference image. `./test` with no arguments already includes image bundles when the dependency graph says they are affected.

- **`--review`** — how each differing reference differs (pixel count, max delta,
changed region); use to tell a broken render from antialiasing drift
- **`--review`** — how each differing reference differs (pixel count, max delta, changed region). Use it to tell a broken render from antialiasing drift.
- **`--timings`** — where capture time went per phase
- **`--record MODE`** — re-record references: `all`, `failed`, `missing`, or
`never` (default). Fix the view first; re-record only when the render is
correct
- **`--record MODE`** — re-record references: `all`, `failed`, `missing`, or `never` (default). Fix the view first. Re-record only when the render is correct.

Don't parallelize the image suite — see
[`Shared/SnapshotKitTesting/AGENTS.md`](../../../Shared/SnapshotKitTesting/AGENTS.md).
Do not parallelize the image suite. See [`Shared/SnapshotKitTesting/AGENTS.md`](../../../Shared/SnapshotKitTesting/AGENTS.md).

## Iterate faster

Expand All @@ -66,31 +50,24 @@ After a green build:
./test --only 'WhereCoreTests/FooTests/bar()'
```

`--only` takes a full xcodebuild test identifier — bundle, suite, or
`Bundle/Suite/testName()`. Repeatable for several tests.
`--only` takes a full xcodebuild test identifier — bundle, suite, or `Bundle/Suite/testName()`. Repeat it for several tests.

## When tests fail

- Swift Testing's headline is often contentless ("Issue recorded"); read the
**`↳` block** below it for the real reason, path, and snapshot paths.
- Snapshot mismatch → `./test --snapshots --review` on the failing reference.
- Green locally / red on CI → merge latest `main` and re-run before debugging
(see [`github-workflow`](../github-workflow/SKILL.md)).
- Swift Testing's headline is often contentless ("Issue recorded"). Read the **`↳` block** below it for the real reason, path, and snapshot paths.
- If a snapshot mismatches, run `./test --snapshots --review` on the failing reference.
- If tests are green locally and red on CI, merge latest `main` and re-run before you debug. See [`github-workflow`](../github-workflow/SKILL.md).

## Simulator

`./test` resolves a UDID via [`./simulator`](../../../simulator) — don't pass a
device *name* to `simctl` or hand-roll a `-destination`.
`./test` resolves a UDID via [`./simulator`](../../../simulator). Do not pass a device *name* to `simctl`. Do not hand-roll a `-destination`.

- **First `./simulator` run in a checkout** creates and boots a device — budget
a couple of minutes for the first boot.
- **Launch failures that look like test failures** (suites that do run are
green):
- The first `./simulator` run in a checkout creates and boots a device. Budget a couple of minutes for the first boot.
- Launch failures can look like test failures when suites that do run are green:
- `Application failed preflight checks (Busy)`
- `Mach error -308 — server died` / `crashed with signal kill before
establishing connection`
→ wedged or contended device → `./simulator --recreate`, then re-run `./test`.
- Deeper ops (`--list`, `--prune`, `--device` / `--os`): `./simulator --help`.
- `Mach error -308 — server died` / `crashed with signal kill before establishing connection`
- If you see these errors, run `./simulator --recreate`. Then re-run `./test`.
- For deeper ops (`--list`, `--prune`, `--device` / `--os`), run `./simulator --help`.

Raw one-off `xcodebuild` (rare):

Expand All @@ -100,9 +77,8 @@ Raw one-off `xcodebuild` (rare):

## Environment

- **macOS + Xcode required** for `./test`.
- **Linux cloud agents** — `./swiftformat --lint` and `./sync-agents` only; no
simulator or test runs. Full validation matches CI on macOS.
- `./test` requires macOS and Xcode.
- Linux cloud agents can run `./swiftformat --lint` and `./sync-agents` only. They cannot run the simulator or tests. Full validation matches CI on macOS.

## Full macOS validation (matches CI)

Expand Down
Loading
Loading