Skip to content
Merged
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
12 changes: 11 additions & 1 deletion .agents/skills/check/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,17 @@ Schema changes require a rebuild — other packages import compiled output. This

## Full check sequence

**Option A — preflight script (recommended):** runs everything and prints a summary table:
**Default — the scoped check:** commit, then

```bash
yarn verify # what a publication runs: scoped build, type-check, tests, lint, format
```

It measures the commits on `HEAD` against `origin/main`, building only the packages the change
reads and running only the tests it can reach. The repository-wide jobs below are CI's; run them
locally only to prove something CI cannot show you sooner.

**Option A — preflight script (full proof):** runs everything and prints a summary table:

```bash
yarn preflight # format + build + typecheck + test + lint
Expand Down
12 changes: 11 additions & 1 deletion .claude/skills/check/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,17 @@ Schema changes require a rebuild — other packages import compiled output. This

## Full check sequence

**Option A — preflight script (recommended):** runs everything and prints a summary table:
**Default — the scoped check:** commit, then

```bash
yarn verify # what a publication runs: scoped build, type-check, tests, lint, format
```

It measures the commits on `HEAD` against `origin/main`, building only the packages the change
reads and running only the tests it can reach. The repository-wide jobs below are CI's; run them
locally only to prove something CI cannot show you sooner.

**Option A — preflight script (full proof):** runs everything and prints a summary table:

```bash
yarn preflight # format + build + typecheck + test + lint
Expand Down
3 changes: 3 additions & 0 deletions .cursor/rules/ci-and-workflow.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ yarn typecheck # zero errors required
yarn test # all unit tests must pass
```

Before a pull request, commit and run `yarn verify`: the scoped check a publication runs, which
leaves the repository-wide build, lint and complete test run to CI.

Across concurrent worktrees, use `test:file`, `test:workspace`, or `test:changed` for iteration.
`yarn test` is the one complete proof and intentionally serializes with other full runs; never
bypass a waiting lock with raw Vitest or workspace-level parallelism.
Expand Down
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ yarn test:workspace @aflow/schemas # One workspace through the shared config
yarn test:file path/to/example.test.ts # One or more explicit test files

# Quality / pre-PR
yarn verify # This branch's checks, scoped to what it changed — run before a PR
yarn preflight # Format, build, typecheck, test, lint — full check
yarn preflight:no-test # Same but skip tests (when infra is not running)
/check # Claude Code skill: auto-fix format/lint, then build + typecheck + test
Expand All @@ -183,6 +184,13 @@ wait with a second broad Vitest process or workspace-level parallel test command
`yarn test` or `yarn preflight` against a database a running stack uses — some suites drop and
recreate schemas.

**Before a pull request, run `yarn verify`** — the check a publication runs on this folder
(`scripts/verify-commit.mjs`). It measures the commits on `HEAD` against `origin/main`, so commit
first: it builds only the packages the change reads, type-checks the touched workspaces, runs the
tests a change can reach, and lints and formats the touched files. The repository-wide build,
lint and complete test run are CI's, on the pull request; `yarn preflight` is for proof, not a
routine step.

### Which stack for which change

| The change is… | Run it in | Build? |
Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ which is only worth rebuilding when the change is to the packaging itself.

```bash
yarn format # CI enforces format:check
yarn typecheck
yarn test:changed # the full `yarn test` is slow; run it for proof
yarn lint
git commit # yarn verify measures commits, not the working tree
yarn verify # build, type-check, tests and lint scoped to what the branch changed
```

Then:
Expand Down
6 changes: 4 additions & 2 deletions docs/dev/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,10 @@ projects one bounded worker pool, applies one project configuration, and prevent
sibling Git worktrees from competing for the same machine. Override its conservative
worker budget only for a measured run with `PHOENIX_TEST_WORKERS=<n>`.

`test:changed`, `test:workspace`, and `test:file` are feedback lanes. CI and preflight still run
the complete `yarn test` proof.
`test:changed`, `test:workspace`, and `test:file` are feedback lanes. Before a pull request,
`yarn verify` runs the branch's committed changes through a scoped build, type-check, the tests
they reach, and lint and format on touched files. CI and preflight still run the complete
`yarn test` proof.

**Multi-worktree rule:** if `yarn test` reports that another run owns the lock, leave it queued or
keep working with a focused feedback command. Do not bypass the wait with raw Vitest, package test
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"test:profile": "node scripts/test-runner.mjs profile",
"test:workspace": "node scripts/test-runner.mjs workspace",
"typecheck": "tsc -b && npx tsc -p packages/schemas/tsconfig.guards.json && node scripts/check-lifecycle-exhaustive.mjs && NODE_OPTIONS='--conditions=ts-source' node scripts/with-stack-env.mjs tsx scripts/large-files/cli.ts check && node scripts/lint-workspaces.mjs --assert-only && NODE_OPTIONS='--conditions=ts-source' node scripts/with-stack-env.mjs tsx scripts/context-budget/cli.ts check",
"verify": "node scripts/verify-commit.mjs",
"web:routes": "node scripts/generate-web-routes.mjs",
"third-party-notices": "node scripts/third-party-notices.mjs",
"contracts:check": "node scripts/publishable-contracts.mjs --check"
Expand Down
Loading