ci

ci is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 0 tokens per session (2,579 once invoked), scanned A, original, Apache-2.0.

A guide to the repository's GitHub Actions continuous-integration workflow, which runs checks for pull requests and before releases. It covers when to test affected packages or the full repository, lockfile handling, permissions, and valid workflow expression contexts.

In plain words
What is it for?
Use it when editing CI or release workflows, changing environment variables, selecting affected packages, or updating dependency installation and permission settings.
Why use it?
It prevents workflow files from becoming invalid, accidentally running no jobs, or weakening checks needed to validate changes before a release.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when editing CI or release workflows, changing environment variables, selecting affected packages, or updating dependency installation and permission settings.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/ci
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ci

README.md
[![agentmods](https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/ci/github.svg)](https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/ci)
Your own site
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/ci"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/ci/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ci

Your own site · 80×15
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/ci"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/ci.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,579 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02579
Opus 5.5 $0.00000 $0.01032
Sonnet 5.5 $0.00000 $0.00516
Haiku 4.5 $0.00000 $0.00258

Measured today against content hash 1446912d6844, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ci scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/ops/ci.mdc · 37 lines

How it starts

The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Continuous Integration

The gate is .github/workflows/ci.yml; read it for the step list. It is both the PR check and a reusable workflow: release.yml's gate job calls it, so every push to main is validated before a tag is cut (release.mdc). Deploy: cd.mdc. This rule loads with every workflow, so its expression-context, script, and hardening rules apply to all of them (install and telemetry: where a workflow installs or runs the tools).

Expression contexts - read before touching env:

Workflow-level env: may reference only github, secrets, inputs, vars; job-level env: adds needs, strategy, matrix; runner, job, steps, and env are step-level only. An unavailable context is a validation error: the file stops parsing, GitHub reports the run under the file path instead of the workflow name, and zero jobs execute - it never degrades to an empty string (this once left ci.yml and cd.yml unparseable for 14 pushes). Anything needing $RUNNER_TEMP goes through a step:

- run: echo "NODE_COMPILE_CACHE=$RUNNER_TEMP/node-compile-cache" >> "$GITHUB_ENV"

