# Meegle Plugin Skills 合并 —— 能力台账（合并契约）

> 把 7 个 `meegle-plugin-*` skill（create / feature / polish / publish / workflow / backend / shared）
> 合并为单一 `meegle-plugin` skill 时，**这份台账是契约**：每一项能力都必须有明确去向，
> 合并 = 照台账搬，验证 = 照台账逐行打勾。`meegle-plugin-cli` 不在合并范围。
>
> 由 2026-05-19 的 7 个并行扫描 agent 产出，逐 skill 拆到「单条行为」粒度。

---

## 0. 怎么用这份文档

- **第 2 节**：跨 skill 的横向风险——合并里最容易系统性丢能力的 9 类，必须统一处理。
- **第 3 节**：需要用户拍板的开放问题——台账填不出去向、必须人工决策的点。
- **第 4 节**：能力台账明细——7 张子表，去向列已按统一命名方案对齐。
- **第 5 节**：回归用例——发布前那道闸门，逐项从台账派生。

去向命名方案：
- router 本身 = `meegle-plugin/SKILL.md`（放 SOP：context 检测 + phase 选择 + phase 路由 + 安全总纲）
- shared = `references/shared.md`（认证/权限/安全/根原则）+ `checkpoint.md` + `errors.md` + `source-attribution.md`
- 各 phase = `references/<phase>-*.md`（`create-*` / `feature-*` / `polish-*` / `publish-*` / `workflow-*` / `backend-*`）
- 点位 doc 整目录 = `references/feature-point-types/...`

能力类型：`执行`（怎么做的细节→进 reference）/ `派发-守卫`（决定分支/入口拦截/context 检测→进 router）/ `理念-上下文`（理念→进 router 引言或 phase reference 开头）。

---

## 2. 跨 skill 横向风险（合并必须系统处理的 9 类）

这 9 类是 7 个 agent 的 ⚠️ 风险项汇总去重后的结果。它们不属于任何单个 skill，是合并动作本身引入的系统性风险。

### X1 · 跨 skill 引用路径会成批失效
references 之间、references 对 SKILL.md 的相对路径链接，在文件搬迁 + 前缀化后全部漂移。已确认的断链点：
- `create` → `publish/references/verify.md V3`（pluginSecret 提示）
- `create/plan.md` → `shared/SKILL.md 根原则 3`
- `publish/pre-check.md` → `feature/references/code-verify.md`（PC2 复用）
- `feature/point-types/` 子目录内大量 `../../config-plan.md`、`../customField/value-shape.md` 等
- `shared` 的 `local-config set` gate → `feature/config-apply.md §A0`（格式权威源）
→ **不能靠一条 grep**。需全量 link audit：列出所有 reference 间引用边，逐条重写为合并后路径。

### X2 · 重复内容需定「单一权威源」
合并后若同一规则在多个 reference 各留一份，会版本漂移。已识别的多处表达：
- **code-verify 流程**：`publish/pre-check.md PC2` 和 `feature/code-verify.md` 完全相同 → 建议抽 `references/shared-code-verify.md`，两处都引用（见决策点 D6）。
- **checkpoint 机制**：`workflow/SKILL.md` 有摘要、`shared/checkpoint.md` 有全文 → 以 `checkpoint.md` 为权威，router 只引用。
- **MCP 缓存协议**：`shared` 标注「本节是权威源」，feature 多处引用 → 合并后保持 `shared.md` 单一权威。
- **app_type 锚定**：create / feature / workflow / backend 都读 `app_type` → router 做一次锚定存 context，各 phase 只读不重复锚。
- **「不 scaffold 整个后端」**：backend 的 setup 和 impl 各表述一半（前置条件 / 范围界定）→ 两处都保留各自角度。
- **「AI 工程不 apply 绕过」**：backend perm Step 0 和 impl Gate 各内联一份 → 抽成 shared 具名规则，两处引用。

### X3 · 隐性前置条件失去「workflow 顺序」保证
今天靠 workflow 的编排顺序隐式保证的前置，合并成状态机后要变显式 gate：
- `polish` 的「feature Stage Code 已执行、代码就绪」——独立调用 polish 时无任何检查（见 D1）。
- `publish` 的 metadata 完整性——今天完全没有，需新增 **PC0**（见 X8）。
- `publish` 的「polish 已执行」——同上。

### X4 · 不可逆确认点必须逐个显式保留（安全红线）
合并重构中最容易被「优化」掉的就是确认交互。必须保留：
- workflow 三个不可逆确认点：①Phase 2 点位方案 ②Phase 2 尾本地调试 ③Phase 3 发布前。
- workflow「开始 Phase 3」≠「确认发布」——两次独立确认，router 引言必须分层写清。
- workflow Phase 3.3 **从 checkpoint 恢复也必须重走 3.2 确认**——极易被「step=3.3 直接续」抹掉。
- **`publish` 的 frontmatter 声明「执行前必须确认」，但 `apply.md` 里根本没有确认步骤文案**——这是合并前就存在的缺陷，合并时必须在 `publish-apply.md` A3 前补上确认节点。
- backend perm apply 前确认；backend「被 workflow 编排时不自己 publish」。
- shared 根原则 3 的「五类必须确认动作」清单。

### X5 · context 检测的 not-exists 是三态，不能 collapse
`test -f plugin.config.json` 不存在时，create / workflow / backend 三方都需要区分：
**待建新插件空目录 / 外部后端仓 / 走错目录**。这正是 SOP Step 2 要多问一句的设计。backend R1 明确：not-exists 且话术无「从零/新建」信号时，router 必须探问澄清，不能默认。

### X6 · `orchestrated=true` 跨 skill 契约的归属
`create` 被 workflow 编排时带 `orchestrated=true` 跳过入口守卫。合并后 create/workflow 同属一个 router，这个参数失去跨 skill 边界——需改成 router 内部「编排路径标记」：走 workflow phase 进入 create 段时免做 context 守卫（workflow 段已做过）。

### X7 · state.json checkpoint 的「零号写入点」纪律
- 只有 workflow Phase 1.2（`PHASE1_CWD_OK` 后）首次落盘 state.json；`create` 明确**不写**。
- 合并后 router 若在 Phase 0 / 1.1 提前落盘 → 在父目录产生孤儿文件。
- checkpoint schema（phase/step/lastCommand/context 等字段）是 router 统一契约，被 feature/publish/backend 编排时共用。
- 命名空间约定：workflow 用 `Phase 0/1/2/3`，feature 用 `Stage Config/Code`，step 字段拼接如 `2.config.apply`。

### X8 · PC0（publish metadata gate）—— 校验逻辑已存在，只需提早到 release
**纠正台账初版的两处错误前提**：(1) 元信息 name/short/icon/category **不在 `plugin.config.json`**，是远端的；
(2) CLI 的 `publishProject` **已有** `ensurePluginMetadataReady()` —— 发布前拉远端查 4 项非空，缺则抛错并提示 `lpm update-description`。
真正的 gap：`releaseProject` **不**跑这个检查 → agent 先 `lpm release`（build+zip+upload 30–120s）→ 再 `lpm publish` 才撞 metadata 失败，那段 build 白做。
PC0 = 把 `ensurePluginMetadataReady` 从 `publish/index.ts` 抽成共享 util，在 `releaseProject` 开头（`resourceCount` 分支之前）也调一次，build 之前 fail-fast。
**不加「临时工作名」blocklist**——会误杀合法名；「跳过 polish 就发布」已被 short/category 空值检查从另一维度挡死。
→ 合并范围含这一个 CLI 改动（抽 util + release 调用 + 测试），非纯 skill 文档重组。详见 D3。

### X9 · feature ↔ backend 的 bounce / 调起逻辑变 router 内分支
- feature 判断「这个 feature 要不要后端那一半」有**两个触发点**：`config-plan P5`（webhook 形态点位）+ `code-verify V4`（代理路由 `/api/proxy/*`）——**两个都要保留**，丢一个就漏调 backend。
- feature vs backend 的判据：**这次改动碰不碰前端产物（resources/entry）**。碰→feature（内部再拉 backend 子分支）；只动 server/→backend。
- backend 的两条到达路径：(a) feature 内部调起 (b) 用户直接进（可能坐在外部后端仓）——路径 (b) 不能在合并后消失。

---

## 3. 决策结论（已按 AUTHORING §0.1 弱 AI 标准定型）

原则：**能代码检查的约束 → CLI `exit 1` 硬 gate；只有判断/意图类才留 skill 文档**。
skill 文档对弱 AI 只是「建议」——会漏读、误读、被上下文压缩冲掉。
下列 7 项已据此定型。D1–D5 原先写成「文档级建议」，对弱 AI 等于没写，已改写为 CLI/SOP 硬 gate。

