# Codex Prompt: Handoff 文件清理 + Prompt 库拆分（session 收尾）

用户准备新开 session，本任务做收尾整理：

1. 精简 `docs/session-handoff.md`（615 行 → ~200 行，删过期段，**不归档**——git log 已保留历史）
2. 把 retrospection 的 "Prompt 库" 段拆为独立文件
3. commit 两个 outstanding M 文件 + 本轮改动

**不要添加任何新任务、新提案、新 audit。** 这是 closure 不是 expansion。

---

## 必读前置

1. `AGENTS.md`
2. `docs/session-handoff.md` 当前 615 行的全部内容
3. `docs/internal/retrospection/2026-04-28-design-system-audit.md`

---

## 任务 1：重写 `docs/session-handoff.md`

**目标行数**：~200 行（从 615 砍约 67%）。

### 保留结构（按此顺序）

```markdown
# Session Handoff

[一句话目的]

## 唤醒词
[当前内容保留]

## 收到唤醒词后的标准动作
[当前内容保留——必读链路 + 先跑 audit + 先输出格式]

## 当前最新基线（2026-04-28）

合并自原文中分散的 4-27 / 4-28 状态到一个 section：

- `pnpm audit:figma-conformance` ✅ overallPass=true（skeletonGeneratedWrappers=0）
- `pnpm audit:docs-site` ✅ 17/17 approved，errors=0
  注：22 个 docs page 已就绪（17 approved + 5 in-review 见下）
- `pnpm audit:published-vs-code` ✅ 36/2/0/0（matched / figma-only / code-only / unmapped）
  - figma-only 2: Popup Box / Chart（Figma 已发布但代码缺）
- `pnpm test` ✅ 17 files / 105 tests
- `pnpm build` ✅
- 5 个新加 docs page 当前 pixelReviewStage=in-review（breadcrumb / form-item / prompt-message / steps / tabs，待人工核 Figma 一致性）
- Phase 6 进展：6.1 / 6.2a / 6.2b / 6.3 ✅ 完成；6.3.5 / 6.4 / 6.5 待做

## 必守规则

合并保留：图标体系 / docs shell / Tooltip 页面规则 / 工作纪律（Codex 不动 figma-data tracked / dry-run 默认 / mapping 自动建议必须 needs-review 等）。

## 当前阶段（指向 PROJECT_GOAL）

不在本文件展开路线图。一句话指出当前位置 + 引用：

> 当前在 Path B 路线图 6.3 → 6.3.5 → 6.4 → 6.5 → npm 化 → Phase 7 文档站 → v0.1 上线 之间。
> 完整路线图：`docs/internal/project-goal-roadmap-proposal-2026-04-28.md`
> 项目目标：`docs/PROJECT_GOAL.md`

## 当前阻塞点 / 待用户决策

只列**当前真有的**，不列已解决的。来源：roadmap 提案的 3 个决策点。

- 决策点 1：Popup Box / Chart 进 v0.1 还是 v0.2
- 决策点 2：多角色视图是 v0.1 必备还是 v0.1.x 增强
- 决策点 3：NP-1~5 与 7-A/B 串行还是并行

## 下一步默认

> 进 6.3.5 反向 audit（验证 src/canonical/ 无其它"自创未登记"项）。

## 历史方法论

> 阶段 0–6 完整方法论沉淀见 `docs/internal/retrospection/2026-04-28-design-system-audit.md`。
> Button bridge 演化、4-22 到 4-24 期间的样板链 narrative、4-27 canonical expansion 的 14 组件清单等历史细节，可通过 `git log docs/session-handoff.md` 回溯。
```

### 必须删除的段（共约 415 行）

- L170–205 "当前审计结论（基线）"（4-24 数据，已被 4-28 全绿覆盖）
- L206–228 "当前阻塞点" 4 条（全部已解决）
- L228–263 "当前优先修复顺序"（4-24 视角，已被 Path B 替代）
- L263–385 Button 样板链历史（约 120 行，已被 retrospection 阶段 0–3 + 6.2b 完成事实覆盖）
- L385–415 "统一问题台账" / "generated skeleton 晋升计划"（指向 conformance-issue-log；handoff 不需要重复展开）
- L417–490 "Button 样板链最新状态" / "新 Session 继续 Button 时" / "2026-04-24 人工反馈"（已过期）
- L490–611 "2026-04-27 最新补充" 多个子段（核心事实合并到"当前最新基线"，narrative 留给 retrospection）
- L7–52 "最新同步（2026-04-28 · Phase 6.2b）"（合并到"当前最新基线"，避免双重记账）

