Agent skill

Refactor To Rules

by openfootmanager in openfootmanager/openfootmanager

Decompose OpenFoot Manager code by responsibility when a quality gate is red, a reviewer requests a split or a refactor is authorized.

GPL-3.0Auto-check: notesTesting & QA

Install Refactor To Rules

skills CLI
$ npx skills add openfootmanager/openfootmanager --skill refactor-to-rules -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install openfootmanager/openfootmanager refactor-to-rules --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/openfootmanager/openfootmanager.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/refactor-to-rules .claude/skills/refactor-to-rules && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
refactor-to-rules
GitHub stars
1.1k
Token cost
~1.3k tokens
SKILL.md length
579 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
GPL-3.0

At a glance

Decompose OpenFoot Manager code by responsibility when a quality gate is red, a reviewer requests a split or a refactor is authorized.

  • Works in 4 steps: Characterize the current boundary → Extract by responsibility → Verify each small extraction → …
  • Tasks that involve Refactoring
  • SKILL.md covers 1. Characterize the current…, 2. Extract by responsibility, 3. Verify each small extraction and 4. Report the result
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Refactor To Rules is an agent skill from openfootmanager/openfootmanager. Decompose OpenFoot Manager code by responsibility when a quality gate is red, a reviewer requests a split or a refactor is authorized. Characterize behaviour first, preserve contracts and report scoped before/after diagnostics without raising limits or reformatting unrelated code.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Refactoring and Quality gates. It works with Rust and Tauri. The repository describes itself as: An open source soccer/football manager game. The licence is GPL-3.0.

When your agent uses it

  • Tasks that involve Refactoring
  • Tasks that involve Quality gates

Example prompts

  • “/refactor-to-rules”

Requirements

  • Pre-approved tools (allowed-tools): Read, Edit, Write, Grep, Glob, Bash

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Characterize the current boundary
  2. Extract by responsibility
  3. Verify each small extraction
  4. Report the result

What it can do on your machine

Read from SKILL.md and the folder at commit a87841b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Edit
    • Write
    • Grep
    • Glob
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Refactor To Rules loads about 1.3k tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 579 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~75
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Edit, Write, Grep, Glob, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from openfootmanager/openfootmanager at commit a87841b, republished under its GPL-3.0 licence (© openfootmanager). 579 words, ~1,344 tokens.

