module-regression
它能做什么
帮助你确保大型项目中某一部分的修改不会破坏其他部分。它会记录哪些部分彼此依赖,以及如何测试整个项目是否仍然正常工作。
适用场景
- ✓当你修改了大型项目中的某一部分,想确认没有影响到其他地方时。
- ✓当项目中某个部分出现的错误,是在另一部分修改了好几天之后才出现时。
- ✓在复杂项目中,整理彼此依赖的测试时。
技能链接
https://github.com/affaan-m/ECC/blob/main/pi/core/skills/module-regression/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“检查一下“用户认证”模块的改动,是否破坏了“个人资料管理”。”
每周 5 个新技能,1 分钟读完。
工作原理
它会使用一个名为 REGRESSION.md 的文件,列出项目各部分之间的依赖关系。修改之后,它会对受影响的部分运行测试,看看有没有失败的情况。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Module Regression Ledger
When to Activate
- The repository has at least three interdependent modules, or a previous change to A has broken B.
- A change modifies a module's externally observable behavior and must prove both that module and downstream consumers still work.
- The project already has executable tests or reconciliation commands that should be organized by dependency.
Anti-Patterns
- Creating a regression ledger for a small repository with no cross-module dependencies.
- Guessing dependencies manually or treating one scan as permanent truth.
- Replacing executable acceptance-command exit codes with model review.
Related Skills
test-collaboration: TEST-IDs, test assets, and defect-regression evidence.ai-regression-testing: executable regression tests derived from important defects.contract-first: cross-service or cross-client contract verification.change-impact: pre- and post-implementation blast-radius analysis.
Problem
In large projects, modules depend on one another. People and agents often verify only the changed module while downstream consumers fail silently. The defect appears days later when an aggregate, export, or external behavior is wrong.
The remedy is a regression ledger (REGRESSION.md) plus a deterministic audit: after any relevant change, run the changed module and all affected downstream consumers. Delivery requires every command to pass.
Three Required Fields per Module
## Module 03 — Shop Data Cleaning
Downstream consumers: 05-aggregation, 07-final-export
Dependency evidence: `<repository dependency graph or reproducible scan command>`
Regression acceptance command: `pytest tests/test_03.py && python scripts/reconcile.py --module 03`
Propagation rule: external behavior change → run 05 and 07; internal-only change with a green module check → downstream may be exempted
- Downstream consumers — derive them from the repository's dependency graph, build tooling, or a reproducible import/call scan, and record the command or tool. Extraction differs by ecosystem; this skill does not pretend a universal scanner can parse every language. Mark edges
unverifiedwhen they cannot be established mechanically. An affected unverified edge blocks an all-green verdict until a human confirms its scope or the related module is included in the run. - Regression acceptance command — the ledger's core asset. Each module needs an executable command that proves it still works: tests, reconciliation scripts, or golden-sample diffs. Without it, the audit collapses into “the model looked and found no problem.”
- Propagation rule — state which downstream modules must run after a change and when an exemption is justified.
Connection to TESTS.md
REGRESSION.md does not maintain business rules or test gaps. It references stable TEST-IDs from the test-registry artifact:
Related test points: TEST-ORDER-001, TEST-REFUND-003
- What rules must be protected, their coverage state, and the evidence location belong to
test-collaborationand the test registry. - Which modules and commands must rerun after a change belong to this skill and the regression ledger.
- The current session plans the ledger commands. Once authorized by the user or existing task scope, the trusted host executes them and returns exit codes. This skill adds no dedicated agent or slash command.
Ledger Discipline
- Prefer reconciliation-style acceptance commands over assertion-only checks. External facts such as golden samples, upstream totals, and accounting relationships are harder to weaken accidentally than mocks or loose assertions.
- Refresh downstream lists only from reproducible evidence. When dependencies change, rerun the recorded repository tool or scan; do not hand-edit an edge without evidence.
- Keep the ledger at the repository root or under
docs/, and link it from the project's instruction/map artifact so it does not become an orphan.
Audit Flow
Invoke module-regression through the host's skill entry point, such as $module-regression in Codex. The current session plans and reports the audit. Repository commands run through the trusted host runner within existing user authorization; ask only when a command needs new authority. Successful exit codes are regression evidence, never canonical ECC completion or integration authority.
…
常见问题
什么是“回归记录表”(regression ledger)?
它就像一本账本,记录了项目中哪些部分依赖其他部分,以及在修改之后应该运行哪些命令,来检查整个项目是否仍然正常。
为什么不能只测试我改过的那部分?
在大型项目中,修改一个部分可能会影响到那些没有被直接测试的其他部分。记录表可以确保所有受影响的部分都被检查到。
如果测试失败了会怎样?
如果受影响部分的测试失败,说明这次修改引入了问题(也就是回归),在问题修复之前,这次修改不应该被通过。
详情
作者的原始描述
Govern cross-module regression in large repositories with a REGRESSION.md ledger that records each module's downstream consumers and executable acceptance command. After a change, run the changed module and every affected downstream command, and use observed exit codes as regression evidence under the project's delivery policy. Use for module regression, regression ledgers, impact audits, downstre
repo: affaan-m/ECC
热度
- GitHub 星标
- 280k
- 排名
- #210
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
accessibility
280k帮你的智能体创建人人都能使用的界面。确保网站和应用对残障人士友好,比如失明或行动不便的用户也能顺畅使用。
agent-architecture-audit
280k让你的智能体检查一切是否正常运行。它能找出并修复 AI 系统中的问题,确保系统按预期工作。
agent-eval
280k帮你的智能体比较不同的 AI 编程工具。它能衡量哪个工具在特定任务上更快、更便宜、更可靠。
agent-harness-construction
280k让你的智能体更好地理解如何完成任务。它会优化智能体使用的工具和指令,提高成功的几率。