Book Refactoring Pass logo

Book Refactoring Pass

Community
KunoLu
book-refactoring-pass

Guides behavior-preserving refactoring with small, reversible steps. In strict tasks, mandatory before the first implementation edit to existing production code; in default/lite tasks, use on demand when structural friction, duplication, long functions, tangled responsibilities, unsafe cleanup, or explicit delivery requirements affect the change.

Overview

PublisherKunoLu
Repository640-skills
Skill namebook-refactoring-pass
Stars
550
Forks
13
Bundled files
1
LicenseApache-2.0
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.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by KunoLu on GitHub. Read the source before you install it.

Installation

Install the Book Refactoring Pass 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/KunoLu/640-skills/tree/main/sbtd-workflow-onboard/templates/skills/book-refactoring-pass
  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/KunoLu/640-skills.git /tmp/640-skills
mkdir -p .claude/skills
cp -r /tmp/640-skills/sbtd-workflow-onboard/templates/skills/book-refactoring-pass .claude/skills/book-refactoring-pass
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Book Refactoring Pass 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 Book Refactoring Pass 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 Book Refactoring Pass 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.

Book Refactoring Pass

Use this Skill as a focused refactoring check before or during implementation.

It is derived from the mini rule style of agent-rules-books. It is a strict development gate for existing-production-code edits and an on-demand engineering lens in other structural-risk scenarios; it does not replace project rules, tests, task artifacts, source/LSP/contract impact analysis, or code review.

Strict Development Gate

Whenever a strict task will modify existing production code, run this Skill before the first implementation edit to existing production code, even when the expected result is that no refactoring is needed.

Emit a separate visible review:

text
Refactoring Review
Status: proceed | refactor-first | blocked
Review mode: normal | safety-seam-only
Existing-code scope: ...
Behavior that must remain unchanged: ...
Structural friction: ...
Decision and smallest safe step: ...
Safety net and validation: ...
Deferred refactors: ...
  • proceed: in normal mode, the existing structure is safe enough for the requested edit; no refactor needed is a valid explicit conclusion.
  • refactor-first: perform only the smallest behavior-preserving structural change allowed by the current review mode, validate it, and rerun the required gate before feature or fix edits.
  • blocked: required behavior evidence, a safety net plan, or the Skill is unavailable; state the blocker and do not edit production behavior.

If book-legacy-change-safety is also mandatory, its review normally reaches characterized before this gate runs. Controlled exception: a legacy seam-required result may invoke this Skill in safety-seam-only mode. That mode may design and implement only the recorded behavior-preserving test seam, must validate observational equivalence, and must return to legacy review to establish the safety net. After legacy reaches characterized, rerun this Skill in normal mode before feature / fix edits.

When To Use

  • Strict: every development task that modifies existing production code. In default/lite, use this Skill when structural risk, project rules, or explicit delivery requirements apply.
  • Existing code structure is making a requested change risky or awkward.
  • A change mixes behavior changes with cleanup.
  • Duplication, long functions, feature envy, primitive obsession, or tangled responsibilities are blocking clarity.
  • A review needs to decide whether a refactor should happen now or be deferred.

When existing production code will not be modified, do not use this Skill for simple text, docs, config-only edits, broad rewrites, speculative architecture changes, or code that is already easy to change safely unless the user explicitly requests the review or another concrete structural risk warrants it.

Workflow

  1. Identify the observable behavior that must remain unchanged.
  2. Confirm the available safety net: tests, characterization checks, manual repro, snapshots, or focused inspection.
  3. Separate structural refactoring from behavior changes.
  4. Prefer the smallest reversible move that lowers the current task risk.
  5. Preserve public contracts unless the task explicitly changes them.
  6. In safety-seam-only mode, reject feature behavior, bug-fix behavior, broad cleanup, or any structural change not required by the recorded test seam.
  7. Run the project validation appropriate to the touched code.

Output

Always emit the visible Refactoring Review for a strict gate. When used in a task-level record, also write only task-specific conclusions to implement.md, design.md, or the check summary:

  • Current friction.
  • Behavior that must not change.
  • Proposed refactoring steps or explicit no refactor needed.
  • Safety net and validation command.
  • Deferred refactors, if any.

Only long-term conventions belong in docs/spec.

Stop Conditions

Stop refactoring when the requested change is safe and clear enough. The mandatory review does not require a refactor; never invent cleanup merely to produce refactor-first, and do not keep improving code outside the task boundary.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Book Refactoring Pass AI skill do?

Guides behavior-preserving refactoring with small, reversible steps. In strict tasks, mandatory before the first implementation edit to existing production code; in default/lite tasks, use on demand when structural friction, duplication, long functions, tangled responsibilities, unsafe cleanup, or explicit delivery requirements affect the change.

Why use Book Refactoring Pass on TypingMind?

Because you install it once and use it with any model. Book Refactoring Pass 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 Book Refactoring Pass in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/KunoLu/640-skills/tree/main/sbtd-workflow-onboard/templates/skills/book-refactoring-pass. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Book Refactoring Pass?

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 Book Refactoring Pass?

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

Is the Book Refactoring Pass AI skill free?

Yes. It is published on GitHub by KunoLu under the Apache-2.0 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 👇