agentleFS
sennaBrunosennaBruno/claude-skills/skills/quality-gate/SKILL.md

quality-gate

Skill1 starsChanged 8 months agoApache-2.0View on GitHub

Use when completing a batch of work, finishing a feature, or before committing - comprehensive validation covering code quality, security, performance, UI/UX, accessibility, and licensing with conditional checks based on what files changed

42 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use deploy.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    deploy

    Deploy applications to Vercel. Use when the user says "deploy", "deploy to Vercel", "push to production", "deploy my app", or "go live".

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 34 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After completing a batch of tasks

    line 16
  2. Distinctive:

    Before committing or creating PRs

    line 17
  3. Distinctive:

    After implementing a feature end-to-end

    line 18
  4. Distinctive:

    When finishing a development branch

    line 19
  5. Distinctive:

    No data loss on rollback

    line 166
  6. Distinctive:

    No GPL/AGPL in proprietary project

    line 173
  7. Distinctive:

    No unnecessary new dependencies

    line 175
  8. Distinctive:

    Only then run quality-gate for deeper analysis

    line 225
  9. Distinctive:

    Run quality-gate after each batch (3 tasks)

    line 232

“Common” is measured: kept by at least 6 in 10 of the 34 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Quality Gate

Overview

Comprehensive validation of all work done in a session/batch. Detects what changed and applies conditional review dimensions.

Core principle: One command to validate everything. No dimension skipped, no issue missed.

When to Use

  • After completing a batch of tasks
  • Before committing or creating PRs
  • After implementing a feature end-to-end
  • When finishing a development branch

Complements (not replaces):

  • superpowers:verification-before-completion (run tests/build first)
  • superpowers:requesting-code-review (architecture-focused review)

The Process

digraph quality_gate {
    rankdir=TB;
    "1. Detect Changes" [shape=box];
    "2. Classify Files" [shape=box];
    "3. Select Dimensions" [shape=diamond];
    "4. Run Reviews" [shape=box];
    "5. Aggregate Report" [shape=box];
    "6. Verdict" [shape=doublecircle];

    "1. Detect Changes" -> "2. Classify Files";
    "2. Classify Files" -> "3. Select Dimensions";
    "3. Select Dimensions" -> "4. Run Reviews";
    "4. Run Reviews" -> "5. Aggregate Report";
    "5. Aggregate Report" -> "6. Verdict";
}

Step 1: Detect Changes

# Get all changed files in this batch
git diff --name-only {BASE_SHA}..HEAD
# Or for uncommitted work:
git diff --name-only HEAD && git diff --name-only --cached

Step 2: Classify & Select Dimensions

Based on changed files, select which dimensions apply:

File PatternDimensions Applied
frontend/**/*.tsx, frontend/**/*.tsCode Quality, Security, Performance (Frontend), UI/UX, Accessibility, Design System
frontend/**/*.css, frontend/**/*.module.cssDesign System, Accessibility, UI/UX
src/**/*.ts (backend)Code Quality, Security (OWASP), Performance (Backend/Lambda)
src/routes/**, src/controllers/**API Design, Rate Limiting, Auth checks
prisma/**, **/migration*Data Safety, Migration Reversibility
package.json, package-lock.jsonLicensing, Dependency Audit
infra/**, sst.config.ts, .github/**Infrastructure Security, Secrets Exposure
shared/**Cross-cutting (both frontend + backend dimensions)

ALWAYS applied (regardless of files):

  • Code Quality (logic, patterns, DRY)
  • Security (secrets, injection, auth)

Step 3: Run Applicable Dimensions

Dispatch the quality-gate-reviewer subagent (see template) with the detected dimensions.

How to dispatch:

Use Task tool with subagent_type: "superpowers:code-reviewer"
Fill template from: quality-gate/quality-gate-reviewer.md
Pass: {CHANGED_FILES}, {DIMENSIONS}, {BASE_SHA}, {HEAD_SHA}

Step 4: Act on Results

SeverityAction
BlockerFix immediately. Cannot proceed.
CriticalFix before commit/merge.
WarningFix if quick (<5 min), otherwise document as known issue.
InfoNote for future improvement. No action required.

Review Dimensions Reference

1. Code Quality (ALWAYS)

  • Logic errors, edge cases, off-by-one
  • Error handling completeness
  • Type safety (no any, no unsafe casts)
  • DRY violations (duplicated logic)
  • Naming clarity and consistency
  • Separation of concerns

2. Security - OWASP (ALWAYS)

  • Injection: SQL, NoSQL, OS command, template injection
  • XSS: Unescaped user input in HTML/JSX
  • Auth bypass: Missing auth checks on protected routes
  • Secrets: Hardcoded API keys, tokens, passwords
  • CSRF: Missing CSRF protection on state-changing endpoints
  • Mass assignment: Accepting unvalidated fields from request body
  • Rate limiting: Missing on public/sensitive endpoints
  • LGPD/Privacy: PII exposure in logs, responses, errors

3. Performance - Frontend (conditional)

  • Bundle size impact (new imports, large libraries)
  • Unnecessary re-renders (missing memo, unstable references)
  • Data fetching waterfalls (sequential when parallel possible)
  • Image optimization (raw <img> vs next/image)
  • Missing lazy loading for below-fold content
  • Client-side computation that belongs server-side

4. Performance - Backend/Lambda (conditional)

  • N+1 database queries
  • Missing database indexes for new query patterns
  • Cold start impact (heavy imports at top level)
  • Connection pool misuse
  • Blocking synchronous operations
  • Lambda timeout risk (long-running operations)

5. UI/UX (conditional: frontend changes)

  • Error states: clear, actionable messages
  • Loading states: skeleton/spinner present
  • Empty states: helpful guidance shown
  • Form validation: inline, immediate feedback
  • Mobile responsiveness: touch targets >= 44px
  • Progressive disclosure: information in logical order
  • User feedback: actions confirmed visually

6. Accessibility (conditional: frontend changes)

  • Semantic HTML (button vs div, nav vs div)
  • ARIA labels on interactive elements
  • Keyboard navigation support
  • Focus management (modals, drawers)
  • Color contrast (WCAG AA minimum)
  • Screen reader compatibility
  • Form labels associated with inputs

7. Design System (conditional: frontend changes)

  • Using project components (Button, Modal, Switch, Container)
  • Consistent spacing (Tailwind scale)
  • Typography hierarchy respected
  • Color palette adherence (no hardcoded hex)
  • Consistent border-radius, shadows
  • Dark mode compatibility (if applicable)

8. API Design (conditional: routes/controllers)

  • RESTful conventions followed
  • Consistent error response format
  • Pagination on list endpoints
  • Input validation via Zod schemas
  • Response types match OpenAPI/docs
  • Versioning consistency

9. Data Safety (conditional: schema/migrations)

  • Migration is reversible
  • No data loss on rollback
  • Zero-downtime compatibility
  • Index strategy appropriate
  • Foreign key constraints correct
  • Default values safe

10. Licensing (conditional: dependency changes)

  • No GPL/AGPL in proprietary project
  • New dependencies are MIT/Apache/BSD/ISC
  • No unnecessary new dependencies
  • Package is actively maintained

Quick Reference: Conditional Matrix

Changed files → Detect automatically with git diff

Frontend (.tsx/.ts/.css in frontend/):
  ✅ Code Quality
  ✅ Security (XSS, secrets)
  ✅ Performance (Frontend)
  ✅ UI/UX
  ✅ Accessibility
  ✅ Design System

Backend (.ts in src/):
  ✅ Code Quality
  ✅ Security (OWASP full)
  ✅ Performance (Backend/Lambda)
  ✅ API Design (if routes/controllers)

Schema (prisma/, migrations):
  ✅ Code Quality
  ✅ Data Safety

Dependencies (package.json):
  ✅ Licensing
  ✅ Security (dependency audit)

Infrastructure (infra/, .github/, sst.config.ts):
  ✅ Security (secrets, IAM)
  ✅ Infrastructure review

Common Mistakes

MistakeFix
Running all dimensions on backend-only changeUse conditional matrix - skip UI/UX/DS
Reporting theoretical risksOnly report REAL vulnerabilities with exploit path
Flagging style opinions as CriticalStyle = Info. Bugs/security = Critical
Skipping licensing check on new depsAlways check when package.json changes
Not checking rate limiting on new endpointsEvery public endpoint needs rate limiting
Missing empty/error/loading state checkEvery UI component needs all 3 states

Integration with Other Skills

Before quality-gate:

  1. superpowers:verification-before-completion - Run tests, build, linter FIRST
  2. Only then run quality-gate for deeper analysis

After quality-gate:

  1. Fix Blocker/Critical issues
  2. superpowers:finishing-a-development-branch - Merge/PR decision

In executing-plans workflow:

  • Run quality-gate after each batch (3 tasks)
  • Lighter than full code-review, broader than verification

Example Usage

[Completed 3 tasks: bulk approve/decline API + frontend hooks + UI components]

1. Run verification-before-completion (tests pass, build clean)
2. Detect changes:
   git diff --name-only origin/main..HEAD
   → src/controllers/appointment.controller.ts  (backend)
   → src/routes/appointment.routes.ts           (backend)
   → src/use-cases/appointment/bulk-*.ts        (backend)
   → frontend/src/features/appointments/*.ts    (frontend)
   → frontend/src/features/appointments/*.tsx   (frontend)

3. Selected dimensions:
   Backend: Code Quality, Security, Performance, API Design
   Frontend: Code Quality, Security, UI/UX, Accessibility, Design System, Performance

4. Dispatch quality-gate-reviewer subagent with dimensions

5. Report:
   Blocker: 0
   Critical: 1 (missing rate limit on bulk endpoint)
   Warning: 2 (no loading state on bulk action, missing aria-label)
   Info: 1 (could memoize filtered list)

6. Fix critical → re-verify → proceed to commit

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.