Skip to content

feat(docs-tools): fan out subagents per requirement#135

Merged
aireilly merged 14 commits intomainfrom
feat/fanout-subagents-per-requirement
Apr 30, 2026
Merged

feat(docs-tools): fan out subagents per requirement#135
aireilly merged 14 commits intomainfrom
feat/fanout-subagents-per-requirement

Conversation

@aireilly
Copy link
Copy Markdown
Member

@aireilly aireilly commented Apr 29, 2026

Summary

  • Restructure scope-req-audit and requirements workflow steps to dispatch one subagent per requirement instead of processing all requirements in a single context window
  • Prevents context degradation when analyzing tickets with 10+ requirements — classification/analysis quality stays consistent regardless of requirement count
  • Output contracts unchanged — downstream steps (planning, orchestrator) see no difference

Phase 1: scope-req-audit fanout

  • New agents/evidence-classifier.md — per-requirement code evidence classifier (haiku, maxTurns: 5)
  • Rewritten skills/docs-workflow-scope-req-audit/SKILL.md — parse → discover repos → warm index → fan out one agent per REQ → merge → write
  • Removed prompts/gap-classification.md — logic embedded in agent definition

Phase 2: requirements two-pass fanout

  • New agents/requirements-discoverer.md — lightweight pass-1 discovery (JIRA traversal, PR listing, spec identification → JSON skeleton)
  • Modified agents/requirements-analyst.md — scoped down from "all requirements" to "one requirement deep analysis" (returns JSON, maxTurns: 15)
  • Rewritten skills/docs-workflow-requirements/SKILL.md — discovery → parse skeleton → fan out analyst per REQ → merge → assemble requirements.md

Version

  • plugin.json bumped to 0.0.57

Test plan

  • Run scope-req-audit on a ticket with 5+ requirements against a source repo — verify evidence-status.json has per-requirement classifications
  • Run requirements on a multi-source JIRA ticket — verify requirements.md has REQ-NNN format with full details
  • Verify discovery.json is written and parseable
  • Verify step-result.json schema unchanged for both steps
  • Run the full docs-workflow-code-evidence pipeline end-to-end — verify planning step consumes evidence-status.json correctly
  • Test error isolation: simulate a single-requirement failure and verify other requirements still process

Closes #116

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added evidence-classifier and requirements-discoverer agent specs.
  • Updates

    • Refactored requirements-analyst into a single-requirement deep-analysis flow with strict JSON I/O, metadata changes, and higher turn limits.
    • Updated skills to a parallel two-pass workflow (discover → analyze), warm index initialization, per-requirement fan-out, and merge with error/fallback handling; removed batch query artifact.
  • Chores

    • Bumped plugin manifest version to 0.0.57.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a multi-agent fan-out architecture to docs-tools: two new agents (requirements-discoverer, evidence-classifier), refactors requirements-analyst to single-requirement JSON output, updates two skills to discovery → parallel-agent → merge flows (including step-result.json handling), and bumps plugin manifest version to 0.0.57.

Changes

Cohort / File(s) Summary
Plugin Manifest
plugins/docs-tools/.claude-plugin/plugin.json
Bumped version from 0.0.550.0.57.
New Agents
plugins/docs-tools/agents/evidence-classifier.md, plugins/docs-tools/agents/requirements-discoverer.md
Adds evidence-classifier (code-finder invocation, grounded/partial/absent classification, gap categorization, strict single-JSON stdout contract) and requirements-discoverer (JIRA/Git traversal, discovery of PR/Doc sources, emit structured requirements JSON or minimal error JSON).
Refactored Agent
plugins/docs-tools/agents/requirements-analyst.md
Reworks requirements-analyst into a single-requirement deep-analysis flow with web fetch/search steps, strict single-JSON stdout contract, updated metadata (maxTurns: 25) and narrowed output schema.
Updated Skills
plugins/docs-tools/skills/docs-workflow-requirements/SKILL.md, plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md
Switches skills from single-pass to two-pass fan-out/merge orchestration: discovery → per-requirement parallel agents (requirements-analyst or evidence-classifier) → orchestrated merge with fallback/error entries; updates artifacts (retain discovery.json, add step-result.json), index-warm/parallelization semantics, and error-isolation rules.