| # | 决策点 | 结论（弱 AI 可靠形态） |
|---|--------|----------------------|
| D1 | polish 独立调用、`src/` 无代码 | **router SOP 的 polish 入口做确定性 `test`**（检 `src/` 有无 `.tsx`）→ 空则硬停、确定性分支到「代码未就绪，先走 feature」。**不是 prose 警告，不「继续」**——「警告后继续」= 用失败可恢复替代失败不发生，§0 禁止。 |
| D2 | polish `mode=apply` 单独入口 | **直接等价于 pipeline**——取消「检测上游产物再决定」的判断。无分支 = 弱 AI 错不了。 |
| D3 | PC0 metadata gate | **CLI 硬校验，且检查逻辑已存在**。元信息（name/short/icon/category）是**远端**的，不在 `plugin.config.json`；CLI 的 `publishProject` 已有 `ensurePluginMetadataReady()` 发布前拉远端、查 4 项非空、缺则抛错并提示 `lpm update-description`。真 gap 在 `releaseProject` **不**跑此检查 → build+zip+upload 白跑后 publish 才失败。PC0 = **把 `ensurePluginMetadataReady` 抽成共享 util、提早到 `releaseProject` 开头（build 之前）调用**。**不加「临时工作名」blocklist**——会误杀合法名；「跳过 polish 就发布」已被 short/category 空值检查从另一维度挡死。skill 只留一句「CLI 报 metadata 不全 → 转 polish」。⚠️ 含一个 CLI 改动（抽 util + release 调用 + 测试）。 |
| D4 | pluginSecret/.gitignore 检查 | **保持 warn（现状）**，不升级 block。理由：不新增弱 AI 要执行的指令，维持现状即零风险。 |
| D5 | 自建后端红线放哪 | **单一家：住 `shared.md` 全文**（安全红线 + shared 必读）；`backend-impl.md` 只留一行纯链接指针。**不双写**（§4：同一规则只在一处完整写）。 |
| D6 | code-verify 共用 | **抽 `references/shared-code-verify.md` 单一源**，`publish-pre-check.md` 与 `feature-code-verify.md` 都引用它，不各留一份。 |
| D7 | source-attribution.md | **保持独立、不进主流程 Read 链**，仅 reviewer 按需读。 |

> §0.1 自检公式：想往 skill 加一条「AI 必须 X」前先问——CLI 能不能在 X 发生时直接 `exit 1`？能 → 进 CLI，skill 不复述。D1/D3 本质是「值是否合法/必填」的校验，属此类；D2 靠取消判断消除出错面；D5 属「一处完整写」。
>
> 备注：扫描 agent 曾提「confirm 输出用了 emoji、可能违反禁 emoji 规则」——经核对，本仓 CLAUDE.md / AUTHORING.md **没有**禁 emoji 规定，现有 skill 普遍用 ✅⛔ 等，故 emoji **不是问题**，不列入决策点。

---

## 4. 能力台账明细

### 4.1 shared（S-*）→ 主要去向 `references/shared.md` / `checkpoint.md` / `errors.md` / `source-attribution.md`

| 能力项 | 今天位置 | 类型 | 合并后去向 | 备注 |
|--------|----------|------|-----------|------|
| 根原则 1：无源即停 | SKILL.md 三条根原则 | 理念-上下文 | `shared.md` 根原则区 | 所有 phase 的「编造」防线，必须首屏可见 |
| 根原则 2：数据完整性（写入前拿基线） | SKILL.md 三条根原则 | 理念-上下文 | `shared.md` 根原则区 | 与「全量提交约束」联动 |
| 根原则 3：真实数据动作显式确认 + 五类动作清单 | SKILL.md 三条根原则 | 派发-守卫 | `shared.md` + router SOP gate 节点 | 五类动作是跨 phase 强制 gate；见 X4 |
| 插件工程识别（plugin.config.json + MII_ 前缀） | SKILL.md 插件工程识别 | 派发-守卫 | router SOP context 检测 | router 区分新建/已有的基础 |
| 工程字段由 CLI 维护、skill 只读不写 | SKILL.md 插件工程识别 | 理念-上下文 | `shared.md` | 防止各 phase 直接 Edit plugin.config.json |
| Token 按 siteDomain 分域管理 | SKILL.md 认证 | 理念-上下文 | `shared.md` 认证节 | 多域场景防错用 token |
| `--site-domain` 传参规则（仅 create/login 传） | SKILL.md 认证 | 执行 | `shared.md` 认证节 | |
| 前置 `lpm login` + auth 错误逐字转呈 stderr | SKILL.md 认证 | 执行 | `shared.md` 认证节 | 刚性约束 |
| CLI 维护文件只经 CLI 操作（禁直接写 .lpm/、plugin.config.json） | SKILL.md 安全规则 | 派发-守卫 | `shared.md` 安全节 | 绕过会静默损坏数据 |
| 禁输出密钥明文（accessToken/pluginSecret） | SKILL.md 安全规则 | 派发-守卫 | `shared.md` 安全节 | 安全红线 |
| 自建后端红线：凭据进后端 env 不进前端 bundle | SKILL.md 自建后端红线 | 派发-守卫 | 见决策点 D5 | 引用 AUTHORING §8.1 |
| 自建后端红线：运行时只走 OpenAPI | SKILL.md 自建后端红线 | 派发-守卫 | 见决策点 D5 | 引用 AUTHORING §8.2 |
| 全量提交约束：local-config set 全量替换原理 | SKILL.md 全量提交约束 | 理念-上下文 | `shared.md` 全量提交节 | 「唯一权威源」不得分散 |
| 全量提交操作流程三步（get→改→set+diff+update） | SKILL.md 全量提交约束 | 执行 | `shared.md` 全量提交节 | 被 feature/config-apply 引用 |
| local-config set 用户确认 gate（ADDED/MODIFIED/DELETED 三类清单） | SKILL.md set 确认 gate | 派发-守卫 | `shared.md` gate 节 | 格式权威源在 feature config-apply §A0，见 X1 |
| 删除点位前置检查协议（diff exit 2 强制停 + 逐字转呈） | SKILL.md 删除点位协议 | 派发-守卫 | `shared.md` gate 节 | 负向禁语「不要自己判断废弃点位」易丢 |
| 无源即停执行细则（适用范围 + 合法/非法源清单） | SKILL.md 无源即停 | 理念-上下文 | `shared.md` 无源即停节 | 根原则 1 的操作化 |
| 无源即停强制话术（四要素 + 停止产出 + 等用户 A/B/C） | SKILL.md 无源即停 | 执行 | `shared.md` 无源即停节 | 逐字级约束，「整批阻塞」规则易软化 |
| MCP 检索关键词模板表（六场景） | SKILL.md MCP 检索技巧 | 执行 | `shared.md` MCP 节 | |
| MCP 通用搜索心法 | SKILL.md MCP 检索技巧 | 执行 | `shared.md` MCP 节 | |
| MCP 缓存协议（Write 到 .lpm-cache/mcp/ + peek 重访 + 7天过期） | SKILL.md MCP 缓存协议 | 执行 | `shared.md` MCP 缓存节 | 标注「唯一权威源」，见 X2 |
| Checkpoint 判断规则（state.json 存在与否分两路） | SKILL.md Checkpoint | 派发-守卫 | router SOP | workflow vs 独立调用的分支点 |
| 错误处理入口（遇错 Read errors.md） | SKILL.md 错误处理 | 派发-守卫 | router SOP / errors.md | 合并后路径更新 |
| Checkpoint 协议全文（适用条件/更新协议/恢复语义） | references/checkpoint.md | 执行 | `checkpoint.md`（保持独立） | 「running→重新执行」语义不能简化成「重试」 |
| 错误处理速查表（Token 过期/网络/config 缺失） | references/errors.md | 执行 | `errors.md`（保持独立） | config 缺失时引导 workflow/create |
| 输出标注溯源规则 | references/source-attribution.md | 执行 | `source-attribution.md`（保持独立） | 仅 reviewer 用，见决策点 D7 |

### 4.2 create（C-*）→ 去向 `references/create-{setup,plan,apply,verify}.md`

