Skip to content

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

Merged
theletterf merged 22 commits into
mainfrom
scope-quality-and-docs-impact
Sep 20, 2026
Merged

theletterf merged 22 commits into
mainfrom
scope-quality-and-docs-impact

Conversation

@theletterf

@theletterf theletterf commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Summary

This started as the OpenRouter migration for the PR review workflow, and it turned into the fix for something that had been quietly broken for a while: the elastic-docs-skills review skills never actually ran in any docs-review run, on either engine.

What I found, from the run artifacts rather than the summaries:

  • On the Copilot engine (current v1), Copilot CLI hides every skill that sets disable-model-invocation: true. Four of the six review skills had that flag, so the agent saw only two and never invoked those either. fix(review): make review skills model-invocable elastic-docs-skills#151 removes the flag.
  • On the Claude engine, three independent things blocked every Skill call: gh-aw's base-folder restore runs after the APM restore and deletes .claude/skills; gh-aw never adds Skill to Claude's --allowed-tools, so every call came back permission_denied; and Claude Code registers project skills by directory name, not by frontmatter name.

What this PR does about it:

  • Migrates the workflow to OpenRouter (claude-sonnet-5 via the Anthropic-format endpoint) and adds the same attribution headers the triage workflows use.
  • Imports the six-criteria rubric from elastic-docs-skills/.../review-criteria.md as an inlined fragment, so the workflow and the local review skill share one source.
  • Installs the six review skills through gh-aw's frontmatter skills: key (pinned to elastic-docs-skills@main at compile time), which is restored after the base-folder wipe. The shared/apm.md import is gone.
  • Sets engine.permission-mode: bypassPermissions so the agent can call Skill. gh-aw's own docs note the allowlist adds no boundary once bash is unrestricted, which it already is here; the MCP gateway allowed: lists and the firewall stay enforced.
  • Invokes skills by directory name, passes report-only instructions to applies-to-tagging (it rewrote the reviewed file once), hands docs-check-style the Vale JSON the pre-step already produced, and reports any skill that fails to run in the review's Notes instead of dropping it.
  • Migrates issue scope to OpenRouter + GPT 5.6 Luna (separate commit, already in this branch).

Test plan

Sandbox: elastic/docs-actions-sandbox PR #141, caller pinned to this branch.

  • Run 35500726847 (lock 891d5aa): six skills installed, six registered, six Skill calls completed with real reports, zero permission denials, review posted with skill-derived findings.
  • Run 35504099580 (lock ebc4268, APM removed, directory-name prompt): six skills installed, registered, and invoked; zero permission denials; review posted with four inline comments and all six criteria. applies-to-tagging edited the reviewed file again and the agent reverted it, so the report-only wording landed in 46d4bcc afterwards and has not been re-run yet.
  • Both bot review comments on the caller secret name addressed (OPENROUTER_API_KEY).
  • After merge and release: repoint the sandbox caller to @v1; confirm one production run on docs-content shows the six skills in the agent log.

