# CI/CD and where checks run

How pipelines build, test, and release each change, where checks run from pre-commit hooks to CI, and how coding agents change the load.

Start here

## [What is CI/CD?](https://specstory.com/learning/ci-cd/ci-cd)

CI/CD is the practice of merging code often and building and testing each change automatically, so the software stays ready to release at any time.

10 min read

## Concepts

### [What is a pre-commit hook?](https://specstory.com/learning/ci-cd/pre-commit-hook)

A pre-commit hook is a script Git runs before it records a commit, used to lint, format, or test the staged changes and stop the commit if a check fails.

### [What are agent hooks (Stop hooks)?](https://specstory.com/learning/ci-cd/agent-hooks)

Agent hooks are scripts a coding agent runs at set points in its loop, e.g. a Stop hook that runs the tests before the agent can end its turn.

### [What are Git hooks?](https://specstory.com/learning/ci-cd/git-hooks)

Git hooks are scripts that Git runs automatically at set points, e.g. before a commit, so a team can check or change the work at each step.

### [What is a quality gate in CI/CD?](https://specstory.com/learning/ci-cd/quality-gate)

A quality gate is a checkpoint where a change must meet agreed criteria, e.g. passing tests, before it moves on to the next stage of delivery.

### [What is continuous integration (CI)?](https://specstory.com/learning/ci-cd/continuous-integration)

Continuous integration is merging every developer's changes into the main branch often, with an automated build and tests run on each merge.

### [What is shift-left testing?](https://specstory.com/learning/ci-cd/shift-left-testing)

Shift-left testing moves testing earlier in development, so problems are found when a change is small and cheap to fix instead of after release.

### [What is test impact analysis?](https://specstory.com/learning/ci-cd/test-impact-analysis)

Test impact analysis maps which tests exercise which code, so a change runs only the tests it could affect instead of the whole suite.

## How-to guides

### [How to run CI checks locally](https://specstory.com/learning/ci-cd/local-ci-checks)

Running CI checks locally means repeating a CI pipeline, e.g. a GitHub Actions workflow, on a developer's machine or in a container before a push.

### [How to run tests in GitHub Actions](https://specstory.com/learning/ci-cd/github-actions-checks)

Running tests in GitHub Actions means adding a workflow file that installs a project, runs its tests on each push or pull request, and reports the result.

## Comparisons

### [What is the difference between pre-commit, pre-push, and CI checks?](https://specstory.com/learning/ci-cd/pre-commit-vs-pre-push-vs-ci)

Pre-commit, pre-push, and CI checks run at different moments, before a commit is saved, before it leaves the machine, or on a server after it arrives.

### [What is the difference between blocking and non-blocking checks?](https://specstory.com/learning/ci-cd/blocking-vs-non-blocking-checks)

A blocking check stops a commit, push, or merge until it passes, while a non-blocking check reports a failure and lets the change go ahead.

## Common questions

### [Why is CI becoming the bottleneck for AI-written code?](https://specstory.com/learning/ci-cd/ci-for-coding-agents)

CI becomes a bottleneck when AI coding agents push more changes than pipelines can test quickly, so queues grow and teams skip or trim checks.

### [Why do tests pass locally but fail in CI?](https://specstory.com/learning/ci-cd/tests-pass-locally-fail-in-ci)

Tests that pass locally but fail in CI usually depend on something that differs between machines, from timing and test order to versions and stale state.

## Terms in this topic

**[Agent hook](https://specstory.com/learning/glossary#agent-hook)**

An agent hook is a script that a coding agent's harness runs at a fixed point in its loop. A Stop hook runs when the agent tries to end its turn.

**[CI pipeline](https://specstory.com/learning/glossary#ci-pipeline)**

A CI pipeline is the ordered set of automated steps, e.g. build, test, and package, that runs each time code is pushed or merged.

**[CI/CD](https://specstory.com/learning/glossary#ci-cd)**

CI/CD is a practice that merges code often and builds and tests each change in an automated pipeline, so the software is kept ready to release.

**[Continuous integration (CI)](https://specstory.com/learning/glossary#continuous-integration)**

Continuous integration is a practice that merges every developer's changes into the main branch often, with an automated build and test run on each merge.

**[Hook](https://specstory.com/learning/glossary#hook)**

A hook is a script that a tool runs automatically at a set point in its workflow, e.g. Git running a check before it records a commit.

**[Pre-commit hook](https://specstory.com/learning/glossary#pre-commit-hook)**

A pre-commit hook is a script that Git runs before it records a commit. It can lint, format, or test the staged changes and stop the commit if a check fails.

**[Pre-push hook](https://specstory.com/learning/glossary#pre-push-hook)**

A pre-push hook is a script that Git runs before it sends commits to a remote repository, which can run slower checks than a pre-commit hook and stop the push.

**[Quality gate](https://specstory.com/learning/glossary#quality-gate)**

A quality gate is a point in a delivery pipeline where a change is measured against set criteria before it goes further. Some gates block the change, and others only report.

**[Shift left](https://specstory.com/learning/glossary#shift-left)**

Shift left is an approach that moves testing and other quality checks earlier in development, when a problem is smaller and cheaper to fix.

**[Test impact analysis](https://specstory.com/learning/glossary#test-impact-analysis)**

Test impact analysis is a technique that maps which tests exercise which code, so a change runs only the tests it could affect instead of the whole suite.

10 terms from the [Learning Center glossary](https://specstory.com/learning/glossary).

---

Source: [CI/CD and where checks run | SpecStory](https://specstory.com/learning/ci-cd)
