Skip to content

Commit 0aaa4b5

Browse files
committed
Reference pre-ci:affected and lean the pre-submit skill on the gate manifest
1 parent 3698158 commit 0aaa4b5

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

.agents/skills/_shared/shopify-cli-ci-repo-contracts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For normal PR CI work, start with `.github/workflows/tests-pr.yml`.
2727

2828
## Local pre-submit tooling
2929

30-
- `pnpm pre-ci` runs the local subset of PR gates at full CI parity (type-check, lint, build, knip, codegen freshness, unit tests). It is heavier than routine work needs; prefer the minimal diff-derived set below, and reach for `pre-ci` when the user wants full confidence before a high-risk push.
30+
- `pnpm pre-ci` runs the local subset of PR gates at full CI parity (type-check, lint, build, knip, codegen freshness, unit tests). `pnpm pre-ci:affected` runs the diff-scoped fast variant (nx/vitest affected; skips the codegen freshness checks unless the diff touches commands, flags, or GraphQL). Default to affected; reach for full `pre-ci` before a high-risk push.
3131
- Codegen freshness is single-sourced in `package.json`: `pnpm codegen` regenerates all generated files; `pnpm codegen:check:graphql` / `:oclif` regenerate and assert a clean tree. The workflow's `graphql-schema` and `oclif-checks` jobs call these scripts, so local and CI cannot drift.
3232
- `bin/ci-gates.js` is the source of truth mapping each `tests-pr.yml` job to a `pre-ci` command or a `ci-only` reason. `pnpm check-ci-gates` (CI job `CI gate manifest`) fails if a workflow job is unclassified or if the Node/pnpm versions in `dev.yml` and `tests-pr.yml` disagree.
3333

.agents/skills/cli-pre-submit-ci/SKILL.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@ If the diff clearly maps to a narrow family, keep the investigation narrow.
3535
|---|---|
3636
| docs/config/wiring only, with no obvious workflow-enforced generator family | **stop there unless contradicted**: run lightweight sanity checks only (`git diff --check`, validate changed symlink targets, validate local markdown links if relevant); do not full-read large workflow/script files |
3737
| user is at PR time (`submit`, `open`, `update`, `restack`) | advisory mode: suggest minimal checks, staging needs, and likely CI risk; ask before running anything substantial |
38-
| user asks what to run before push | recommend the minimal high-signal checks implied by the workflow; mention `pnpm pre-ci` as the full-parity option for a high-risk push |
38+
| user asks what to run before push | `pnpm pre-ci:affected` for a diff-scoped fast check, or the minimal high-signal checks implied by the workflow; `pnpm pre-ci` for full parity before a high-risk push |
3939
| user asks what to commit or stage | reproduce the relevant generator/check path, then inspect git status and diffs |
4040
| user explicitly asks to run checks | run the minimal derived set, not the whole world |
4141

4242
### 2) Resolve the contract for the relevant family
4343
Only do this if the diff class suggests a real CI-family mapping, or if the user asks for broader confidence.
4444

45-
Read sources in this order:
45+
The gate list is already resolved in [`bin/ci-gates.js`](../../../bin/ci-gates.js) — each `tests-pr.yml` job mapped to its local command (full and affected) or a ci-only reason. Read it first; `pnpm pre-ci` / `pnpm pre-ci:affected` run those gates, so most pre-submit work needs no per-diff YAML archaeology.
46+
47+
When the manifest is not enough, resolve from the contract files in this order:
4648

4749
1. relevant `.github/workflows/*.yml`
4850
2. `dev.yml`
@@ -75,7 +77,7 @@ After any generator, freshness check, or lightweight sanity pass:
7577

7678
## Gotchas
7779

78-
- At PR time, do **not** automatically run the full workflow-equivalent validation set unless the user asks. `pnpm pre-ci` is that full set — offer it for high-risk pushes, but default to the minimal derived checks.
80+
- At PR time, do **not** automatically run the full workflow-equivalent validation set unless the user asks. `pnpm pre-ci` is that full set; `pnpm pre-ci:affected` is the diff-scoped fast check (and skips the codegen freshness checks unless the diff touches commands, flags, or GraphQL). Default to affected or the minimal derived checks.
7981
- `dev.yml` is a useful local entrypoint, but workflow YAML is the source of truth for what CI enforces.
8082
- Broad generated diffs are not automatically wrong; distinguish required churn from suspicious churn.
8183
- Do not stop at “run this command.” Explain what likely needs staging.

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Entry point for contributors and coding agents. Canonical docs live under [`docs
77

88
## Before you push
99

10-
- Derive the minimal checks for your diff with the [`cli-pre-submit-ci`](./.agents/skills/cli-pre-submit-ci/SKILL.md) skill. For full local CI parity (slower), run `pnpm pre-ci`.
10+
- Run `pnpm pre-ci:affected` for a fast, diff-scoped pre-push check, or `pnpm pre-ci` for full CI parity before a high-risk push. The [`cli-pre-submit-ci`](./.agents/skills/cli-pre-submit-ci/SKILL.md) skill covers deriving the minimal set and what to stage.
1111
- After changing commands, flags, or GraphQL queries, run `pnpm codegen` and commit the regenerated files.
1212
- `pnpm check-ci-gates` keeps the local gate list ([`bin/ci-gates.js`](./bin/ci-gates.js)) and pinned tool versions in sync with the workflow.
1313

docs/cli/get-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ Besides the scripts for building and running the CLIs, there are others that mig
7272
- `pnpm lint:fix`: Runs ESLint and Prettier checks for all the packages and fixes the fixable issues.
7373
- `pnpm type-check`: Type-checks all the packagesusing the Typescript `tsc` tool.
7474
- `pnpm clean`: Removes the `dist` directory from all the packages.
75-
- `pnpm pre-ci`: Runs the local subset of PR CI gates (type-check, lint, build, knip, codegen freshness, unit tests) at full parity with CI. Slower, for a high-risk push; for routine PRs derive the minimal checks for your diff (see the `cli-pre-submit-ci` agent skill).
75+
- `pnpm pre-ci`: Runs the local subset of PR CI gates (type-check, lint, build, knip, codegen freshness, unit tests) at full parity with CI. Slower, for a high-risk push.
76+
- `pnpm pre-ci:affected`: The diff-scoped fast variant for routine PRs (nx/vitest affected; skips codegen freshness checks unless the diff touches commands, flags, or GraphQL).
7677
- `pnpm codegen`: Regenerates all generated files (GraphQL types, OCLIF manifests, README, docs). Run after changing commands, flags, or queries, and commit the result.
7778
- `pnpm check-ci-gates`: Verifies the local CI-gate manifest stays in sync with the GitHub Actions workflow.
7879

0 commit comments

Comments
 (0)