Refactor an existing OpenClaw docs page with source-audited preservation, restructuring, and verification.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-openclaw-refactor-docs-4c945651121b ,按照其中的说明把「openclaw-refactor-docs」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Use this skill when the user gives a target OpenClaw docs page and asks to rewrite, refactor, reorganize, split, shorten, or improve it.
This skill builds on technical-documentation: use that skill for style, page types,
structure, examples, discoverability, and verification. This skill adds the
rewrite workflow needed to avoid losing accurate behavior during a major docs
refactor.
Required:
docs/plugins/codex-harness.md.Optional:
If the target page is missing or ambiguous, ask one concise question before editing. Otherwise, proceed.
Refactor the target page to be more useful, concise, and comprehensive within its stated scope.
Do not treat a rewrite as permission to discard behavior facts. Preserve, verify, move, or explicitly retire existing material. Incorrect docs are worse than verbose docs.
Prefer this split:
Read ../technical-documentation/SKILL.md first. Apply its page-type, style,
examples, navigation, and verification guidance throughout the refactor.
Run pnpm docs:list when available, then read only the target page and the
likely entry points, references, or related pages needed for the refactor.
Before editing, decide the intended page type from technical-documentation.
If the current page mixes page types, choose the main page type and plan where the other material belongs:
Create a working inventory from the old page before rewriting. Include:
For each fact, choose one outcome:
Do not infer defaults, permissions, policy, timeout behavior, or safety posture from names or intent. Verify them.
Use the nearest authoritative source for each behavior-sensitive claim:
If a page promises a reference, compare its tables against the schema, manifest, CLI help, generated docs, or exported types. Missing public fields, defaults, precedence rules, caps, or side effects are correctness bugs.
When moving detail out of the target page, record the destination before editing:
doc-schema-version: 1, and read_when hints.Avoid duplicate truth. If the same contract appears in multiple places, choose one canonical page and link to it.
Rewrite in this order:
Add doc-schema-version: 1 to the YAML frontmatter of every docs page that the
refactor migrates, creates, or materially rewrites. Apply it only to docs page
files, not docs.json, glossary JSON, or other non-page metadata. If a
migrated page is generated, update the generator so regeneration preserves the
marker instead of hand-editing generated output.
Do not leave placeholders such as "TODO", "TBD", or "see docs" unless the user explicitly asks for a draft.
After editing, compare the old and new page:
If the refactor deliberately removes relevant material, say where it went or why it was removed in the final report.
Run the smallest reliable docs checks for the touched surface:
pnpm docs:listgit diff --check -- <touched-files>pnpm exec oxfmt --check --threads=1 <touched-files>pnpm docs:check-mdxpnpm docs:check-linkspnpm docs:check-i18n-glossary when link text, navigation, labels, or glossary
surfaces changedRun commands and examples from the page whenever feasible. If you cannot verify a behavior-sensitive claim, either remove the claim, mark the uncertainty in the work-in-progress report, or ask for the missing source.
Report:
Do not include a long rewrite diary. Lead with remaining risks only if there are any.