Follow-ups (not in this PR)

  • Rename the mismatched skill directories in elastic-docs-skills so directory and frontmatter names agree.
  • Upstream gh-aw issue for the Claude-engine .claude wipe after APM restore (#27566/#28290 covered Copilot only).
  • Registry entry in docs-ai-tools/docs/registry/docs-review.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b

Related to #402

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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
…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 <[email protected]>
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 <[email protected]>
@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.

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 <[email protected]>

@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.

Comment thread agentic-workflows/docs-review/README.md Resolved
theletterf and others added 3 commits September 20, 2026 10:45
The reusable workflow reads secrets.OPENROUTER_API_KEY and maps it to
ANTHROPIC_API_KEY internally. The example and install docs told callers
to pass ANTHROPIC_API_KEY, so new adopters following them would fail
authentication. Production callers use secrets: inherit and were not
affected.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…he Skill tool

Under the claude engine the APM-installed .claude/skills were deleted
before the agent started: restore_base_github_folders.sh runs after the PR
checkout with GH_AW_AGENT_FOLDERS=".agents .claude .github" and either
overwrites .claude from the base snapshot or removes it as PR-injected.
The frontmatter skills: key installs in activation and is restored after
that step. Skill was also absent from --allowed-tools, so every Skill call
returned permission_denied; bypassPermissions is the only mode that lifts
it, and the allowlist adds no boundary with unrestricted bash already on.

Pinned to elastic-docs-skills 952fbdd (PR #151), which removes
disable-model-invocation from the review skills.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

@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 updated setup guidance requires OPENROUTER_API_KEY, but the README example invocation still omits secret wiring and will fail for consumers who copy it.


What is this? | From workflow: PR Review

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

Comment thread agentic-workflows/docs-review/README.md Resolved
theletterf and others added 2 commits September 20, 2026 11:53
…ion, drop APM import

Sandbox run 35500726847 confirmed the frontmatter skills: install
survives the base-folder restore and that bypassPermissions lets the
agent call the Skill tool: six installs, six registered, six Skill calls
completed. Claude Code registers each skill under its directory name, so
the prompt now names them that way instead of by frontmatter name.

The shared/apm.md import is removed: under the claude engine its
.claude/skills output is deleted before the agent starts, so the apm job
only cost a runner. Attribution headers match the triage workflows so
docs-review spend shows up as its own app on OpenRouter. A skill that
fails to run is now reported in the review Notes instead of dropped.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b

@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 conflicting prompt instructions that can force invalid step ordering during issue scoping runs.


What is this? | From workflow: PR Review

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

Comment thread .github/workflows/gh-aw-issue-scope.md Resolved
…le output

Sandbox run 35500726847 showed two skill-quality gaps. applies-to-tagging
rewrote the reviewed file instead of reporting; the agent noticed and ran
git checkout -- to undo it. The prompt now passes a validate-only
instruction and states the revert rule. docs-check-style could not run
vale on the runner; the prompt now points it at the JSON the Vale
pre-step already wrote. README documents the skills: install, the @main
pin, and why permission-mode is bypassPermissions.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b
@theletterf theletterf changed the title docs-review: OpenRouter + six-criteria rubric + APM skills docs-review: OpenRouter + six-criteria rubric + review skills Sep 20, 2026
theletterf and others added 2 commits September 20, 2026 12:27
… secrets in README example

docs-check-style, content-type-checker, and applies-to-tagging each fetch
the published style, content-type, and cumulative-docs pages they need
through the Elastic docs MCP server, so the prompt no longer tells the
agent to fetch the same pages before judging. Direct fetches are reserved
for pages no skill covered. The Vale hint no longer claims vale is
missing; the binary is on the runner but not on the skill's PATH.

The README example invocation now passes OPENROUTER_API_KEY, which the
PR Review bot flagged as missing after the earlier secret-name fix.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b
…ed files

applies-to-tagging rewrote the reviewed file in both sandbox runs: it
declares Edit, its SKILL.md says "report or fix", and a forked skill
inherits the parent's permission mode. Prompt wording is a request, not
a boundary. Deny rules block in every mode including bypassPermissions,
and Claude checks file permissions against Edit(path) rules only, so one
Edit(./**) deny covers Edit, Write, NotebookEdit and MultiEdit across the
checkout for the agent and every fork. /tmp/gh-aw/agent stays writable.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b
Step 1 reads .github/CODEOWNERS for path vocabulary, but Step 4 forbade
get_file_contents before the first search_docs result, so the prompt
contradicted itself and the agent had to pick one. The ordering rule
exists to stop the agent scoping against repository files instead of
published docs; CODEOWNERS is vocabulary, not evidence, so it is now a
named exception and the rule keeps its purpose.

Reported by the PR Review workflow on #352.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b

@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 because the new read-only contract in the docs-review workflow is currently unenforced at runtime.


What is this? | From workflow: PR Review

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

Comment thread .github/workflows/gh-aw-docs-review.md Resolved
…y fix

A @main skill reference resolves once and the SHA is cached in
.github/aw/actions-lock.json, so a plain `gh aw compile` keeps serving
the old commit after the upstream merge. Only --force-refresh-action-pins
re-resolves it. Moves the six skills from 44d2d7a to b079923
(elastic-docs-skills#152: applies-to-tagging report-only, docs-check-style
reads pre-computed Vale).

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b
theletterf and others added 2 commits September 20, 2026 14:01
…s-impact

# Conflicts:
#	.github/workflows/gh-aw-issue-scope.lock.yml
#	.github/workflows/gh-aw-issue-scope.md
The comment claimed review is read-only. The deny rule covers the
built-in file tools, the file commands Claude recognizes in bash, and
shell redirections — but not a subprocess that opens files itself, which
stays reachable while bash is unrestricted. Say that instead of implying
a guarantee the rule does not make.

Also records why one Edit rule is enough: Claude consults path rules for
Edit only, so Write, MultiEdit, and NotebookEdit path rules would be
accepted and never consulted.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b

@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.

Approved: no new actionable findings; prior blocking comments are resolved in this revision.


What is this? | From workflow: PR Review

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

The compile-workflows hook builds all 13 workflows; I had only compiled
the two I edited, so CI found drift in two places.

Compiling gh-aw-docs-review with --force-refresh-action-pins cleared the
whole action-pin cache and re-resolved only the entries that workflow
needs, dropping github/gh-aw-actions/setup-cli and microsoft/apm-action —
still used by the sweeps and docs-agent-experimental. Both are restored.

The other 11 lock files pick up an upstream gh-aw-node image digest
change, unrelated to this branch.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b

@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 README example is still missing required permissions.copilot-requests: write, so copied caller workflows can fail at runtime.


What is this? | From workflow: PR Review

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

Comment thread agentic-workflows/docs-review/README.md Resolved
The install section requires permissions.copilot-requests: write and
example.yml grants it, but the inline example block did not. A consumer
copying that snippet fails at runtime, because a reusable workflow cannot
grant a permission its caller never had.

Reported by the PR Review workflow on #352.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b

@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.

Approved: no new actionable findings.


What is this? | From workflow: PR Review

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

@theletterf
theletterf merged commit 392d3d9 into main Sep 20, 2026
11 checks passed
@theletterf
theletterf deleted the scope-quality-and-docs-impact branch September 20, 2026 14:37
theletterf added a commit that referenced this pull request Sep 20, 2026
elastic/elastic-docs-skills#153 renamed the skill directories whose folder
disagreed with their frontmatter name. APM package references are directory
paths, so five workflows pointed at directories that no longer exist.

Renaming the paths in place would have fixed the instance and left the
class: APM package refs carry no @ref, gh-aw passes them to apm-action
without a lockfile, and they resolve from the catalog default branch on
every run. That is what made this breakage possible and silent to review.

The frontmatter skills: key is resolved at compile time and pinned into
actions-lock.json, so a future catalog rename cannot reach these workflows
until someone recompiles deliberately. All five skills now pin to
4d8ad27, the rename commit.

Removing the APM import also drops the apm job and the apm-action
dependency from these workflows. apm-action remains in the repo for
gh-aw-docs-review, which #352 converts separately.

Security review: this compilation removes the microsoft/apm-action
dependency from the affected workflows and adds no new actions, secrets,
or network destinations. The only additions to actions-lock.json are five
SHA-pinned skill paths in elastic/elastic-docs-skills, a repository these
workflows already consumed unpinned.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b
theletterf added a commit that referenced this pull request Sep 20, 2026
…lls: (#354)

* Point APM skill packages at the renamed catalog directories

elastic/elastic-docs-skills#153 renames the skill directories whose
folder name disagreed with their frontmatter name. APM package paths are
directory paths, so these two workflows have to follow.

These references carry no @ref and resolve from the catalog's default
branch at runtime, so they cannot be pinned ahead of the rename — gh-aw
passes the dependency list straight to apm-action with no lockfile. The
mitigation is ordering, not pinning: merge the rename first, then this.

A stale path fails loudly rather than silently degrading the review: the
agent job needs the apm job, and the bundle guard exits 1 when no bundle
is produced.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b

* Move APM skill imports to frontmatter skills: with the renamed paths

elastic/elastic-docs-skills#153 renamed the skill directories whose folder
disagreed with their frontmatter name. APM package references are directory
paths, so five workflows pointed at directories that no longer exist.

Renaming the paths in place would have fixed the instance and left the
class: APM package refs carry no @ref, gh-aw passes them to apm-action
without a lockfile, and they resolve from the catalog default branch on
every run. That is what made this breakage possible and silent to review.

The frontmatter skills: key is resolved at compile time and pinned into
actions-lock.json, so a future catalog rename cannot reach these workflows
until someone recompiles deliberately. All five skills now pin to
4d8ad27, the rename commit.

Removing the APM import also drops the apm job and the apm-action
dependency from these workflows. apm-action remains in the repo for
gh-aw-docs-review, which #352 converts separately.

Security review: this compilation removes the microsoft/apm-action
dependency from the affected workflows and adds no new actions, secrets,
or network destinations. The only additions to actions-lock.json are five
SHA-pinned skill paths in elastic/elastic-docs-skills, a repository these
workflows already consumed unpinned.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b

* Drop accidentally committed local run logs

.github/aw/logs/run-30910942575 is local agent-run output that was
untracked in the working tree and is not on main. A broad git add during
the merge resolution swept it in. Removed from the index; the files stay
on disk.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H3vJ764kbRQMFqEtZxh42b

---------

Co-authored-by: Claude Opus 5 <[email protected]>
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