### 不动的部分

- 唤醒词
- 收到唤醒词后的标准动作
- 必守规则的核心条目（合并即可，不删）

完成后 `wc -l docs/session-handoff.md` 期望约 150–220 行。

---

## 任务 2：拆 retrospection 的 "Prompt 库" 段

源文件：`docs/internal/retrospection/2026-04-28-design-system-audit.md`，L178–204 的 "## Prompt 库（已验证有效，可复用）" 段（约 27 行）。

### 操作

1. 把整段内容（含 `## Prompt 库...` 标题及其下的 5 个 Prompt 子项）剪切到新文件 `docs/internal/prompt-library-index.md`
2. 新文件加头部说明：
   ```markdown
   # Prompt 库索引
   
   验证有效、可复用的 Codex prompt 类型清单。完整 prompt 文件位置：`docs/internal/_prompts/`。
   
   摘自 `2026-04-28-design-system-audit.md` 复盘（已拆出，复盘文档保持聚焦阶段 narrative）。
   ```
3. 在 retrospection 原 "Prompt 库" 段位置改为一行 reference：
   ```markdown
   ## Prompt 库
   
   见 [`docs/internal/prompt-library-index.md`](../prompt-library-index.md)
   ```

---

## 任务 3：清理 outstanding M 文件

当前 working tree 有 2 个 M 文件遗留：

- `docs/internal/retrospection/2026-04-28-design-system-audit.md` (M：把 `[ ] 6.2` → `[x] 6.2` + 追加 6.2b 段，是用户/linter 之前的合理改动)
- `docs/session-handoff.md` (M：之前 Phase 6.3 commit 时 Codex 越界加的"最新同步"段，内容合理)

任务 1 + 任务 2 自然会覆盖这两个文件——本轮改动完成后 commit 时一并包含。

---

## 任务 4：自验 + commit

```bash
wc -l docs/session-handoff.md docs/internal/retrospection/2026-04-28-design-system-audit.md docs/internal/prompt-library-index.md
pnpm build 2>&1 | tail -5
pnpm test 2>&1 | tail -5
```

build / test 必须通过（应该不影响——这只是文档改动）。

### Commit message 建议

```
chore(docs): slim session-handoff (615→~200), extract prompt-library-index

session-handoff.md:
- Remove 4-24 baseline / blockers / repair order (all resolved at 4-27)
- Remove Button bridge historical narrative ~120 lines
  (covered by retrospection stages 0-3 + 6.2b token replacement)
- Remove 4-27 incremental补充 sections, merge into single "当前最新基线"
- Keep 唤醒词 / 标准动作 / 必守规则 / 当前阶段 (link) / 决策点 / 下一步
- Historical content reachable via `git log docs/session-handoff.md`

retrospection/2026-04-28-design-system-audit.md:
- Mark 6.2 as completed in phase 6 checklist
- Add 6.2b execution details inline
- Extract "Prompt 库" section to standalone file (link replaced)

new file: docs/internal/prompt-library-index.md
- Validated reusable Codex prompt types

Goal: prepare clean handoff state for new session start.

Co-Authored-By: Codex
```

### Commit 文件清单

包含：
- `docs/session-handoff.md`（重写）
- `docs/internal/retrospection/2026-04-28-design-system-audit.md`（含 outstanding M + Prompt 库段抽出后的引用）
- `docs/internal/prompt-library-index.md`（新文件）
- `docs/internal/_prompts/phase-handoff-cleanup.prompt.md`（本 prompt，作为版本记录）

不包含：
- `figma-data/published/icons/manifest.json`（如有 timestamp M，git restore 还原）

---

## 禁止

- ❌ 不创建 `docs/internal/handoff-archive/` 等归档文件夹（git log 已是 archive）
- ❌ 不动 src/ / figma-sync/ / figma-data/ / package.json
- ❌ 不动 `AGENTS.md` / `CLAUDE.md` / `PROJECT_GOAL.md` / `working-principles.md`
- ❌ 不动 `translation/` 4 文件
- ❌ 不重写 retrospection 阶段叙事段（只动 "Prompt 库" 段）
- ❌ 不主动新增"建议下次做 X" 类内容
- ❌ 不修 audit 脚本 / 添加新 audit
- ❌ 失败 build / test 不强行通过

---

## 完成后

1. 写一行简短报告：handoff 行数（before → after），新文件路径，commit hash
2. STOP

完成后 STOP。本轮是 session 收尾，不进入下一阶段。
