# /verify — Quality Gate

The quality gate. Run before every PR. Checks TypeScript, ESLint, tests, and production build.

## Usage

```
/verify                    # Run all checks
/verify types              # TypeScript only
/verify lint               # ESLint only
/verify tests              # All tests (Jest + Playwright)
/verify tests:unit         # Jest unit tests only
/verify tests:e2e          # Playwright E2E only
/verify build              # Production build only
```

**Examples:**
- `/verify` (run everything)
- `/verify types` (quick TS check)
- `/verify tests:unit` (just unit tests)

## Full Verification Workflow (default)

Run all checks in this order. Stop on first failure and report.

### 1. TypeScript Check
```bash
cd /Users/Asim/Desktop/mawidi_codex/mawidi-site && npx tsc --noEmit
```
- Report: number of errors, which files

### 2. ESLint
```bash
cd /Users/Asim/Desktop/mawidi_codex/mawidi-site && npx next lint
```
- Report: number of warnings/errors

### 3. Unit Tests (Jest)
```bash
cd /Users/Asim/Desktop/mawidi_codex/mawidi-site && npm run test:unit
```
- Report: pass/fail count, failing test names

### 4. E2E Tests (Playwright)
```bash
cd /Users/Asim/Desktop/mawidi_codex/mawidi-site && npm run test:smoke
```
- Use smoke tests as default (faster)
- For full E2E: `npm run test:e2e`
- Report: pass/fail count

### 5. Production Build
```bash
cd /Users/Asim/Desktop/mawidi_codex/mawidi-site && npm run build
```
- Report: success/failure, build size if successful

## Output Format

After all checks, present a summary table:

```
VERIFICATION RESULTS
====================
TypeScript    PASS / FAIL (X errors)
ESLint        PASS / FAIL (X warnings, Y errors)
Unit Tests    PASS / FAIL (X/Y passed)
E2E Tests     PASS / FAIL (X/Y passed)
Build         PASS / FAIL

Overall: READY TO SHIP / NEEDS FIXES
```

## Individual Check Modes

### /verify types
Just run `npx tsc --noEmit` and report results.

### /verify lint
Just run `npx next lint` and report results.

### /verify tests
Run both:
```bash
npm run test:unit
npm run test:smoke
```

### /verify tests:unit
Just run `npm run test:unit`.

### /verify tests:e2e
Just run `npm run test:e2e`.

### /verify build
Just run `npm run build` and report size.

## Key Rules
- Always run from the mawidi-site directory
- Stop on first CRITICAL failure (TS errors, build failure)
- Warnings don't block shipping but should be reported
- Use smoke tests for quick verification, full e2e for thorough
- Report results clearly with pass/fail status
