Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 4.65 KB

AGENTS.md

File metadata and controls

36 lines (25 loc) · 4.65 KB

AGENTS.md

Releases run in standing-PR mode with sync versioning; the standing release PR lives on release/next.

Architecture invariants

Violating these breaks releases.

  • Three-stage pipeline version → notes → publish. VersionOutput (packages/core/src/types.ts) is the JSON contract between stages and is persisted in standing-PR manifests — new fields must be optional; consumers must tolerate their absence (old manifests live in open PRs).
  • Roll-forward in standing-PR mode the version bump is on main before publishing. In direct batch mode it is not pushed until every publish succeeds. Tags are created locally before publishing and pushed after a clean publish (once at the end in batch mode, after each package in per-package mode). A failed publish is never recovered by reverting commits or by deleting a tag whose version was published. Already-published versions are skipped on retry. See docs/architecture.md.
  • Release-commit prefix subjects starting with chore: release match release.ci.skipPatterns and suppress standing-PR update runs. Keep the prefix on release commits; nothing else may use it.
  • [skip ci] asymmetry the direct-release commit on main (version.commitMessage) includes it to stop CI loops — leave it. The standing-PR branch's prep commit must NOT: a squash merge inherits its message, and [skip ci] on main would suppress the publish workflow.
  • Marker comments every bot comment is keyed by a distinct HTML marker and posted idempotently (update-in-place). Machine state uses its own marker line — never parse the human prose.
  • Workflow if guards can't read config label names in workflow guards are hardcoded defaults; in-step checks against releasekit.config.json are authoritative.

Design decisions are recorded in docs/adr/ — check there before reworking a load-bearing choice.

Commands

  • Before you push: run pnpm lint, pnpm typecheck and pnpm test. The commit hook only checks staged files, and nothing runs on push. pnpm test skips @releasekit/version's and @releasekit/release's own test/integration/; run pnpm --filter @releasekit/version test:integration when you change the version CLI, and pnpm --filter @releasekit/release test:integration (the standing-PR lifecycle model) when you change the standing-PR flow. RELEASEKIT_MODEL_RUNS sets the model's run count and RELEASEKIT_MODEL_KNOWN_BUGS=#799 enables the commands flagged knownBug: '#799'; a failure prints the variables that replay it.
  • One package: pnpm --filter <package> test or typecheck skips Turborepo, so it runs against the dependencies' built dist/, which may be stale. Build them first with pnpm turbo run build --filter=<package>^....
  • Lint: a package's own lint script is Biome only; pnpm lint also runs ESLint.
  • CI-only suites: pnpm test doesn't run the action harness (test:action:*, test:harness:*), scripts/test-e2e.ts or scripts/test-packages.ts. Run them when you change a CLI, action.yml or what a package ships.
  • Live tests: integration tests that call a real service, such as packages/notes/test/integration/ollama-live.spec.ts, skip unless their opt-in variable is set; CI runs them in the Live Tests job. A new one needs a step in _ci-live.reusable.yml, any new secret declared there and passed from ci.yml, and its package's paths in Detect Changes' live filter.

Gotchas

  • Turborepo runs tasks in strict env mode, so a variable that turbo.json doesn't declare never reaches the task. Opt-in switches such as RELEASEKIT_NOTES_LIVE=1 work through pnpm --filter @releasekit/notes test, not through pnpm test.
  • When Vitest detects a coding agent it switches to a terse reporter that hides console output and passing tests; add --reporter=default to see them. Runs through Turborepo keep the default reporter, because strict env mode drops the variables Vitest detects.
  • Don't put a worktree under .claude/, where Claude Code creates them by default. Biome ignores .claude paths, so pnpm lint there finds no files and fails.

Code conventions the linters don't check

  • Test new behaviour through the path a user hits, such as a CLI command or a package's exported API, not only the helper underneath.
  • A PR that adds a VersionOutput or standing-PR manifest field adds a manifest carrying it to packages/release/test/fixtures/manifests/: hand-built until a release has written a real one, then replaced by it.
  • Default to no comment. Write one only when the why isn't clear from the code: a hidden constraint, a workaround, behaviour that would surprise a reader. Don't repeat the code, a JSDoc or a nearby comment, and don't narrate.