---
description: Full production readiness certification (code + security + runtime)
argument-hint: "[project-path: defaults to .]"
allowed-tools: Bash, Read, Write, Glob, Grep
---

Run complete production readiness certification across all dimensions.

## Overview

This is the master certification skill that combines:
- **Code Quality** (20%) — Type safety, patterns, test coverage
- **Security** (25%) — Vulnerabilities, secrets, RLS policies
- **Runtime Verified** (25%) — E2E tests, visual regression, API tests
- **Scale Ready** (15%) — Load tested, capacity estimation (M8)
- **Deploy Ready** (15%) — Canary success, health checks (M9)

## Steps

1. **Validate project path**
   - Default to `.` if no argument provided
   - Detect project type (web app, API, CLI, library)

2. **Run security audit** (`/vaspera-audit` equivalent)
   - Use `certification_scan` MCP tool
   - Collect findings by severity

3. **Run runtime verification** (`/vaspera-verify-e2e` equivalent)
   - Detect framework
   - Launch app (if web/API project)
   - Execute golden path flows
   - Calculate runtime score

4. **Run scale assessment** (M8 - if available)
   - Check for `.vaspera/load/*.yaml` profiles
   - Run load tests if profiles exist
   - Calculate scale score

5. **Check deployment readiness** (M9 - if available)
   - Verify health endpoints exist
   - Check for deployment configuration
   - Calculate deploy score

6. **Calculate Production Readiness Score**
   ```
   Score = (
     code_quality * 0.20 +
     security * 0.25 +
     runtime * 0.25 +
     scale * 0.15 +
     deploy * 0.15
   )
   ```

7. **Determine certification level**
   | Score | Level | Badge | Recommendation |
   |-------|-------|-------|----------------|
   | 90-100 | CERTIFIED | 🟢 | Ship to production |
   | 70-89 | APPROVED | 🟡 | Ship with monitoring |
   | 40-69 | REVIEW_REQUIRED | 🟠 | Fix before shipping |
   | 0-39 | BLOCKED | 🔴 | Critical issues |

8. **Generate certification report**
   ```
   ╔══════════════════════════════════════════════════════════════╗
   ║           PRODUCTION READINESS CERTIFICATION                 ║
   ╠══════════════════════════════════════════════════════════════╣
   ║                                                              ║
   ║  Project: my-app                                             ║
   ║  Framework: Next.js 14.2.3                                   ║
   ║  Certified: 2026-05-29T21:30:00Z                             ║
   ║                                                              ║
   ╠══════════════════════════════════════════════════════════════╣
   ║                                                              ║
   ║  Code Quality:     92/100  ████████████████████░░░░  (20%)   ║
   ║  Security:         88/100  ██████████████████░░░░░░  (25%)   ║
   ║  Runtime Verified: 95/100  █████████████████████░░░  (25%)   ║
   ║  Scale Ready:      --/100  (not tested)              (15%)   ║
   ║  Deploy Ready:     --/100  (not tested)              (15%)   ║
   ║  ──────────────────────────────────────────────────────────  ║
   ║  OVERALL:          88/100                                    ║
   ║                                                              ║
   ╠══════════════════════════════════════════════════════════════╣
   ║                                                              ║
   ║  Level: 🟡 APPROVED                                          ║
   ║  → Ship with monitoring                                      ║
   ║                                                              ║
   ╠══════════════════════════════════════════════════════════════╣
   ║                                                              ║
   ║  Top Issues:                                                 ║
   ║  1. [CRITICAL] SQL injection in auth/login.ts:42             ║
   ║  2. [HIGH] Missing RLS on users table                        ║
   ║  3. [HIGH] No rate limiting on /api/checkout                 ║
   ║                                                              ║
   ╚══════════════════════════════════════════════════════════════╝
   ```

9. **Write certification to stable location**
   - Create `.vaspera/certifications/` directory
   - Write to `.vaspera/certifications/{ISO-timestamp}.json`
   - Include full breakdown and remediation recommendations

## Fallback Scoring

When a dimension isn't testable:
- **No web app** → Runtime defaults to 50 (neutral)
- **No load profiles** → Scale defaults to 50 (neutral)
- **No deploy config** → Deploy defaults to 50 (neutral)

## MCP Tools Used

- `certification_scan` — Security findings
- `runtime_detect` — Framework detection
- `runtime_verify` — Runtime verification (if applicable)
- `certification_summary` — Final summary

## Certification Badge

Projects passing certification can display:

```markdown
[![Production Ready](https://img.shields.io/badge/Production%20Ready-88%25-green)](CERTIFICATION.md)
```

## Important

- This is a comprehensive audit — may take several minutes
- Requires MCP server connection for full functionality
- Falls back to CLI tools when MCP unavailable
- Does NOT auto-fix issues — use `/vaspera-harden` for that
