Module Regression logo

Module Regression

Community
qshanx
module-regression

大项目模块间联动回归——一份 REGRESSION.md 回归台账登记"每个模块的下游消费者 + 可执行的回归验收命令",每次改动后照台账跑回归审计,防"改一个模块悄悄弄坏其他模块"。判决靠退出码,不靠 AI 看着没问题。中文触发:模块回归、回归台账、回归审计、改A坏B、模块联动检查、影响面检查、模块牵连、下游验证、大项目改动检查。English triggers: module regression, regression ledger, impact regression audit, downstream verification.

Overview

Publisherqshanx
Repositorydocs-governance
Skill namemodule-regression
Stars
228
Forks
4
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 qshanx on GitHub. Read the source before you install it.

Installation

Install the Module Regression 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/qshanx/docs-governance/tree/main/skills/engineering/module-regression
  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/qshanx/docs-governance.git /tmp/docs-governance
mkdir -p .claude/skills
cp -r /tmp/docs-governance/skills/engineering/module-regression .claude/skills/module-regression
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Module Regression 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 Module Regression 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 Module Regression 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.

模块回归台账(module-regression)

治什么病

大项目里模块互相引用。改模块 A 时,AI 和人都只盯着 A 本身对不对,下游的 B、C 被悄悄改坏了没人知道——直到几天后 B 的产出数字对不上才发现。这是 AI 协作大项目里最高发、最晚爆雷的事故。

解法:一份回归台账(REGRESSION.md)+ 一个照单审计动作——改完任何模块,按台账把受牵连的下游全部验一遍,全绿才算改完。

台账三要素(每个模块一段,缺一不可)

markdown
## 模块 03-店铺数据清洗
下游(谁依赖我):05-汇总、07-成品导出        <!-- 脚本从 import 生成,勿手改 -->
回归验收命令:pytest tests/test_03.py && python scripts/对账.py --module 03
联动规则:改我的对外行为 → 必须跑 05、07 的验收命令;只改内部实现且本模块验收绿 → 可豁免下游
  1. 下游消费者——脚本从 import/调用关系生成,禁止手写。手写的依赖清单必然腐烂(变动最频繁、没人记得同步),生成的永远反映真实代码。
  2. 回归验收命令——台账的核心资产:每个模块一条"怎么证明我没坏"的可执行命令(pytest / 对账脚本 / golden sample diff)。没有这行,审计退化成"AI 看一眼说没问题"(把裁判权交给被告);有这行,判决就是退出码。
  3. 联动规则——改我 → 谁必须被验证;什么情况可豁免。

与 TESTS.md 的连接

REGRESSION.md 不再维护业务规则和测试缺口。它只引用 TESTS.md 中稳定的 TEST-ID:

markdown
关联测试点:TEST-ORDER-001、TEST-REFUND-003
  • 哪些规则必须被保护、测试处于什么状态、证据在哪:由 test-collaboration skill 和 TESTS.md 管理。
  • 改了某模块后要重跑哪些模块、执行哪条命令:由本 skill 和 REGRESSION.md 管理。
  • /regression-audit 只按回归台账执行命令和报告退出码,不重复审查测试必要性。

台账纪律

  • 验收命令优先"对账型"而非"断言型":锚外部事实(golden sample / 上游合计 / 财务勾稽),"测试全过"能被钻(改松断言、注水 mock),"和基准差异 < 0.01"钻不了。
  • 下游列表只由重扫刷新:加了新 import → 重跑生成脚本,不许手补一行了事。
  • 台账放项目根或 docs/,从 CLAUDE.md 挂指路牌(否则成孤儿文档没人读必烂)。

审计流程(每次改完照做)

