From ea9253e4a008b1fe6137e2b27d7e2439dc6c07fe Mon Sep 17 00:00:00 2001 From: JOY Date: Sun, 24 May 2026 01:52:49 +0700 Subject: [PATCH] ci: add Claude Code Review workflow for docs PRs The DOS.AI code repo auto-reviews every PR via claude-code-review, but this docs repo had no PR reviewer - docs PRs (e.g. the partner-API update #1) shipped unreviewed. Mirrors that workflow, retuned for a documentation repo: - Reviews for factual accuracy (base URLs, endpoint paths, auth schemes, code samples vs the real product), broken links, cross-page consistency, house style (ASCII hyphens only - flag em/en-dashes), and completeness. - Same org secret CLAUDE_CODE_OAUTH_TOKEN, same anthropics/claude-code-action@v1, same read-only permissions + gh-comment allowed-tools. Runs on pull_request opened/synchronize. No build step (Markdown repo). --- .github/workflows/claude-code-review.yml | 58 ++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/claude-code-review.yml diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml new file mode 100644 index 0000000..90dc918 --- /dev/null +++ b/.github/workflows/claude-code-review.yml @@ -0,0 +1,58 @@ +name: Claude Code Review + +# Auto-reviews every docs PR for accuracy, broken links, consistency, and +# house style. Mirrors the reviewer in the DOS.AI code repo, retuned for a +# documentation repo (no build/tests to reason about). Uses the org secret +# CLAUDE_CODE_OAUTH_TOKEN. + +on: + pull_request: + types: [opened, synchronize] + +jobs: + claude-review: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + issues: read + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 1 + + - name: Run Claude Code Review + id: claude-review + uses: anthropics/claude-code-action@v1 + with: + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + prompt: | + REPO: ${{ github.repository }} + PR NUMBER: ${{ github.event.pull_request.number }} + + This is a documentation repository (GitBook Markdown for the + DOS.AI developer docs). Review this pull request for: + + - Factual accuracy: do API base URLs, endpoint paths, auth + schemes, request/response shapes, and code samples match the + actual product? Flag anything that looks stale or invented. + - Broken or wrong links: internal page links and external URLs. + - Consistency: terminology, endpoint naming, and auth examples + should agree across pages (e.g. an endpoint documented one way + on the overview must match the reference page). + - House style: user-facing text uses ASCII hyphens only - flag + any em-dash (—) or en-dash (–). + - Completeness: new endpoints/parameters documented; deprecated + ones marked. + + Use the repository's README / SUMMARY.md for structure and any + CLAUDE.md for conventions. Be constructive and specific (cite the + file + line). Do NOT rewrite the docs; just review. + + Use `gh pr comment` with your Bash tool to leave your review as a + comment on the PR. + + claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'