/pf-code-review:pf-adversarial-reviewfrom pf-code-review
Audits PatternFly React components for unhandled edge cases, missing defensive code, and silent API misuse failures. Useful before production releases or stress-testing.
Ships in pf-code-review. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Probe PatternFly React components for unhandled edge cases, missing defensive code, and gaps in error handling. Focus on PF-specific failure modes — prop combinations that break component contracts, missing UI states, and boundary conditions that cause silent failures or crashes.
If PatternFly documentation tools are available, use them to verify component props and expected behavior before flagging edge cases. Without documentation available, rely on the edge-case tables and contract rules in this skill.
The user provides a file path, directory, or component to review. Default to the current working directory. Focus on .tsx and .jsx files that import from @patternfly/* packages.
Test each component's props with values at the extremes:
| Input type | Edge cases to try |
|---|---|
| Strings | Empty "", whitespace-only " ", very long (1000+ chars), strings with HTML/script tags, Unicode/emoji, RTL text |
| Numbers | 0, negative, NaN, Infinity, very large (1e15), floats where integers expected |
| Arrays | Empty [], single item, 1000+ items, arrays with null/undefined elements |
| Objects | Empty {}, deeply nested (10+ levels), circular references, missing expected keys |
| Callbacks | undefined (when optional), functions that throw, async callbacks where sync expected |
| Booleans | Truthy/falsy coercion — 0, "", null passed where boolean expected |
| Children | No children, null, undefined, fragments, deeply nested children, mixed text and elements |
Flag components that lack:
undefined.map(), .length, .toString() on untyped dataCheck for misuse of PatternFly component APIs that fails silently. For structural composition rules (required parent-child hierarchies), defer to pf-component-structure-audit:
Td without dataLabel in responsive mode — content vanishes on mobileonSelect handler — selections don't registereventKey values — wrong tab rendersitemCount of 0 with no empty state guard — shows "0 of 0"name collisions — navigation breaks silentlyavailableOptions without empty state — blank panel&& where the left operand is 0 or "" (renders 0 or empty string instead of nothing)...props without filtering PF-specific props from DOM attributesWhen recommending fixes, use PF6 components:
Alert with variant="danger" or EmptyState with error iconSpinner (indeterminate) or Skeleton (content placeholder)EmptyState with titleText and action buttonTruncate component or isTruncated propErrorBoundary wrapping dynamic content sectionsGroup findings by severity. Each finding includes the code location, the edge case that triggers it, and a specific fix.
## Adversarial Review: [ComponentName]
### Critical — crashes or data loss
- **file.tsx:42** — `items.map()` crashes when `items` is `undefined`
Edge case: parent renders before API response
Fix: default to empty array — `const items = data?.items ?? [];`
### High — silent failures or broken UI
- **file.tsx:78** — Pagination shows "0 of 0" when data is empty
Edge case: API returns empty array
Fix: guard with EmptyState when `items.length === 0`
### Medium — degraded experience
- **file.tsx:23** — Long usernames overflow Card title
Edge case: 100+ character display name
Fix: add `isTruncated` to `CardTitle` or use `Truncate`
### Summary
Tested: [N] components | Critical: [N] | High: [N] | Medium: [N]
Do not fabricate file paths or line numbers — read the actual source files before reporting.
eval/cases/conditional-render-trap/StatusPanel.tsx (opens in a new tab)eval/cases/conditional-render-trap/annotations.yaml (opens in a new tab)eval/cases/conditional-render-trap/input.yaml (opens in a new tab)eval/cases/missing-defensive-code/UserTable.tsx (opens in a new tab)eval/cases/missing-defensive-code/annotations.yaml (opens in a new tab)eval/cases/missing-defensive-code/input.yaml (opens in a new tab)eval/cases/pf-contract-violation/OrderTable.tsx (opens in a new tab)eval/cases/pf-contract-violation/annotations.yaml (opens in a new tab)eval/cases/pf-contract-violation/input.yaml (opens in a new tab)eval/cases/well-defended-component/SafeList.tsx (opens in a new tab)eval/cases/well-defended-component/annotations.yaml (opens in a new tab)eval/cases/well-defended-component/input.yaml (opens in a new tab)eval/eval.yaml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/pf-i18n-auditAudit PatternFly React code for i18n readiness — hardcoded user-facing strings, concatenation anti-patterns, locale-dependent formatting, and RTL-unsafe CSS. Use when reviewing code for global deployment or auditing i18n compliance./pf-reviewRun all PatternFly compliance checks on a project — imports, components, colors, legacy CSS, and security. Use when auditing PF code, before merging PRs, or for comprehensive compliance review./pf-security-scanScan PatternFly React code for security anti-patterns — XSS via dangerouslySetInnerHTML, unsanitized user input in tooltips/labels, and insecure href patterns. Use when reviewing PF code for security vulnerabilities or auditing user-controlled content in PF components./pf-state-auditAudit PatternFly React components for missing UI states — loading, error, empty, and unauthorized. Use when reviewing data-dependent components or auditing a page for production readiness.npx claudepluginhub rh-uxd/ai-helpers --plugin pf-code-reviewOther plugins' skills for the same job