# L0-L4 Documentation Refresh Implementation Plan

> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

**Goal:** Refresh the L0-L4 product documentation so it matches the current ZeroClaw-based refactor and removes outdated team or roadmap narratives.

**Architecture:** Replace speculative architecture with the repository's current runtime model: a Rust browser-agent process that speaks the existing STDIO JSON Line protocol, enforces MAC policy from `resources/rules.json`, and uses a ZeroClaw compatibility runtime when provider configuration is present. Keep protocol and deployment descriptions aligned with actual files under `src/`, `resources/`, `tests/`, and `docs/浏览器对接标准.md`.

**Tech Stack:** Markdown, Rust source inspection, existing sgClaw protocol docs

### Task 1: Reconfirm source-of-truth files

**Files:**
- Modify: `docs/L0-产品白皮书与能力全景层.md`
- Modify: `docs/L1-系统架构与安全模型层.md`
- Modify: `docs/L2-核心模块与接口契约层.md`
- Modify: `docs/L3-数据流与Skill体系层.md`
- Modify: `docs/L4-工程实现与部署拓扑层.md`
- Reference: `src/lib.rs`
- Reference: `src/agent/mod.rs`
- Reference: `src/agent/runtime.rs`
- Reference: `src/compat/runtime.rs`
- Reference: `src/compat/browser_tool_adapter.rs`
- Reference: `src/pipe/protocol.rs`
- Reference: `resources/rules.json`
- Reference: `docs/浏览器对接标准.md`

**Step 1: Inspect current docs and implementation**

Run: `sed -n '1,220p' docs/L0-产品白皮书与能力全景层.md`
Expected: outdated capability claims and pre-refactor architecture language are visible.

**Step 2: Inspect runtime and protocol source**

Run: `sed -n '1,260p' src/pipe/protocol.rs`
Expected: `BrowserMessage`, `AgentMessage`, and `Action` definitions show the real contract surface.

**Step 3: Inspect compatibility runtime path**

Run: `sed -n '1,260p' src/compat/runtime.rs`
Expected: current ZeroClaw integration is clearly a compatibility adapter around `browser_action`.

### Task 2: Rewrite the layered product narrative

**Files:**
- Modify: `docs/L0-产品白皮书与能力全景层.md`
- Modify: `docs/L1-系统架构与安全模型层.md`

**Step 1: Replace L0 narrative**

Write: describe sgClaw as the productized browser-agent runtime after the ZeroClaw refactor, define current value, supported workflows, and explicit non-goals.

**Step 2: Replace L1 architecture**

Write: describe the actual three-part runtime topology, dual execution path, and layered security model without claiming unimplemented subsystems.

### Task 3: Rewrite contract and flow documents

**Files:**
- Modify: `docs/L2-核心模块与接口契约层.md`
- Modify: `docs/L3-数据流与Skill体系层.md`

**Step 1: Replace L2**

Write: define module ownership, protocol messages, active tool contract, and the relationship to `docs/浏览器对接标准.md`.

**Step 2: Replace L3**

Write: describe task lifecycle, planner fallback versus ZeroClaw compat path, memory/config loading, and why “Skill 体系” is currently a prompt/tool abstraction rather than a standalone skill engine.

### Task 4: Rewrite engineering and deployment view

**Files:**
- Modify: `docs/L4-工程实现与部署拓扑层.md`

**Step 1: Replace L4**

Write: document the real repository layout, build/test commands, environment variables, deployment assumptions, and integration boundaries with the browser host.

### Task 5: Verify consistency

**Files:**
- Modify: `docs/plans/2026-03-26-l0-l4-doc-refresh.md`

**Step 1: Review git status**

Run: `git status --short`
Expected: only intended doc updates and existing archive-related changes remain.

**Step 2: Spot-check final docs**

Run: `sed -n '1,120p' docs/L2-核心模块与接口契约层.md`
Expected: tool contract, protocol messages, and allowed actions match the codebase.