Invariants

  • Triggers: pull_request, workflow_call, workflow_dispatch. No push: - release.yml's gate covers pushes to main, so a commit is never checked twice.
  • The required check is the job name Lint, typecheck, test, and build (the main ruleset, strict up-to-date): renaming the ci job leaves every PR waiting on a check that never reports.
  • Parity is about the kinds of checks, not the mechanism: change both sides when adding or renaming a gate (deps:format:check exists because both call it by name). Locally pnpm run ci is pnpm run types, pnpm run boundaries, one turbo run of the //# root tasks plus check-types test build deploy:check with --continue=dependencies-successful, then pnpm run audit; here the same checks are separate parallel: steps calling bare pnpm run scripts. The local && chain is deliberately serial (types before type-aware lint, boundaries a cheap fail-fast pre-gate, audit a success-gated network tail); a parallel-sections rewrite was rejected to keep the gate zero-dependency. Never route the workflow through the //# tasks: a root task's default inputs span the repo, so under futureFlags.affectedUsingTaskInputs it would always be affected and defeat --affected.
  • Scope by event: --affected on pull_request only, the full graph on workflow_call / workflow_dispatch (a release validates everything), expressed as two if:-gated steps - never interpolate the flag into a run: body. The dependency audit is pull_request-only for the inverse reason: the advisory DB changes daily, so an auditing release gate is not a pure function of the commit (local pnpm run ci still audits).
  • The Changesets step is pull_request-only, like the audit: release:check diffs against origin/main, so the release gate has nothing to check. Locally ci, ci:agent, and ci:sandbox run it as //#release:check; ci:affected does not, since mid-task a changeset is not due yet. CHANGESET_ALLOW_MAJOR reads the release:major label from the event payload, and label events start no CI run, so adding the label takes a re-run of the job. The step also gets GITHUB_TOKEN (the job's contents: read) to read the base pnpm-workspace.yaml through the API. CHANGESET_SKIP_RUNTIME_DEPENDENCIES is set only on a Dependabot PR when CHANGESET_BOT_TOKEN is absent (release.mdc).
  • No TURBO_SCM_BASE: on pull_request turbo infers the base from GitHub Actions, and futureFlags.githubActionsRemoteBaseRefFallback resolves it to origin/<base_ref> (checkout creates only remote-tracking refs). Never set it off PRs: github.event.before is all-zeros on a new branch, which silently degrades --affected to "everything changed". Keep fetch-depth: 0 + filter: blob:none.
  • One job, with the parallel: step keyword (GA 2026-06-25, alongside background / wait / wait-all / cancel) for OXC (lint:ci, pinned to --format=github for PR annotations, and format), boundaries, syncpack, and zizmor; Knip is diagnostic only, never a step here or in pnpm run ci (quality-report.mdc). A parallel: list item takes no sibling keys. At most 10 background steps run at once and a PR runs 9, so an eleventh item would queue behind the others. The "Generate cf types" step (pnpm run types) runs before parallel:: type-aware lint needs the gitignored types, and the parallel turbo step, their only other producer, is --affected on PRs. There is no types-drift step (nothing generated is committed). check-types test build deploy:check is a single turbo run --continue=dependencies-successful at default concurrency (no override in turbo.json), so one run reports every package's failures.
  • The deploy dry-run is the deploy:check task (cf deploy --prebuilt --mode production --dry-run per app) inside that single run, never a step after the join: turbo run deploy -- --dry-run hashes the pass-through args into every task of the graph, so the whole app build re-ran uncached. It depends on build only, and with --prebuilt needs neither token nor account ID, so the job gets no Cloudflare variables. ci:sandbox drops it with build: cf also stats the app's .env, which the agent sandbox denies (EPERM), and SKIP_ENV_FILES does not reach cf deploy.
  • The release PR's check comes from a dispatched run: GitHub holds the pull_request runs of a github-actions[bot] PR at action_required until a writer approves them, so release.yml's version job runs gh workflow run ci.yml --ref changeset-release/main; a dispatch is exempt, and its run reports the bare job name on the PR head. The job-level if still skips an approved pull_request run of that PR, whose release:check would fail on the changesets the PR consumes. It is bound to head_ref == 'changeset-release/main' and author github-actions[bot]: a prefix match would let any PR skip the required check by naming its branch, and a pull_request branches-ignore filters the base branch, so it cannot express this.
  • Step bodies longer than a few lines are scripts under .github/actions/<concern>/ (cd/, changesets/, previews/, quality/, release/; shared modules in lib/), not inline YAML. Invoke with bash <path>, wire inputs through step-level env:, open each script with set -euo pipefail, and fail fast on missing input (:? guards or an explicit check). Short steps stay inline.
  • Install, in every workflow that installs: pnpm install --frozen-lockfile after pnpm/setup with install: false; Node runtime: node@26, matching root engines.
  • Only ci.yml saves the pnpm store cache: actions/cache keyed on hashFiles('pnpm-lock.yaml'), never pnpm/setup's cache: true, whose key includes the run id and saved a new ~300 MB entry on every job. quality.yml's analyze job and changeset-pr-status.yml's pr-status job restore the same key read-only with actions/cache/restore (quality-report.mdc). Jobs holding a write token or Cloudflare credentials (version, CD, Previews) restore no cache: defense in depth, since cache scoping already keeps PR entries away from main.
  • Remote cache: job env wires TURBO_TOKEN, TURBO_TEAM, and TURBO_REMOTE_CACHE_SIGNATURE_KEY (repo secret, >= 32 bytes, the same value as local machines; turbo.json enables remoteCache.signature + longerSignatureKey). workflow_call declares those secrets explicitly so the release gate never receives Cloudflare credentials; never secrets: inherit. TURBO_CACHE is local:rw,remote:rw on pull_request and local:rw,remote:w everywhere else: signing checks integrity, not trust, and same-repo PR runs hold both token and key, so a PR could upload an entry the release gate would replay as a passing check-types / test / build; write-only makes the gate run the full graph fresh and publish trusted artifacts. CD has no Turbo token at all. envMode is strict: a workflow env: value reaches a turbo task only if turbo.json lists it in env / passThroughEnv.
  • Hardening, every workflow: every uses: is a full-length commit SHA with a # vX.Y.Z comment; actions/checkout sets persist-credentials: false; workflow permissions: {} with per-job re-grants (ci.yml: contents: read only - artifact upload and actions/cache use the runner's runtime token, not GITHUB_TOKEN); a same-repo uses: is $/<path> (this repository at the running commit, no checkout needed), never ./<path> - Dependabot ignores both; runners ubuntu-24.04, never ubuntu-latest. A workflow that runs turbo, cf, or Wrangler turns telemetry off at workflow env: (DO_NOT_TRACK covers cf; CF_SEND_TELEMETRY: "false" beside WRANGLER_SEND_METRICS).
  • cancel-in-progress only on pull_request. Never interpolate github.ref_name into script bodies. No production or Cloudflare secrets in this workflow (CD only).
  • Never add scanners "for completeness" without a concrete threat and owner. zizmor (the Workflow security step) has both: workflow edits, often agent-written, that bring an unpinned or impostor pin, a # vX.Y.Z comment not matching its SHA, template injection, or permission creep; the owner is the /.github/ CODEOWNERS entry. It is pull_request-only like the audit, since its online audits query the GitHub API, and CI-only (no Node distribution): reproduce with uvx zizmor . when uv is available. Fix a finding; an unavoidable one gets an inline # zizmor: ignore[<audit>] naming why.

Read the full file on GitHub · 37 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed 1446912d6844
  2. 20d ago Changed 4a3ba9d51eeb
  3. 22d ago Changed · +3 lines 50024c57211a
  4. 23d ago Changed 1e06fcb3bc6d
  5. 25d ago Changed 1568dab49229
  6. 27d ago Changed ceec4143a1d1
  7. 1mo ago First seen · 34 lines · 0 tokens per session scan A e09686cb2ef8

Subscribe to this mod's changes

ci is a cursor rule published in the GitHub repository louisbrulenaudet/monorepo-template (19 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,579 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.