mcpField
R
review-docs

review-docs

github.com/tldraw文档处理51.1k393 次安装今天更新
代码仓库

关于 review-docs

review-docs 是用于评估和改进文档文件的技能,通过多轮审查推进工作。它用状态文件跟踪问题,并行开展风格与内容评估,随后验证修改结果。

主要功能

  1. 01并行开展风格与内容审查
  2. 02跨轮次跟踪问题
  3. 03由用户参与问题分流
  4. 04针对问题改进文档
  5. 05验证已应用的修复

适用场景

  1. 01评估文档文件
  2. 02跨修订跟踪审查发现
  3. 03应用选定的审查反馈
  4. 04检查修改是否解决已报告的问题

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/tldraw/tldraw --skill review-docs

安装后在 Claude Code 中输入/review-docs确认已加载。

详细介绍

审查文档

此技能对文档文件运行评估与改进循环。

目标:$ARGUMENTS

相关技能:write-docs

工作流概览

┌──────────────────────────────────────────────────────────────┐
│  INITIALIZE: Create state file to track issues               │
└──────────────────────────────────────────────────────────────┘
                              ↓
┌──────────────────────────────────────────────────────────────┐
│  EVALUATE (parallel)                                         │
│  ┌─────────────────────┐    ┌─────────────────────────────┐  │
│  │ Style Agent         │    │ Content Agent               │  │
│  │ (readability+voice) │    │ (completeness+accuracy)     │  │
│  └─────────────────────┘    └─────────────────────────────┘  │
└──────────────────────────────────────────────────────────────┘
                              ↓
┌──────────────────────────────────────────────────────────────┐
│  UPDATE STATE: Add new issues, verify fixed issues           │
└──────────────────────────────────────────────────────────────┘
                              ↓
┌──────────────────────────────────────────────────────────────┐
│  SUMMARIZE: Present findings, ask user for next step         │
└──────────────────────────────────────────────────────────────┘
                              ↓
           ┌──────────────────┼──────────────────┐
           ↓                  ↓                  ↓
    [User: improve]   [User: complete]    [User: done]
           ↓                  ↓                  ↓
┌──────────────────┐  ┌──────────────────┐    EXIT
│  IMPROVE         │  │  COMPLETE        │
│  (fix issues)    │  │  (fix all, exit) │
└──────────────────┘  └──────────────────┘
           ↓                  ↓
  LOOP → EVALUATE          EXIT

状态文件

在暂存目录中创建状态文件,以跟踪各轮次中的所有问题。这可以防止重复发现相同的问题,并允许验证修复情况。

路径:<scratchpad>/review-<filename>.md

格式:

# Review tracker: [filename]

## Issue tracker

Status values: `pending` | `fixed` | `verified-fixed` | `not-fixed` | `wont-fix`

| ID  | Issue         | Type                        | Status         | Round | Notes            |
| --- | ------------- | --------------------------- | -------------- | ----- | ---------------- |
| 1   | [description] | Style/Accuracy/Completeness | pending        | 1     | [details]        |
| 2   | [description] | Accuracy                    | verified-fixed | 1     | Fixed in round 1 |
| 3   | [description] | Completeness                | wont-fix       | 2     | Out of scope     |

## Round history

### Round 1

- Style: X/10, Voice: X/10, Completeness: X/10, Accuracy: X/10
- **Total: X/40**

状态定义:

  • pending:已发现问题,尚未处理
  • fixed:改进 Agent 声称已修复,需要验证
  • verified-fixed:评估确认修复已正确应用
  • not-fixed:评估发现修复未正确应用
  • wont-fix:误报、超出范围或有意为之(例如,需要扩展文档的完整性问题)

步骤 1:初始评估

对于第一轮,使用 Task 工具并行启动两个子 Agent:

// Single message with two Task tool calls:
Task(subagent_type="general-purpose", model="opus", prompt="Style evaluation...")
Task(subagent_type="general-purpose", model="opus", prompt="Content evaluation...")
风格 Agent 提示词(第 1 轮)
Evaluate documentation style for: $ARGUMENTS

