CI/CD
Purpose
Design a CI/CD pipeline that reflects what the project actually is — its selected applications and chosen test types — running the right checks in the right order, gating merges and (with approval) deploys. Platform wiring for GitHub is github-actions.
When to Use
- When establishing or revising the pipeline for a project.
- After applications, tests, and deployment target are selected.
- Not to scaffold infrastructure, or to add jobs for applications that don't exist.
Inputs
- Selected applications (
../../application-selection) — the pipeline is generated from these.
- Test selection (
../../testing/testing-selection), repo/monorepo shape (repository-strategy, monorepo-selection), deployment target (deployment-selection).
Discovery Questions
- Which applications exist (backend, web, dashboard, mobile, shared packages)? The pipeline covers exactly these.
- Which test types were selected per app (unit, API/Supertest, Playwright, Maestro)?
- Is this a monorepo where affected-only runs and caching apply (
turborepo-foundation)?
- What is gated at merge vs deploy, and does deploy require approval?
Responsibilities
- Generate jobs from the selected applications + test selection, choosing from: install, lint, typecheck, unit tests, API tests, Playwright (web/dashboard E2E), mobile tests (Maestro), build, security checks, deployment — including only those an existing application needs.
- Never create jobs for applications that don't exist: no Playwright job without a web app, no mobile job without a mobile app, no deploy job without a deployable — absence of an app means absence of its jobs.
- Order for fast feedback: cheap/fast checks (lint, typecheck, unit) before slow ones (E2E, build); fail fast; parallelize independent jobs.
- Use frozen, cached installs (
pnpm --frozen-lockfile/npm ci); in monorepos, affected-only execution + caching (turborepo-foundation).
- Wire security checks (dependency/secret scanning —
../../security/dependency-security, secrets-audit) as pipeline jobs.
- Set gates: required checks block merge; deployment jobs are approval-gated and run only after tests + security pass (
../../backend/backend-deployment, production-readiness, ../../release-planning).
- Provide environment/config validation and post-deploy smoke as pipeline steps (
environment-management, ../../testing/smoke-testing).
Required Workflow
- Read the selected applications + test selection + repo shape.
- Derive the job set per app (only for apps that exist).
- Order jobs fast→slow; parallelize; frozen/affected installs.
- Add security-check jobs.
- Set merge gates; make deploy approval-gated with post-deploy smoke.
- Hand platform wiring to
github-actions.
Decision Rules
- The pipeline is a function of the selected applications — derive it, don't template a fixed pipeline onto every project.
- No job for a nonexistent application, ever.
- Fast checks gate before expensive ones; a failing lint shouldn't wait behind E2E.
- Deploys never run unapproved or on red tests/security (
../../release-planning gate 7).
Rules
- Jobs map to real applications and selected test types.
- Deployment is approval-gated; no auto-deploy without explicit policy.
- No infrastructure scaffolding — pipeline design only.
Anti-Patterns
- A fixed one-size pipeline with jobs for apps the project lacks.
- Playwright/mobile jobs with no corresponding app.
- Slow E2E running before cheap lint/typecheck.
npm install (unpinned) in CI instead of npm ci.
- Auto-deploying on green without approval or post-deploy smoke.
Validation Checklist
Definition of Done
A pipeline design generated from the project's real applications and selected tests — correctly ordered, frozen/affected installs, security checks, merge gates, and approval-gated deploys with post-deploy smoke — with no jobs for applications that don't exist.
Related Skills
github-actions, ../../testing/testing-selection, ../../application-selection, repository-strategy, monorepo-selection, turborepo-foundation, deployment-selection, production-readiness, ../../security/dependency-security, ../../release-planning.
Related Knowledge
../../../knowledge/ (selected apps, deploy target).
Related References
../../../references/devops/ (pipeline patterns, when populated).
Context Loading Guidance
- Requires: selected applications, test selection, repo shape, deploy target.
- Does not require: infrastructure provisioning, app feature code.
- May load:
github-actions, deployment-selection.
- Stop when: the app-derived job set + gates are designed.
Token Efficiency Guidance
The application × job matrix is the artifact — it directly encodes "only jobs for apps that exist." Build it, then wire the platform.
1---2name: ci-cd3description: Use to design the CI/CD pipeline generated from the project's selected applications and test selection — jobs like install, lint, typecheck, unit, API, Playwright, mobile, build, security checks, deployment. Only generate jobs for applications that exist; deploys are approval-gated. Does not scaffold infrastructure.4---56# CI/CD78## Purpose910Design a CI/CD pipeline that reflects **what the project actually is** — its selected applications and chosen test types — running the right checks in the right order, gating merges and (with approval) deploys. Platform wiring for GitHub is `github-actions`.1112## When to Use1314- When establishing or revising the pipeline for a project.15- After applications, tests, and deployment target are selected.16- **Not** to scaffold infrastructure, or to add jobs for applications that don't exist.1718## Inputs1920- **Selected applications** (`../../application-selection`) — the pipeline is generated *from these*.21- **Test selection** (`../../testing/testing-selection`), repo/monorepo shape (`repository-strategy`, `monorepo-selection`), deployment target (`deployment-selection`).2223## Discovery Questions2425- Which applications exist (backend, web, dashboard, mobile, shared packages)? The pipeline covers exactly these.26- Which test types were selected per app (unit, API/Supertest, Playwright, Maestro)?27- Is this a monorepo where **affected-only** runs and caching apply (`turborepo-foundation`)?28- What is gated at merge vs deploy, and does deploy require approval?2930## Responsibilities3132- **Generate jobs from the selected applications + test selection**, choosing from: **install**, **lint**, **typecheck**, **unit tests**, **API tests**, **Playwright (web/dashboard E2E)**, **mobile tests (Maestro)**, **build**, **security checks**, **deployment** — including only those an existing application needs.33- **Never create jobs for applications that don't exist**: no Playwright job without a web app, no mobile job without a mobile app, no deploy job without a deployable — absence of an app means absence of its jobs.34- Order for **fast feedback**: cheap/fast checks (lint, typecheck, unit) before slow ones (E2E, build); fail fast; parallelize independent jobs.35- Use **frozen, cached installs** (`pnpm --frozen-lockfile`/`npm ci`); in monorepos, **affected-only** execution + caching (`turborepo-foundation`).36- Wire **security checks** (dependency/secret scanning — `../../security/dependency-security`, `secrets-audit`) as pipeline jobs.37- Set **gates**: required checks block merge; **deployment jobs are approval-gated** and run only after tests + security pass (`../../backend/backend-deployment`, `production-readiness`, `../../release-planning`).38- Provide **environment/config validation** and post-deploy **smoke** as pipeline steps (`environment-management`, `../../testing/smoke-testing`).3940## Required Workflow41421. Read the selected applications + test selection + repo shape.432. Derive the job set per app (only for apps that exist).443. Order jobs fast→slow; parallelize; frozen/affected installs.454. Add security-check jobs.465. Set merge gates; make deploy approval-gated with post-deploy smoke.476. Hand platform wiring to `github-actions`.4849## Decision Rules5051- The pipeline is a **function of the selected applications** — derive it, don't template a fixed pipeline onto every project.52- No job for a nonexistent application, ever.53- Fast checks gate before expensive ones; a failing lint shouldn't wait behind E2E.54- Deploys never run unapproved or on red tests/security (`../../release-planning` gate 7).5556## Rules5758- Jobs map to real applications and selected test types.59- Deployment is approval-gated; no auto-deploy without explicit policy.60- No infrastructure scaffolding — pipeline design only.6162## Anti-Patterns6364- A fixed one-size pipeline with jobs for apps the project lacks.65- Playwright/mobile jobs with no corresponding app.66- Slow E2E running before cheap lint/typecheck.67- `npm install` (unpinned) in CI instead of `npm ci`.68- Auto-deploying on green without approval or post-deploy smoke.6970## Validation Checklist7172- [ ] Job set derived from selected applications + test selection.73- [ ] No jobs for nonexistent applications.74- [ ] Fast→slow ordering; parallel; frozen/affected installs.75- [ ] Security-check jobs included.76- [ ] Merge gates set; deploy approval-gated with post-deploy smoke.77- [ ] Platform wiring handed to `github-actions`.7879## Definition of Done8081A pipeline design generated from the project's real applications and selected tests — correctly ordered, frozen/affected installs, security checks, merge gates, and approval-gated deploys with post-deploy smoke — with no jobs for applications that don't exist.8283## Related Skills8485`github-actions`, `../../testing/testing-selection`, `../../application-selection`, `repository-strategy`, `monorepo-selection`, `turborepo-foundation`, `deployment-selection`, `production-readiness`, `../../security/dependency-security`, `../../release-planning`.8687## Related Knowledge8889`../../../knowledge/` (selected apps, deploy target).9091## Related References9293`../../../references/devops/` (pipeline patterns, when populated).9495## Context Loading Guidance9697- **Requires:** selected applications, test selection, repo shape, deploy target.98- **Does not require:** infrastructure provisioning, app feature code.99- **May load:** `github-actions`, `deployment-selection`.100- **Stop when:** the app-derived job set + gates are designed.101102## Token Efficiency Guidance103104The application × job matrix is the artifact — it directly encodes "only jobs for apps that exist." Build it, then wire the platform.