diff --git a/.agents/skills/check/SKILL.md b/.agents/skills/check/SKILL.md index f5cba049..a426aa47 100644 --- a/.agents/skills/check/SKILL.md +++ b/.agents/skills/check/SKILL.md @@ -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 diff --git a/.claude/skills/check/SKILL.md b/.claude/skills/check/SKILL.md index b15f537f..4bfc216f 100644 --- a/.claude/skills/check/SKILL.md +++ b/.claude/skills/check/SKILL.md @@ -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 diff --git a/.cursor/rules/ci-and-workflow.mdc b/.cursor/rules/ci-and-workflow.mdc index 39b2d402..ea93ca33 100644 --- a/.cursor/rules/ci-and-workflow.mdc +++ b/.cursor/rules/ci-and-workflow.mdc @@ -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. diff --git a/CLAUDE.md b/CLAUDE.md index abdeafb1..d01dff1f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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 @@ -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? | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1b9d1f58..26f5d88c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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: diff --git a/docs/dev/CONTRIBUTING.md b/docs/dev/CONTRIBUTING.md index 0b968cb1..970be713 100644 --- a/docs/dev/CONTRIBUTING.md +++ b/docs/dev/CONTRIBUTING.md @@ -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=`. -`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 diff --git a/package.json b/package.json index 0ab7cc54..efa3e2e0 100644 --- a/package.json +++ b/package.json @@ -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"