Agent skill

Module Regression

by qshanx in qshanx/docs-governance

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

MITAuto-check passedAgent Workflows

Install Module Regression

skills CLI
$ npx skills add qshanx/docs-governance --skill module-regression -a claude-code

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

GitHub CLI
$ gh skill install qshanx/docs-governance module-regression --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/qshanx/docs-governance.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/module-regression .claude/skills/module-regression && 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
module-regression
GitHub stars
132
Token cost
~811 tokens
SKILL.md length
192 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 3 steps: 下游消费者——脚本从… → 回归验收命令——台账的核心资产:每个模块一条"怎么证明我没坏"的可执行命令(pyt… → 联动规则——改我 → 谁必须被验证;什么情况可豁免。
  • Agent Workflows work in your project
  • SKILL.md covers 治什么病, 台账三要素(每个模块一段,缺一不可), 与 TESTS.md 的连接 and 台账纪律, plus 5 more sections
  • Calls git

What it does

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

Its SKILL.md is about 810 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 Agent Workflows. The repository describes itself as: Claude Code、Codex 与 ChatGPT 的文档驱动开发治理插件:防文档腐烂、维护上下文与决策、契约协作、测试与回归证据。 The licence is MIT.

When your agent uses it

  • Agent Workflows work in your project

Example prompts

  • “每个模块的下游消费者 + 可执行的回归验收命令”
  • “改一个模块悄悄弄坏其他模块”
  • “/module-regression”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. 下游消费者——脚本从 import/调用关系生成,禁止手写。手写的依赖清单必然腐烂(变动最频繁、没人记得同步),生成的永远反映真实代码。
  2. 回归验收命令——台账的核心资产:每个模块一条"怎么证明我没坏"的可执行命令(pytest / 对账脚本 / golden sample diff)。没有这行,审计退化成"AI 看一眼说没问题"(把裁判权交给被告);有这行,判决就是退出码。
  3. 联动规则——改我 → 谁必须被验证;什么情况可豁免。

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Module Regression loads about 811 tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 192 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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 qshanx/docs-governance at commit 520696e, republished under its MIT licence (© qshanx). 192 words, ~811 tokens.

Download SKILL.mdSave it as .claude/skills/module-regression/SKILL.md (or your agent's skills folder).
name
module-regression
description
大项目模块间联动回归——一份 REGRESSION.md 回归台账登记"每个模块的下游消费者 + 可执行的回归验收命令",每次改动后照台账跑回归审计,防"改一个模块悄悄弄坏其他模块"。判决靠退出码,不靠 AI 看着没问题。中文触发:模块回归、回归台账、回归审计、改A坏B、模块联动检查、影响面检查、模块牵连、下游验证、大项目改动检查。English triggers: module regression, regression ledger, impact regression audit, downstream verification.
metadata.origin
小磊 · 模块间回归审计

模块回归台账(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. 查联动:台账告诉你下游是谁。
  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"的事故 → 当天建台账。
  • 已有测试/对账脚本的项目:台账 = 把现成验收命令按模块归位登记,半天出第一版。

初始化与参数

  • 默认按 Git 工作区改动定位模块;指定模块时只检查该模块及其下游。台账不存在且没有 init 请求时报告缺失,不猜依赖。
  • init 模式可以生成 REGRESSION 台账文档,不修改业务实现。先从真实 import/require/调用关系生成下游,记录生成命令;不把手写列表标成脚本生成。
  • 从现有测试和对账脚本寻找验收命令候选,标待确认;没有命令的模块登记缺口,不能编造绿色结果。
  • 使用 templates/REGRESSION.example.md,从项目 CLAUDE 挂入口。报告模块、命令、退出码、结论和未跑项;用户确认真实验收命令后再审计。

© qshanx, MIT. 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 skills/module-regression of qshanx/docs-governance.

Open the folder on GitHubat commit 520696e

Compare with similar skills

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

Module Regression compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Module Regression this skillqshanx/docs-governance132—~811Automated safety check: PassMIT
MCP Server Builderanthropics/skills180k64 repos~2.3kAutomated safety check: PassApache-2.0
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k11 repos~4.1kAutomated safety check: NotesApache-2.0
Using Superpowersfarm-fe/farm5.6k35 repos~1.4kAutomated safety check: PassMIT
Executing Plans Inlineobra/superpowers296k2 repos~5.1kAutomated safety check: PassMIT
Claude Code Agent Developmentanthropics/claude-plugins-official38k8 repos~2.8kAutomated safety check: PassApache-2.0

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 64 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 11 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Using Superpowers

    farm-fe/farm

    A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

    5.6k GitHub starsUsed in 35 repos~1.4k tokens
    Agent WorkflowsAuto-check passed
  • Executing Plans Inline

    obra/superpowers

    Has the agent carry out an implementation plan itself, task by task in the current session, keeping a ledger, proving each step with a test and ending with one whole-branch review.

    296k GitHub starsUsed in 2 repos~5.1k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    38k GitHub starsUsed in 8 repos~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Skill Creator

    Azure/azqr

    Official

    Create new skills, modify and improve existing skills, and measure skill performance.

    795 GitHub starsUsed in 89 repos~8.2k tokens
    Agent WorkflowsAuto-check passed

More from qshanx/docs-governance

All 10 skills in this repo
  • Agent Entrypoints

    qshanx/docs-governance

    根据项目事实与已确认讨论生成、精简或审查 AGENTS.md / CLAUDE.md,明确共享规则主文件、可执行约束、PRD / Spec 读取路标和验证入口。用于项目入口只有空模板、规范含糊、双入口冲突或需要设置 Agent 项目说明时。English triggers: AGENTS.md, CLAUDE.md, project instructions, agent entrypoint…

    132 GitHub stars~1.3k tokensUpdated 3 days ago
    Auto-check passed
  • Contract First

    qshanx/docs-governance

    分前端/后端(或多个服务)多端开发的项目,用 CONTRACT.md 指向的唯一机器契约,各端只照它各做各的,防止字段漂移导致集成时白屏。支持单会话多 agent 和多终端各自跑两种模式。只要项目有前后端/多服务、接口字段老对不上、各端联调卡住、某端改了字段忘了通知别人、或前端为渲染一个页面要调一堆接口拼数据,就用这个…

    132 GitHub stars~1.2k tokensUpdated 3 days ago
    Auto-check passed
  • Docs Governance

    qshanx/docs-governance

    作为面向长期 AI 协作项目的知识、决策与验证治理总入口,把优秀 Agent 的一次性工作沉淀为可继承、可验证、可持续演进的项目集体能力;根据用户意图把任务路由到活文档、领域上下文与 ADR、变更影响、接口契约、测试资产、模块回归或闭环设计能力,并在大型变更中组织正确顺序。用于用户只说“文档治理”“项目治理”“帮我整理项目知识”“改完怎么收尾”而未指定具体…

    132 GitHub stars~485 tokensUpdated 3 days ago
    Auto-check passed
  • Living Docs Governance

    qshanx/docs-governance

    把长期项目的文档当成一个小系统来维护,防止文档腐烂——四份各司其职的脊柱文件(CLAUDE.md 共享章程 / CLAUDEMAP.md 地图 / PROJECTSTATUS.md 健康仪表盘 / PROJECTLOG.md 流水账)+ Codex 的 AGENTS.md 入口桥接 + 固定读序,并按需连接 ARCHITECTURE、CONTEXT、ADR、契约、测试、回归和 Issue…

    132 GitHub stars~4.1k tokensUpdated 3 days ago
    Auto-check passed
  • Loop Design Check

    qshanx/docs-governance

    把一个任务"写成"一个目标导向的 loop,并"检查"这个 loop 写得对不对、会不会跑飞——防止空转烧钱 / Goodhart 作弊 / 把错的干到底。两个动作:① 写 loop(先做减法判该不该建 → 定可判定目标 → 选回路类型 → 选骨架)② 体检 loop(过五个崩法 + 可判定性 + 边界 + 降级 + judge 独立 + 判断留人红线)。中文触发:写 loop、设计…

    132 GitHub stars~1.2k tokensUpdated 3 days ago
    Auto-check passed
  • Product Evolution

    qshanx/docs-governance

    在 docs 下建立或维护产品管理入口,登记材料来源,统一需求编号、状态与修订,连接需求池、单需求、版本及验收复盘,并只读审查需求演变是否可追溯。用于产品文档管理员、PRD 版本混乱、产品进展难以理解、已确认决定未回写或需要产品文档审查时。English triggers: product documentation manager, product evolution, PRD…

    132 GitHub stars~2.1k tokensUpdated 3 days ago
    Auto-check passed

Categories

Questions about Module Regression

What does Module Regression do?

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

When should I use Module Regression?

Module Regression fits situations like: agent Workflows work in your project.

How do I install Module Regression in Claude Code?

Run `npx skills add qshanx/docs-governance --skill module-regression -a claude-code`. Or copy the skill folder (skills/module-regression in qshanx/docs-governance) into .claude/skills/module-regression in your project. Claude Code loads it when a task matches its description.

How do I install Module Regression in Codex?

Run `npx skills add qshanx/docs-governance --skill module-regression -a codex`. Or copy the skill folder (skills/module-regression in qshanx/docs-governance) into .agents/skills/module-regression in your project. Codex loads it when a task matches its description.

Can I use Module Regression 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 qshanx/docs-governance --skill module-regression -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/module-regression, .gemini/skills/module-regression, .github/skills/module-regression and .opencode/skills/module-regression in your project.

What does Module Regression need to run?

Going by SKILL.md and its folder, Module Regression needs the command-line tools its instructions call (git). Our summary lists: Python 3.

Does Module Regression access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Module Regression safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Module Regression use?

Module Regression is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Module Regression use?

About 811 tokens (SKILL.md is roughly 3.2k 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 Module Regression?

Skills that share tags, products or a category with Module Regression: MCP Server Builder (anthropics/skills, 180k stars), Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Using Superpowers (farm-fe/farm, 5.6k stars) and Executing Plans Inline (obra/superpowers, 296k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Module Regression?

qshanx (a GitHub user) maintains it in qshanx/docs-governance, which has 132 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 5, 2026.

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