brownfield-retrospective
它能做什么
这个工具可以帮你理解并改进已有的软件项目。它会分析现有代码,弄清楚代码是怎样一步步构建出来的,并找出缺失的部分或可以改进的地方。
适用场景
- ✓当你在一个旧项目上开始使用新工具时。
- ✓当你接手或重新回到一段不是你写的代码时。
- ✓当你想知道哪些地方被遗漏了,或者代码为什么会是现在这个样子时。
技能链接
https://github.com/affaan-m/ECC/blob/main/skills/brownfield-retrospective/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“分析一下这个现有项目,告诉我们有哪些地方可以改进。”
每周 5 个新技能,1 分钟读完。
工作原理
它的做法是:选取一段代码,查看它当前的状态,尝试还原导致这种状态的各项决策,最后规划如何修复已经发现的问题。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Brownfield Retrospective
Run ECC's engineering process retroactively against a project that was built without it. Pick any slice of an existing codebase, audit what exists, reconstruct how it got there, extract a four-axis gap register, then execute the fixes forward through the standard ECC pipeline.
The workflow is slice-first: no whole-repo onboarding is required before it is useful, and every phase is re-enterable from a durable artifact on disk. Start in the middle, work backwards, then move forward.
When to Activate
- Adopting ECC in a repository that already exists and is already shaped
- User asks to "audit my existing project", "retro this codebase", or "what did we miss?"
- Taking over, inheriting, or returning to a codebase after a long gap
- User asks "why is it like this?" followed by "should it stay like this?"
- A module, feature, or service needs a rethink before the next feature lands on top of it
- Deciding whether a legacy area should be fixed forward, rewritten, or left documented as-is
When Not to Use
- Greenfield work with no existing code — use
plannerandtdd-workflowdirectly - Onboarding to spec-driven development without the redesign loop — the
spec-mineragent does that on its own - A launch go/no-go production-readiness pass — use
production-audit - Security-only sweeps — use
security-review - Team process retrospectives (sprint ceremonies) — this audits a codebase, not people
The Working Set
All artifacts are written inside the audited project, under docs/retro/<slice>/:
| File | Phase | Purpose |
|---|---|---|
gap-register.md |
0-6 | The state machine — perimeter, Current phase: marker, and rows. The only file required to resume mid-stream. |
baseline-audit.md |
1 | Reviewer findings, test/CI snapshot, TODO inventory. |
reconstructed-spec.md |
2 | What the code actually does today (Requirements + Invariants). |
target-design.md |
4 | Target shape for the slice and the fix sequence. |
Backfilled decisions go to docs/adr/ per the architecture-decision-records skill. If the project uses OpenSpec, reconstructed-spec.md may instead be openspec/specs/<capability>/spec.md produced by spec-miner.
How It Works
Phase 0 — Pick the Entry Point
Start from what the user cares about today. Do not map the whole repo first.
Any of these is a valid slice:
| User signal | Slice |
|---|---|
| Names a directory, module, or service | That path plus its direct callers |
| Names a feature or user flow | The files that implement it, traced from the entry point |
| Names a bug, incident, or pain point | The code that produced it plus one level of call chain |
| Names a dependency or tech choice | Everything that touches it |
| Names nothing | The 2-3 hottest paths by churn — propose them and let the user pick |
Record the perimeter at the top of gap-register.md before anything else: paths in scope, entry points, callers, blast radius. Budget the slice at roughly 15 files or 2,000 lines; if the user's pick is bigger, cut it into named sub-slices and register each as its own row of work. A slice too big to audit in one session is a slice that never finishes. Keep a Current phase: marker beside the perimeter and advance it each time a phase completes.
Phase 1 — Present-State Audit
Establish what exists now, with evidence. Do not fix anything yet.
- Recon the slice: manifest and framework fingerprint, entry points, test layout, CI checks (borrow the recon steps from
codebase-onboarding, scoped to the perimeter). - Run the reviewers that match the stack, in parallel where possible. Every finding must carry a
file:linepointer:- The language reviewer for the stack (
typescript-reviewer,python-reviewer,go-reviewer, ...) security-reviewersilent-failure-hunterfor swallowed errorstype-design-analyzerwhere invariants are encoded in typesperformance-optimizeronly if the slice is on a hot path
- The language reviewer for the stack (
- Snapshot the current state: test count and coverage, lint/CI status,
TODO/FIXME/HACKinventory inside the perimeter.
Write everything to baseline-audit.md. Findings that get fixed during this phase corrupt the baseline — hold them for the register.
Phase 2 — Backward Reconstruction
Work backwards from the present state to the decisions that produced it.
…
常见问题
什么是代码的“切片”?
切片是项目中的一小部分,比如某个模块或某项具体功能。这样分析时就不需要一次覆盖整个代码库。
什么是“四个维度”?
这是用来整理问题的四类分类:未记录的决策(思路)、编码实践、缺失的功能,以及技术选型。
我需要分析整个项目吗?
不需要。你可以先只分析项目中的一个小“切片”,之后如果有需要再逐步扩大范围。
详情
作者的原始描述
Run the ECC engineering process retroactively against an existing project slice. Audit current state, reconstruct past decisions, produce a four-axis gap register (thinking, coding practice, missing features, technology selection), then execute fixes forward through the plan-TDD-review pipeline. Use when adopting ECC mid-project, taking over an inherited codebase, or asking what was missed and wha
repo: affaan-m/ECC
热度
- GitHub 星标
- 280k
- 排名
- #271
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
accessibility
280k帮你的智能体创建人人都能使用的界面。确保网站和应用对残障人士友好,比如失明或行动不便的用户也能顺畅使用。
agent-architecture-audit
280k让你的智能体检查一切是否正常运行。它能找出并修复 AI 系统中的问题,确保系统按预期工作。
agent-eval
280k帮你的智能体比较不同的 AI 编程工具。它能衡量哪个工具在特定任务上更快、更便宜、更可靠。
agent-harness-construction
280k让你的智能体更好地理解如何完成任务。它会优化智能体使用的工具和指令,提高成功的几率。