Skip to content
quality-gate-calculator logo

Quality Gate Calculator Skill

quality-gate-calculator

Calculates context-appropriate quality gate thresholds based on work type (Feature/Bug/Hotfix/Docs/Refactor). Ensures rigorous standards for features, pragmatic standards for hotfixes, and 100% test pass rate for all work.

SKILL.md

Full skill instructions

Quality Gate Calculator Skill

Purpose: Calculate appropriate quality gates based on work type and phase.

When to Use: At workflow start to set expectations, and at phase transitions to validate progress.

How to Use This Skill

Executable Script: execute.sh

# Basic usage
bash .claude/​skills/​quality-gate-calculator/​execute.sh <work-type> <phase>

# Examples:
bash .claude/​skills/​quality-gate-calculator/​execute.sh Feature 3
bash .claude/​skills/​quality-gate-calculator/​execute.sh Hotfix 1
bash .claude/​skills/​quality-gate-calculator/​execute.sh Bug 4

Parameters:

  • work-type: Feature|Bug|Hotfix|Documentation|Refactoring (required)
  • phase: 1|2|3|4|5 (required)

Script outputs:

  • Required percentage for quality gate
  • Target score (points needed to pass)
  • Rationale for threshold
  • Pass/​fail examples
  • Exports quality gate to /​tmp/​quality-gate.env

Exit codes:

  • 0: Quality gate calculated successfully
  • 1: Invalid work type or phase

Quality Gate Philosophy

Not all work is equal:

  • Features: Highest rigor (new functionality, high risk)
  • Bug Fixes: Moderate rigor (fixing existing code)
  • Hotfixes: Minimal rigor (production emergency)
  • Documentation: High completion, moderate validation
  • Refactoring: High quality, no behavior change

Universal Rule: ALL work types require 100% test pass rate in Phase 4.

Quality Gate Matrix

Phase 1: Requirements

Work TypeRequired %Score TargetRationale
Feature95%24/​25 pointsComplete requirements critical for feature success
Bug Fix80%20/​25 pointsFocus on problem and fix, less ceremony
Hotfix70%18/​25 pointsEmergency - just enough to understand issue
Documentation85%21/​25 pointsClear purpose and scope needed
Refactoring90%23/​25 pointsUnderstand current state and goals

Phase 2: Design

Work TypeRequired %Score TargetRationale
Feature90%32/​35 pointsThorough design prevents implementation issues
Bug Fix70%25/​35 pointsFocus on fix design, skip elaborate specs
Hotfix60%21/​35 pointsQuick design - enough to implement safely
Documentation80%28/​35 pointsStructure and organization plan
Refactoring85%30/​35 pointsDetailed refactoring plan with safety checks

Phase 3: Implementation

Work TypeRequired %Score TargetRationale
Feature85%43/​50 pointsHigh code quality for new features
Bug Fix75%38/​50 pointsFocus on fix, tests, and no regressions
Hotfix70%35/​50 pointsWorking fix with minimal tests
Documentation80%40/​50 pointsComplete documentation with examples
Refactoring90%45/​50 pointsHighest quality - no behavior changes allowed

Phase 4: Testing

Work TypeRequired %Test Pass RateRationale
Feature100%100%ALL tests must pass
Bug Fix100%100%ALL tests must pass
Hotfix100%100%ALL tests must pass
Documentation100%100%ALL tests must pass
Refactoring100%100%ALL tests must pass

CRITICAL: Phase 4 is ZERO TOLERANCE for all work types. One failing test = cannot advance.

Phase 5: Finalization

Work TypeRequired %Score TargetRationale
Feature80%80/​100 pointsComplete documentation and cleanup
Bug Fix75%75/​100 pointsDocument fix and lessons learned
Hotfix70%70/​100 pointsBasic documentation, commit, deploy
Documentation90%90/​100 pointsComprehensive docs and cross-references
Refactoring85%85/​100 pointsDocument changes and performance impact

Usage Examples

From Orchestrator (Workflow Start)

Use the quality-gate-calculator skill to set quality gates for this feature work

Manual Calculation

# Calculate quality gate for bug fix in design phase
bash .claude/​skills/​quality-gate-calculator.md Bug 2

# Calculate for hotfix in implementation
bash .claude/​skills/​quality-gate-calculator.md Hotfix 3

From Validator

# Phase validator loads quality gate
source /​tmp/​quality-gate.env
echo "Required: $REQUIRED_PERCENTAGE%"
echo "Target: $TARGET_SCORE / $MAX_SCORE"

Decision Flowchart

Start Workflow
     |
     v
Identify Work Type
     |
     +-- Is it production emergency? --> Hotfix (70-100%)
     |
     +-- Is it fixing existing bug? --> Bug Fix (75-100%)
     |
     +-- Is it new functionality? --> Feature (85-100%)
     |
     +-- Is it improving code? --> Refactoring (85-100%)
     |
     +-- Is it documentation? --> Documentation (80-100%)
     v
Calculate Quality Gates for Each Phase
     v
Store in Workflow Context
     v
Apply at Each Phase Validation

Work Type Classification Guide

Feature

Characteristics:

  • Adds new functionality
  • Creates new user-facing capabilities
  • Introduces new APIs or components

Examples:

  • "Add event registration system"
  • "Implement user dashboard"
  • "Create teacher profile pages"

Bug Fix

Characteristics:

  • Fixes existing functionality
  • Addresses reported issues
  • Resolves unexpected behavior

Examples:

  • "Fix login button not working"
  • "Resolve event date display issue"
  • "Correct user role assignment"

Hotfix

Characteristics:

  • Production emergency
  • Blocking critical functionality
  • Requires immediate deployment

Examples:

  • "Fix payment processing failure"
  • "Resolve database connection timeout"
  • "Patch security vulnerability"

Documentation

Characteristics:

  • Creates or updates documentation
  • No code changes (or minimal)
  • Improves developer/​user understanding

Examples:

  • "Document API endpoints"
  • "Create onboarding guide"
  • "Update architecture diagrams"

Refactoring

Characteristics:

  • Improves code quality
  • No behavior changes
  • Performance or maintainability focus

Examples:

  • "Extract service layer"
  • "Optimize database queries"
  • "Simplify component structure"

Integration with Validators

Each phase validator loads work type-specific quality gates:

#!/​bin/​bash
# In phase-1-validator.md

# Load quality gate for this work type
source /​tmp/​quality-gate.env

# Use in validation
if [ "$PERCENTAGE" -ge "$REQUIRED_PERCENTAGE" ]; then
    echo "✅ PASS - Meets quality gate"
else
    echo "❌ FAIL - Below quality gate"
    echo "   Required: $REQUIRED_PERCENTAGE%"
    echo "   Actual: $PERCENTAGE%"
fi

Common Issues

Issue: Work Type Misclassification

Problem: Feature classified as bug fix to lower quality gates Impact: Lower quality work slips through Solution: Orchestrator validates work type at workflow start

Issue: Quality Gate Gaming

Problem: Developer tries to lower requirements Impact: System integrity compromised Solution: Quality gates are non-negotiable per work type

Issue: Hotfix Abuse

Problem: Everything labeled "hotfix" to skip rigor Impact: Production quality degrades Solution: Hotfix requires prod issue ticket + approval

Output Format

{
  "qualityGate": {
    "workType": "Feature",
    "phase": 3,
    "phaseName": "Implementation",
    "required": {
      "percentage": 85,
      "score": 43,
      "maxScore": 50
    },
    "rationale": "Features require high code quality for new features",
    "criticalRules": [
      "Phase 4 requires 100% test pass rate regardless of work type"
    ],
    "exported": "/​tmp/​quality-gate.env"
  }
}

Progressive Disclosure

Initial Context: Show work type and required percentage only On Request: Show full matrix with rationale During Validation: Show pass/​fail threshold On Failure: Show how far from target and what's needed


Remember: Quality gates ensure appropriate rigor for the work being done. Features get highest scrutiny, hotfixes get pragmatic validation, but ALL work requires 100% test pass rate. This balances quality with velocity.

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View