Skip to content

Add PR Docs Review workflow #704

@joecompute

Description

@joecompute

Add PR Docs Review workflow

Analysis

No existing workflow checks whether a PR's code changes need corresponding documentation updates. The gap sits between two existing workflows:

  • Docs Patrol (scheduled) scans recent commits for documentation drift and files issues. It operates on a time window, not a PR diff, and its output is an issue — not PR feedback.
  • Estc Docs PR Review reviews the quality of documentation files already being changed in a PR (style guide, applies_to tags). It doesn't check whether code changes should have triggered doc updates.

A PR-event workflow modeled on PR Review (inline comments, review verdict) with Docs Patrol's domain knowledge (what constitutes documentation drift, quality gate, what to skip) would close this gap. It should cover docs, runbooks, architecture diagrams, and operational guides — broader than Docs Patrol's current scope. Plus, it nips the major source of obsolete documentation in the bud - repo drift - as PRs are the primary source of repo content evolution.

Implementation Plan

1. Create the workflow source (.github/workflows/gh-aw-pr-docs-review.md)

Model on gh-aw-pr-review.md with Docs Patrol's domain knowledge:

  • Imports: elastic-tools, runtime-setup, formatting, rigor, mcp-pagination, pr-context, messages-footer, safe-output-review-comment, safe-output-submit-review, network-ecosystems
  • Inputs: standard set (model, additional-instructions, setup-commands, allowed-bot-users, messages-footer) plus create-pull-request-review-comment-max (default 15)
  • Permissions: contents: read, pull-requests: read, issues: read
  • Tools: github: [repos, issues, pull_requests, search], bash, web-fetch
  • Safe outputs: noop, review comments, review submission
  • Concurrency: keyed on PR number, cancel-in-progress
  • Timeout: 60 minutes

Prompt — four steps:

  1. Gather Context: read pr-context files and dynamically discover documentation files (READMEs, docs/, runbooks/, architecture diagrams, .md files in root)
  2. Analyze the Diff: apply Docs Patrol's "What to Look For" criteria (public API changes, behavioral changes, new features, dependency/tooling changes, structural changes, configuration changes) plus operational and architecture changes
  3. Verify Findings: for each finding, check if the PR already updates the docs, check for open tracking issues/PRs, assess real impact (would a user get incorrect results?), check for duplicate threads. Drop anything that doesn't survive all checks. Apply Docs Patrol's "What to Skip" list
  4. Review or Noop: noop is the expected outcome for most PRs. If findings survive, leave inline review comments on the code lines that need doc coverage. Each comment should link directly to the documentation file(s) that need updating using repository blob URLs so the author can navigate there immediately. Submit as COMMENT (advisory, not blocking)

2. Create the trigger (gh-agent-workflows/pr-docs-review/example.yml)

  • Trigger on pull_request targeting main with types [opened, synchronize, reopened, ready_for_review]
  • Skip draft PRs (github.event.pull_request.draft == false)
  • Skip label: skip-pr-docs-review (consistent with skip-auto-pr-review and skip-pr-body-update)

3. Create the README (gh-agent-workflows/pr-docs-review/README.md)

Standard per-workflow README: description, quick install curl, trigger table, inputs table, safe outputs list.

4. Recompile and validate

  • Run make compile to regenerate lock files and sync triggers
  • Verify 0 errors, 0 warnings

Design decisions

  • No sub-agents for v1 — single-agent analysis is sufficient for a single PR diff. Sub-agents via pick-three-keep-many can be added later if large PRs need it.
  • COMMENT verdict, not REQUEST_CHANGES — documentation gaps are advisory. Teams that want stricter enforcement can override via additional-instructions.
  • Strict quality gate — noop is the expected outcome. Only flag concrete gaps: "docs are wrong," "new public feature has zero documentation," or "removed interface is still referenced." No vague "could be improved" flags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions