Individual skill
adversarial-ts-patterns
Use this skill to gate TypeScript and React application code with a pass/fail adversarial review of design-pattern usage — a single blind reviewer subagent judges a diff or file set against 18 decidable rules covering implicit state machines (boolean-flag lifecycles, useEffect chains, stored derived state, non-exhaustive union matches) and over-engineered OO/enterprise ports (getInstance singletons, factory and builder classes, single-method strategy classes, State/Visitor hierarchies, event buses inside a React tree, pass-through repositories, DI containers, single-implementation interfaces, component inheritance, logic-only HOCs, static-only classes, trivial accessors). Trigger it before merging TS/React work, when asked to gate or pass/fail pattern usage, or as a check that agent-authored code is not porting Java/C# idioms. It renders verdicts only; for teaching-style guidance use implementation-design-patterns or implementation-functional-patterns.
skills/.experimental/adversarial-ts-patterns/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 222
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- design Derived category
- education Derived category
- devops Derived category
- engineering Derived category
- devops-containers Derived category
- engineering-web Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 7,410 bytesSKILL.mdcore · 7,410 bytesassets/templates/verdict.mddoc · 1,448 bytesgotchas.mddoc · 1,904 bytesmetadata.jsonasset · 1,739 bytesreferences/_sections.mddoc · 2,571 bytesreferences/behave-no-event-bus-in-tree.mddoc · 2,121 bytesreferences/behave-no-single-method-class.mddoc · 1,920 bytesreferences/behave-union-over-state-visitor-classes.mddoc · 2,300 bytesreferences/create-no-builder-for-optional-bag.mddoc · 2,143 bytesreferences/create-no-factory-class-hierarchy.mddoc · 1,905 bytesreferences/create-no-getinstance-singleton.mddoc · 1,802 bytesreferences/layer-no-di-container-in-app.mddoc · 2,273 bytesreferences/layer-no-passthrough-repository.mddoc · 2,374 bytesreferences/layer-no-single-impl-interface.mddoc · 2,186 bytesreferences/oo-no-static-only-class.mddoc · 1,617 bytesreferences/oo-no-trivial-accessors.mddoc · 1,666 bytesreferences/react-no-component-inheritance.mddoc · 2,249 bytesreferences/react-no-hoc-for-logic-reuse.mddoc · 2,089 bytesreferences/react-no-imperative-handle-data-flow.mddoc · 2,335 bytesreferences/reviewer-prompt.mddoc · 4,377 bytesreferences/state-exhaustive-match-on-unions.mddoc · 2,175 bytesreferences/state-no-effect-chains.mddoc · 2,228 bytesreferences/state-no-stored-derived-state.mddoc · 1,668 bytesreferences/state-union-over-boolean-flags.mddoc · 1,988 bytes
Read excerpt
# Adversarial TS Patterns Gate
A design-pattern usage gate for TypeScript and React application code — a pass/fail gate: a single blind reviewer subagent judges the work against this gate's rules with an adversarial mandate, and the work passes only when every rule is PASS or N/A. This skill renders verdicts; it never fixes the work.
The gate judges in both directions. **Over-abstraction** — Gang of Four and enterprise machinery ported from Java/C# where idiomatic TypeScript reaches for a function, a module, or a tagged union. **Under-modeling** — implicit state machines whose impossible states compile: boolean-flag lifecycles, effect chains, hand-synced derived state, silent `default` branches.
## When to Apply
- A TypeScript/React diff or feature is about to merge and needs an objective PASS/FAIL on pattern usage, not advisory feedback.
- An agent (Claude, Codex) authored the code and you want an independent check that it is not reproducing Java/C# training-data idioms — Singleton classes, factory hierarchies, repository wrappers, JavaBean accessors.
- A migration from another stack (Java, C#, Angular-style DI) claims completion and the ported architecture needs auditing for layers that lost their justification in TypeScript.
- Component or store state grew organically and you want the implicit-state-machine failure modes (contradictory booleans, effect chains, non-exhaustive matches) caught before they ship.
Do not apply to non-TypeScript codebases (the reviewer prompt's precondition aborts with "GATE NOT APPLICABLE"), or when the user wants explanations and refactors rather than a verdict — that is the job of the curated `implementation-design-patterns` and `implementation-functional-patterns` skills. React-specific rules go N/A in non-React TypeScript projects; the rest of the gate works in any TypeScript application.