Claude Code 可通过 /regression-audit 调用 regression-auditor;Codex / ChatGPT 直接调用 $module-regression,由当前 agent 承担同一“只跑、只报、不修”职责。宿主不同不改变退出码终审和红着不交付的边界。

  1. 列改动:git status -s / git diff --name-only,对照台账定位改的是哪个(些)模块。
  2. 查联动:复用 change-impact 的影响清单,并核对实际 diff、台账及当前调用关系;清单不是已验证结论,新增消费者不能漏验。
  3. 跑回归:本模块验收命令 + 所有下游模块的验收命令,逐个跑,记录每条的退出码。
  4. 退出码终审:全绿 = 已执行的检查通过;说明覆盖范围与缺口后再判断是否可交付;任何一条失败先归因;本次引入的失败由改动者修复,再从第 3 步复跑受影响检查,不得宣称完成。
    • 红了怎么归因(控制变量,不靠猜):基线全绿 + 本次只改了 A + B 红 → 错误必然由 A 引入,顺着 B 验收命令的输出(对账差异行 / assert 信息)反查 A 碰到的交接字段。若 B 在改动前就红 = B 的旧债,不赖本次改动,标台账缺口另行处理。改动批次越小归因越准——一次改 5 个模块再跑,红了就说不清谁干的。台账应记「上次全绿的 commit」,保证归因有干净基线。
  5. 出审计摘要:改了哪个模块 / 跑了谁的回归 / 各自结果(命令 + 关键输出行)/ 豁免了谁及理由。

铁律(四条,违反任何一条审计无效)

  1. 判决 = 退出码,不是"看着没问题"。没有可执行验收命令的模块 = 台账缺口,先补命令再审计。
  2. 审计员只报不修:跑回归、报红绿;红了怎么修是改动者(主会话/人)的事——裁判不能下场踢球。
  3. 红着不准交付:下游红 = 本次改动没完成,没有"下游的问题以后再说"。
  4. 坑必下沉:每修一个 bug,必须在 TESTS.md 新增或关联 TEST-ID,写清回归测试 / lint / schema 校验落在哪;确实只能人工验收时写明理由、步骤和证据。只改代码不登记保护证据 = 没修完。

与相邻方法的边界(别混)

方法管什么文档验证时机
contract-first跨端接口(前后端 / 服务间字段契约)CONTRACT.md集成对账
test-collaboration测试资产、必要测试点、Bug 回归保护和证据TESTS.md需求/Bug/测试变化与交付前
module-regression同一代码库内模块间行为回归REGRESSION.md(下游 + 验收命令 + TEST-ID 引用)每次相关改动后

渐进采用

  • 模块 < 3 个、或模块间零引用 → 不需要,别过度治理。
  • 预警信号:第一次发生"改 A 坏了 B"的事故 → 当天建台账。
  • 已有测试/对账脚本的项目:台账 = 把现成验收命令按模块归位登记,半天出第一版。

初始化与参数

  • 默认按本次实际 diff 定位模块;指定模块时检查该模块及其受影响下游。没有台账时,复用 change-impact 核实的调用关系及项目已有测试命令完成本轮验证,不强制新建台账;缺少依赖证据或可执行命令时报告未验证,不编造绿色结果。
  • init 模式可以生成 REGRESSION 台账文档,不修改业务实现。先从真实 import/require/调用关系生成下游,记录生成命令;不把手写列表标成脚本生成。
  • 从现有测试和对账脚本寻找验收命令候选,标待确认;没有命令的模块登记缺口,不能编造绿色结果。
  • 使用 templates/REGRESSION.example.md,从项目 CLAUDE 挂入口。报告模块、命令、退出码、结论和未跑项;init 中新增的命令经确认后再审计;本轮复用项目既有命令不重复请求确认。

Frequently asked questions

What does the Module Regression AI skill do?

大项目模块间联动回归——一份 REGRESSION.md 回归台账登记"每个模块的下游消费者 + 可执行的回归验收命令",每次改动后照台账跑回归审计,防"改一个模块悄悄弄坏其他模块"。判决靠退出码,不靠 AI 看着没问题。中文触发:模块回归、回归台账、回归审计、改A坏B、模块联动检查、影响面检查、模块牵连、下游验证、大项目改动检查。English triggers: module regression, regression ledger, impact regression audit, downstream verification.

Why use Module Regression on TypingMind?

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/qshanx/docs-governance/tree/main/skills/engineering/module-regression. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Module Regression?

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 Module Regression?

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

Is the Module Regression AI skill free?

Yes. It is published on GitHub by qshanx 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 👇