Adversarial pr review

From Tibsfox/gsd-skill-creator · View interactive version

Adversarial pr review is an AI agent skill from the GitHub repository Tibsfox/gsd-skill-creator. Adversarial spec-compliance PR review — cross-references diffs against approved specs, verifies runtime claims against source, detects competing PRs, audits scope/convention compliance. Use before merging.

How to use this skill

Skill file

Adversarial PR Review

Adversarial review with spec-compliance focus. Reviews PRs like a hostile-but-fair reviewer — verifies that what the PR claims matches what it actually does and what the approved spec requires.

REVIEW SCOPE

Accept one of:

PHASE 1: CONTEXT GATHERING

For each PR under review, collect:

1.1 PR metadata

gh pr view <N> -R Tibsfox/gsd-skill-creator --json title,body,headRefName,labels,reviewDecision,statusCheckRollup,files

1.2 Linked issue and approval status

Extract issue number from PR body (Closes #N, Fixes #N, Resolves #N).

gh api repos/Tibsfox/gsd-skill-creator/issues/<N> --jq '{title, labels: [.labels[].name], state, body}'

Verify:

1.3 Approved scope

From the issue body or PR description, extract:

1.4 Competing PRs

gh pr list -R Tibsfox/gsd-skill-creator --state open --search "closes #<issue_number> OR fixes #<issue_number>" --json number,author,title

If multiple PRs target the same issue, flag the competition.

1.5 Full diff

gh pr diff <N> -R Tibsfox/gsd-skill-creator

Or for branch mode:

git diff main...HEAD

PHASE 2: SPEC-COMPLIANCE AUDIT

Cross-reference every claim against reality.

2.1 Scope compliance

Compare files in the diff against files listed in the approved issue scope:

| Check | Verdict |

|-------|---------|

| All in-scope files are modified | PASS / UNDER-DELIVERY |

| Only in-scope files are modified | PASS / SCOPE CREEP |

| Modifications match approved intent | PASS / DEVIATION |

2.2 Acceptance criteria verification

For each acceptance criterion in the approved issue:

  1. Is it implemented? Search the diff for evidence
  2. Is it implemented correctly? Cross-reference field names, flag names, behavior descriptions against the spec
  3. Is it tested? Check test files for assertions that would catch regressions
  4. Does the test actually verify the criterion? Tautological tests don't count

Flag any criterion that is:

2.3 Schema and interface verification

When the spec defines a data schema, API interface, or config shape:

  1. Extract field names from the spec
  2. Extract field names from the implementation
  3. Compare — flag any divergence
  4. If fields are marked required in the spec, verify they are required in the implementation

2.4 Import boundary verification

This repo has strict import boundaries (CLAUDE.md):

PHASE 3: RUNTIME CLAIM VERIFICATION

Verify that runtime references in the code actually exist.

3.1 Import and dependency verification

When the diff adds new imports:

# Check the import target exists
grep -r "export.*<name>" src/ desktop/

If the imported symbol doesn't exist, this is BLOCKING.

3.2 Skill and agent references

When code references skills (.claude/skills/) or agents (.claude/agents/):

3.3 Config and settings verification

When code references settings or config fields:

grep -n "<field_name>" .claude/settings.json src/

Verify field names, defaults, and types match the source of truth.

3.4 Command and workflow references

When workflows reference GSD commands (.claude/commands/gsd/):

PHASE 4: CONVENTION COMPLIANCE

Check project conventions per CLAUDE.md.

4.1 Commit convention

4.2 Test conventions

For test files:

4.3 TypeScript conventions

4.4 Skill conventions

For skill files in .claude/skills/:

4.5 Documentation

PHASE 5: SECURITY REVIEW

5.1 Shell injection

When code interpolates values into shell commands:

5.2 Path traversal

When code accepts file paths:

5.3 Secret exposure

5.4 Prompt injection in content

5.5 Self-modifying system safety

This is a self-modifying system — skills, agents, hooks can change behavior:

PHASE 6: ADVERSARIAL DEEP REVIEW

Beyond spec compliance:

6.1 Logic and correctness

6.2 Supply chain

6.3 Description vs. reality

6.4 Completeness

OUTPUT FORMAT

For each PR, produce a structured review:

## Adversarial Review — PR #<N>

### Issue Linkage
- Issue: #<N> — labels: [list] — **PASS** / **FAIL** (reason)

### Scope Compliance
| Check | Status | Detail |
|-------|--------|--------|
| All in-scope files modified | PASS/FAIL | ... |
| No out-of-scope files | PASS/FAIL | ... |
| Import boundaries respected | PASS/FAIL | ... |

### Acceptance Criteria
| Criterion | Implemented | Tested | Correct | Notes |
|-----------|-------------|--------|---------|-------|
| AC-1: ... | Yes/No | Yes/No | Yes/No | ... |

### Runtime Claims
| Claim | Verified | Detail |
|-------|----------|--------|
| Import target exists | Yes/No | ... |
| Skill reference valid | Yes/No | ... |

### Convention Compliance
| Check | Status | Detail |
|-------|--------|--------|
| Conventional Commits | PASS/FAIL | ... |
| Vitest for tests | PASS/FAIL | ... |
| No .planning/ commits | PASS/FAIL | ... |

### Security
| Finding | Severity | Detail |
|---------|----------|--------|
| ... | BLOCKING/WARNING/INFO | ... |

### Adversarial Findings
| Finding | Severity | Detail |
|---------|----------|--------|
| ... | BLOCKING/WARNING/INFO | ... |

### Competing PRs
- None / #<N> by <author> — [comparison notes]

### Verdict
**APPROVE** / **CHANGES REQUESTED** / **CLOSE** (with rationale)

### Required Changes (if any)
1. ...

### Non-blocking Observations
1. ...

COMMUNICATION TONE

RELATIONSHIP TO OTHER SKILLS

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.