Skip to content

Optimize Claude user docs review workflow with inline sub-agents for extractive phases#31416

Merged
pelikhan merged 2 commits into
mainfrom
copilot/optimize-claude-code-user-docs-review
May 11, 2026
Merged

Optimize Claude user docs review workflow with inline sub-agents for extractive phases#31416
pelikhan merged 2 commits into
mainfrom
copilot/optimize-claude-code-user-docs-review

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

✨ Enhancement

The claude-code-user-docs-review workflow is a high-token claude run with multiple extractive phases that were executed in the main prompt context. This change extracts those mechanical phases into inline small sub-agents while keeping synthesis/reporting in the main agent path.

  • What does this improve?

    • Reduces main-model context load by moving phase-local extraction/classification work out of the primary prompt.
    • Enables independent execution patterns for phases 1, 4, 5, and 6 via sub-agent calls.
  • Why is this valuable?

    • Targets the workflow’s largest token contributors (document scans and deterministic classification/counting tasks).
    • Preserves final judgment/report quality by leaving interpretive phases and final synthesis in the main workflow.
  • Implementation approach:

    • Frontmatter updates
      • Enabled inline agent extraction in .github/workflows/claude-code-user-docs-review.md:
        features:
          copilot-requests: true
          inline-agents: true
    • Phase prompt refactors
      • Replaced direct bash scan blocks with sub-agent invocations in:
        • Phase 1 → doc-reader
        • Phase 4 → engine-example-counter
        • Phase 5 → tool-engine-classifier
        • Phase 6 → auth-doc-extractor
    • Inline sub-agent definitions
      • Appended four ## agent: blocks at the end of the workflow with model: small and constrained structured outputs:
        • doc-reader: summarizes six core docs into compact factual JSON
        • engine-example-counter: counts/listings by engine:* across workflow markdowns
        • tool-engine-classifier: tool compatibility classification table + summary
        • auth-doc-extractor: per-engine auth/secret extraction from quick-start docs
    • Compiled output update
      • Recompiled workflow to refresh .github/workflows/claude-code-user-docs-review.lock.yml.

Example invocation change:

Use the `doc-reader` agent to gather structured facts from the six core documentation files. Use its JSON output as the factual basis for Phases 2, 3, and 7.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize Claude code user documentation review Optimize Claude user docs review workflow with inline sub-agents for extractive phases May 11, 2026
Copilot AI requested a review from pelikhan May 11, 2026 04:53
@pelikhan pelikhan marked this pull request as ready for review May 11, 2026 05:13
Copilot AI review requested due to automatic review settings May 11, 2026 05:13
@pelikhan pelikhan merged commit 4f7d5af into main May 11, 2026
@pelikhan pelikhan deleted the copilot/optimize-claude-code-user-docs-review branch May 11, 2026 05:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the claude-code-user-docs-review workflow to offload extractive/scanning phases into inline “small” sub-agents, reducing main-prompt context and keeping synthesis in the primary agent path.

Changes:

  • Enabled inline sub-agent usage in the workflow frontmatter.
  • Replaced Phase 1/4/5/6 bash-based scanning instructions with sub-agent invocations.
  • Added four inline sub-agent definitions (doc-reader, engine-example-counter, tool-engine-classifier, auth-doc-extractor) and recompiled the lockfile.
Show a summary per file
File Description
.github/workflows/claude-code-user-docs-review.md Adds inline sub-agents and rewires phases to use them for extractive tasks.
.github/workflows/claude-code-user-docs-review.lock.yml Recompiled generated lockfile reflecting the workflow markdown changes.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (2)

.github/workflows/claude-code-user-docs-review.md:596

  • This sub-agent is instructed to read docs/src/content/docs/setup/quick-start.md, but the repo’s quick start is docs/src/content/docs/setup/quick-start.mdx. As written, the agent will fail to read the intended file.
Read `docs/src/content/docs/setup/quick-start.md` and extract authentication details for:
- copilot
- claude
- codex
- custom

.github/workflows/claude-code-user-docs-review.md:601

  • Like the other extractive agents, this one is used for factual “JSON output” in the main workflow. Consider tightening the output contract to require ONLY a single valid JSON object (no markdown fences / no additional text) to prevent downstream parsing or copy/paste errors.
Return compact JSON with:
- required_secrets_by_engine
- setup_steps_by_engine
- explicit_warnings_or_scope_notes
- auth_gaps_or_missing_instructions
  • Files reviewed: 2/2 changed files
  • Comments generated: 5

- shared/observability-otlp.md
features:
copilot-requests: true
inline-agents: true
Comment on lines +539 to +543
Read these files:
- README.md
- docs/src/content/docs/setup/quick-start.md
- docs/src/content/docs/introduction/how-they-work.mdx
- docs/src/content/docs/introduction/architecture.mdx
Comment on lines +547 to +553
Return compact JSON with:
- engines_mentioned
- copilot_dependencies
- claude_or_codex_mentions
- prerequisites
- missing_setup_pieces_for_claude_users
- notable_quotes_with_file_refs
Comment on lines +560 to +565
Scan `.github/workflows/*.md` and count occurrences of:
- `engine: claude`
- `engine: copilot`
- `engine: codex`
- `engine: custom`

- codex-only
- unclear

Return a compact markdown table and JSON summary with counts by class and any ambiguous entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[subagent-optimizer] Optimize Claude Code User Documentation Review — 2026-05-10

3 participants