Sequence Diagram(s)

sequenceDiagram
    participant Orchestrator as Orchestrator
    participant Discover as requirements-discoverer
    participant Analyst as requirements-analyst
    participant Classifier as evidence-classifier
    participant CodeFinder as Code-Finder
    participant JIRA as JIRA/Git/Docs

    Orchestrator->>Discover: request discovery (ticket key / context)
    Discover->>JIRA: fetch ticket + graph traversal
    JIRA-->>Discover: discovered requirements + PR/Doc URLs
    Orchestrator->>Analyst: dispatch per-requirement (parallel)
    Orchestrator->>Classifier: dispatch per-requirement (parallel)
    Analyst->>JIRA: fetch referenced docs / PR diffs / web fetch
    Classifier->>CodeFinder: run code-finder search (repo/query/limit)
    CodeFinder-->>Classifier: ranked results + scores
    Analyst-->>Orchestrator: JSON result (per requirement)
    Classifier-->>Orchestrator: JSON result (status: grounded/partial/absent)
    Orchestrator->>Orchestrator: merge results, apply fallbacks, write `requirements.md` + `step-result.json`
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Skill And Script Conventions ❌ Error The PR uses qualified agent names with unnecessary docs-tools: prefix in subagent_type references, violating the bare name convention since no other plugins define these agents. Remove the docs-tools: prefix from all three subagent_type references: change docs-tools:evidence-classifier to evidence-classifier, docs-tools:requirements-discoverer to requirements-discoverer, and docs-tools:requirements-analyst to requirements-analyst.
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring workflow steps to fan out subagents per requirement instead of batch processing.
Linked Issues check ✅ Passed The PR implements all objectives from #116: fans out subagents per requirement with isolated processing, improves analysis reliability, and preserves downstream compatibility.
Out of Scope Changes check ✅ Passed All changes directly support the fan-out architecture objective: new agent specs, skill refactors, version bump, and removal of legacy prompt file are all in scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
No Real People Names In Style References ✅ Passed Thorough search of all modified files found no references to real people's names used as style references or writing guidance.
Git Safety Rules ✅ Passed No git commands or hardcoded remotes found in PR files; changes contain only agent specifications and skill documentation in markdown and JSON formats.
No Untrusted Mcp Servers ✅ Passed Pull request contains no MCP server installations, npm packages, npx commands, or external dependencies.
Plugin Registry Consistency ✅ Passed Marketplace.json structure correctly maintains plugin metadata separately from versions; docs-tools plugin properly registered with matching name and description. New agents (evidence-classifier, requirements-discoverer) and modified agent (requirements-analyst) are specialized, non-overlapping subagents for docs-tools workflow orchestration with no conflicts in repository.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fanout-subagents-per-requirement

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md (1)

111-124: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Make requirement parsing resilient to the actual requirements.md shape.

