What problem does it solve?
The auto-enforcer closes the enforcement gap between deterministic CI checks and agent-based rules by running all PR-scoped constraints automatically on each pull request, preventing silent skips and surfacing AI findings to reviewers.
Core Features & Use Cases
- Deterministic enforcement: Executes tool commands for deterministic constraints and fails the CI job when they return non-zero, preventing merges on violations.
- Agent advisory checks: Sends PR diffs and rule text to the Claude API for agent-evaluated constraints and posts advisory findings as PR comments without blocking merges.
- Data-driven configuration: Reads constraints from HARNESS.md at runtime so adding or changing rules requires no workflow modifications.
- Use Case: Automatically check for missing frontmatter and secrets on every PR, failing the job for deterministic issues and posting AI-generated advisories for judgment-based rules.
Quick Start
Copy the ci-auto-enforcer.yml template into .github/workflows/auto-enforcer.yml and add ANTHROPIC_API_KEY as a repository secret to enable automatic PR checks.