quality-gate-enforcement
Skill4 starsChanged 10 months agoMITView on GitHub
Use when creating or modifying CI/CD pipelines to enforce quality gates (coverage thresholds, security scans, test requirements, performance benchmarks). Ensures code quality standards are automatically enforced before merge or deployment.
- Installs packages
In this repository67 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-onboardingSkill
- agent-workitem-automationSkill
- architecture-testingSkill
- aspire-integration-testingSkill
- automated-standards-enforcementSkill
- best-practice-introductionSkill
- branching-strategy-and-conventionsSkill
- broken-windowSkill
- change-risk-rollbackSkill
- ci-cd-conformanceSkill
- component-boundary-ownershipSkill
- contract-consistency-validationSkill
- csharp-best-practicesSkill
- deployment-provenanceSkill
- documentation-as-codeSkill
- documentation-scaffoldSkill
- dotnet-bespoke-code-minimisationSkill
- dotnet-best-practicesSkill
- dotnet-domain-primitivesSkill
- dotnet-efcore-practicesSkill
- dotnet-healthchecksSkill
- dotnet-logging-serilogSkill
- dotnet-mapping-standardSkill
- dotnet-open-source-first-governanceSkill
- dotnet-source-generation-firstSkill
- dotnet-specification-patternSkill
- dotnet-testing-assertionsSkill
- environment-traceabilitySkill
- finishing-a-development-branch-iddSkill
- greenfield-baselineSkill
- impacted-scope-enforcementSkill
- incremental-change-impactSkill
- incremental-deploymentSkill
- innersource-governance-bootstrapSkill
- issue-driven-deliverySkill
- library-extraction-stabilisationSkill
- local-dev-experienceSkill
- markdown-authorSkill
- modern-csharp-coding-standardsSkill
- monorepo-orchestration-setupSkill
- observability-logging-baselineSkill
- pair-programmingSkill
- persona-switchingSkill
- process-skill-routerSkill
- release-tagging-planSkill
- repo-best-practices-bootstrapSkill
- repository-foundation-bootstrapSkill
- requirements-gatheringSkill
- runtime-tooling-validationSkill
- safe-brownfield-refactorSkill
- scoped-colocationSkill
- security-processesSkill
- selective-build-testSkill
- semantic-version-impactSkill
- session-awareSkill
- skills-first-workflowSkill
- static-analysis-securitySkill
- structured-review-workflowSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Use this matrix to select the appropriate security skill:
- Distinctive: line 65
Add security scanning (SAST, dependency, container)
- Distinctive: line 67
Add static analysis with warnings-as-errors
- Very specific: line 69
Document gates in docs/quality-gates.md
- Distinctive: line 90
Never allow coverage to decrease
- Distinctive: line 119
When gates cannot be met immediately:
- Very specific: line 121
Document exception in docs/quality-gates.md
- Distinctive: line 127
Never disable gates without documented exception.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Quality Gate Enforcement
Overview
P1 Quality & Correctness - Applies to all CI/CD pipelines. Quality gates are blocking by default.
REQUIRED: superpowers:verification-before-completion, superpowers:test-driven-development
Security Skills Decision Matrix
Use this matrix to select the appropriate security skill:
| If You Need To... | Use This Skill |
| Define org-wide security policies and governance | security-processes |
| Set up SAST tools, secrets detection, or security linting | static-analysis-security |
| Configure CI/CD quality gates including security scan blocking | quality-gate-enforcement (this) |
Skill Scope Comparison
| Aspect | security-processes | static-analysis-security | quality-gate-enforcement |
| Primary Focus | Governance & policy | Tool configuration | Pipeline enforcement |
| Scope | Organization-wide | Project-level | Pipeline-level |
| Outputs | Policies, SLAs, exception rules | Tool configs, suppression rules | Gate thresholds, blocking rules |
| When to Invoke | Defining security standards | Setting up scanning | Configuring CI/CD |
| Relationship | Orchestrates other skills | Implements SAST portion | Enforces as gates |
Do NOT Use This Skill When
- Defining what policies should be enforced (use security-processes)
- Selecting and configuring SAST tools (use static-analysis-security)
- Setting up tool-specific suppression rules (use static-analysis-security)
When to Use
- Creating or modifying CI/CD pipelines
- Adding quality controls to existing workflows
- Integrating security scanning into deployment process
- Opt-out: Explicit exception with documented remediation timeline
Core Quality Gates
| Gate Category | Minimum Threshold | Enforcement |
| Code Coverage | 80% (lines, branches) | Blocking |
| Security Scan | Zero high/critical | Blocking |
| Test Pass Rate | 100% | Blocking |
| Static Analysis | Zero warnings | Blocking |
| Build Status | Zero errors | Blocking |
Core Workflow
- Identify pipeline stages (PR, build, deploy)
- Define gate thresholds per stage
- Configure coverage tools with thresholds
- Add security scanning (SAST, dependency, container)
- Enforce test pass requirements
- Add static analysis with warnings-as-errors
- Configure fail-fast behaviour
- Document gates in
docs/quality-gates.md - Implement coverage ratchet for brownfield
Multi-Stage Gate Matrix
| Stage | Gates |
| PR/Branch | Unit tests, coverage, SAST, linting |
| Dev Deploy | Integration tests, container scan |
| Staging | E2E tests, performance, DAST |
| Production | All gates green, manual approval |
See Pipeline Integration for CI/CD platform configurations.
Coverage Ratchet Pattern
For brownfield codebases:
- Measure current coverage percentage
- Set threshold at current level (no regression)
- Require coverage increase with each PR
- Never allow coverage to decrease
- Track progress toward target threshold
See Brownfield Strategy for incremental adoption.
Security Scanning Integration
| Scan Type | Stage | Tools |
| SAST | PR | SonarQube, CodeQL, Semgrep |
| Dependency | PR | npm audit, Snyk, Dependabot |
| Container | Build | Trivy, Grype, Snyk |
| DAST | Staging | OWASP ZAP, Burp Suite |
See Security Scanning for tool configuration.
Red Flags - STOP
- "Can add quality gates later"
- "Coverage threshold too strict"
- "Security scanning blocks releases"
- "Some test failures are acceptable"
- "Override quality gate for this release"
- "Internal code doesn't need gates"
All mean: Apply brownfield approach or document exception with remediation timeline.
Exception Handling
When gates cannot be met immediately:
- Document exception in
docs/quality-gates.md - Specify reason and scope
- Define remediation timeline (max 30 days)
- Create tracking issue
- Review exceptions weekly
Never disable gates without documented exception.
Sample Gate Configurations
.NET (GitHub Actions)
# .github/workflows/quality-gates.yml
name: Quality Gates
on: [pull_request]
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Build
run: dotnet build --warnaserror
- name: Test with Coverage
run: |
dotnet test --collect:"XPlat Code Coverage" \
--settings coverlet.runsettings \
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
- name: Coverage Gate
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
threshold: 80
- name: Security Scan (SAST)
uses: github/codeql-action/analyze@v3Node.js (GitHub Actions)
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install & Build
run: npm ci && npm run build
- name: Lint (warnings as errors)
run: npm run lint -- --max-warnings 0
- name: Test with Coverage
run: npm test -- --coverage --coverageThreshold='{"global":{"branches":80,"functions":80,"lines":80}}'
- name: Security Audit
run: npm audit --audit-level=highPython (GitHub Actions)
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install -r requirements.txt -r requirements-dev.txt
- name: Lint (ruff)
run: ruff check . --output-format=github
- name: Type check (mypy)
run: mypy src/ --strict
- name: Test with Coverage
run: pytest --cov=src --cov-fail-under=80
- name: Security (bandit)
run: bandit -r src/ -llCoverage Ratchet Example
For brownfield codebases, implement a ratchet that only allows coverage to increase:
# coverage-ratchet.yml
name: Coverage Ratchet
on: [pull_request]
jobs:
ratchet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get baseline coverage
id: baseline
run: |
git checkout origin/main
npm test -- --coverage --coverageReporters=json-summary
BASELINE=$(cat coverage/coverage-summary.json | jq '.total.lines.pct')
echo "coverage=$BASELINE" >> $GITHUB_OUTPUT
- name: Get PR coverage
id: current
run: |
git checkout ${{ github.head_ref }}
npm test -- --coverage --coverageReporters=json-summary
CURRENT=$(cat coverage/coverage-summary.json | jq '.total.lines.pct')
echo "coverage=$CURRENT" >> $GITHUB_OUTPUT
- name: Enforce ratchet
run: |
BASELINE=${{ steps.baseline.outputs.coverage }}
CURRENT=${{ steps.current.outputs.coverage }}
if (( $(echo "$CURRENT < $BASELINE" | bc -l) )); then
echo "::error::Coverage decreased from $BASELINE% to $CURRENT%"
exit 1
fi
echo "Coverage: $BASELINE% → $CURRENT% ✓"Ratchet Configuration File
// .coverage-ratchet.json
{
"baseline": 65.5,
"target": 80,
"increment": 0.5,
"excludePaths": ["**/migrations/**", "**/generated/**"],
"enforceOnFiles": ["src/**/*.ts", "src/**/*.tsx"]
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

