with one click
docs-review
// Reviews documentation PRs and provides GitHub PR suggestions. Load when asked to review, suggest changes, or provide feedback on docs content. Covers MDX, frontmatter, style guide, components, and content accuracy.
// Reviews documentation PRs and provides GitHub PR suggestions. Load when asked to review, suggest changes, or provide feedback on docs content. Covers MDX, frontmatter, style guide, components, and content accuracy.
Evaluate a GitHub issue or pull request and decide if it is spam or clearly off-topic for cloudflare/cloudflare-docs.
Creates, updates, and reviews product changelog entries for the Cloudflare documentation site. Load when generating changelog MDX files, editing existing entries, reviewing changelog style, or validating frontmatter.
Reviews Workers and Cloudflare Developer Platform code for type correctness, API usage, and configuration validity. Load when reviewing TypeScript/JavaScript using Workers APIs, wrangler.jsonc/toml config, or Cloudflare bindings (KV, R2, D1, Durable Objects, Queues, Vectorize, AI, Hyperdrive).
Analyzes a Dependabot PR to determine what actually changed in each bumped package and whether those changes affect this repo. Reports changed APIs/methods, which doc pages use them, and the realistic probability of any visible impact on the docs site.
Creates and updates GitHub pull requests for cloudflare-docs changes. Load when asked to open, create, submit, update, edit, or write a title or description for a PR. Covers title conventions, PR body structure, and the documentation checklist template.
Transform technical jargon into clear explanations using before/after comparisons, metaphors, and practical context
| name | docs-review |
| description | Reviews documentation PRs and provides GitHub PR suggestions. Load when asked to review, suggest changes, or provide feedback on docs content. Covers MDX, frontmatter, style guide, components, and content accuracy. |
Review documentation changes for correctness, style, and structure.
Primary style reference: .agents/references/style-guide.md — read this before reviewing. It contains the canonical rules for MDX syntax, frontmatter, writing style, formatting, links, code blocks, and admonitions. The full style guide lives at src/content/docs/style-guide/ if you need to go deeper on any topic.
gh CLI, never push commits. If they say "fix", "address this", or "update" — edit files directly and commit.| Instruction | Action |
|---|---|
| "review", "suggest changes", "provide suggestions" | Post suggestions only via gh CLI — do not push commits |
| "only make suggestions", "do not make changes" | Post suggestions only — never edit files or push |
| "fix", "address this", "update" | Always edit files directly and commit changes |
| "review and fix" | Fix low-severity issues directly; suggest high-impact changes |
| Invoked by someone other than PR author | Post suggestions unless explicitly told to fix |
| Invoked by PR author (or unclear) | Fix directly — especially MDX syntax, code errors, and build breakers |
When in doubt, fix obvious errors (build breakers, MDX syntax, wrong imports, broken code) and suggest subjective changes (wording, restructuring, style preferences).
Use the GitHub REST API via gh api to post line-level suggestions on PRs. This is the only way to propose changes when operating in suggestion-only mode.
Determine the PR number and the latest commit SHA before posting:
PR_NUMBER=$(gh pr view --json number -q '.number')
COMMIT_SHA=$(gh pr view --json commits -q '.commits[-1].oid')
Replace one line in the diff. Use subject_type: "line".
gh api repos/{owner}/{repo}/pulls/${PR_NUMBER}/comments \
-f body='Tighten the phrasing:
```suggestion
Workers use an event-driven architecture. Each incoming request triggers a `fetch` handler.
```' \
-f commit_id="${COMMIT_SHA}" \
-f path="src/content/docs/workers/get-started/index.mdx" \
-F line=42 \
-f side="RIGHT" \
-f subject_type="line"
Replace a range of lines. Add start_line and start_side.
gh api repos/{owner}/{repo}/pulls/${PR_NUMBER}/comments \
-f body='Simplify this paragraph:
```suggestion
Bindings provide direct, in-process access to Cloudflare services like R2, KV, and D1.
They require no network hop, no authentication token, and add no extra latency.
```' \
-f commit_id="${COMMIT_SHA}" \
-f path="src/content/docs/workers/runtime-apis/bindings.mdx" \
-F start_line=18 \
-F line=22 \
-f start_side="RIGHT" \
-f side="RIGHT" \
-f subject_type="line"
For feedback that does not map to a specific replacement, post a plain review comment (no suggestion block):
gh api repos/{owner}/{repo}/pulls/${PR_NUMBER}/comments \
-f body="This claim needs a source. Link to the relevant API reference or remove it." \
-f commit_id="${COMMIT_SHA}" \
-f path="src/content/docs/workers/observability/index.mdx" \
-F line=55 \
-f side="RIGHT" \
-f subject_type="line"
suggestion fenced block replaces the target line(s) exactly. Include the full replacement text with correct indentation.line to the diff line number. Do not set start_line.start_line to the first line and line to the last line of the range being replaced.side to "RIGHT" (the new file side of the diff).subject_type to "line".-F (not -f) for numeric fields (line, start_line) so gh sends them as integers.When posting 3+ suggestions, use a single review with multiple comments to avoid notification spam:
gh api repos/{owner}/{repo}/pulls/${PR_NUMBER}/reviews \
--input - <<EOF
{
"event": "COMMENT",
"body": "A few suggestions for this PR.",
"commit_id": "${COMMIT_SHA}",
"comments": [
{
"path": "src/content/docs/workers/get-started/index.mdx",
"line": 42,
"side": "RIGHT",
"body": "Tighten:\n\n\`\`\`suggestion\nWorkers use an event-driven model.\n\`\`\`"
},
{
"path": "src/content/docs/workers/get-started/index.mdx",
"line": 58,
"side": "RIGHT",
"body": "Fix link:\n\n\`\`\`suggestion\nFor more information, refer to [Bindings](/workers/runtime-apis/bindings/).\n\`\`\`"
}
]
}
EOF
When using --input - with a heredoc, do not pass -f/-F flags — all fields go in the JSON body. The JSON must include event, commit_id, body, and comments.
gh pr diff ${PR_NUMBER}
Read full files for context — code that looks wrong in a diff may be correct in context. Check what section the change sits in and what comes before/after.
See .agents/references/style-guide.md for the full rules. Quick reference:
| Rule | Detail |
|---|---|
| Unescaped MDX characters | {, }, <, > in prose must be escaped or in backticks |
| Component imports | Every component used must be imported from ~/components |
| Workers code | Must use TypeScriptExample, not bare js/ts fences |
| Config blocks | Must use WranglerConfig with TOML input; use $today for compatibility_date |
| Package install commands | Must use PackageManagers, not bare sh fences |
| Code block languages | Lowercase, from the supported set — see .agents/references/style-guide.md |
| Internal links | Root-relative paths, trailing slash, no file extensions, no full developers.cloudflare.com URLs |
| Frontmatter | title and description required; pcx_content_type must be a valid value |
| Writing style | See .agents/references/style-guide.md — covers voice, contractions, terminology, headings, etc. |
| Code correctness | For type checking, API usage, and binding patterns, load the code-review skill |
| Accuracy | Claims must be substantiated — link to sources of truth, do not re-explain what other pages cover |
| Flag | Do not flag |
|---|---|
| Incorrect technical content | Style preferences not in the style guide |
| Broken MDX (build will fail) | Pre-existing issues in unchanged lines |
| Wrong API usage or types | "Could be cleaner" when code is correct |
Missing component usage (TypeScriptExample, WranglerConfig) | Theoretical concerns without evidence |
| Inaccurate or unsubstantiated claims | Missing features outside the PR scope |
| Security or safety issues in examples | Minor wording differences that do not change meaning |
| Scope creep (changes to files outside the PR intent) |
Review in severity order:
TypeScriptExample, hardcoded compat dates, bare code fencesThese principles are derived from recurring review feedback on this repo:
/support/troubleshooting/http-status-codes/.TypeScriptExample. Config should use WranglerConfig with $today for compatibility dates. Package install commands should use PackageManagers.<response_format> Your responses appear as GitHub comments. Every comment a reviewer reads costs attention. Be direct, be brief, and never repeat yourself.
When posting inline suggestions, keep commentary to one sentence before the suggestion block. Do not over-explain.
When posting a summary comment, use this structure:
That is the entire comment. Do not add anything else.
When responding to a follow-up request in the same thread (for example, "fix the build", "address the review comments"):
Do not re-run the full review. Do not re-summarize the PR. Do not repeat guidance from a prior comment. Each comment in a thread should contain only new information. </response_format>