Skip to content
Development
Command

/guard

Pre-merge quality checks (TS, lint, tests, secrets)

From plugin
claude-plugin-prd-workflow
1327 skills17 agents27 commands

Command definition

guard.md
name: guard
description: Pre-merge quality checks (TS, lint, tests, secrets)
category: Development Tools
version: 0.4.2

Guard Command

Comprehensive pre-merge quality gate.

Purpose

Catch issues before PR merge:

  • TypeScript compilation
  • Linting errors
  • Test failures
  • Security vulnerabilities
  • Secrets detection
  • Code quality checks

Workflow

1. TypeScript Check

**Run type checking**:

npm run type-check  # or tsc --noEmit

**Report**:

  • Type errors found
  • Files affected
  • Severity level

2. Lint Check

**Run linters**:

npm run lint  # ESLint, Prettier, etc.

**Report**:

  • Lint errors and warnings
  • Fixable vs manual
  • Style violations

3. Test Suite

**Run full test suite**:

npm test

**Report**:

  • Tests passing/failing
  • Coverage metrics
  • Slow tests flagged

4. Security Scan

**Check for vulnerabilities**:

npm audit
git secrets --scan  # or gitleaks

**Report**:

  • Dependency vulnerabilities
  • Secrets in code
  • Security best practices

5. Build Verification

**Verify production build**:

npm run build

**Report**:

  • Build success/failure
  • Bundle size
  • Performance metrics

6. Summary Report

🛡️ Guard Results

TypeScript: ✅ No errors
Lint: ⚠️  3 warnings (auto-fixable)
Tests: ✅ 248 passing (92% coverage)
Security: ❌ 1 high vulnerability (axios@0.21.1)
Build: ✅ Success (bundle: 324 KB)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
BLOCKERS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔴 Security: axios vulnerability (high)
   Fix: npm install axios@latest

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNINGS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🟡 Lint: 3 auto-fixable warnings
   Fix: npm run lint:fix

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
VERDICT: ❌ NOT READY TO MERGE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Fix blockers before merging.

Blocking vs Non-Blocking

**Blockers** (must fix):

  • TypeScript errors
  • Test failures
  • High/Critical security vulnerabilities
  • Secrets detected
  • Build failures

**Warnings** (should fix):

  • Lint warnings
  • Low coverage
  • Bundle size increase
  • Slow tests

Auto-Fix

**Fixable issues**:

/guard --fix

**Auto-fixes**:

  • Lint errors (Prettier, ESLint --fix)
  • Import sorting
  • Code formatting

**Non-fixable**:

  • Type errors (require manual fix)
  • Test failures (require code changes)
  • Security vulnerabilities (require updates)

Flags

**Options**:

  • `--fix`: Auto-fix what's possible
  • `--strict`: Treat warnings as errors
  • `--skip-tests`: Skip test suite (faster)
  • `--skip-security`: Skip security scan

**Examples**:

/guard              # Full check
/guard --fix        # Check + auto-fix
/guard --strict     # Warnings block merge
/guard --skip-tests # Quick check (no tests)

Configuration

{
  "guard": {
    "block_on": ["typescript", "tests", "security_high"],
    "warn_on": ["lint", "coverage_below_80"],
    "auto_fix": true,
    "min_coverage": 80
  }
}

Success Criteria

  • ✅ All checks run successfully
  • ✅ Blockers identified (if any)
  • ✅ Clear actionable feedback
  • ✅ Auto-fixes applied (if requested)
  • ✅ Verdict clear: Ready/Not Ready

---

**Version**: 0.4.2 **Plugin**: claude-prd-workflow v0.4.2

Read more
@yassinello
Ships withclaude-plugin-prd-workflow

The complete Claude Code plugin for Product-Driven Development Transform PRDs from ideas to shipped features with AI-powered review, guided implementation, and automated quality gates. Never ship unclear requirements again.

Stars on GitHub

Momentum

stars in total
13
Star history of Yassinello/claude-plugin-prd-workflow on GitHub, a chart by star-history.com

Other commands on claude-plugin-prd-workflow.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command