/guard
Pre-merge quality checks (TS, lint, tests, secrets)
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/guard
Context preview
What this command does when you run it.
Pre-merge quality checks (TS, lint, tests, secrets)
Command definition
guard.mdname: 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
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
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.
Repo: Yassinello/claude-plugin-prd-workflow

