Skip to content

docs-review: OpenRouter + six-criteria rubric + APM skills - #352

Open
theletterf wants to merge 8 commits into
mainfrom
scope-quality-and-docs-impact
Open

theletterf wants to merge 8 commits into
mainfrom
scope-quality-and-docs-impact

Conversation

@theletterf

Copy link
Copy Markdown
Member

Summary

  • Migrates the PR review workflow from the Copilot API to OpenRouter (claude-sonnet-5 via the Anthropic-format endpoint)
  • Imports the six-criteria rubric from elastic/elastic-docs-skills/skills/review/review-pr/references/review-criteria.md as an inlined fragment, so the workflow and the local review skill share one authoritative source
  • Adds explicit Skill tool invocations for all six APM docs skills (docs-check-style, docs-flag-jargon-skill, docs-frontmatter-audit, docs-content-type-checker, docs-applies-to-tagging, docs-check-contradictions) — the agent actively runs them rather than treating them as passive context
  • Migrates issue scope to OpenRouter + GPT 5.6 Luna (separate commit, already merged into this branch)

Test plan

  • Sandbox test in elastic/docs-actions-sandbox PR Add scoped targeting modes to docs quality sweeps #141 (APM logs refresh content)
  • All 6 pipeline stages pass (pre_activation, activation, apm, agent, detection, safe_outputs, conclusion)
  • All 6 APM skills invoked and confirmed in agent stdio log
  • Full six-criteria summary produced with inline comments
  • primary_model: anthropic/claude-sonnet-5 confirmed in usage artifact
  • Cost: 252 AIC per run ($2.50); ~$1.23/run on lighter PRs without heavy cache_write

Notes

The correct OpenRouter setup for the claude engine is:

  • ANTHROPIC_BASE_URL: https://openrouter.ai/api (no /v1 — the SDK appends it)
  • model: sonnet (gh-aw alias; OpenRouter resolves it to anthropic/claude-sonnet-5)

Using a hardcoded model ID or appending /v1 to the base URL both produce 404s on OpenRouter's Anthropic-format endpoint.

🤖 Generated with Claude Code

theletterf and others added 7 commits September 15, 2026 14:43
Remove every sizing concern from issue-scope: the sizer sub-agent, the
Cost & benefit section, effort buckets, ownership, audience, bill of
materials, and good-for-ai. Scope now judges issue quality, searches the
Elastic docs corpus for affected pages, verifies the request against any
linked code, says how to tackle the work, and lists questions to go
deeper.

Structural changes from the 2026-09-15 analysis:
- One agent. The three sub-agents delegated under codex and not under
  Claude, and the best production comment came from the run that did
  the work itself.
- Docs MCP search is mandatory and first. It had never been called in
  any run under either engine.
- Drop the APM import and its job. The installed skills were never
  invoked.
- Linked code is evidence, not a prerequisite. No PR caps confidence at
  Medium instead of forcing a partial outcome.
- Labels: human-needed on the red quality gate only, create-if-missing
  false. Drop "Not assessable" — with one agent that is a run failure.

Compiled with gh-aw v0.88.7, zero warnings. README and example updated;
example drops the dead project-instructions-path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Move the workflow from the Copilot engine to Claude via OpenRouter
(anthropic/claude-sonnet-5). Add ANTHROPIC_API_KEY to the secrets
manifest; consumers must now pass this secret in their caller workflow.

Import review-criteria.md from elastic/elastic-docs-skills at compile
time so both the local docs-review-pr skill and this workflow share one
authoritative rubric. Structured the prompt around the rubric's six
criteria (User focus, Technical accuracy, Applicability, Maintainability,
Language, Style) and removed the embedded prose checklists that
duplicated what the rubric and APM skills already cover. Updated the
review body format to match the skill's six-criteria output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…skill invocations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GPT 5.6 Luna costs ~2× more per run due to higher cache-read pricing
on long-prompt workloads, and the Skill tool is not available in the
codex engine — both reasons to stay on claude-sonnet-5.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rmat endpoint

OpenRouter's Anthropic-format /v1/messages endpoint requires model IDs
without the provider prefix (claude-sonnet-5, not anthropic/claude-sonnet-5).
The anthropic/ prefix is for the OpenAI-compatible endpoint only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use the gh-aw 'sonnet' alias (OpenRouter resolves it) instead of a
hardcoded model ID. Use https://openrouter.ai/api as the base URL —
Claude Code SDK appends /v1/messages, giving the correct path. Adding
/v1 to the base URL caused a double-path 404.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@theletterf
theletterf requested a review from a team as a code owner September 18, 2026 13:11
@theletterf
theletterf requested a review from akira28 September 18, 2026 13:11
@theletterf theletterf self-assigned this Sep 18, 2026
@theletterf theletterf added the enhancement New feature or request label Sep 18, 2026
@theletterf

Copy link
Copy Markdown
Member Author

Example review output from the latest sandbox run (run 35345724174, triggered on docs-actions-sandbox#141 — an APM logs page refresh with real docs-content material):

  • All 6 APM skills invoked (docs-check-style ×4, docs-frontmatter-audit, docs-flag-jargon-skill, docs-content-type-checker, docs-applies-to-tagging, docs-check-contradictions)
  • 2 inline comments: one flagging a non-standard {applies_to} syntax, one flagging a version-gated default that doesn't match the Kibana advanced settings reference
  • Full six-criteria summary + nits section

See the review comments directly on the sandbox PR: https://github.com/elastic/docs-actions-sandbox/pull/141

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: the docs-review caller secret name in the example and setup docs does not match the reusable workflow input OPENROUTER_API_KEY, which causes authentication failure for consumers following the published setup.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

with:
review-scope: docs-subtree
secrets:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Example passes a non-consumed secret name

The reusable workflow consumes secrets.OPENROUTER_API_KEY (mapped to ANTHROPIC_API_KEY internally). Passing ANTHROPIC_API_KEY here means the callee never receives OPENROUTER_API_KEY, so runs fail when callers follow this example and README guidance. Use the same external secret name the workflow expects to keep invocation and docs consistent.

Suggested change
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}

Claude Code makes fallback calls to api.anthropic.com during startup;
blocking them surfaces a warning in the run logs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes due to a blocking workflow setup mismatch in the updated installation guidance.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Add the following to the caller workflow before running this workflow:

- `permissions.copilot-requests: write`
- A repo or organization secret named `ANTHROPIC_API_KEY` containing your OpenRouter API key. Pass it with `secrets: inherit` or as an explicit secret in the `uses:` call.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Install docs use a non-consumed secret name

This workflow reads ${{ secrets.OPENROUTER_API_KEY }} (mapped to ANTHROPIC_API_KEY internally), so telling callers to define ANTHROPIC_API_KEY causes authentication failures when they follow the install steps. Document OPENROUTER_API_KEY as the required caller secret name to match the reusable workflow contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant