Pre-PR Validation Pipeline banner
jotamaggi jotamaggi

Pre-PR Validation Pipeline

Data community intermediate

Description

Complete validation pipeline to run before creating a pull request.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

Repository README

This is the README for jotamaggi/python-claude-sub-agents, shared by 2 entries in this directory. It describes the repository, not this entry specifically.


description: Run complete validation before creating a PR - security, tests, breaking changes, and generate PR description

Pre-PR Validation Pipeline

Complete validation pipeline to run before creating a pull request.

Pipeline Overview

┌─────────────────────────────────────────────────────────────┐
│                    PRE-PR PIPELINE                          │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  PHASE 1: SECURITY & COMPLIANCE (Blocking)                  │
│  ├── 1. Security Scanner      → Secrets, OWASP              │
│  ├── 2. Compliance Checker    → Project rules               │
│  └── 3. Architecture Validator→ Layer boundaries            │
│                                                             │
│  PHASE 2: QUALITY (Blocking)                                │
│  ├── 4. Test Coverage Gate    → Tests exist                 │
│  ├── 5. Breaking Change Check → API compatibility           │
│  └── 6. Performance Analyzer  → N+1, blocking I/O           │
│                                                             │
│  PHASE 3: POLISH (Non-blocking)                             │
│  ├── 7. Type Modernization    → Modern Python types         │
│  └── 8. Code Simplification   → Refactoring suggestions     │
│                                                             │
│  PHASE 4: OUTPUT                                            │
│  ├── 9. Run Tests             → pytest / vitest             │
│  ├── 10. Run Linters          → ruff, basedpyright, biome   │
│  └── 11. Generate PR Desc     → Ready-to-paste description  │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Execution

Step 1: Gather Context

# Get branch info
git branch --show-current
git log main..HEAD --oneline

# Get changed files
git diff --name-only main...HEAD

Step 2: Determine Scope

Based on changed files, run appropriate checks:

  • .py files in chat-services/ → Python pipeline
  • .ts files in backend/ → TypeScript backend checks
  • .tsx files in frontend/ → Frontend checks

Phase 1: Security & Compliance (BLOCKING)

1.1 Security Scan

Run security-scanner agent:

  • Hardcoded secrets
  • SQL/Command injection
  • SSRF risks

**STOP if CRITICAL or HIGH issues found.**

1.2 Compliance Check

Run appropriate compliance checker:

  • Python: python-compliance-checker
  • TypeScript: Check for any, let, proper imports

1.3 Architecture Validation

Run architecture-validator:

  • Layer boundaries respected
  • No circular imports
  • Proper dependency injection

Phase 2: Quality (BLOCKING)

2.1 Test Coverage

Run test-coverage-gate:

  • Check modified files have tests
  • Verify coverage meets minimum

2.2 Breaking Changes

Run breaking-change-detector:

  • API changes
  • Schema changes
  • Configuration changes

**WARN if breaking changes detecte