Detects workflow/config drift across repos and enforces a single source of truth via CERBER.md.
AI doesn't break your project. Lack of a contract does.
Cerber enforces your project roadmap as executable contract (CERBER.md). Write rules once, get automatic validation on every commit + CI run.
β
Contract guard β Validates your CERBER.md rules are enforced
β
Drift detector β Catches when CI config/workflow changes break protection
β
Works WITH existing tools β Doesn't replace ESLint/Prettier/tests. Ensures they stay required.
β Not a linter β Use ESLint for code style
β Not a test runner β Use Jest/Vitest for unit tests
β Not a deployment tool β Use your existing CD pipeline
Think of it as: Policy-as-code layer that prevents your other tools from being bypassed.
- β
AI agents follow your roadmap β Agent pastes code matching
CERBER.md - β Human bypasses rules β Commit sneaks through, CI green but wrong
- β CI config drifts β Workflow changes, gates disappear, protection gone
Solution: Guardian blocks bad commits before they reach CI. CI re-validates and protects itself from tampering.
Cerber protects real SaaS applications. See it in action:
Eliksir Platform CI Pipelines:
- π¨ Frontend: Guardian Schema Check + tests β
- βοΈ Backend: Quality Gate + deploy checks β
These aren't demo projects - live production systems serving real users, protected by Cerber since day one.
π Full case study: How Cerber prevented 47 production bugs
Join the Cerber Core Discord for support, feedback, and CI/Doctor showcases: π https://discord.gg/V8G5qw5D
- Questions: ask in
#general - Feedback / bugs:
#feedback(bugs can also go to GitHub Issues) - Proofs: post your CI runs / doctor output in
#showcase
# 1. Install
npm i -D cerber-core
# 2. Generate contract template
npx cerber init
# 3. Edit CERBER.md (use AI assistant or manual)
# β Define your roadmap, tech stack, protected assets
# 4. Generate hooks + CI workflow
npx cerber init
# 5. Verify setup
npx cerber doctor
# 6. Commit and push
git add .
git commit -m "feat: add Cerber protection"
git pushThat's it. Guardian now blocks bad commits. CI re-validates and protects itself.
- β Secrets in code (API keys, tokens)
- β Forbidden patterns (eval, console.log in prod)
- β Missing required imports
- β Protected file deletions
- β Schema validation (if enabled)
- β Workflow tampering (job ID changes)
- β Missing required checks
- β Contract violations
- β Re-runs Guardian validation
π TODAY: CI contract guard + workflow drift detection
π ROADMAP: Post-deploy health gates (experimental in v1.1, production-ready in v2.0)
- β Missing CERBER.md
- β Missing schema (strict mode)
- β Missing pre-commit hook
- β Missing CI workflow
- β Override state validation
Cerber is a devtool β we don't break pipelines:
- CLI flags + exit codes: Follow SemVer. Breaking changes = major version bump.
- JSON output: Versioned schema (e.g.,
{"version": "1.0", ...}). New fields = minor, changed fields = major. - CI workflow templates: Generated files are yours to customize. Updates = opt-in via
cerber init --force.
Current stability: v1.1.11 is production-ready for CI contract guard use case. See production proof.
$ npx cerber doctor
[Cerber Doctor] Setup Validation
[OK] All checks passed!
Configuration:
Mode: dev
Guardian: enabled
Health: enabled
CI: github
Override: DISABLED
[READY] Ready to commit!
β If Cerber helped you, star the repo: https://github.com/Agaslez/cerber-core
π¬ Join Discord for feedback/support: https://discord.gg/V8G5qw5DWhen drift detected:
$ npx cerber doctor
[Cerber Doctor] Setup Validation
[FAIL] Issues found:
[!] .github/workflows/cerber.yml
GitHub workflow not found
Next Steps:
1. Re-run initialization to generate missing files:
npx cerber init
Help: https://github.com/Agaslez/cerber-core/discussionsCerber is simple: write rules once in CERBER.md, enforce on every commit + CI run.
π TODAY: Pre-commit Guardian + CI workflow drift detection
π ROADMAP: Post-deploy health gates (experimental)
Roadmap β CERBER.md contract β enforced automatically on every commit/push.
npm i -D cerber-corenpx cerber initIf CERBER.md did not exist, Cerber creates a template and stops.
Now YOU fill the contract (ideally with an AI assistant).
Take your project roadmap + repo structure and paste it into ChatGPT/Claude/Cursor with the Cerber Contract Translator prompt (see below).
Then:
- Paste the generated contract into
CERBER.md - Run init again to generate hooks/workflows/templates:
npx cerber init
npx cerber doctorExit codes:
0β All checks pass2β Missing CERBER.md3β Missing schema (strict mode)4β Missing hook/workflow
git commitβ Guardian validates staged changes (blocks violations)git pushβ GitHub Actions validates again in CI
Cerber maintains comprehensive test coverage with emphasis on production evidence in CI.
- Unit Tests: 950+ tests covering individual adapters, validators, and core logic
- Integration Tests: 138+ tests with real adapters, real git operations, no mocks
- β Orchestrator real adapter execution (13 tests)
- β FileDiscovery real git repository operations (15 tests)
- β Contract & profile error handling (24 tests)
- β Output JSON schema validation (39 tests)
- β Timeout enforcement & concurrency safety (37 tests)
- E2E Tests: 30+ end-to-end tests covering complete workflows
Tests are not just local β they run in GitHub Actions on every commit/PR:
What makes this "Production Evidence":
- Real Adapters β Tests execute actual ActionlintAdapter, GitleaksAdapter, ZizmorAdapter
- Real Git β FileDiscovery tests use actual git commands (execSync), including:
- Detached HEAD scenarios (GitHub Actions default)
- Shallow clone support (GitHub Actions default depth=1)
- Staged vs. committed file detection
- Real Output β Validates against actual
output.schema.json - Determinism Verified β Same input β identical JSON (snapshot-testable)
- Concurrency Safe β Tests for race conditions, parallel execution, factory cache thread-safety
Locally:
npm test # All tests (unit + integration)
npm run test:integration # Integration tests only (138 tests)
npm run test:watch # Watch mode for developmentIn CI (GitHub Actions):
test-integration:
name: Integration - Real Adapters & Git Operations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.0
- uses: actions/setup-node@v4.0.0
with:
node-version: '20'
- run: npm ci
- run: npm run build
- run: npx jest test/integration/ --testTimeout=30000 --verboseEvery commit runs these 138 integration tests. Results are visible in Actions logs.
Having issues? Want to share your setup?
- π¬ Discord: https://discord.gg/V8G5qw5D (fastest support)
- π GitHub Issues: Report bugs
- π‘ GitHub Discussions: Ask questions, share ideas
- π Case Studies: See Cerber in production
Show your CI runs in Discord #showcase!
Use this to generate a production-ready
CERBER.mdfrom your roadmap.
Cerber does NOT design your architecture. It enforces what you write.
PROMPT:
You are a "Cerber Contract Translator". Convert my roadmap + repo structure into a `CERBER.md` contract.
RULES:
- Do NOT invent architecture or rules.
- Only translate what I explicitly provide.
- If something is missing, ask up to 10 questions in a `QUESTIONS` section and leave placeholders.
- Output must be a complete `CERBER.md` with:
1) CERBER_CONTRACT (YAML)
2) ROADMAP_AS_LAW (milestones)
3) AI_AGENT_RULES (no guessing)
4) PROTECTED_ASSETS
5) CERBER_OVERRIDE (TTL safety fuse)
6) QUESTIONS
INPUT I PROVIDE:
- Roadmap (what we are building, milestones, priorities)
- Repo structure (`tree -L 3` or folder list)
- Tech stack + commands for smoke/e2e/build
- Integrations (Stripe/Ghost/Cloudinary/etc.)
- What files/paths are "protected" from deletion
Now generate `CERBER.md`.
Single rule: CERBER.md is the ONLY source of truth.
-
If
CERBER.mdis missing:- Run
npx cerber initto generate template - STOP (user must provide contract content)
- Run
-
If
CERBER.mdexists:- Read it first
- Execute exactly what it says
- Do NOT invent rules, do NOT infer architecture
-
Schema policy (important):
- If
schema.mode: strictβ DO NOT generate schema files - If
schema.mode: template_onlyβ you may generate only the minimal template (NOT decisions)
- If
-
Safety rules:
- Never disable or rename CI job id:
cerber-ci - Never remove:
CERBER.md,.github/workflows/cerber.yml,scripts/cerber-guardian.mjs,.husky/pre-commit,.github/CODEOWNERS - Never bypass checks using
continue-on-error - Never use
cat <<EOFfor TS/JS (corrupts${}template literals)
- Never disable or rename CI job id:
If a required rule is not present in CERBER.md β ASK USER or FAIL FAST.
- Repository: https://github.com/Agaslez/cerber-core
- Releases: https://github.com/Agaslez/cerber-core/releases
- Security Policy: https://github.com/Agaslez/cerber-core/blob/main/SECURITY.md
- Discussions: https://github.com/Agaslez/cerber-core/discussions
- Full Documentation: docs/README_LONG.md
## CERBER_CONTRACT
\```yaml
version: 1
mode: solo # solo | dev | team
guardian:
enabled: true
schemaFile: BACKEND_SCHEMA.mjs
schema:
enabled: true
file: BACKEND_SCHEMA.mjs
mode: strict # Recommended: You create schema, Cerber never generates
health:
enabled: true
endpoint: /api/health
ci:
provider: github
branches: [main]
\```Schema modes:
strict(recommended) β You design architecture, Cerber guards ittemplate_onlyβ Helper scaffold for beginners (NOT design decisions)
Quick Links:
- π Full Documentation (Long README)
- π‘οΈ Guardian API - Pre-commit validation
- π Cerber API - Runtime health checks
- β‘ SOLO Layer - Automation for solo developers (666 LOC)
- π₯ TEAM Layer - Focus Mode + module system (1861 LOC)
- ποΈ Architecture - System design philosophy
- π Security Policy - Supply-chain security, vulnerability reporting
- π€ Contributing - How to contribute
Workflows by Team Size:
- Solo Developer - 1 person, 15min setup
- Small Team (2-5) - Module system, 1-2h setup
- Growing Team (5-20) - Architecture governance
Examples:
- Schema-as-Code (architecture rules in version control)
- Fast feedback (<1s validation vs 5min CI wait)
- Required imports + forbidden patterns
- Architect approvals (traceable exceptions)
- Detailed diagnostics (diagnosis + rootCause + fix)
- Severity levels (critical/error/warning)
- Component-based health checks
- Performance tracking
- Auto-repair (format, deps, changelog)
- Performance budget enforcement
- Daily dashboard
- Dependency health checks
- Focus Mode (500 LOC context vs 10K LOC for AI) β
- Module boundaries enforcement
- Connection contracts between modules
- CERBER.md project mapping
For P0 production hotfixes only, controlled safety fuse with strict TTL:
## CERBER_OVERRIDE
enabled: true
reason: "P0 - Payment API down, emergency rollback"
expires: "2026-01-04T18:00:00Z" # 6-hour TTL
approvedBy: "CTO Name"What Override DOES:
- β Allows pre-commit to pass WITH WARNING (audit trail logged)
- β Can skip postDeploy gate if configured
What Override NEVER DOES:
- β Disable
cerber-integrityjob (self-protection always runs) - β Disable entire CI pipeline (build/test/lint must pass)
- β Disable CODEOWNERS enforcement (team mode)
Use sparingly. After expiry, guardian proceeds with normal validation.
Cerber has comprehensive test coverage with real adapters verified in CI:
# Run all tests (1000+ tests)
npm test
# Run specific test suites
npm test -- test/unit # Unit tests
npm test -- test/integration # Integration tests (real adapters & git)
npm test -- test/e2e # End-to-end tests
# Watch mode
npm test -- --watch| Type | Count | Purpose |
|---|---|---|
| Unit | 950+ | Schemas, adapters, utilities |
| Integration | 45+ | Real adapters, git operations, CI scenarios |
| E2E | 30+ | CLI commands, end-to-end workflows |
Integration tests run on every commit in CI/CD:
β
Real Adapters β Tests verify ActionlintAdapter, GitleaksAdapter, ZizmorAdapter work together
β
Deterministic Output β Same input β identical output across runs
β
Parallel Execution β Adapters run in parallel without race conditions
β
Git Operations β Tests with actual git repos (detached HEAD, shallow clones)
β
Error Resilience β Graceful handling of missing files, invalid YAML, timeouts
Evidence: Test results are in GitHub Actions logs for every commit.
Contributions welcome! Please read CONTRIBUTING.md first.
git clone https://github.com/Agaslez/cerber-core.git
cd cerber-core
npm install
npm run build
npm test- π¬ Discord: Join community
- π Issues: GitHub Issues
- π‘ Discussions: GitHub Discussions
- π Full Docs: docs/README_LONG.md
- π Case Study: How Cerber prevented 47 bugs
- π Story: The team behind Cerber
- π Security: Report vulnerabilities to st.pitek@gmail.com
- β Repository: github.com/Agaslez/cerber-core
- Progress: 60% complete (110 hours remaining)
- Test Coverage: 97% (1105/1140 passing)
- Architecture Rating: 7.2/10 (good foundation with known debt)
- ETA to Release: 1.5 weeks (54 hours of focused work)
- π ROADMAP_V2_ACTUAL.md β USE THIS - Real roadmap (110h remaining)
- π ROADMAP_V2_PRO.md - Theoretical planning (reference only)
- π SENIOR_AUDIT_REPORT.md - Architecture analysis & code quality
- π― ONE_TRUTH.md - Executive summary for stakeholders
- π ROADMAP_COMPARISON.md - Which roadmap to read & when
β
Orchestrator (85% - coordinates multiple tools)
β
Profiles (90% - solo/dev/team execution modes)
β
Adapters (70% - actionlint, zizmor, gitleaks)
β
Contract System (80% - single source of truth)
β
Tool Detection (75% - cross-platform compatibility)
β
File Discovery (80% - git-based, multi-mode)
β
Circuit Breaker & Retry (85% - resilience patterns)
β
Reporting (75% - text, JSON, GitHub annotations)
β
Tests (97% - 1105 passing, integration tests included)
π
Auto-Install Tools (8h) - Download binaries, cache, checksum verification
π
Execution Persistence (8h) - History, replay, audit trails
π
SARIF Format (4h) - GitHub Code Scanning integration
π
Plugin System (6h) - Custom adapters
π
Universal Targets (GitLab CI, generic YAML) - V2.2
MIT Β© 2026 Stefan Pitek
Free for commercial use. See LICENSE for details.
Founded by Agata ΕlΔzak, created and maintained by Stefan Pitek
- π Read the full story: docs/STORY.md
Read the full story: docs/STORY.md
Support development: docs/SPONSORING.md
β If Cerber saved you time, give it a star! β
Made with π‘οΈ by developers, for developers