agentleFS
ShopifyKnown publisherShopify/cli/.agents/skills/cli-pre-submit-ci/SKILL.md

cli-pre-submit-ci

Skill772 starsChanged 8 months agoMITView on GitHub

Prevent predictable Shopify CLI PR CI failures before push or submit. Use when users: (1) ask what to run before pushing, submitting, restacking, opening, or updating a PR, (2) ask which generated files to commit or stage, (3) want to validate a branch against GitHub Actions, or (4) want to avoid CI churn after command, docs, workflow, schema, or test changes. At PR time, default to suggesting the minimal pre-submit checks rather than running a full local workflow automatically.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Start with the shared repo facts in ../_shared/shopify-cli-ci-repo-contracts.md.

    line 8
  2. Distinctive:

    Start by inspecting both the branch diff and the current working tree.

    line 17
  3. Distinctive:

    Use one consistent branch-diff command rather than rediscovering it each time.

    line 19
  4. Distinctive:

    Treat these as different scopes:

    line 28
  5. Distinctive:

    If the diff clearly maps to a narrow family, keep the investigation narrow.

    line 32
  6. Distinctive:

    Only do this if the diff class suggests a real CI-family mapping, or if the user asks for broader confidence.

    line 43
  7. Distinctive:

    Read sources in this order:

    line 45
  8. Very specific:

    Read only the files and script sections needed for the diff class you identified.

    line 54
  9. Distinctive:

    After any generator, freshness check, or lightweight sanity pass:

    line 67
  10. Distinctive:

    Do not stop at “run this command.” Explain what likely needs staging.

    line 81
  11. Very specific:

    If the diff is docs/config/wiring only, do not escalate to heavyweight checks unless the workflow or the user gives a reason.

    line 82
  12. Distinctive:

    If the change touches async/timing-heavy tests, local servers, callback flows, socket teardown, or workflow topology, warn that CI-only …

    line 84

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CLI pre-submit CI

Start with the shared repo facts in ../_shared/shopify-cli-ci-repo-contracts.md.

Principle

Derive the smallest sufficient pre-submit validation set from the current CI contract. Do not guess, and do not default to the broadest possible local run.

Pattern

1) Classify the diff first

Start by inspecting both the branch diff and the current working tree.

Use one consistent branch-diff command rather than rediscovering it each time.

Example:

git diff --name-only $(git merge-base HEAD origin/main)...HEAD
git status --short

Treat these as different scopes:

  • branch diff vs origin/main = what the PR currently changes
  • working tree status = what the user might still push next

If the diff clearly maps to a narrow family, keep the investigation narrow.

Diff classDefault response
docs/config/wiring only, with no obvious workflow-enforced generator familystop 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
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
user asks what to run before pushrecommend the minimal high-signal checks implied by the workflow
user asks what to commit or stagereproduce the relevant generator/check path, then inspect git status and diffs
user explicitly asks to run checksrun the minimal derived set, not the whole world

2) Resolve the contract for the relevant family

Only do this if the diff class suggests a real CI-family mapping, or if the user asks for broader confidence.

Read sources in this order:

  1. relevant .github/workflows/*.yml
  2. dev.yml
  3. package.json
  4. helper scripts referenced by those files

For normal PR work, start with .github/workflows/tests-pr.yml.

Read only the files and script sections needed for the diff class you identified. Avoid full reads of large files for docs/config/wiring-only diffs.

3) Map the diff to contract families

Change shapeInspect firstLikely response
Command/flag/help surfacedocs/manifests/readme freshness jobsderive the generator path from workflow → scripts
GraphQL queries or schemasschema/codegen freshness jobsderive the schema fetch + codegen path
TypeScript implementation or exportstype-check, lint, knip, bundle jobsfocused tests plus required static checks
Test helpers, async UI, network/auth/callback logicunit-test jobs and nearby testsfocused tests plus a CI-risk warning
Workflow files or CI plumbingaffected workflow definitionsvalidate the changed contract directly

4) Finish with staging guidance

After any generator, freshness check, or lightweight sanity pass:

  1. inspect git status --short
  2. inspect targeted diffs
  3. say which files look like:
    • required generated output
    • optional broad churn worth review
    • suspicious changes suggesting the wrong or incomplete generation path

Gotchas

  • At PR time, do not automatically run the full workflow-equivalent validation set unless the user asks.
  • dev.yml is a useful local entrypoint, but workflow YAML is the source of truth for what CI enforces.
  • Broad generated diffs are not automatically wrong; distinguish required churn from suspicious churn.
  • Do not stop at “run this command.” Explain what likely needs staging.
  • If the diff is docs/config/wiring only, do not escalate to heavyweight checks unless the workflow or the user gives a reason.
  • For docs/config/wiring-only diffs, avoid full reads of large workflow or script files unless the diff clearly maps to an enforced CI family.
  • If the change touches async/timing-heavy tests, local servers, callback flows, socket teardown, or workflow topology, warn that CI-only failures may still appear even after local checks pass.

Examples

  • "What should I run before I push this PR?" → derive the minimal checks from workflow → dev.yml → package.json, then recommend focused tests plus any required generators.
  • "Submit this PR." → treat it as a pre-submit moment, suggest the minimal recommended checks and likely staging requirements first, and ask before running them.
  • "Which generated files do I need to commit?" → reproduce the relevant generation path, inspect git status, and separate required generated output from optional churn.
  • "I changed a command flag; what repo checks matter?" → start from the freshness job that enforces command-surface updates rather than from memory.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.