当前为 🧱 基础分步版(Project 3 · 第 3/3 步 完结) · ← 上一步 Step 2 · ⚡ 看本项目速通版
1. 全新只读会话:给整个分支做对抗式 Diff 审计 / Fresh-Session Adversarial Diff Audit
合入主干前,用 git diff main...HEAD 喂给一个从未参与过编码的新会话,专抓隐蔽退化、边界遗漏和越权改动:
Before merging, pipe git diff main...HEAD into a brand-new, unbiased read-only session to catch silent regressions or boundary leaks:
1 | # 三大 CLI 任选其一执行独立审稿 |
2. 发布后 30 秒线上真冒烟 / 30-Second Live Post-Deploy Smoke Check
推送并部署完成后,别把“CI 绿了”当终点——立刻从外部真实请求线上关键 URL(涵盖新功能页 + 至少 1 个老历史页面 + 核心静态资源),全部看到实打实的 200 才算真正收工:
Never stop at a green CI badge—probe live production URLs (new pages + at least one untouched legacy page + key static assets) and verify real HTTP 200 responses:
1 | for url in "https://your-site.example/" "https://your-site.example/new-feature/" "https://your-site.example/legacy-page/"; do |
3. 清理 Worktree + 沉淀知识复利 / Cleanup & Compound Knowledge
- 合并分支后删除临时工作区:
git worktree remove ../legacy-safe-refactor。 - 把这次改造挖出来的隐藏环境坑(比如老构建工具兼容参数、线上部署分支规则)用 1~2 行极简补录进
AGENTS.md,把最终状态与新路由记入work.md。
至此,《Agent 实战项目工坊》三大核心实战全部通关! 无论从 0 到 1 建全栈、手搓前沿 Harness,还是安全改造多年老仓库,你都已经手握一套可复制、可验证、跨 agy / claude / codex 通用的工业级作战手册。
Clean up your temporary worktree (git worktree remove ...), distill any hard-won legacy gotchas into 1–2 crisp lines in AGENTS.md, and update work.md. You have completed all three hands-on tracks of the Agent Projects Workshop!