Download SKILL.mdSave it as .claude/skills/refactor-to-rules/SKILL.md (or your agent's skills folder).
name
refactor-to-rules
description
Decompose OpenFoot Manager code by responsibility when a quality gate is red, a reviewer requests a split or a refactor is authorized. Characterize behaviour first, preserve contracts and report scoped before/after diagnostics without raising limits or reformatting unrelated code.
allowed-tools
Read, Edit, Write, Grep, Glob, Bash
when_to_use
A quality gate or reviewer requests a responsibility split, or a behaviour-preserving refactor is authorized.
argument-hint
[file or unit to refactor and the rule it violates]
<!-- Adapted for OFM from nathankim0/clean-architecture-skills (MIT), revision
725cbeeb12e3f731445e7688dee3bbfe5e149c8e:
https://github.com/nathankim0/clean-architecture-skills/blob/725cbeeb12e3f731445e7688dee3bbfe5e149c8e/plugins/clean-architecture/skills/clean-architecture/SKILL.md
Copyright (c) 2026; and btseee/clean-code-skills (MIT), revision
49b1354be3ec9d0158c99b1c1c9bc1f833133640:
https://github.com/btseee/clean-code-skills/blob/49b1354be3ec9d0158c99b1c1c9bc1f833133640/skills/clean-code/SKILL.md
Copyright (c) 2026 Battseren Badral. Full notices: ../../THIRD_PARTY_NOTICES.md.
Adapted to OFM's approved crate graph, football vocabulary and shared application seams. -->

Refactor to rules

Read the root Code quality rules and the unit's callers/tests. A numeric ceiling triggers an inspection; meeting it by splitting arbitrary chunks is not the purpose. Preserve documented inputs, outputs, errors, ordering, stored names and save compatibility. No wider redesign or .clean/ state store is part of this procedure.

1. Characterize the current boundary

Name the unit's one reason to change and list the responsibilities currently mixed into it. When a quality gate is red, record the failing command/diagnostic and the relevant limits from the root section. For an authorized refactor with no red gate, record the request or authorization instead. Avoid a second threshold configuration here. Search ofm_core, src/lib, src/utils, src/services and src/components/ui/index.ts for an existing owner before extracting another copy.

Use /write-tests to pin weakly covered scenarios before moving code. For pure decomposition, observe existing and characterization tests green on the unchanged code; do not invent a red failure for unchanged behaviour. A new behaviour/fix gets its own red scenario and separate change. Cover the public state/persistence seam when wiring can regress.

2. Extract by responsibility

  • Rust: keep a mod.rs orchestration shell and cohesive submodules, following ofm_core/src/generator/ and ofm_core/src/turn/. Engine mirror conversions stay only in turn/.
  • Frontend: a cohesive *.helpers.ts, hook or child component, with football names; respect library/service/UI/feature/page directions. Components call services; policy stays in Rust.
  • Boolean selectors for distinct operations become two named functions or a meaningful enum. Preserve a documented wire selector at its adapter if changing it would break callers.
  • More than seven parameters become a request struct only if they describe a real concept, with explicit units and IDs. Never introduce a catch-all Context containing the whole world.
  • Long Tauri command bodies move into a shared *_internal/application function; both command and MCP wrappers delegate there. Application modules do not import either adapter.
  • Helpers start private or pub(crate) until a second caller needs them. A trait belongs at a consuming boundary only for real I/O with a second implementation/test double; no abstract scaffolding to satisfy SOLID. The approved db -> ofm_core edge is preserved.

Check single responsibility, extension seams, replacement contracts, small input interfaces and real dependency inversion. Do not rename stored fields or IPC keys unless an authorized migration ships; pure refactoring preserves serialized data. Keep validation before live mutation, atomic writes and error propagation. An intentional outcome change is a separate tested fix.

Show full SKILL.md (186 more words)Show less

3. Verify each small extraction

Rerun the named scenario tests and the scoped failing gate after each coherent move. For Rust, check default and mcp feature builds/tests if the seam is shared. For frontend, verify stateful hosts and component/service wiring as well as helper outputs. Read persisted state through a fresh reader when writes move. Use ofm-architecture-reviewer, ofm-dedup-reviewer and ofm-test-reviewer for their respective evidence, then /preflight.

Never raise a threshold, add a broad suppression, shorten meaningful names, remove useful comments, move tests to evade metrics or weaken tests to turn a gate green. Format only changed code; the final format check is read-only. Report an out-of-scope duplicate in the PR body for #589, do not file an issue or copy it again. A blocker does not authorize unrelated fixes.

4. Report the result

Give before/after diagnostics, responsibilities and their new homes, the public contract preserved, scenario/test commands and results, reviewer findings, and checks not run. Explain the split in plain words so the reviewer can assess its purpose. Do not claim a green linter proves SOLID or behaviour, and do not include an unmeasured complexity number.

© openfootmanager, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/refactor-to-rules of openfootmanager/openfootmanager.

Open the folder on GitHubat commit a87841b

Compare with similar skills

Refactor To Rules next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Refactor To Rules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactor To Rules this skillopenfootmanager/openfootmanager1.1k—~1.3kAutomated safety check: NotesGPL-3.0
Worklog Designregisx001/Worklog261—~3.3kAutomated safety check: PassMIT
Refactoratilladeniz/Kubeli387—~7.7kAutomated safety check: WarnMIT
Triage Sonarqubenetdata/netdata81k—~2.8kAutomated safety check: NotesGPL-3.0
Sonarqube Analysishbmartin/graphviz2drawio275—~508Automated safety check: NotesGPL-3.0
Code SolvingHoangTheQuyen/think-better122—~3.7kAutomated safety check: PassMIT

Similar skills

  • Worklog Design

    regisx001/Worklog

    Design and UI skill for the Worklog desktop project manager.

    261 GitHub stars~3.3k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • Refactor

    atilladeniz/Kubeli

    Refactors code following Ousterhout's design principles. An agent skill from atilladeniz/Kubeli.

    387 GitHub stars~7.7k tokensUpdated 5 days ago
    DevelopmentAuto-check: warnings
  • Triage Sonarqube

    netdata/netdata

    Inspect, review, or apply authorized triage decisions to SonarCloud issues and security hotspots; also review the Sonar helpers.

    81k GitHub stars~2.8k tokensUpdated today
    Testing & QAAuto-check: notes
  • Sonarqube Analysis

    hbmartin/graphviz2drawio

    Inspect SonarQube Cloud/SonarCloud findings for this repository using local .env credentials.

    275 GitHub stars~508 tokensUpdated 2 mo ago
    Testing & QAAuto-check: notes
  • Code Solving

    HoangTheQuyen/think-better

    Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates.

    122 GitHub stars~3.7k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Runs a pass, revise or block acceptance review on lo2cin4bt work, checking a deliverable against the request, repo contracts, tests, docs and the public GitHub boundary.

    289 GitHub stars~1.4k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed

More from openfootmanager/openfootmanager

All 8 skills in this repo
  • Add UI String

    openfootmanager/openfootmanager

    Add or change any text a player can see, in every locale the game ships in.

    1.1k GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed
  • Add Domain Field

    openfootmanager/openfootmanager

    Add a field to a domain type so it survives save/load. An agent skill from openfootmanager/openfootmanager.

    1.1k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Add MCP Tool

    openfootmanager/openfootmanager

    Add a tool to the MCP server that lets AI agents play OpenFoot Manager.

    1.1k GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Add Tauri Command

    openfootmanager/openfootmanager

    Expose new backend behaviour to the frontend over Tauri IPC.

    1.1k GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • New UI Surface

    openfootmanager/openfootmanager

    Build a new frontend component, panel, dashboard tab, or screen that matches the Matchday design language, works in light and dark, is keyboard and screen-reader accessible, reuses existing…

    1.1k GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Preflight

    openfootmanager/openfootmanager

    Verify a pull request with the frontend scripts, default and MCP backend tests and clippy, formatting, architecture checks and review evidence.

    1.1k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Refactor To Rules

What does Refactor To Rules do?

Decompose OpenFoot Manager code by responsibility when a quality gate is red, a reviewer requests a split or a refactor is authorized. Refactor To Rules is an agent skill from openfootmanager/openfootmanager. Decompose OpenFoot Manager code by responsibility when a quality gate is red, a reviewer requests a split or a refactor is authorized.

When should I use Refactor To Rules?

Refactor To Rules fits situations like: tasks that involve Refactoring; tasks that involve Quality gates.

How do I install Refactor To Rules in Claude Code?

Run `npx skills add openfootmanager/openfootmanager --skill refactor-to-rules -a claude-code`. Or copy the skill folder (.claude/skills/refactor-to-rules in openfootmanager/openfootmanager) into .claude/skills/refactor-to-rules in your project. Claude Code loads it when a task matches its description.

How do I install Refactor To Rules in Codex?

Run `npx skills add openfootmanager/openfootmanager --skill refactor-to-rules -a codex`. Or copy the skill folder (.claude/skills/refactor-to-rules in openfootmanager/openfootmanager) into .agents/skills/refactor-to-rules in your project. Codex loads it when a task matches its description.

Can I use Refactor To Rules in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openfootmanager/openfootmanager --skill refactor-to-rules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/refactor-to-rules, .gemini/skills/refactor-to-rules, .github/skills/refactor-to-rules and .opencode/skills/refactor-to-rules in your project.

What does Refactor To Rules need to run?

SKILL.md names no scripts, command-line tools or credentials: Refactor To Rules is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Edit, Write, Grep, Glob, Bash.

Does Refactor To Rules access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Refactor To Rules safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Refactor To Rules use?

Refactor To Rules is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Refactor To Rules use?

About 1.3k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Refactor To Rules?

Skills that share tags, products or a category with Refactor To Rules: Worklog Design (regisx001/Worklog, 261 stars), Refactor (atilladeniz/Kubeli, 387 stars), Triage Sonarqube (netdata/netdata, 81k stars) and Sonarqube Analysis (hbmartin/graphviz2drawio, 275 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Refactor To Rules?

openfootmanager (a GitHub organization) maintains it in openfootmanager/openfootmanager, which has 1,135 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 9, 2026.

Source: openfootmanager/openfootmanager on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.