| # | 能力项 | 今天位置 | 类型 | 合并后去向 | 备注 |
|---|--------|----------|------|-----------|------|
| C1 | 触发条件判定（只建空壳 vs 被编排 vs 应走 workflow） | SKILL.md description | 派发-守卫 | router | |
| C2 | 入口守卫：bash 检测 plugin.config.json EXIST/NOT_EXIST | SKILL.md 入口守卫 | 派发-守卫 | router context 检测 | EXIST→旧行为停并报错；合并后 EXIST→路由 feature，但「EXIST+从零新建」仍拦 |
| C3 | `orchestrated=true` 跳过守卫契约 | SKILL.md 入口守卫 | 派发-守卫 | router（见 X6） | |
| C4 | 按 mode 按需 Read，不预加载 4 个 reference | SKILL.md 最少 Read 清单 | 理念-上下文 | router lazy-load 节 | |
| C5 | 核心理念：用户出发点是功能需求、create 只要工作名+siteDomain | SKILL.md 核心理念 | 理念-上下文 | `create-plan.md` 开头 | |
| C6 | app_type 不可逆，选错需 workspace clean 重建 | SKILL.md + plan.md P1.5 | 理念-上下文 | `create-plan.md` P1.5 + router 提示 | 最高风险约束 |
| C7 | 五段式 pipeline（setup→plan→apply→verify）+ mode 路由 | SKILL.md 核心流程 | 执行 | `create-setup.md` 开头流程图 | |
| C8 | 输出产物声明（plugin.config.json/node_modules/src 字段列表） | SKILL.md 输出产物 | 执行 | `create-verify.md` | |
| C9 | 后续流程链接 create→feature→polish→publish | SKILL.md 后续流程 | 理念-上下文 | router 总览图 | |
| C10 | 创建完成输出绝对路径 + git 建议（被编排时跳过） | SKILL.md 后续流程 | 执行 | `create-verify.md` | 条件逻辑保留 |
| C11 | pluginSecret 风险提示（引用 publish/verify.md V3） | SKILL.md 后续流程 | 执行 | `create-verify.md` | 跨 skill 引用，见 X1 |
| C12 | S1：不做 lpm --version 显式检查 | setup.md S1 | 理念-上下文 | `create-setup.md` S1 | |
| C13 | S2 优先级 1：orchestrated 时沿用上下文 siteDomain | setup.md S2 | 执行 | `create-setup.md` S2 | 跨 skill 契约 |
| C14 | S2 优先级 2：从已有 plugin.config.json 读 siteDomain | setup.md S2 | 执行 | `create-setup.md` S2 | |
| C15 | S2 优先级 3：lpm whoami 推荐站点（三态处理） | setup.md S2 | 执行 | `create-setup.md` S2 | 依赖 whoami stdout 格式 |
| C16 | S2 优先级 4：索要 Meegle URL，`new URL().origin` 解析 | setup.md S2 | 执行 | `create-setup.md` S2 | |
| C17 | S2 输出模板 | setup.md 输出 | 执行 | `create-setup.md` 输出 | |
| C18 | P1：需求问询（已描述则不追问） | plan.md P1 | 执行 | `create-plan.md` P1 | |
| C19 | **P1.5 HARD GATE：app_type 决策树（5 分支 + AI 关键词列表）** | plan.md P1.5 | 执行 | `create-plan.md` P1.5 | 极易丢，任一分支漏=选错 app_type |
| C20 | P1.5：ai_node vs ai_field 速记表 | plan.md P1.5 | 执行 | `create-plan.md` P1.5 | |
| C21 | P1.5：appType 记到上下文变量供 P3/apply 复用 | plan.md P1.5 | 执行 | `create-plan.md` P1.5 | |
| C22 | P2：工作名称生成规则（中文≤15字） | plan.md P2 | 执行 | `create-plan.md` P2 | |
| C23 | P2：不收集短描述/详情/分类（推迟 polish） | plan.md P2 | 理念-上下文 | `create-plan.md` P2 | |
| C24 | P3：真实数据写入护栏（引用 shared 根原则 3） | plan.md P3 | 派发-守卫 | `create-plan.md` P3 | 跨 skill 引用，见 X1 |
| C25 | P3：三套确认话术模板（normal/ai_node/ai_field），逐字输出 | plan.md P3 | 执行 | `create-plan.md` P3 | |
| C26 | P3：分支 5（完全模糊）追加 ⚠️ 告知行 | plan.md P3 | 执行 | `create-plan.md` P3 | |
| C27 | A1：lpm create 参数列表（含 --force 语义） | apply.md A1 | 执行 | `create-apply.md` A1 | |
| C28 | A1：--description/--detail-description 不传 | apply.md A1 | 执行 | `create-apply.md` A1 | |
| C29 | A1：lpm create 两步骤说明（API 创建→init 写盘） | apply.md A1 | 理念-上下文 | `create-apply.md` A1 | |
| C30 | A1：从 stdout 逐字抓 Plugin ID / Local project directory | apply.md A1 | 执行 | `create-apply.md` A1 | 「不可凭工作名拼目录名」强约束 |
| C31 | A1：create 不写 state.json（由 workflow Phase 1.2 落盘） | apply.md A1 | 执行 | `create-apply.md` A1 | 见 X7 |
| C32 | A1：失败处理表（5 类错误） | apply.md A1 | 执行 | `create-apply.md` A1 | |
| C33 | A2：输出格式（pluginId + 工程目录 + 切 cwd 提示） | apply.md A2 | 执行 | `create-apply.md` A2 | |
| C34 | **A3 HARD GATE：cd 进工程目录，CWD_OK/CWD_FAIL 分支** | apply.md A3 | 执行 | `create-apply.md` A3 | 极易丢，后续所有 lpm 命令依赖 |
| C35 | A3：cwd 成功后记 projectRoot 到上下文 | apply.md A3 | 执行 | `create-apply.md` A3 | |
| C36 | A3：被编排时 cwd 信任规则 | apply.md A3 | 派发-守卫 | router | 跨 skill 契约 |
| C37 | V1：plugin.config.json 五字段完整性校验 | verify.md V1 | 执行 | `create-verify.md` V1 | |
| C38 | V1：失败恢复指引（app_type 不一致→workspace clean） | verify.md V1 | 执行 | `create-verify.md` V1 | |
| C39 | V2：工程目录结构检查（node_modules + src） | verify.md V2 | 执行 | `create-verify.md` V2 | |
| C40 | V3：验证通过输出模板 | verify.md V3 | 执行 | `create-verify.md` V3 | |

### 4.3 feature（F-*）→ 去向 `references/feature-*.md` + `references/feature-point-types/`

> 体量最大（118 项）。完整明细见扫描结果；下表保留全部，备注从略处仅标关键风险。