Read the shared guides relative to this skill directory, then read the target document:
1. `../../VOICE.md`
2. `../shared/docs-guide.md`
3. $ARGUMENTS

Score these dimensions (0-10):

READABILITY - How clear and easy to understand is the writing?
- Clear, direct sentences
- Logical flow between sections
- Appropriate use of code snippets and links
- No unnecessary jargon

VOICE - How well does it follow the writing guide?
- Confident assertions (no hedging)
- Active voice, present tense
- No AI writing tells (hollow importance, trailing gerunds, formulaic transitions)
- Appropriate tone (expert-to-developer)
- Sentence case headings

Important! Include as many high-priority fixes as needed.

Return in this exact format:

STYLE REPORT: [filename]

READABILITY: [score]/10
- [specific issue or strength]
- [specific issue or strength]

VOICE: [score]/10
- [specific issue or strength]
- [specific issue or strength]

PRIORITY FIXES:
1. [Most important style issue]
2. [Second most important]
3. [Third most important]
4. ...
内容 Agent 提示词(第 1 轮)
Evaluate documentation content for: $ARGUMENTS

Read $ARGUMENTS, then verify claims against the source code in packages/editor/ and packages/tldraw/.

Score these dimensions (0-10):

COMPLETENESS - How thorough is the coverage?
- Overview establishes purpose before mechanism
- Key concepts explained with enough depth
- Illustrative code snippets where needed
- Links to relevant examples in apps/examples (if applicable)

ACCURACY - Is the technical content correct?
- Code snippets are syntactically correct and use valid APIs
- API references match actual implementation
- Described behavior matches the code
- No outdated information

For accuracy issues, include file:line references to the source code.

Important! Include as many high-priority fixes as needed. Make sure that all accuracy issues are flagged.

Return in this exact format:

CONTENT REPORT: [filename]

COMPLETENESS: [score]/10
- [specific issue or strength]
- [specific issue or strength]

ACCURACY: [score]/10
- [specific issue with file:line reference if inaccurate]
- [specific issue or strength]

PRIORITY FIXES:
1. [Most important content issue]
2. [Second most important]
3. [Third most important]
4. ...

第 1 轮之后,创建状态文件,记录所有发现的问题。

步骤 2:总结并提示用户

两个 Agent 返回后,将它们的报告综合为一份摘要:

## Evaluation: [filename]

| Dimension    | Score | Key issue   |
| ------------ | ----- | ----------- |
| Readability  | X/10  | [one-liner] |
| Voice        | X/10  | [one-liner] |
| Completeness | X/10  | [one-liner] |
| Accuracy     | X/10  | [one-liner] |
| **Total**    | X/40  |             |

### Priority fixes

1. [Combined priority 1 from both reports]
2. [Combined priority 2]
3. [Combined priority 3]
4. [Combined priority 4]
5. [Combined priority 5]
6. ...

然后使用 AskUserQuestion 询问用户:

  • Improve:根据发现进行改进,然后重新评估
  • Complete and finish:修复所有剩余问题并退出(不重新评估)
  • Done:不做更改直接退出循环

步骤 3:分诊(改进之前)

在运行改进 Agent 之前,与用户一起审查待处理的问题。将需要添加新章节的完整性问题标记为 wont-fix —— 这些属于文档扩展,而非审查修复。

根据 AGENTS.md 的指导:

"Do what has been asked; nothing more, nothing less." "Don't add features, refactor code, or make 'improvements' beyond what was asked."

审查技能改进现有内容。添加新章节是一项单独的任务。

步骤 4:改进

启动单个改进 Agent,仅针对待处理的问题:

Task(subagent_type="general-purpose", model="opus", prompt="Improve documentation...")
改进 Agent 提示词
Improve documentation based on specific tracked issues: $ARGUMENTS

Fix ONLY these pending issues:

| ID | Issue | Type | Notes |
|----|-------|------|-------|
[paste pending issues from state file]

Instructions:
1. Read `../../VOICE.md` and `../shared/docs-guide.md` relative to this skill directory
2. Read $ARGUMENTS

