بنقرة واحدة
skill-pr-review-research
Fetch GitHub PR and Zulip thread data for pr-type review tasks. Invoke for pr research tasks.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Fetch GitHub PR and Zulip thread data for pr-type review tasks. Invoke for pr research tasks.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Orchestrate multi-agent implementation with parallel phase execution. Spawns teammates for independent phases and coordinates dependent phases. Includes debugger teammate for error recovery.
Orchestrate multi-agent planning with parallel plan generation. Spawns 2-3 teammates for diverse planning approaches and synthesizes into final plan with trade-off analysis.
Orchestrate multi-agent research with wave-based parallel execution. Spawns 2-4 teammates for diverse investigation angles and synthesizes findings.
Full structural hard-mode orchestration state machine with per-phase dispatch (H1), adversarial verification (H4), convergence policing (H6), territory contracts (H7), and churn detection (H5). Invoke for /orchestrate --hard.
Autonomous state machine that drives a task through its full lifecycle (research -> plan -> implement -> complete) without user confirmation between phases. Invoke for /orchestrate command.
Execute hard-mode implementation with anti-analysis contracts, per-phase dispatch, and territory-aware execution. Invoke for --hard implementation tasks.
| name | skill-pr-review-research |
| description | Fetch GitHub PR and Zulip thread data for pr-type review tasks. Invoke for pr research tasks. |
| allowed-tools | Agent, Bash, Edit, Read, Write |
Thin wrapper that validates inputs, extracts the sources array from state.json,
and delegates to pr-review-research-agent to fetch GitHub and Zulip data.
This skill activates when:
/research command targets a pr-type review task/pr --review and has a sources array in state.jsonValidate that:
task_number exists and resolves to an active project in state.jsontask_type is "pr"sources array with at least one entry# Check task exists and get task_type
task_type=$(jq -r --argjson num "$task_number" \
'.active_projects[] | select(.project_number == $num) | .task_type' \
specs/state.json)
if [ "$task_type" != "pr" ]; then
echo "Error: Task $task_number has type '$task_type', not 'pr'. skill-pr-review-research only handles pr tasks."
exit 1
fi
# Check sources array is present and non-empty
sources_count=$(jq --argjson num "$task_number" \
'.active_projects[] | select(.project_number == $num) | .sources // [] | length' \
specs/state.json)
if [ "$sources_count" -eq 0 ]; then
echo "Error: Task $task_number has no sources. Tasks created by /pr --review populate sources in state.json."
exit 1
fi
Update status to "researching" BEFORE invoking subagent:
bash .claude/scripts/update-task-status.sh preflight "$task_number" research "$session_id"
touch "specs/{NNN}_{SLUG}/.postflight-pending"
Read next_artifact_number from state.json with reconciliation pattern. Use this for
naming the report file (zero-padded to 2 digits, e.g., 01).
artifact_number=$(jq -r --argjson num "$task_number" \
'.active_projects[] | select(.project_number == $num) | .next_artifact_number // 1' \
specs/state.json)
artifact_number_padded=$(printf "%02d" "$artifact_number")
Build the delegation JSON with PR-specific fields:
{
"session_id": "{session_id}",
"delegation_depth": 1,
"delegation_path": ["orchestrator", "research", "skill-pr-review-research"],
"timeout": 3600,
"task_context": {
"task_number": N,
"task_name": "{project_name}",
"description": "{description}",
"task_type": "pr"
},
"sources": [
{
"type": "github_pr",
"url": "https://github.com/owner/repo/pull/123",
"parsed": {
"owner": "owner",
"repo": "repo",
"pr_number": 123
}
}
],
"artifact_number": "01",
"focus_prompt": "{optional focus, or null}",
"metadata_file_path": "specs/{NNN}_{SLUG}/.return-meta.json"
}
Extract sources from state.json:
sources=$(jq -c --argjson num "$task_number" \
'.active_projects[] | select(.project_number == $num) | .sources // []' \
specs/state.json)
Note: Use jq -c (compact output) for inline JSON in delegation context.
Use the safe select(.project_number == $num) pattern (not !=) per jq-escaping-workarounds.md.
If --clean flag is NOT set, retrieve relevant memories:
memory_context=$(bash .claude/scripts/memory-retrieve.sh "pr review github zulip research" 2>/dev/null || echo "")
Include memory_context in the delegation context if non-empty.
Use the Agent tool with:
subagent_type: "pr-review-research-agent"The subagent will:
.return-meta.jsonspecs/{NNN}_{SLUG}/reports/{NN}_pr-review-research.md.return-meta.jsonCRITICAL: If you performed the work above WITHOUT using the Agent tool (i.e., you read files,
wrote artifacts, or updated metadata directly instead of spawning a subagent), you MUST write a
.return-meta.json file now before proceeding to postflight. Use the schema from
return-metadata-file.md with status: "researched" and include the report artifact.
If you DID use the Agent tool, skip this stage -- the subagent already wrote the metadata.
The following stages MUST execute after work is complete, whether the work was done by a subagent or inline (Stage 5b). Do NOT skip these stages for any reason.
Read the metadata file:
cat "specs/{NNN}_{SLUG}/.return-meta.json"
Check status field:
"researched" -> success, proceed normally"partial" -> partial success, note in status update"failed" -> failure, update status accordinglyreport_path="specs/{NNN}_{SLUG}/reports/{NN}_pr-review-research.md"
if [ -f "$report_path" ] && [ -s "$report_path" ]; then
echo "Report artifact validated: $report_path"
else
echo "Warning: Report artifact missing or empty at $report_path"
fi
bash .claude/scripts/update-task-status.sh postflight "$task_number" research "$session_id"
If .return-meta.json contains memory_candidates array with entries, pass them to the
memory vault:
# Extract and process memory candidates from subagent metadata
memory_candidates=$(jq -c '.memory_candidates // []' "specs/{NNN}_{SLUG}/.return-meta.json")
if [ "$memory_candidates" != "[]" ]; then
# Log candidates for /learn --task N to harvest later
echo "Memory candidates available: $memory_candidates"
fi
Add the research report artifact to state.json and regenerate TODO.md:
# Link report artifact
report_path="specs/{NNN}_{SLUG}/reports/{NN}_pr-review-research.md"
report_summary=$(jq -r '.artifacts[0].summary // "PR review research report"' \
"specs/{NNN}_{SLUG}/.return-meta.json")
# Update state.json with artifact
jq --argjson num "$task_number" \
--arg path "$report_path" \
--arg summary "$report_summary" \
'.active_projects |= map(if .project_number == $num then
. + {"artifacts": ((.artifacts // []) + [{"type": "report", "path": $path, "summary": $summary}]),
"next_artifact_number": ((.next_artifact_number // 1) + 1)}
else . end)' \
specs/state.json > /tmp/state.tmp && mv /tmp/state.tmp specs/state.json
# Regenerate TODO.md
bash .claude/scripts/generate-todo.sh
bash .claude/scripts/lifecycle-notify.sh "research" "$task_number" "researched" 2>/dev/null || true
rm -f "specs/{NNN}_{SLUG}/.postflight-pending"
rm -f "specs/{NNN}_{SLUG}/.return-meta.json"
Return 3-6 bullet points summarizing:
Do NOT return JSON.
Brief text summary (NOT JSON).