| # | 能力项 | 今天位置 | 类型 | 合并后去向 |
|---|--------|----------|------|-----------|
| F1 | 触发条件—业务域信号词 | SKILL.md description | 派发-守卫 | router 触发条件节 |
| F2 | 触发条件—迭代意图信号词（含咨询口吻清单） | SKILL.md description | 派发-守卫 | router 触发条件节 |
| F3 | 新插件 vs 存量插件路由守卫（plugin.config.json 检查） | SKILL.md 前置守卫 Step1 | 派发-守卫 | router context 检测 |
| F4 | plugin.config.json 不存在时 bounce 到 workflow 的话术 | SKILL.md 前置守卫 Step1 | 派发-守卫 | router |
| F5 | 「只改服务端那一半」bounce 到 stage=backend | SKILL.md 前置守卫 Step1 | 派发-守卫 | router 分支表（见 X9） |
| F6 | app_type 锚定（读 plugin.config.json app_type） | SKILL.md Step2.1 | 派发-守卫 | router context 检测 |
| F7 | 信号词对账（点位指向词 × app_type 矩阵） | SKILL.md Step2.2 | 派发-守卫 | router |
| F8 | 不匹配时停下问用户模板 | SKILL.md Step2.3 | 派发-守卫 | router |
| F9 | AI 应用工程参考卡（ai_node/ai_field 形态约束） | SKILL.md Step2 末 | 理念-上下文 | `feature-config-plan.md` / router 引言 |
| F10 | 三 stage 结构及触发条件 | SKILL.md 核心流程 | 派发-守卫 | router SOP 核心流程节 |
| F11 | 「意图→跑哪些 stage」映射表（5 行） | SKILL.md 核心流程 | 派发-守卫 | router |
| F12 | stage 参数（config/code/backend）命令行用法 | SKILL.md 使用方式 | 执行 | router 使用方式节 |
| F13 | 线性不可跳纪律（Config apply 未成功不进 Code） | SKILL.md 核心流程 | 理念-上下文 | `feature-config-apply.md` 前置条件 |
| F14 | 「跑了就别干一半」纪律 | SKILL.md 关键设计原则1 | 理念-上下文 | router 引言 |
| F15 | **「feature 需要后端那一半」判据—触发点① config.plan P5** | SKILL.md 后端那一半 | 派发-守卫 | router 分支 + `feature-config-plan.md`（见 X9） |
| F16 | 内部调起 backend 的契约传递（代理路由/webhook/originalRequirement） | SKILL.md 后端那一半 | 执行 | `feature-code-verify.md` V4 |
| F17 | 完成态交接（有前端→lpm start；纯后端→backend） | SKILL.md 本地调试引导 | 执行 | router 完成态节 |
| F18 | 断点续跑—state.json 记录进度 | SKILL.md 文件约定 | 理念-上下文 | router 引言 |
| F19 | 中间产物清理规则（.lpm-cache 由 CLI 清，skill 不 rm） | SKILL.md 文件约定 | 理念-上下文 | `feature-config-plan.md` P6 |
| F20 | 全量提交约束执行点（config.apply A0/A1/A2） | SKILL.md 全量提交约束 | 执行 | `feature-config-apply.md` |
| F21 | 代码溯源协议三源优先级（点位 doc→用户代码→MCP） | SKILL.md 代码溯源协议 | 理念-上下文 | `feature-code-plan.md` P2 |
| F22 | resources 扁平数组结构说明（id/entry 由 CLI 维护） | SKILL.md resources 结构 | 理念-上下文 | `feature-code-setup.md` S2 |
| F23 | 最少 Read 清单—不预加载全部 point-type doc | SKILL.md 最少 Read 清单 | 理念-上下文 | router 引言 |
| F24 | config-plan P1：操作类型识别（增/改/删）+ 粗扫候选 | config-plan.md P1 | 执行 | `feature-config-plan.md` |
| F25 | config-plan：点位类型速查表（11 种点位） | config-plan.md | 执行 | `feature-config-plan.md` |
| F26 | config-plan P2：并行跑 lpm schema + local-config get，结果写文件 | config-plan.md P2 | 执行 | `feature-config-plan.md` |
| F27 | config-plan P2：lpm ai peek 分片读 schema | config-plan.md P2 | 执行 | `feature-config-plan.md` |
| F28 | config-plan P2：DSL 字段先走 MCP 再对照 schema | config-plan.md P2 | 执行 | `feature-config-plan.md` |
| F29 | config-plan P2.5：精细点位选型 4 步公式 | config-plan.md P2.5 | 执行 | `feature-config-plan.md` |
| F30 | **config-plan P2.5.1：customField vs control 双候选选型（4 步 + 4 铁律）** | config-plan.md P2.5.1 | 执行 | `feature-config-plan.md` |
| F31 | config-plan：术语→点位类型映射（"组件"歧义表） | config-plan.md | 执行 | `feature-config-plan.md` |
| F32 | config-plan P3：交互补全缺失字段 + 外部数据源 stop-and-ask | config-plan.md P3 | 执行 | `feature-config-plan.md` |
| F33 | config-plan P4：生成完整配置文件（全量，增/改/删规则） | config-plan.md P4 | 执行 | `feature-config-plan.md` |
| F34 | **config-plan P5：判定前端点位 vs webhook 形态（url/token 位置因点位类型而异）** | config-plan.md P5 | 执行 | `feature-config-plan.md` |
| F35 | config-plan P6：plan 阶段输出格式（含前端/后端判定结论） | config-plan.md P6 | 执行 | `feature-config-plan.md` |
| F36 | config-plan：MCP 缓存协议引用 | config-plan.md P1 | 理念-上下文 | `shared.md`（见 X2） |
| F37 | config-apply A0：ADDED/MODIFIED 人工闸口 | config-apply.md A0 | 执行 | `feature-config-apply.md` |
| F38 | config-apply A0：Checkpoint 跳过重复确认 | config-apply.md A0 | 执行 | `feature-config-apply.md` |
| F39 | config-apply A1：local-config set 本地校验 + 6 类错误处理 | config-apply.md A1 | 执行 | `feature-config-apply.md` |
| F40 | config-apply A1：table_cell must be object → 提示升级 CLI | config-apply.md A1 | 执行 | `feature-config-apply.md` |
| F41 | config-apply A1：校验失败默认停下问用户 | config-apply.md A1 | 理念-上下文 | `feature-config-apply.md` |
| F42 | config-apply A2：local-config diff（exit 0/1/2 三分支） | config-apply.md A2 | 执行 | `feature-config-apply.md` |
| F43 | config-apply A3：lpm update --source-type=local 推送 + 拉模板 | config-apply.md A3 | 执行 | `feature-config-apply.md` |
| F44 | config-apply A4：输出格式 | config-apply.md A4 | 执行 | `feature-config-apply.md` |
| F45 | code-setup S1：再次确认插件工程根目录 | code-setup.md S1 | 派发-守卫 | `feature-code-setup.md` |
| F46 | **code-setup S2：resources 为空→Stage Code 整段 no-op，不回 Config 重跑** | code-setup.md S2 | 执行 | `feature-code-setup.md` |
| F47 | code-setup S2：entry 文件缺失→回 config.apply 重跑 update | code-setup.md S2 | 执行 | `feature-code-setup.md` |
| F48 | code-plan P0：Stage Config/Code 职责边界 | code-plan.md P0 | 理念-上下文 | `feature-code-plan.md` |
| F49 | code-plan P0：5 种缺口模式 | code-plan.md P0 | 执行 | `feature-code-plan.md` |
| F50 | code-plan P0：HARD-GATE—写 SDK 前 peek point.config.local.json 拿真 propKey | code-plan.md P0 | 执行 | `feature-code-plan.md` |
| F51 | code-plan P1：peek resources 取 entry 列表后 Read 所有 entry | code-plan.md P1 | 执行 | `feature-code-plan.md` |
| F52 | code-plan P2.1：context 命名空间互不通用 | code-plan.md P2.1 | 执行 | `feature-code-plan.md` |
| F53 | code-plan P2：强制三源查询步骤（1→5） | code-plan.md P2 | 执行 | `feature-code-plan.md` |
| F54 | code-plan P2：aiNode/aiField 例外（走 lpm schema peek） | code-plan.md P2 | 执行 | `feature-code-plan.md` |
| F55 | code-plan P2：doc 路径映射表（8 种点位） | code-plan.md P2 | 执行 | `feature-code-plan.md`（路径前缀化 feature-point-types/） |
| F56 | code-plan P2：MCP fallback 常见查询模板（5 类） | code-plan.md P2 | 执行 | `feature-code-plan.md` |
| F57 | code-plan P2：冲突裁决 doc > MCP | code-plan.md P2 | 理念-上下文 | `feature-code-plan.md` |
| F58 | code-plan P3：源标注规则 | code-plan.md P3 | 执行 | `feature-code-plan.md` |
| F59 | **code-plan P3.5：发现 SDK 给不了的数据→fetch('/api/proxy/')+标注需要后端** | code-plan.md P3.5 | 执行 | `feature-code-plan.md` |
| F60 | code-plan P4：规划功能实现方案（读 originalRequirement） | code-plan.md P4 | 执行 | `feature-code-plan.md` |
| F61 | code-apply A1：为每个 entry 实现代码（不替换入口启动逻辑） | code-apply.md A1 | 执行 | `feature-code-apply.md` |
| F62 | code-apply A1.2：调试日志规则 | code-apply.md A1.2 | 执行 | `feature-code-apply.md` |
| F63 | code-apply A1.5：代码溯源审计 lpm ai audit-jssdk（exit 1 原文呈现） | code-apply.md A1.5 | 执行 | `feature-code-apply.md` |
| F64 | code-apply A1.5：可跳过 audit 的唯一条件 | code-apply.md A1.5 | 执行 | `feature-code-apply.md` |
| F65 | code-verify V1：npx tsc --noEmit 预检（L1） | code-verify.md V1 | 执行 | `feature-code-verify.md`（见 D6） |
| F66 | code-verify V2：AI 自动修复最多 2 轮（L2） | code-verify.md V2 | 执行 | `feature-code-verify.md` |
| F67 | code-verify V3：降级兜底（L3） | code-verify.md V3 | 执行 | `feature-code-verify.md` |
| F68 | **code-verify V4：扫 fetch('/api/proxy/*')+「需要后端吗」判定（触发点②）** | code-verify.md V4 | 执行 | `feature-code-verify.md`（见 X9） |
| F69 | code-verify V5：完成态引导 lpm start --auto | code-verify.md V5 | 执行 | `feature-code-verify.md` |
| F70 | code-verify：Checkpoint 恢复检查 | code-verify.md | 执行 | `feature-code-verify.md` |
| F71 | 点位类型分层结构（rich 目录/Tier0 速查/无 doc） | SKILL.md + code-plan P2 | 理念-上下文 | router 引言 + 最少 Read 清单 |
| F72–F84 | liteAppComponent 全套（核心心智/操作维度/业务速查/propKey-fieldKey/read-props §1-4/write-outputs §1-6） | point-types/liteAppComponent/* | 执行 | `feature-point-types/liteAppComponent/*` |
| F85–F87 | dashboard/tab 全套（核心心智/namespace=tab/移动端约束） | point-types/dashboard/index.md | 执行 | `feature-point-types/dashboard/index.md` |
| F88–F90 | button 全套（两种点击效果/onWorkItemFormValueChanged 场景/union type） | point-types/button/index.md | 执行 | `feature-point-types/button/index.md` |
| F91–F93 | componentSchedule 全套（5 入口/综合示例/handleSubmit 错码） | point-types/componentSchedule/index.md | 执行 | `feature-point-types/componentSchedule/index.md` |
| F94–F95 | control 核心（三场景决策表/双候选引用 P2.5.1） | point-types/control/index.md | 执行/派发 | `feature-point-types/control/index.md` |
| F96–F99 | control form-control §1-3,§5（场景识别/UUID 边界/联动/控件值自存） | point-types/control/form-control.md | 执行 | `feature-point-types/control/form-control.md` |
| F100–F103 | control table-cell §1-3（DSL 是什么/5 硬约束/editable/$fieldValue） | point-types/control/table-cell.md | 执行 | `feature-point-types/control/table-cell.md` |
| F104–F106 | customField 核心（三产物场景/强制双端/i18n_info 双层形态） | point-types/customField/index.md | 执行 | `feature-point-types/customField/index.md` |
| F107–F112 | customField value-shape（field_key 映射链路/企业名片示例/双层 key/命名对照/3 硬规则/disabled+405） | point-types/customField/value-shape.md | 执行 | `feature-point-types/customField/value-shape.md` |
| F113–F114 | context-only（configuration/page/view 三点位 + 共享约束） | point-types/context-only.md | 执行 | `feature-point-types/context-only.md` |
| F115–F118 | shared-scenes（onWorkItemFormValueChanged 矩阵/完整签名 5 硬约束/namespace 不串/边界汇总） | point-types/shared-scenes.md | 执行 | `feature-point-types/shared-scenes.md` |

> feature 高风险项：F15+F68（后端判定双触发点，丢一个就漏调 backend）；F46（resources 为空 no-op，丢了死循环）；F81（watch 重调 getDataSourceResult，运行时静默失效）；F111（field_key 映射 3 硬规则，线上高频报错）；F30（双候选 4 铁律）；point-types 整目录前缀化后内部 `../../` 链接全失效（见 X1）。

### 4.4 polish（PO-*）→ 去向 `references/polish-{analyze,generate,confirm,apply}.md`

| # | 能力项 | 今天位置 | 类型 | 合并后去向 | 备注 |
|---|--------|----------|------|-----------|------|
| PO1 | 触发条件（"完善信息/改名/改描述/改分类"） | SKILL.md description | 派发-守卫 | router 触发规则 | |
| PO2 | 触发条件—被 workflow 编排 | SKILL.md description | 派发-守卫 | router workflow 编排节 | |
| PO3 | 前置守卫：feature Stage Code 已执行、代码就绪 | SKILL.md + 核心理念 | 派发-守卫 | router polish 入口检查 | 隐性前置，见 X3 + 决策点 D1 |
| PO4 | 外部依赖 npx | SKILL.md metadata | 派发-守卫 | router / shared 环境检查 | |
| PO5 | CLI help 来源 lpm update-description | SKILL.md metadata | 执行 | `polish-apply.md` 开头 | |
| PO6 | 按 mode 按需 Read | SKILL.md 最少 Read 清单 | 理念-上下文 | router lazy-load 节 | |
| PO7 | 共享规则引用 shared | SKILL.md 前置 | 理念-上下文 | router 顶部 Read | |
| PO8 | 核心理念：功能实现后填充信息质量更高 | SKILL.md 核心理念 | 理念-上下文 | `polish-analyze.md` 开头 | |
| PO9 | mode=pipeline 默认（analyze→generate→confirm→apply） | SKILL.md 核心流程 | 执行 | router polish phase 流程图 | |
| PO10–13 | mode=analyze/generate/confirm/apply 单独可调用 | SKILL.md 使用方式 | 派发-守卫 | router polish mode 分支 | apply 单独调用见决策点 D2 |
| PO14 | 输入源 point.config.local.json | SKILL.md 输入 | 执行 | `polish-analyze.md` A1 | |
| PO15 | 输入源 src/ 代码文件 | SKILL.md 输入 | 执行 | `polish-analyze.md` A2 | |
| PO16 | 输出—update-description 更新名称/描述/分类 | SKILL.md 输出 | 执行 | `polish-apply.md` | |
| PO17 | 前置依赖链由 workflow 维护（feature→polish→publish） | SKILL.md 输出尾注 | 理念-上下文 | router workflow 编排节 | |
| PO18 | A1：从 point.config.local.json 提取点位类型/name/desc | analyze.md A1 | 执行 | `polish-analyze.md` A1 | |
| PO19 | A1：权威源说明（remote.json 已删、plugin.config.json 仅 resources） | analyze.md A1 | 执行 | `polish-analyze.md` A1 | |
| PO20 | A2：扫 src/ 入口文件（不逐行读） | analyze.md A2 | 执行 | `polish-analyze.md` A2 | |
| PO21 | A3：内部生成结构化功能摘要（不展示给用户） | analyze.md A3 | 执行 | `polish-analyze.md` A3 | 隐性约束「摘要不可见」 |
| PO22 | G1：生成名称（≤30字） | generate.md G1 | 执行 | `polish-generate.md` G1 | |
| PO23 | G1：生成短描述（≤100字纯文本） | generate.md G1 | 执行 | `polish-generate.md` G1 | |
| PO24 | G1：生成详情描述（多段纯文本） | generate.md G1 | 执行 | `polish-generate.md` G1 | |
| PO25 | G1：详情描述三段模板（功能介绍/使用方式/适用场景） | generate.md G1 | 执行 | `polish-generate.md` G1 | |
| PO26 | G2：lpm list-categories 获取分类 | generate.md G2 | 执行 | `polish-generate.md` G2 | |
| PO27 | G2：AI 推荐 1-3 分类（点位类型映射规则） | generate.md G2 | 执行 | `polish-generate.md` G2 | |
| PO28 | G2：获取分类失败则跳过（不阻塞） | generate.md G2 | 执行 | `polish-generate.md` G2 | |
| PO29 | C1：固定格式展示预览 | confirm.md C1 | 执行 | `polish-confirm.md` C1 | |
| PO30 | C2：用户确认/改某项/全重生成的循环逻辑 | confirm.md C2 | 执行 | `polish-confirm.md` C2 | |
| PO31 | A1：update-description 更新名称 + i18n 描述 | apply.md A1 | 执行 | `polish-apply.md` A1 | |
| PO32 | A1：detail-description 传纯文本，CLI 自动转富文本 | apply.md A1 | 执行 | `polish-apply.md` A1 | |
| PO33 | A2：单独调用 update-description --category-ids | apply.md A2 | 执行 | `polish-apply.md` A2 | 名称描述与分类是两次独立调用 |
| PO34 | A2：分类更新失败不阻塞 | apply.md A2 | 执行 | `polish-apply.md` A2 | |
| PO35 | A3：成功输出格式 + 下一步指引 publish | apply.md A3 | 执行 | `polish-apply.md` A3 | 跨 skill 衔接，路径更新 |
| PO36 | A3 错误处理：权限不足→逐字转呈 stderr | apply.md A3 | 执行 | `polish-apply.md` A3 | |
| PO37 | A3 错误处理：网络超时→重试一次 | apply.md A3 | 执行 | `polish-apply.md` A3 | |
| PO38 | A3 错误处理：分类失败→仅 warn | apply.md A3 | 执行 | `polish-apply.md` A3 | |

> polish 关键风险：PO3 独立调用无代码检查（X3/D1）；被 publish 的 PC0 触达时，polish 完成信号如何回传给 publish 需定义（X3/X8）。

### 4.5 publish（PU-*）→ 去向 `references/publish-{pre-check,apply,verify}.md`

| # | 能力项 | 今天位置 | 类型 | 合并后去向 | 备注 |
|---|--------|----------|------|-----------|------|
| PU1 | 入口守卫：触发词匹配 | SKILL.md description | 派发-守卫 | router 触发词表 | |
| PU2 | 入口守卫：前置条件声明（polish 已执行/代码就绪/resources 已更新） | SKILL.md description | 派发-守卫 | router 引言 / publish phase 开头 | |
| PU3 | **不可逆动作标记（发布前必须用户显式确认）** | SKILL.md description | 派发-守卫（安全红线） | router + `publish-apply.md` A3 前 | apply.md 当前无确认文案，见 X4 |
| PU4 | 按 mode 按需 Read | SKILL.md 最少 Read 清单 | 理念-上下文 | router publish phase 引言 | |
| PU5 | 共享规则引用 shared | SKILL.md 最少 Read 清单 | 执行 | `shared.md` / router 顶部 | |
| PU6 | 四模式编排（pre-check/apply/verify/pipeline） | SKILL.md 核心流程 | 理念-上下文 | router publish phase 结构 | |
| PU7 | **PC0：metadata gate（逻辑已存在，需提早到 release）** | `publish/index.ts` 的 `ensurePluginMetadataReady`（已有） | CLI 硬校验 + 执行 | 抽 `src/utils/ensure-plugin-metadata-ready.ts` 共享 util；`releaseProject` 开头调用；`publish-pre-check.md` 只留「CLI 报错→转 polish」 | 见 X8 + D3；含 CLI 改动 |
| PU8 | PC1：resources 条目存在性检查 | pre-check.md PC1 | 派发-守卫 | `publish-pre-check.md` PC1 | |
| PU9 | PC1 分支：无前端产物（webhook 形态）跳 PC2 直接 apply | pre-check.md PC1 | 派发-守卫 | `publish-pre-check.md` PC1 | |
| PU10 | PC1.5：Runtime URL 占位符 CLI 只告知不拦截（概念节点） | pre-check.md PC1.5 | 理念-上下文 | `publish-pre-check.md` PC1.5 | 占位=非阻断 NOTICE；仅缺失/非 http 硬阻止 |
| PU11 | PC1.5：占位符告知义务（转呈 NOTICE 给用户） | pre-check.md PC1.5 | 执行 | `publish-pre-check.md` PC1.5 | |
| PU12 | PC2：tsc --noEmit + L1/L2/L3 自动修复 | pre-check.md PC2 | 执行 | `publish-pre-check.md` PC2 | 复用 code-verify，见 X1/X2/D6 |
| PU13 | PC2 降级兜底（L3 失败→zip 下载指引） | pre-check.md PC2 | 执行 | `publish-pre-check.md` PC2 | |
| PU14 | Checkpoint 恢复检查（apply 入口读 state.json） | apply.md | 执行 | `publish-apply.md` 开头 | |
| PU15 | A1：同步配置到后台（lpm update --source-type=local 兜底） | apply.md A1 | 执行 | `publish-apply.md` A1 | |
| PU16 | A1：Checkpoint 写入（running/success/failed） | apply.md A1 | 执行 | `publish-apply.md` A1 | |
| PU17 | A1：失败处理（终止，不继续 A2） | apply.md A1 | 执行 | `publish-apply.md` A1 | |
| PU18 | A2：构建 + 上传（lpm release） | apply.md A2 | 执行 | `publish-apply.md` A2 | |
| PU19 | A2：耗时提示（30-120s） | apply.md A2 | 理念-上下文 | `publish-apply.md` A2 | |
| PU20 | A2：artifactVersion 提取（正则 Artifact version） | apply.md A2 | 执行 | `publish-apply.md` A2 | A2→A3 关键传参 |
| PU21 | A2：artifactVersion=0 处理（AI 应用无产物） | apply.md A2 | 执行 | `publish-apply.md` A2 | |
| PU22 | **A2：Checkpoint 写入含 context.artifactVersion 持久化** | apply.md A2 | 执行 | `publish-apply.md` A2 | 中断恢复跳过 release 的关键 |
| PU23 | A2 失败：webpack 错误自动修复（1 轮） | apply.md A2 | 执行 | `publish-apply.md` A2 | |
| PU24 | A2 失败：仍失败的终止提示（含手动续跑指令） | apply.md A2 | 执行 | `publish-apply.md` A2 | |
| PU25 | A3：Checkpoint 写入（running） | apply.md A3 | 执行 | `publish-apply.md` A3 | |
| PU26 | A3：publish 参数自动准备（release-notes/version/store/upgrade） | apply.md A3 | 执行 | `publish-apply.md` A3 | |
| PU27 | A3：release-notes AI 自动总结（git diff→中文） | apply.md A3 | 执行 | `publish-apply.md` A3 | |
| PU28 | A3：用户指定版本号时追加 --version | apply.md A3 | 执行 | `publish-apply.md` A3 | |
| PU29 | A3：AI 应用通道透传（CLI 按 app_type 自动选） | apply.md A3 | 理念-上下文 | `publish-apply.md` A3 | |
| PU30 | A3 成功：分享链接解析 | apply.md A3 | 执行 | `publish-apply.md` A3 | |
| PU31 | A3：Checkpoint 写入（publish 成功后） | apply.md A3 | 执行 | `publish-apply.md` A3 | |
| PU32 | A3 失败：版本号已存在→patch+1 重试 | apply.md A3 | 执行 | `publish-apply.md` A3 | |
| PU33 | A3 失败：网络/权限→展示原始错误 | apply.md A3 | 执行 | `publish-apply.md` A3 | |
| PU34 | A4：输出格式（产物版本+发布版本+分享链接三行） | apply.md A4 | 执行 | `publish-apply.md` A4 | |
| PU35 | A4：.lpm-cache 清理时机（成功 CLI 自动清，失败保留） | apply.md A4 | 理念-上下文 | `publish-apply.md` A4 | |
| PU36 | V1：release exit 0 + 产物版本号成功提取 | verify.md V1 | 执行 | `publish-verify.md` V1 | |
| PU37 | V1 fallback：版本号未解析时读完整 stdout/问用户 | verify.md V1 | 执行 | `publish-verify.md` V1 | |
| PU38 | V2：publish exit 0 + 分享链接格式验证 | verify.md V2 | 执行 | `publish-verify.md` V2 | |
| PU39 | V3：输出格式（三行 + 成功确认语） | verify.md V3 | 执行 | `publish-verify.md` V3 | |
| PU40 | V3：工程路径输出 + git 管理建议（pluginSecret 风险） | verify.md V3 | 执行 | `publish-verify.md` V3 | 见决策点 D4 |

### 4.6 workflow（W-*）→ 去向 `references/workflow-phase-{0-context,1-scaffold,2-feature,3-release}.md`

| # | 能力项 | 今天位置 | 类型 | 合并后去向 | 备注 |
|---|--------|----------|------|-----------|------|
| W1 | 入口守卫：test -f plugin.config.json | SKILL.md 入口守卫 | 派发-守卫 | router context 检测 | |
| W2 | 守卫命中 EXIST：立即停、不加载 reference、引导切换 | SKILL.md 入口守卫 | 派发-守卫 | router 拒绝分支 | 见 X5 |
| W3 | 最少 Read 清单（守卫通过后只读 2 份） | SKILL.md 最少 Read 清单 | 理念-上下文 | router lazy-load 策略 | |
| W4 | 核心理念：用户只感知完成态，自动跑完全流程 | SKILL.md 核心理念 | 理念-上下文 | router 引言 | |
| W5 | 三个不可逆决策确认点总纲 | SKILL.md 核心理念 | 理念-上下文 | router 引言安全总纲 | 见 X4 |
| W6 | 完整线性流程图（守卫→Phase 0/1/2/3） | SKILL.md 完整流程 | 理念-上下文 | `workflow-phase-0-context.md` 前置图 | |
| W7 | state.json 零号写入时机（Phase 1.2 首次落盘） | SKILL.md + phase-1 | 执行 | `workflow-phase-1-scaffold.md` | 见 X7 |
| W8 | app_type 单一权威源（plugin.config.json，state.json 不复述） | SKILL.md 完整流程 | 理念-上下文 | `workflow-phase-1-scaffold.md` | |
| W9 | Phase 2 内部委托设计（细节在 feature） | SKILL.md 完整流程 | 理念-上下文 | `workflow-phase-2-feature.md` | |
| W10 | 命名空间约定（Phase 0/1/2/3 vs Stage，step 拼接如 2.config.apply） | SKILL.md 完整流程 | 理念-上下文 | `checkpoint.md` | |
| W11 | Phase 3 发布护栏总则（publish 前必确认） | SKILL.md 完整流程 | 派发-守卫 | router 安全总纲 + `workflow-phase-3-release.md` | |
| W12 | 关键设计原则 1：新插件推到底 | SKILL.md 关键设计原则 | 理念-上下文 | router 引言 | |
| W13 | 关键设计原则 3：延迟填充（名称/描述/分类在 Phase 3 polish 生成） | SKILL.md 关键设计原则 | 理念-上下文 | `workflow-phase-3-release.md` | |
| W14 | 关键设计原则 4：快速到调试（Phase 2 尾强制 lpm start --auto） | SKILL.md 关键设计原则 | 理念-上下文 | `workflow-phase-2-feature.md` | |
| W15 | 关键设计原则 5：容错兜底（从 state.json 断点继续） | SKILL.md 关键设计原则 | 理念-上下文 | `checkpoint.md` | |
| W16 | cwd 信任规则（CWD_OK 后信任 cwd 持久，不逐条 prepend cd） | SKILL.md cwd 信任规则 | 执行 | `workflow-phase-1-scaffold.md` | |
| W17 | cwd 漂移恢复路径（pwd 验证→从 state.json projectRoot 重 cd） | SKILL.md cwd 信任规则 | 执行 | `workflow-phase-1-scaffold.md` | |
| W18 | phase=N 命令行参数（断点续跑） | SKILL.md 使用方式 | 执行 | router 入口参数规范 | |
| W19 | Phase 0.1：lpm whoami 优先（推荐站点） | phase-0-context.md 0.1 | 执行 | `workflow-phase-0-context.md` | 当前分支新增能力 commit a8edac1 |
| W20 | Phase 0.1：siteDomain 询问流程（三选一） | phase-0-context.md 0.1 | 执行 | `workflow-phase-0-context.md` | |
| W21 | Phase 0.1：AI 硬约束（禁假设站点/禁推断/禁占位符） | phase-0-context.md 0.1 | 派发-守卫 | `workflow-phase-0-context.md` | |
| W22 | Phase 0.2：siteDomain 在上下文持有，不写 state.json | phase-0-context.md 0.2 | 执行 | `workflow-phase-0-context.md` | 见 X7 |
| W23 | Phase 0 恢复语义（无 plugin.config.json⇒无 state.json⇒从 0.1 起） | phase-0-context.md | 执行 | `workflow-phase-0-context.md` | |
| W24 | Phase 1.1：编排调用 create（orchestrated=true） | phase-1-scaffold.md 1.1 | 执行 | `workflow-phase-1-scaffold.md` | 合并后变 router phase 跳转 |
| W25 | Phase 1.1：workflow 层禁止自己执行 create 操作 | phase-1-scaffold.md 1.1 | 派发-守卫 | `workflow-phase-1-scaffold.md` | |
| W26 | Phase 1.1：后置 verify（PHASE1_CWD_OK） | phase-1-scaffold.md 1.1 | 执行 | `workflow-phase-1-scaffold.md` | |
| W27 | Phase 1.2：state.json 零号写入（5 字段） | phase-1-scaffold.md 1.2 | 执行 | `workflow-phase-1-scaffold.md` | |
| W28 | Phase 1.2：写入硬约束（不写 app_type/originalRequirement 逐字保留） | phase-1-scaffold.md 1.2 | 执行 | `workflow-phase-1-scaffold.md` | |
| W29 | Phase 1.3：自动进入 Phase 2 | phase-1-scaffold.md 1.3 | 执行 | `workflow-phase-1-scaffold.md` | |
| W30 | Phase 2.0：cwd 守卫 HARD GATE | phase-2-feature.md 2.0 | 派发-守卫 | `workflow-phase-2-feature.md` | |
| W31 | Phase 2.1：编排调用 feature | phase-2-feature.md 2.1 | 执行 | `workflow-phase-2-feature.md` | 合并后变 router phase 跳转 |
| W32 | Phase 2.1：编排层禁止预判后端分支 | phase-2-feature.md 2.1 | 派发-守卫 | `workflow-phase-2-feature.md` | |
| W33 | Phase 2.1：originalRequirement 传递约定（不预消化） | phase-2-feature.md 2.1 | 执行 | `workflow-phase-2-feature.md` | |
| W34 | Phase 2.1：断点恢复读 feature 子状态 | phase-2-feature.md 2.1 | 执行 | `workflow-phase-2-feature.md` / `checkpoint.md` | |
| W35 | **不可逆确认点②：Phase 2 本地调试确认** | phase-2-feature.md 2.2 | 派发-守卫 | `workflow-phase-2-feature.md` | |
| W36 | Phase 2.2：无前端产物兜底（webhook 形态 start 不报错） | phase-2-feature.md 2.2 | 执行 | `workflow-phase-2-feature.md` | |
| W37 | Phase 2.3 场景 A（功能 OK→进 Phase 3） | phase-2-feature.md 2.3 | 执行 | `workflow-phase-2-feature.md` | |
| W38 | Phase 2.3 场景 B（仅代码调整→回 feature stage=code） | phase-2-feature.md 2.3 | 执行 | `workflow-phase-2-feature.md` | |
| W39 | Phase 2.3 场景 B（涉及点位变更→回 feature 完整流程） | phase-2-feature.md 2.3 | 执行 | `workflow-phase-2-feature.md` | |
| W40 | Phase 2.3 场景 C（方向有误→更新 originalRequirement 重跑） | phase-2-feature.md 2.3 | 执行 | `workflow-phase-2-feature.md` | |
| W41 | Phase 2.3 场景 D（暂时搁置→写 checkpoint） | phase-2-feature.md 2.3 | 执行 | `workflow-phase-2-feature.md` | |
| W42 | Phase 2.4：完成标志—输出发布预告→等"开始"进 Phase 3 | phase-2-feature.md 2.4 | 执行 | `workflow-phase-2-feature.md` | "开始"≠发布确认，见 X4 |
| W43 | Phase 3.1：编排调用 polish | phase-3-release.md 3.1 | 执行 | `workflow-phase-3-release.md` | |
| W44 | **不可逆确认点③：Phase 3.2 发布前二次确认** | phase-3-release.md 3.2 | 派发-守卫 | `workflow-phase-3-release.md` + router | |
| W45 | Phase 3.2：AI 硬约束（禁模糊词触发 publish/接受改名/接受取消） | phase-3-release.md 3.2 | 派发-守卫 | `workflow-phase-3-release.md` | |
| W46 | Phase 3.3：编排调用 publish | phase-3-release.md 3.3 | 执行 | `workflow-phase-3-release.md` | |
| W47 | **Phase 3.3：从 checkpoint 恢复也必须先回 3.2 确认** | phase-3-release.md 3.3 | 派发-守卫 | `workflow-phase-3-release.md` | 极易在重构中被抹掉，见 X4 |
| W48 | Phase 3.4：完成—删除 state.json + 输出分享链接 | phase-3-release.md 3.4 | 执行 | `workflow-phase-3-release.md` | |
| W49 | Checkpoint：state.json 文件格式（字段规范） | SKILL.md 进度追踪 | 执行 | `checkpoint.md` | |
| W50 | Checkpoint：写入时机规则（前 running/后 success-failed） | SKILL.md 进度追踪 | 执行 | `checkpoint.md` | |
| W51 | Checkpoint：启动时恢复流程（展示摘要→等确认） | SKILL.md 进度追踪 | 执行 | `checkpoint.md` | |
| W52 | Checkpoint：Phase 3 完成后删除 state.json | SKILL.md 进度追踪 | 执行 | `checkpoint.md` | |
| W53 | Checkpoint：.lpm-cache 进 .gitignore 约定 | SKILL.md 进度追踪 | 理念-上下文 | `checkpoint.md` | |
| W54 | Checkpoint：被编排子 skill 也要更新 state.json，独立调用不强制 | SKILL.md 进度追踪 | 执行 | `checkpoint.md` | |

### 4.7 backend（B-*）→ 去向 `references/backend-{setup,contract,perm,impl,integ-test}.md`

| # | 能力项 | 今天位置 | 类型 | 合并后去向 | 备注 |
|---|--------|----------|------|-----------|------|
| B1 | 触发条件判定（业务域信号 AND 服务端意图两条同时成立） | SKILL.md description | 派发-守卫 | router 路由判断层 | |
| B2 | 咨询口吻的服务端意图也触发 | SKILL.md description | 派发-守卫 | router 路由判断层 | |
| B3 | bounce①：bounce 回 feature（cwd 是工程目录 + 意图是带 UI 的新 feature） | SKILL.md 守卫+bounce | 派发-守卫 | router 内部分支 | |
| B4 | bounce②：bounce 回 workflow（找不到工程 + 从零做完整插件） | SKILL.md 守卫+bounce | 派发-守卫 | router 内部分支 | not-exists 三态，见 X5/决策点 R1 |
| B5 | 判别要点：服务端信号强≠进后端，看工程是否存在 | SKILL.md 守卫+bounce | 派发-守卫 | router 决策注解 | |
| B6 | 等用户决定后继续 | SKILL.md 守卫+bounce | 执行 | router | |
| B7 | 最少 Read 清单 + 按需加载 | SKILL.md 最少 Read 清单 | 理念-上下文 | router 引言 / 各 phase 开头 | |
| B8 | AI 应用工程识别（peek app_type → ai_node/ai_field） | SKILL.md AI 速记 | 理念-上下文 | `backend-perm.md` Step0 + `backend-setup.md`/`contract.md` 入口注 | |
| B9 | AI 工程权限模型（固定 scope 集，perm 只对账不 apply） | SKILL.md AI 速记 | 执行 | `backend-perm.md` | 见 X2/X4 |
| B10 | AI 工程 OpenAPI 能力清单发现（lpm perm list 输出即全集） | SKILL.md AI 速记 | 执行 | `backend-perm.md` | |
| B11 | MCP 在 AI 工程的角色 + 查询姿势 + 反模式 | SKILL.md AI 速记 | 执行 | `backend-perm.md` + `backend-impl.md` | |
| B12 | ai_node 写回路径（work_item_id + state_key/node_uuid） | SKILL.md AI 速记 | 执行 | `backend-impl.md` | |
| B13 | ai_field 写回路径（field_ai_entity.task_id） | SKILL.md AI 速记 | 执行 | `backend-impl.md` | |
| B14 | ai_node/ai_field webhook 位置（在 listen_event extension 里） | SKILL.md + contract.md §1 | 执行 | `backend-contract.md` | |
| B15 | ai_field 形态（通常纯 webhook 无前端） | SKILL.md AI 速记 | 理念-上下文 | `backend-setup.md` / router 分流注 | |
| B16 | 点位单一约束（ai_node/ai_field 各只 1 个点位） | SKILL.md AI 速记 | 执行 | `backend-contract.md` 入口注 | |
| B17 | 核心流程线性顺序（setup→contract→perm→impl→integ-test） | SKILL.md 核心流程 | 理念-上下文 | router backend 子流程结构 | |
| B18 | **红线 1（无源即停）：每行碰平台代码指回合法源** | SKILL.md 红线 1 | 执行 | `backend-impl.md` 开头 | 独立加粗段保留 |
| B19 | **红线 2（凭据进 env）：不去 plugin.config.json grep pluginSecret** | SKILL.md 红线 2 | 执行 | `backend-impl.md` 凭据节 | 负向规则显式保留 |
| B20 | **红线 3（运行时不依赖 lark-project/lpm）** | SKILL.md 红线 3 | 执行 | `backend-impl.md` 红线节 | |
| B21 | 两条到达路径设计原则（feature 调起 / 用户直接进） | SKILL.md 关键设计原则 | 理念-上下文 | router 引言 backend 入口说明 | 路径(b)不能消失，见 X9 |
| B22 | 独立 skill 原因：cwd 可能是后端仓 | SKILL.md 关键设计原则 | 理念-上下文 | router 引言适用场景注 | |
| B23 | 溯源优先原则（写碰平台代码前先拿源） | SKILL.md 关键设计原则 | 理念-上下文 | `backend-impl.md` 开头（与红线 1 合表达） | |
| B24 | 收束在联调通过 + 引导发布 | SKILL.md 关键设计原则 | 理念-上下文 | `backend-integ-test.md` 开头 | |
| B25 | setup：插件工程目录定位 SOP | setup.md | 执行 | `backend-setup.md` | |
| B26 | setup：被编排时从 state.json context.projectRoot 取 PLUGIN_DIR | setup.md | 执行 | `backend-setup.md` | |
| B27 | setup：后端代码目录定位 SOP（三分支） | setup.md | 执行 | `backend-setup.md` | 三分支不能合并 |
| B28 | setup：后端代码目录候选扫描（./server / cwd / 用户指定） | setup.md | 执行 | `backend-setup.md` | 注意别凭空扩展候选列表 |
| B29 | setup：前置条件—不 scaffold 整个后端 | setup.md | 执行 | `backend-setup.md` | 见 X2 |
| B30 | setup：所有 lpm 调用带 (cd "$PLUGIN_DIR" && lpm ...) 前缀 | setup.md | 执行 | `backend-setup.md` + 所有 backend reference | |
| B31 | setup：不引入新 checkpoint 机制 | setup.md | 理念-上下文 | `backend-setup.md` 末尾注 | |
| B32 | setup：输出格式 | setup.md | 执行 | `backend-setup.md` | |
| B33 | contract §1：从 plugin.config.json 读 webhook 形态点位（url/token 位置分表） | contract.md §1 | 执行 | `backend-contract.md` §1 | |
| B34 | contract §1：app_type 决定 perm 走哪条流程 | contract.md §1 | 执行 | `backend-contract.md` §1 注 | |
| B35 | contract §2：从前端代码读代理路由清单（优先用 code-plan 产出） | contract.md §2 | 执行 | `backend-contract.md` §2 | 见 X9/R2 |
| B36 | contract §3：写回数据形态查 MCP，不内联 doc | contract.md §3 | 执行 | `backend-contract.md` §3 | |
| B37 | contract §4：originalRequirement 取法 | contract.md §4 | 执行 | `backend-contract.md` §4 | |
| B38 | contract 输出格式（四项结构化输出） | contract.md 输出 | 执行 | `backend-contract.md` 输出 | |
| B39 | perm Step 0：app_type 分流（normal 完整 6 步 / AI 工程只对账） | perm.md Step0 | 执行 | `backend-perm.md` Step0 | 安全约束 |
| B40 | perm step 1：从契约推 OpenAPI 业务需求 | perm.md | 执行 | `backend-perm.md` §1 | |
| B41 | perm step 2：lpm perm list 拉权限目录（三层字段解析） | perm.md §2 | 执行 | `backend-perm.md` §2 | |
| B42 | perm step 3：双动作（算缺口 + 投影"能调 OpenAPI 全清单"） | perm.md §3 | 执行 | `backend-perm.md` §3 | "投影全清单"易漏 |
| B43 | perm step 3：无源即停（scope↔OpenAPI 源是 perm_meta resource[]） | perm.md §3 | 执行 | `backend-perm.md` §3 注 | 安全相关 |
| B44 | perm step 4：apply 前置确认（仅 normal） | perm.md §4 | 执行 | `backend-perm.md` §4 | shared 五类确认之一 |
| B45 | perm step 5：lpm perm apply（仅 normal）+ 错误处理 | perm.md §5 | 执行 | `backend-perm.md` §5 | |
| B46 | perm step 6：处理 pending（仅 normal，可挂起先 impl） | perm.md §6 | 执行 | `backend-perm.md` §6 | |
| B47 | perm 输出格式（能调 OpenAPI 全清单 + scope 状态） | perm.md 输出 | 执行 | `backend-perm.md` 输出 | |
| B48 | impl 范围界定（只写碰平台的几块，不 scaffold） | impl.md 开头 | 理念-上下文 | `backend-impl.md` 开头 | 见 X2 |
| B49 | impl：webhook 接收 handler + 验签（验签算法走 MCP） | impl.md | 执行 | `backend-impl.md` webhook 节 | |
| B50 | impl：OpenAPI token 获取（走 MCP，doc 不写死凭据名） | impl.md | 执行 | `backend-impl.md` token 节 | 安全相关 |
| B51 | **impl：OpenAPI 调用 Gate—每个调用须在 perm 能调清单里（三分支）** | impl.md Gate | 执行 | `backend-impl.md` Gate 节 | 核心安全 Gate，见 X2 |
| B52 | impl：/api/proxy/* 代理路由 handler（含小回环） | impl.md | 执行 | `backend-impl.md` 代理路由节 | |
| B53 | impl：代码溯源协议（每行标 // source:） | impl.md | 执行 | `backend-impl.md` 溯源节 | |
| B54 | impl：凭据进 env 正向写法 + 交接话术 | impl.md | 执行 | `backend-impl.md` 凭据节 | |
| B55 | integ-test §1：暴露后端是 user handoff checkpoint | integ-test.md §1 | 执行 | `backend-integ-test.md` §1 | 合法 checkpoint，保留区分理由 |
| B56 | integ-test §2：第 2 次 local-config set（把真 webhook url/token 指过去） | integ-test.md §2 | 执行 | `backend-integ-test.md` §2 | 走 config-apply A0-A3 |
| B57 | integ-test §2 已知 issue：ai_node/ai_field url/token 往返恒 MODIFIED | integ-test.md §2 | 执行 | `backend-integ-test.md` §2 | 已记 MEMORY.md，必须随迁 |
| B58 | integ-test §3：产品里触发场景验证（盯后端日志） | integ-test.md §3 | 执行 | `backend-integ-test.md` §3 | perm pending→OpenAPI 鉴权失败的联系 |
| B59 | integ-test §4：lpm publish 前置确认 + 执行（被 workflow 编排时交还控制权） | integ-test.md §4 | 执行 | `backend-integ-test.md` §4 | 见 X4 |
| B60 | integ-test 输出格式 | integ-test.md 输出 | 执行 | `backend-integ-test.md` 输出 | |

---

## 5. 回归用例（发布前闸门，从台账派生）

合并完成后、打 release tag 前必须全绿。复盘 session（"发布会管理插件"）作端到端 fixture。

**端到端场景**（每个对照合并前后输出 diff）：
1. 从零做完整插件全流程（new-plugin → workflow → create→feature→polish→publish）
2. 给已有插件加纯前端 feature（plugin-project → feature，无 backend）
3. 给已有插件加前后端混合 feature（feature → 内部拉 backend）
4. 直接 publish（不走 workflow）—— 验证 **`releaseProject` 开头的 PC0 在 build 之前 `exit 1`** 拦住缺 metadata，skill 据此转 polish
5. 完善元信息后 publish（polish → publish）
6. 外部后端仓接 webhook（external-backend → backend）
7. 断点续跑（state.json 恢复，含 Phase 3.3 恢复必回 3.2 确认）
8. **在已有插件目录里说"从零做新插件"** → router 必须拦截警告（X5）

**能力级检查点**（台账逐行，重点抽查高风险项）：
- C19 / C34 / F15+F68 / F46 / F81 / F111 / F30 / W47 / B51 / X4 全部确认显式保留。
- X1 跨 skill 引用：合并后全仓 grep 无残留旧路径。
- X2 单一权威源：code-verify / checkpoint / MCP 缓存协议 / app_type 锚定无重复漂移。

**AUTHORING.md 对照**：本仓 CLAUDE.md 强制——动 skills/ 的改动 code review 必须逐条对照 `skills/AUTHORING.md`，尤其 §0 正确性、§0.1 校验归 CLI、§3 弱 AI 友好、§4 少重复。