3. For each accuracy fix:
   - Read the source file referenced in the notes
   - Verify the correct API/behavior from the source
   - Apply the fix based on what the source code actually shows

5. Apply style fixes

6. Run prettier: pnpm exec prettier --write $ARGUMENTS

DO NOT:
- Add new sections
- Expand the document
- Fix issues not in the list above

Return a summary:

CHANGES MADE:

| ID | Fix applied | Verification |
|----|-------------|--------------|
| X | [description] | [source file:line checked] |
| Y | [description] | n/a |

改进之后,更新状态文件,将问题标记为 fixed。

步骤 4b:完成并结束(步骤 4 的替代方案)

如果用户选择 "Complete and finish",则修复所有剩余的待处理问题,不重新评估。当评估结果令人满意且用户希望应用修复并继续前进时,这很有用。

工作流:

  1. 运行分诊(与步骤 3 相同),将超出范围的项标记为 wont-fix
  2. 启动改进 Agent(与步骤 4 相同的提示词)
  3. 更新状态文件,将问题标记为 fixed
  4. 退出循环 —— 不重新评估

此路径信任改进 Agent 能正确应用修复,并跳过验证循环。适用于:

  • 问题都是简单的风格修复
  • 时间有限,重新评估不值得付出成本
  • 分数已经可以接受,只剩少量润色

步骤 5:验证评估

对于后续轮次,评估 Agent 验证修复情况并发现新问题:

风格 Agent 提示词(验证)
Verify fixes and evaluate documentation: $ARGUMENTS

Read the state file first: [path to state file]

Then read the shared guides relative to this skill directory and the target document:
1. `../../VOICE.md`
2. `../shared/docs-guide.md`
3. $ARGUMENTS

Your job:
1. VERIFY fixes marked as "fixed" in the state file - confirm they were actually applied
2. Score style dimensions (do NOT re-flag wont-fix issues)
3. Flag only NEW issues not already in the state file

VERIFY THESE FIXES:
[paste fixed style issues from state file]

Return in this format:

VERIFICATION REPORT:

| ID | Status | Notes |
|----|--------|-------|
| X | verified-fixed / not-fixed | [what you found] |

STYLE SCORES:
READABILITY: [score]/10
VOICE: [score]/10

NEW ISSUES (not already in state file):
- [issue] or "None found"
内容 Agent 提示词(验证)
Verify fixes and evaluate documentation content: $ARGUMENTS

Read the state file first: [path to state file]

Then read $ARGUMENTS and verify claims against source code in packages/tldraw/.

Your job:
1. VERIFY accuracy fixes marked as "fixed" in the state file
2. Score content dimensions (do NOT re-flag wont-fix issues)
3. Flag only NEW accuracy issues not already in the state file

VERIFY THESE FIXES:
[paste fixed accuracy issues from state file]

Return in this format:

VERIFICATION REPORT:

| ID | Status | Notes |
|----|--------|-------|
| X | verified-fixed / not-fixed | [what you found in doc AND source] |

CONTENT SCORES:
COMPLETENESS: [score]/10 (score existing content only, ignore wont-fix items)
ACCURACY: [score]/10

NEW ACCURACY ISSUES (not already in state file):
- [issue with source file:line] or "None found"

验证之后,更新状态文件,记录新的状态和任何新问题。

步骤 6:循环

继续循环,直到:

  • 用户选择 "Done"(不做更改直接退出)
  • 用户选择 "Complete and finish"(应用修复后退出)
  • 分数达到可接受的水平(32/40 或更高)
  • 所有问题均为 verified-fixed 或 wont-fix

备注

  • 状态文件可防止在各轮次中重复发现相同的问题
  • 评估 Agent 在评分前先验证之前的修复
  • wont-fix 适用于需要添加新章节的完整性问题
  • 准确性验证至关重要:改进 Agent 在应用任何准确性修复之前,必须阅读实际的源代码
  • 风格和内容评估始终并行运行以提高效率

评论

支持 Markdown