The parser contract here is too strict and no longer matches the format documented in plugins/docs-tools/skills/docs-workflow-requirements/SKILL.md (REQ headings shown as #### REQ-NNN and summary as - **Summary**: ...). This can trigger false “No requirements found” failures.

Suggested parser-contract update
-Read `$REQUIREMENTS_FILE` and extract each requirement. The requirements-analyst produces requirements in this pattern:
+Read `$REQUIREMENTS_FILE` and extract each requirement using a heading-level-agnostic pattern. The assembled requirements.md contains entries in this shape:

 ```text
-### REQ-NNN: [title]
+#### REQ-NNN: [title]

-**Summary**: [description]
+- **Summary**: [description]

For each requirement, extract:

  • id — the REQ-NNN identifier
  • title — the requirement title
  • summary — the summary text

-If no requirements are found matching this pattern, STOP with error: "No requirements found in requirements.md. Expected REQ-NNN pattern."
+If no requirements are found matching ^#{3,6}\s+REQ-\d+:\s+, STOP with error: "No requirements found in requirements.md. Expected REQ-NNN heading pattern."

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md around
lines 111 - 124, Update the requirements parser to be resilient to heading
levels and minor formatting differences: change the strict pattern that looks
for "### REQ-NNN: [title]" and "Summary: [description]" (referenced near
$REQUIREMENTS_FILE) to a more flexible regex that matches headings with 3–6
hashes and numeric IDs (for example use pattern '^#{3,6}\s+REQ-\d+:\s+' to
detect requirement headings) and accept an optional space before "Summary"
(e.g., '- Summary: ...'); also update the STOP error string from "No
requirements found in requirements.md. Expected REQ-NNN pattern." to "No
requirements found in requirements.md. Expected REQ-NNN heading pattern." so
failures reflect the relaxed match.


</details>

</blockquote></details>
<details>
<summary>plugins/docs-tools/skills/docs-workflow-requirements/SKILL.md (1)</summary><blockquote>

`33-271`: _🛠️ Refactor suggestion_ | _🟠 Major_ | _🏗️ Heavy lift_

**Move procedural orchestration from SKILL.md into `scripts/` for this step.**

This file now embeds substantial operational logic (arg parsing, validation, dispatch, merge, output assembly). Please shift executable procedure into `skills/docs-workflow-requirements/scripts/` and keep SKILL.md as dispatch + contract + verification only.

 

As per coding guidelines: "Skill logic must defer procedural logic (argument parsing, mode determination, input validation, path computation, directory creation) to a script under skills/<skill-name>/scripts/. The SKILL.md should only contain frontmatter, instructions, domain knowledge, dispatch instructions, and verification."

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @plugins/docs-tools/skills/docs-workflow-requirements/SKILL.md around lines
33 - 271, SKILL.md currently contains procedural orchestration (argument
parsing, validation, dispatch, merging, and file I/O) that should be moved into
an executable script; extract all operational logic from SKILL.md and implement
it as a script under skills/docs-workflow-requirements/scripts/ (e.g., a single
entrypoint script that performs: parse args (--base-path, --pr, ticket id),
create OUTPUT_DIR, run the discovery agent and validate DISCOVERY_FILE, fan out
requirements-analyst calls in one message, parse/merge agent results into the
required merged structure, assemble OUTPUT_FILE (requirements.md) using the
exact document contract, run parse_title.py and write step-result.json, and
verify outputs); leave SKILL.md only with dispatch instructions, agent prompts,
input/output contract, and verification steps, and update SKILL.md to reference
the new script for the procedural execution.


</details>

</blockquote></details>

</blockquote></details>
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/docs-tools/skills/docs-workflow-requirements/SKILL.md`:
- Line 50: Two fenced code blocks containing the YAML snippets that start with
"Agent:" and include "subagent_type: docs-tools:requirements-discoverer" and
"subagent_type: docs-tools:requirements-analyst" are currently unlabeled and
trigger MD040; update each opening fence from ``` to ```yaml so both blocks are
explicitly marked as YAML (leave the inner content and closing fences
unchanged).

In `@plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md`:
- Line 158: The markdown fenced code block around the "Agent:" YAML example in
SKILL.md is missing a language tag (triggering MD040); update the opening fence
to ```yaml so the block is explicitly YAML (e.g., change ``` to ```yaml for the
block containing "Agent:", "subagent_type", and "model") to satisfy the linter.

---

Outside diff comments:
In `@plugins/docs-tools/skills/docs-workflow-requirements/SKILL.md`:
- Around line 33-271: SKILL.md currently contains procedural orchestration
(argument parsing, validation, dispatch, merging, and file I/O) that should be
moved into an executable script; extract all operational logic from SKILL.md and
implement it as a script under skills/docs-workflow-requirements/scripts/ (e.g.,
a single entrypoint script that performs: parse args (--base-path, --pr, ticket
id), create OUTPUT_DIR, run the discovery agent and validate DISCOVERY_FILE, fan
out requirements-analyst calls in one message, parse/merge agent results into
the required merged structure, assemble OUTPUT_FILE (requirements.md) using the
exact document contract, run parse_title.py and write step-result.json, and
verify outputs); leave SKILL.md only with dispatch instructions, agent prompts,
input/output contract, and verification steps, and update SKILL.md to reference
the new script for the procedural execution.

In `@plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md`:
- Around line 111-124: Update the requirements parser to be resilient to heading
levels and minor formatting differences: change the strict pattern that looks
for "### REQ-NNN: [title]" and "**Summary**: [description]" (referenced near
$REQUIREMENTS_FILE) to a more flexible regex that matches headings with 3–6
hashes and numeric IDs (for example use pattern '^#{3,6}\s+REQ-\d+:\s+' to
detect requirement headings) and accept an optional space before "**Summary**"
(e.g., '- **Summary**: ...'); also update the STOP error string from "No
requirements found in requirements.md. Expected REQ-NNN pattern." to "No
requirements found in requirements.md. Expected REQ-NNN heading pattern." so
failures reflect the relaxed match.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e4d6d6cd-d61d-4b24-9629-3237f5b69138

📥 Commits

Reviewing files that changed from the base of the PR and between bd7447b and eff345b.

📒 Files selected for processing (7)
  • plugins/docs-tools/.claude-plugin/plugin.json
  • plugins/docs-tools/agents/evidence-classifier.md
  • plugins/docs-tools/agents/requirements-analyst.md
  • plugins/docs-tools/agents/requirements-discoverer.md
  • plugins/docs-tools/skills/docs-workflow-requirements/SKILL.md
  • plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md
  • plugins/docs-tools/skills/docs-workflow-scope-req-audit/prompts/gap-classification.md
💤 Files with no reviewable changes (1)
  • plugins/docs-tools/skills/docs-workflow-scope-req-audit/prompts/gap-classification.md

Comment thread plugins/docs-tools/skills/docs-workflow-requirements/SKILL.md
Comment thread plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
plugins/docs-tools/agents/requirements-analyst.md (1)

5-5: ⚡ Quick win

Standardize skill references to fully qualified names in this agent doc.

This file uses bare skill names in frontmatter and inline instructions (jira-reader, git-pr-reader, docs-convert-gdoc-md). Please align to one canonical convention for agents and use fully qualified plugin:skill names consistently to avoid ambiguous invocation behavior.

Suggested edit
-skills: jira-reader, git-pr-reader, article-extractor, redhat-docs-toc, docs-convert-gdoc-md
+skills: docs-tools:jira-reader, docs-tools:git-pr-reader, docs-tools:article-extractor, docs-tools:redhat-docs-toc, docs-tools:docs-convert-gdoc-md
-Use the `docs-convert-gdoc-md` skill for Google Docs. For other specs, use WebFetch.
+Use the `docs-tools:docs-convert-gdoc-md` skill for Google Docs. For other specs, use WebFetch.

Based on learnings: “Always use fully qualified plugin:skill names … in agent instructions, Skill invocations, inline text references, and cross-references between skills.”

Also applies to: 56-56

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/docs-tools/agents/requirements-analyst.md` at line 5, Frontmatter and
inline references use bare skill names (jira-reader, git-pr-reader,
article-extractor, redhat-docs-toc, docs-convert-gdoc-md) which must be replaced
with fully qualified plugin:skill names; update the frontmatter skills line and
every inline mention (including the occurrence around line 56) to the canonical
form (e.g., plugin-name:jira-reader, plugin-name:git-pr-reader,
plugin-name:article-extractor, plugin-name:redhat-docs-toc,
plugin-name:docs-convert-gdoc-md) so all agent instructions, Skill invocations,
and cross-references consistently use the fully qualified names.
plugins/docs-tools/agents/evidence-classifier.md (2)

114-116: 💤 Low value

Minor: Clarify key_files ordering after deduplication.

Line 116 specifies "file paths from the top 3 results (deduplicated)" but doesn't indicate whether the deduplicated list should preserve rank order. Consider adding brief clarification:

-- `key_files`: file paths from the top 3 results (deduplicated)
+- `key_files`: file paths from the top 3 results (deduplicated, preserving rank order)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/docs-tools/agents/evidence-classifier.md` around lines 114 - 116,
Clarify that the "key_files" field should preserve the original ranking: after
deduplicating file paths from the top results, keep them in the same order they
appeared in the ranked results and then take up to the first three unique paths
(i.e., deduplicate while preserving rank, not sorting alphabetically), so update
the description for the key_files definition accordingly.

10-12: 💤 Low value

Consider rewording to reduce repetition.

Three consecutive sentences begin with "You," which affects readability. Consider restructuring:

♻️ Suggested refactor
-You are a code evidence classifier. You receive a single documentation requirement and determine whether the described feature is implemented in the source repository by running a code search and applying score thresholds.
+You are a code evidence classifier. Receive a single documentation requirement and determine whether the described feature is implemented in the source repository by running a code search and applying score thresholds.

-You produce exactly one JSON object on stdout — no markdown, no commentary, no explanation.
+Produce exactly one JSON object on stdout — no markdown, no commentary, no explanation.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/docs-tools/agents/evidence-classifier.md` around lines 10 - 12, The
three opening sentences ("You are a code evidence classifier.", "You receive a
single documentation requirement...", "You produce exactly one JSON object...")
are repetitive; rewrite them into a single, concise lead that combines role,
input, and output constraints (for example: "As a code evidence classifier, take
one documentation requirement as input, search the repo, and output exactly one
JSON object on stdout — no markdown or commentary."). Update the text containing
the exact phrases "You are a code evidence classifier.", "You receive a single
documentation requirement", and "You produce exactly one JSON object on stdout"
to the new combined sentence and ensure punctuation/constraints are preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/docs-tools/agents/evidence-classifier.md`:
- Around line 76-80: Clarify the ambiguous classification rules in
evidence-classifier.md by explicitly defining precedence and the edge case:
state that Grounded is evaluated first (requires top hit scores.combined >=
grounded threshold AND at least 2 results with scores > absent threshold), and
if the top hit >= grounded but fewer than 2 results exceed the absent threshold
classify as Partial; also reword the Partial rule to explicitly cover "top hit
between absent and grounded OR top hit >= grounded but fewer than 2 results
above absent" and keep Absent as currently written.

---

Nitpick comments:
In `@plugins/docs-tools/agents/evidence-classifier.md`:
- Around line 114-116: Clarify that the "key_files" field should preserve the
original ranking: after deduplicating file paths from the top results, keep them
in the same order they appeared in the ranked results and then take up to the
first three unique paths (i.e., deduplicate while preserving rank, not sorting
alphabetically), so update the description for the key_files definition
accordingly.
- Around line 10-12: The three opening sentences ("You are a code evidence
classifier.", "You receive a single documentation requirement...", "You produce
exactly one JSON object...") are repetitive; rewrite them into a single, concise
lead that combines role, input, and output constraints (for example: "As a code
evidence classifier, take one documentation requirement as input, search the
repo, and output exactly one JSON object on stdout — no markdown or
commentary."). Update the text containing the exact phrases "You are a code
evidence classifier.", "You receive a single documentation requirement", and
"You produce exactly one JSON object on stdout" to the new combined sentence and
ensure punctuation/constraints are preserved.

In `@plugins/docs-tools/agents/requirements-analyst.md`:
- Line 5: Frontmatter and inline references use bare skill names (jira-reader,
git-pr-reader, article-extractor, redhat-docs-toc, docs-convert-gdoc-md) which
must be replaced with fully qualified plugin:skill names; update the frontmatter
skills line and every inline mention (including the occurrence around line 56)
to the canonical form (e.g., plugin-name:jira-reader, plugin-name:git-pr-reader,
plugin-name:article-extractor, plugin-name:redhat-docs-toc,
plugin-name:docs-convert-gdoc-md) so all agent instructions, Skill invocations,
and cross-references consistently use the fully qualified names.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9986819c-5007-4478-b3ad-df3a3df966f7

📥 Commits

Reviewing files that changed from the base of the PR and between eff345b and d125623.

📒 Files selected for processing (2)
  • plugins/docs-tools/agents/evidence-classifier.md
  • plugins/docs-tools/agents/requirements-analyst.md

Comment thread plugins/docs-tools/agents/evidence-classifier.md Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/docs-tools/agents/requirements-analyst.md`:
- Around line 22-25: The hard-fail rule that demands successful access to
JIRA/Git should be made source-aware: change the logic that unconditionally
requires JIRA/Git access to first inspect the requirement object’s sources list
and only attempt/require access for systems actually listed (i.e., check for
"jira" and/or "git" in requirement.sources); if a listed source fails access,
then return the error result, otherwise do not fail for missing/unlisted
systems. Apply the same conditional-source check to the other occurrences of
this rule in the file (the block referenced around lines 39-64) so spec-only or
JIRA-only requirements aren’t erroneously hard-failed.

In `@plugins/docs-tools/agents/requirements-discoverer.md`:
- Around line 99-104: The related_tickets contract is inconsistent between
per-ticket "relation" and containerized groups (parent, children, siblings,
linked); fix by normalizing to a single representation: when assembling
related_tickets ensure every ticket object includes the fields key, url, summary
and a relation string (e.g., "parent", "child", "sibling", "linked") and stop
relying on container-only groupings, or if you keep containers, populate the
relation field for each ticket within the containers (update the code that
builds related_tickets to set ticket.relation accordingly and remove ambiguity
between container names and per-ticket relation).
- Around line 22-25: The current access gate in requirements-discoverer mandates
successful Git/JIRA access always; change it so Git access is only required when
a PR/MR URL is present in inputs or auto-discovery (detect via the PR/MR URL
field), while JIRA/spec-derived discovery proceeds even if Git is unavailable;
when skipping Git due to missing PR/MR, do not set the JSON "error" field for
Git failures—only set "error" when a required resource (e.g., a referenced PR/MR
or mandatory JIRA ticket) actually fails to be fetched.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 42d138af-9929-4e91-b05c-e946f5e4460c

📥 Commits

Reviewing files that changed from the base of the PR and between d125623 and 47a0ccf.

📒 Files selected for processing (2)
  • plugins/docs-tools/agents/requirements-analyst.md
  • plugins/docs-tools/agents/requirements-discoverer.md

Comment thread plugins/docs-tools/agents/requirements-analyst.md Outdated
Comment thread plugins/docs-tools/agents/requirements-discoverer.md Outdated
Comment thread plugins/docs-tools/agents/requirements-discoverer.md Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/docs-tools/agents/evidence-classifier.md`:
- Line 5: The configuration in evidence-classifier (the maxTurns setting) is
inconsistent with the PR summary: change the manifest value for maxTurns from 8
to 5 (or update the PR summary if 8 is intended); locate the maxTurns entry in
the evidence-classifier agent definition (the maxTurns key in the
evidence-classifier.md file) and set it to the correct integer (5) so the agent
configuration matches the intended design.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a557b92e-6dae-43b6-b3e0-041bd0149da7

📥 Commits

Reviewing files that changed from the base of the PR and between 47a0ccf and 3b04df5.

📒 Files selected for processing (1)
  • plugins/docs-tools/agents/evidence-classifier.md

Comment thread plugins/docs-tools/agents/evidence-classifier.md
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md`:
- Around line 180-197: The doc now describes a fallback requirement entry that
uses status: "error", which conflicts with the claimed unchanged contract of
only "grounded|partial|absent"; either update the contract to explicitly allow
"error" or change the fallback to preserve the existing contract (set "status":
"absent" and add an optional "error" field for diagnostics), and update the
example JSON and the text that says "unchanged output format" so downstream
parsers expecting only grounded/partial/absent won't break; look for the
fallback example and references to status values (the JSON example block and any
sentences enumerating statuses) and apply the chosen approach consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 25b3b8ba-c966-41d6-8c49-8b253add4533

📥 Commits

Reviewing files that changed from the base of the PR and between 3b04df5 and f7e4da3.

📒 Files selected for processing (1)
  • plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md

Comment thread plugins/docs-tools/skills/docs-workflow-scope-req-audit/SKILL.md Outdated
aireilly added 13 commits April 30, 2026 19:54
…t and requirements steps

Restructure two workflow steps to dispatch one subagent per requirement
instead of processing all requirements in a single context window. This
prevents context degradation when analyzing tickets with many requirements.

Phase 1 — scope-req-audit:
- New evidence-classifier agent for per-requirement code evidence classification
- Skill restructured: parse → discover repos → fan out (parallel) → merge
- Index warming step ensures code-finder index is built once before fanout
- Removed orphaned prompts/gap-classification.md (logic embedded in agent)

Phase 2 — requirements:
- New requirements-discoverer agent for lightweight pass-1 enumeration
- requirements-analyst scoped down to single-requirement deep analysis
- Skill restructured: discovery → parse skeleton → fan out (parallel) → merge → assemble markdown

Output contracts unchanged — evidence-status.json, requirements.md, and
step-result.json formats are identical. Downstream steps see no difference.

Closes #116

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
A complex requirement with JIRA + multiple PRs + spec + web search can
consume 10-12 turns. With retries on failed tool calls, 15 was too tight.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
…at runtime

Restore the prompt file as the single source of truth for gap categories
and recommended actions. The agent now reads it via the Read tool instead
of embedding the logic inline. Bumped maxTurns from 5 to 8 to account
for the additional Read turn.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Per Anthropic docs, the skills: frontmatter injects the full skill
content into the subagent's context at startup. Preloading 5 skills
into agents that run N times in parallel wastes context unnecessarily.

Instead, reference scripts directly via ${CLAUDE_PLUGIN_ROOT} paths
(jira-reader, git-pr-reader, gdoc2md.py are already called this way).
Remove the Skill tool since it's no longer needed.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Replace bash variable syntax ($FIND_EVIDENCE_SCRIPT, $REPO_PATH) with
placeholder syntax (<script>, <repo>) to make it clear these values come
from the prompt's CONFIGURATION block, not from shell environment variables.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Remove the Cursor-specific path affordance for FIND_EVIDENCE_SCRIPT.
Use the standard ${CLAUDE_PLUGIN_ROOT} cross-skill script pattern
consistent with all other agent and skill script references.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Remove script existence check (find_evidence.py ships with the plugin)
and discovery file existence check (just written by our own agent).
Keep input validation at the system boundary (--repo, requirements.md)
and final output verification (step contract).

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
- evidence-classifier: clarify classification precedence (evaluate
  absent first, then grounded, then partial as catch-all). Covers the
  edge case where top hit >= grounded but < 2 supporting results.
- requirements-discoverer: make Git access conditional on PR/MR URLs
  being present. JIRA-only discovery proceeds without Git.
- requirements-discoverer: align related_tickets step 6 description
  with the actual JSON output structure (container groups, not flat
  relation field).

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
code-finder is a documented prerequisite — call find_evidence.py
directly at its canonical ${CLAUDE_PLUGIN_ROOT} path instead of
detecting install method or passing script paths through variables.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
…trator invocations

Add guardrails so the model respects explicit /docs-orchestrator invocations
instead of routing them through docs-workflow-start.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
…--pr, qualify agent names

Three changes:

1. resolve_source.py: single repos now clone into code-repo/<repo_name>/
   instead of flat into code-repo/. Consistent with multi-repo behavior.

2. resolve_source.py: --repo and --pr accept multiple space-delimited
   values (nargs="+"). Multiple --repo values each get cloned into their
   own subdirectory with primary + additional_repos in the result.

3. All workflow step skills: use fully qualified agent names
   (docs-tools:<agent>) in prose, descriptions, and subagent_type fields
   to prevent "agent not found" errors from bare name dispatch.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
…script

The script was clearing the plugin cache but not updating
installed_plugins.json, so Claude Code kept reading the stale version
entry. Now patches the registry after checkout. Also defaults --branch
to the current git branch and --plugin to docs-tools.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
resolve_source.py now queries the JIRA ticket's git_links and
auto-discovered PR URLs when no --repo or --pr is provided. It
groups discovered URLs by repo and selects the primary by reference
count, failing with an actionable error on a tie. This lets the
code-evidence workflow run without explicit --source-code-repo when
the ticket has linked PRs or repo URLs.

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@aireilly aireilly force-pushed the feat/fanout-subagents-per-requirement branch from 23c2034 to 1491aaa Compare April 30, 2026 18:54
… subgroup regex

- requirements-analyst: only require access for systems listed in the
  requirement's sources array instead of unconditionally requiring JIRA/Git
- scope-req-audit: use "status": "absent" (not "error") in fallback entries
  to preserve the grounded|partial|absent downstream contract
- resolve_source: fix GITLAB_REPO_RE to match subgroup paths (org/sub/repo)

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

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@aireilly aireilly merged commit 3eeb290 into main Apr 30, 2026
5 of 6 checks passed
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.

Ensure Requirements Analysis Step fans out subagents per requirements task

1 participant