React Refactor Tournament logo

React Refactor Tournament

Community
ragnar-pwninskjold
react-refactor-tournament

Review React/Next.js code against the real vercel-react-best-practices skill, backlog the performance findings keyed to actual rule ids + impact tiers, rank the most over-subscribed tiers, then fix + test the top N in isolated worktrees. Use when the user wants to systematically harvest and fix React/Next.js PERFORMANCE refactors (waterfalls, bundle size, RSC fetching, re-renders, JS perf), or says "react refactor tournament", "find React performance refactors", "/react-refactor-tournament".

Overview

Publisherragnar-pwninskjold
Repositorytech-snacks
Skill namereact-refactor-tournament
Stars
138
Forks
30
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by ragnar-pwninskjold on GitHub. Read the source before you install it.

Installation

Install the React Refactor Tournament AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ragnar-pwninskjold/tech-snacks/tree/main/plugins/tech-snacks/skills/react-refactor-tournament
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ragnar-pwninskjold/tech-snacks.git /tmp/tech-snacks
mkdir -p .claude/skills
cp -r /tmp/tech-snacks/plugins/tech-snacks/skills/react-refactor-tournament .claude/skills/react-refactor-tournament
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable React Refactor Tournament in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads React Refactor Tournament on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so React Refactor Tournament is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

react-refactor-tournament

Harvest React/Next.js performance refactor candidates straight from the vercel-react-best-practices skill, persist them as a tracked backlog keyed to the skill's real rule ids and impact tiers, rank the most contested tiers, then auto-fix the worst N (each in an isolated git worktree, with tests, committed but not pushed). This runs a bundled dynamic workflow that fans out skill-backed reviewers in parallel, then ranks and fixes under a hard 500k-output-token cap.

It only proposes and fixes on isolated worktree branches — it never pushes or merges, and it refuses to run at all if the vercel-react-best-practices skill isn't installed (no hand-written stand-in).

Requirements (check first)

This skill drives Claude Code's dynamic workflows feature. Before running, confirm:

  • Claude Code v2.1.154+ and a paid plan (Pro/Max/Team/Enterprise) or API access.
  • Workflows are enabled (/config → Dynamic workflows, or disableWorkflows not set, and CLAUDE_CODE_DISABLE_WORKFLOWS unset).
  • The vercel-react-best-practices skill is installed (project or user scope, .claude/skills or .agents/skills). The workflow's first phase hard-checks this and aborts with an actionable message if it's missing — do not try to work around it.

If workflows are disabled, the Workflow tool call below will fail. If it does, tell the user to enable Dynamic workflows in /config and re-run — do not fall back to doing the review inline (the whole point is the parallel skill-backed harness + token cap).

Resolve the bundled workflow path

The orchestration script ships inside this plugin. Resolve its absolute path now — this works whether the plugin is installed at the personal, project, or plugin level, and regardless of the current working directory:

echo "${CLAUDE_SKILL_DIR}/../../workflows/react-refactor-tournament.workflow.js"

Use the path printed above as the scriptPath argument. Do not retype or guess it.

Gather inputs

Determine the workflow args before launching:

  • repoPath (optional): absolute path to the repo root to review. Default to the current project root (${CLAUDE_PROJECT_DIR} or the cwd) unless the user named a different repo.
  • n (optional, default 3): how many top-ranked candidates the fix loop processes. n=0 ranks only and skips the fix loop entirely.
  • scope (optional): a glob/dir hint to constrain the review (e.g. src/components/dashboard). Omit to auto-detect the React component areas.

If repoPath is ambiguous, ask the user once. Otherwise proceed with the current project.

Run it

Call the Workflow tool with:

  • scriptPath: the absolute path resolved above.
  • args: an object, e.g. { "n": 3 }, { "n": 0 } for rank-only, or { "n": 3, "scope": "src/components", "repoPath": "/abs/path/to/repo" }.

The run executes in the background across these phases:

  1. Preflight — resolve the vercel-react-best-practices skill install path; abort if missing.
  2. Scope — detect the framework and group React component dirs into disjoint review areas.
  3. Discover — parallel reviewers invoke the skill and emit candidates keyed to real rule ids (async-parallel, bundle-barrel-imports, …), with severity = the rule's impact: tier.
  4. Backlog — dedup, assign stable ids, and write .pro-brown/refactors/BACKLOG.{json,md}.
  5. Rank — order by impact tier (free); a single lazy tie-break ranker re-orders only an over-subscribed tier (more candidates than remaining fix slots).
  6. Fix (skipped when n=0) — fix the top N in isolated worktrees, write tests where feasible, and commit each (no push, no merge).

Watch progress with /workflows. When it finishes, present the ranking + backlog paths to the user. Fixes live on isolated worktree branches — point the user at git worktree list / git branch to review, and let them merge/PR. Do not push or merge on their behalf.

What counts as a good candidate

A candidate qualifies only if it is a genuine violation of a specific vercel-react-best-practices rule, pinned to a real file:line, with ruleId taken from the skill (never invented) and severity taken from that rule's static impact:. Generic React hygiene the skill doesn't cover (naming, alt text, design-system nits) does not qualify. Quality over quantity — a clean codebase reporting zero candidates is a valid result.

Frequently asked questions

What does the React Refactor Tournament AI skill do?

Review React/Next.js code against the real vercel-react-best-practices skill, backlog the performance findings keyed to actual rule ids + impact tiers, rank the most over-subscribed tiers, then fix + test the top N in isolated worktrees. Use when the user wants to systematically harvest and fix React/Next.js PERFORMANCE refactors (waterfalls, bundle size, RSC fetching, re-renders, JS perf), or says "react refactor tournament", "find React performance refactors", "/react-refactor-tournament".

Why use React Refactor Tournament on TypingMind?

Because you install it once and use it with any model. React Refactor Tournament is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install React Refactor Tournament in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ragnar-pwninskjold/tech-snacks/tree/main/plugins/tech-snacks/skills/react-refactor-tournament. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use React Refactor Tournament?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with React Refactor Tournament?

As many as you like. As long as a model supports skills, you can use React Refactor Tournament with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the React Refactor Tournament AI skill free?

Yes. It is published on GitHub by ragnar-pwninskjold under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