Dev Refactor logo

Dev Refactor

Organization
devcodex-labs
dev-refactor

重构子类型规范 — 测试覆盖前置确认 + 三段式重构流程

Overview

Publisherdevcodex-labs
Repositorydevcodex
Skill namedev-refactor
Stars
433
Forks
44
Bundled files
1
LicenseAGPL-3.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 devcodex-labs on GitHub. Read the source before you install it.

Installation

Install the Dev Refactor 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/devcodex-labs/devcodex/tree/main/content/skills/dev-refactor
  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/devcodex-labs/devcodex.git /tmp/devcodex
mkdir -p .claude/skills
cp -r /tmp/devcodex/content/skills/dev-refactor .claude/skills/dev-refactor
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Dev Refactor 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 Dev Refactor 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 Dev Refactor 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.

Dev Refactor Skill

触发条件

用户意图为重构现有代码(不改变外部行为),典型场景:提取公共模块、消除重复代码、改善架构分层、升级编码风格。

前置检查(必须在 CP1 前完成)

项内容
测试覆盖确认确认被重构模块已有测试覆盖(单测/集成测试),无测试时禁止继续,优先补测试
基线快照记录当前接口签名、导出列表、公开 API
类型契约基线TypeScript 项目须区分必须保持兼容的公开类型契约与允许修正的旧类型缺陷

执行流程

text
CP1(范围确认)→ CP2(方案确认)→ [plan-review] → [impact-review] → CP3(计划确认)→ 执行

plan-review:PR-1 在 CP2 前自检,PR-2~PR-7 在 CP2→CP3 之间执行;PR-5② 跨模块依赖变更时继续 impact-review,🔴 阻断时回 CP2。

执行阶段:

  1. 最小增量重构,每步可独立回滚
  2. 重构后运行测试套件(零新增失败)
  3. 更新 API 文档(若接口签名变更)
  4. document-sync(更新架构文档)

关键规则

  • 🔴 重构前测试覆盖率不足时,必须先补测试再重构(C-REF-01)
  • 禁止在重构 PR 中混入功能变更(行为不变原则)
  • Breaking Changes 必须在 CP2 中列出并评估
  • TypeScript 类型迁移或重构不得机械复制旧版本类型缺陷;应按公开契约与消费面逐步完善,跨模块业务契约、公开类型与配置类型优先集中到 types 契约层,本地私有 interface 可保留但须说明理由

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 Dev Refactor AI skill do?

重构子类型规范 — 测试覆盖前置确认 + 三段式重构流程

Why use Dev Refactor on TypingMind?

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/devcodex-labs/devcodex/tree/main/content/skills/dev-refactor. 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 Dev Refactor?

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 Dev Refactor?

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

Is the Dev Refactor AI skill free?

Yes. It is published on GitHub by devcodex-labs under the AGPL-3.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 👇