CI & Enforcement
SpecLeft enforcement is opt-in. When enabled, it validates your specs and fails CI only if required intent is missing.
Use enforcement when you want coverage and priority rules to be a hard gate.
Policy types
Section titled “Policy types”SpecLeft supports two enforcement tiers:
- Core policy: enforce priority requirements only
- Enforce policy: enforce priority plus coverage thresholds
Both are executed with the same command:
specleft enforceCommon enforcement commands
Section titled “Common enforcement commands”# Use the default policy locationspecleft enforce
# Use a specific policy filespecleft enforce .specleft/policies/policy-core.yml
# JSON output for CIspecleft enforce --format jsonExit codes:
0: policy satisfied1: policy violated2: license issue
CI example (GitHub Actions)
Section titled “CI example (GitHub Actions)”Add this job to .github/workflows/specleft.yml:
name: SpecLeft Complianceon: [push, pull_request]
jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install SpecLeft run: pip install specleft - name: Enforce spec policy run: specleft enforce --format json