Type: AFK
Parent
docs/issues/pr-review-doc-context-spawn-reliability/PRD.md
What to build
Rewrite step 4a in commands/review-pr.md to fix the three defects that cause the Doc Context phase to be silently skipped:
- Initialise
DOC_CONTEXT='' unconditionally as the first statement in step 4a.
- Pre-fetch linked work item IDs in bash. If the
value array is empty or the command fails, leave DOC_CONTEXT='' and proceed.
- If work items are found: wait for the diff from step 5, resolve
CONFLUENCE_CLIENT_PATH from ${CLAUDE_PLUGIN_ROOT} in bash, then spawn the Doc Context Orchestrator agent via an explicit Agent(subagent_type: "pr-review:doc-context-orchestrator", ...) call with all required context. Store the agent's plain-text output as DOC_CONTEXT.
- Update the parallelism note: step 4a pre-fetch runs in parallel with steps 5–7; the orchestrator agent spawn waits for the diff from step 5; step 8 waits for the orchestrator to complete.
Also update docs/plans/README.md to add spec 11 to the status table, and add a Fixed entry under [Unreleased] in CHANGELOG.md describing the three defects and the orchestrator extraction.
Acceptance criteria
Blocked by
Agent Brief
This was generated by AI during triage.
Category: bug
Summary: Fix step 4a in review-pr command — initialise DOC_CONTEXT, add explicit Agent() spawn, resolve absolute path
Current behavior:
Step 4a has three defects that cause the Doc Context phase to be silently skipped on every run:
- No
DOC_CONTEXT='' initialisation — the variable is undefined when the phase is skipped
- No explicit
Agent() spawn call — the orchestrator satisfies intent inline and proceeds without spawning anything
confluence-client.mjs is referenced with a relative path that fails when the working directory is the reviewed project's root
Desired behavior:
Step 4a in the review-pr command is rewritten so that:
DOC_CONTEXT='' is the first statement
- If no work items are linked, the step exits silently with
DOC_CONTEXT=''
- If work items are found, an explicit
Agent(subagent_type: "pr-review:doc-context-orchestrator", ...) call is made — never satisfied inline — with all required context: ORG_URL, PR_ID, work item IDs, CONFLUENCE_CLIENT_PATH (absolute string from ${CLAUDE_PLUGIN_ROOT}), changed files list, and diff
- The agent's plain-text output is stored as
DOC_CONTEXT
- The parallelism note reflects the correct sequencing: pre-fetch runs in parallel with steps 5–7; orchestrator spawn waits for the diff; step 8 waits for the orchestrator
docs/plans/README.md includes spec 11 in the status table. CHANGELOG.md has a Fixed entry under [Unreleased] covering the three defects.
Key interfaces:
review-pr command step 4a — the Agent() call must name subagent_type: "pr-review:doc-context-orchestrator" explicitly
CONFLUENCE_CLIENT_PATH — resolved as "${CLAUDE_PLUGIN_ROOT}/scripts/confluence-client.mjs" in bash before the spawn
DOC_CONTEXT — string; empty when no work items are found, plain markdown block otherwise
Acceptance criteria:
Out of scope:
- The agent file implementations (issues 01 and 02)
- Changes to
confluence-client.mjs or its tests
- Thread posting, re-review logic, or Bot Signature
- GitHub PR support, caching, or Jira sources
PRD: docs/issues/pr-review-doc-context-spawn-reliability/PRD.md
Migrated from: docs/issues/pr-review-doc-context-spawn-reliability/03-wire-up-and-housekeeping.md (source removed after migration)
Touched by PRs: #23, #25
Type: AFK
Parent
docs/issues/pr-review-doc-context-spawn-reliability/PRD.mdWhat to build
Rewrite step 4a in
commands/review-pr.mdto fix the three defects that cause the Doc Context phase to be silently skipped:DOC_CONTEXT=''unconditionally as the first statement in step 4a.valuearray is empty or the command fails, leaveDOC_CONTEXT=''and proceed.CONFLUENCE_CLIENT_PATHfrom${CLAUDE_PLUGIN_ROOT}in bash, then spawn the Doc Context Orchestrator agent via an explicitAgent(subagent_type: "pr-review:doc-context-orchestrator", ...)call with all required context. Store the agent's plain-text output asDOC_CONTEXT.Also update
docs/plans/README.mdto add spec 11 to the status table, and add aFixedentry under[Unreleased]inCHANGELOG.mddescribing the three defects and the orchestrator extraction.Acceptance criteria
DOC_CONTEXT=''is the first statement in step 4a.Agent(subagent_type: "pr-review:doc-context-orchestrator", ...)call — the intent is not satisfied inline.Agent()call passesORG_URL,PR_ID, work item ID list,CONFLUENCE_CLIENT_PATH(as an absolute string expanded from${CLAUDE_PLUGIN_ROOT}), changed files list, and diff.node scripts/confluence-client.mjsrelative-path call remains in step 4a.docs/plans/README.mdincludes spec 11 in the status table.CHANGELOG.mdhas aFixedentry under[Unreleased]covering the three defects.DOC_CONTEXTis non-empty after a review run; review agents receive the## Business contextpreamble.DOC_CONTEXT=''; step 8 prompts unchanged.Blocked by
Agent Brief
Category: bug
Summary: Fix step 4a in
review-prcommand — initialiseDOC_CONTEXT, add explicit Agent() spawn, resolve absolute pathCurrent behavior:
Step 4a has three defects that cause the Doc Context phase to be silently skipped on every run:
DOC_CONTEXT=''initialisation — the variable is undefined when the phase is skippedAgent()spawn call — the orchestrator satisfies intent inline and proceeds without spawning anythingconfluence-client.mjsis referenced with a relative path that fails when the working directory is the reviewed project's rootDesired behavior:
Step 4a in the
review-prcommand is rewritten so that:DOC_CONTEXT=''is the first statementDOC_CONTEXT=''Agent(subagent_type: "pr-review:doc-context-orchestrator", ...)call is made — never satisfied inline — with all required context:ORG_URL,PR_ID, work item IDs,CONFLUENCE_CLIENT_PATH(absolute string from${CLAUDE_PLUGIN_ROOT}), changed files list, and diffDOC_CONTEXTdocs/plans/README.mdincludes spec 11 in the status table.CHANGELOG.mdhas aFixedentry under[Unreleased]covering the three defects.Key interfaces:
review-prcommand step 4a — theAgent()call must namesubagent_type: "pr-review:doc-context-orchestrator"explicitlyCONFLUENCE_CLIENT_PATH— resolved as"${CLAUDE_PLUGIN_ROOT}/scripts/confluence-client.mjs"in bash before the spawnDOC_CONTEXT— string; empty when no work items are found, plain markdown block otherwiseAcceptance criteria:
DOC_CONTEXT=''is the first statement in step 4aAgent(subagent_type: "pr-review:doc-context-orchestrator", ...)call present — intent not satisfied inlineAgent()call passes all required context variablesnode scripts/confluence-client.mjsrelative-path call remains in step 4adocs/plans/README.mdincludes spec 11CHANGELOG.mdhas aFixedentry under[Unreleased]DOC_CONTEXTnon-empty after a review runDOC_CONTEXT=''Out of scope:
confluence-client.mjsor its testsPRD:
docs/issues/pr-review-doc-context-spawn-reliability/PRD.mdMigrated from:
docs/issues/pr-review-doc-context-spawn-reliability/03-wire-up-and-housekeeping.md(source removed after migration)Touched by PRs: #23, #25