shape-research
Research codebase comprehensively using parallel sub-agents
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Research codebase comprehensively using parallel sub-agents
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Self-evaluation loop for the treadmill Claude plugins pack. Runs cursor-plugin-evals against bundled skills, tracks quality over time, and escalates recurring failures via PAMS. Use periodically or before publishing plugin updates.
Autonomously implement technical plans from context/changes/<change-id>/plan.md under Codex's /goal — no human interaction at any point. Sibling of /shape-implement for unattended runs, in an interactive /goal session or headless via Codex -p. Flips the plan's Automated Progress rows, verifies each phase through an automatic quality-gate stack (plan success criteria, deliberate-break check, full suite), commits each phase on green with Conventional Commits, and surfaces pending Manual rows as a closing human checklist. Use when the user wants autonomous or unattended plan execution, pairs /goal with a plan, asks to "run the plan under /goal", or needs headless implementation.
Review implementation against plan for drift, dangerous decisions, and pattern compliance
Implement technical plans from context/changes/<change-id>/plan.md with verification
Review implementation plans for substance, feasibility, and architectural fitness. Use when user asks to review a plan, says "is this plan good", "check my plan", "review this plan", mentions plan review, or references a plan file and asks for feedback. Also trigger when user finishes /shape-plan and wants validation before starting /shape-implement.
Drive an approved implementation plan to completion phase by phase, test-first, through the red→green→refactor cycle, but only for phases whose implementation does not exist yet. Reads a plan from context/changes/<change-id>/plan.md and the canonical Progress section, and for each phase first checks whether the phase is TDD'able and still unimplemented — if it is, you write a failing test (RED), make it pass with the minimal code (GREEN), then clean up (REFACTOR); if it is not TDD'able, you redirect that phase to /shape-implement; if implementation is already present, you stop and explain that TDD does not work for already existing code, then suggest /shape-implement for that phase. Mirrors /shape-implement (same plan, same Progress source of truth, same phase-end commit ritual and clipboard handoffs) but flips the order so the failing test always comes before the code. Assumes test infrastructure is already in place — it does NOT set up runners, configs, fixtures, or CI. Use this skill when the user says "td
| name | shape-research |
| description | Research codebase comprehensively using parallel sub-agents |
| allowed-tools | ["Read","Glob","Grep","Bash","Task","Write","AskUserQuestion","TaskCreate","TaskUpdate","TaskList","TaskGet"] |
You are tasked with conducting comprehensive research across the codebase to answer user questions by spawning parallel sub-agents and synthesizing their findings.
When this command is invoked, respond with:
I'm ready to research the codebase. Please provide your research question or area of interest, and I'll analyze it thoroughly by exploring relevant components and connections.
Then wait for the user's research query.
Read any directly mentioned files first:
context/foundation/lessons.md if present and treat its entries as known-pattern priors when shaping the research areas — recurring rules already accepted by the team narrow what's worth re-investigating.Analyze and decompose the research question:
Clarify research scope using AskUserQuestion:
After decomposing the research question, use AskUserQuestion to align on scope and focus before spawning sub-agents.
Rules for structuring questions:
description to each option explaining what it means for the researchheader short (max 12 chars): "Scope", "Depth", "Focus"What to ask about (pick 1-3 based on the query):
Example — for an ambiguous query like "how does authentication work": AskUserQuestion with questions:
context/changes/**/ and context/archive/**/."
multiSelect: trueFor a clear, scoped query like "find all files using the TaskCreate tool":
Spawn parallel sub-agent tasks for comprehensive research:
Use the Task tool with parallel sub-agents:
subagent_type: "Explore") — fast file/pattern search, code structure analysis. Use for finding files, tracing code paths, searching for patterns.subagent_type: "general-purpose") — deep analysis requiring reading many files and multi-step reasoning. Use for understanding complex systems.Spawn 2-4 agents in parallel in a single message for concurrent execution:
context/changes/**/ and context/archive/**/", a general-purpose for "analyze how Z system works"Wait for all sub-agents to complete and synthesize findings:
context/changes/**/ and context/archive/**/ as supplementary historical contextResolve change folder and gather metadata for the research document:
/shape-research <change-id> and context/changes/<change-id>/ exists, use it.change.md (mirroring /shape-new semantics) before writing.context/archive/ — print: "This change is archived. Open a new change with /shape-new instead." and STOP.change.md: set updated: <today> and, only if current status is new, advance to status: preparing.context/changes/<change-id>/research.md (single artifact per change).Generate research document:
Use the metadata gathered in step 5
Structure the document with YAML frontmatter followed by content:
---
date: [Current date and time with timezone in ISO format]
researcher: [Researcher name]
git_commit: [Current commit hash]
branch: [Current branch name]
repository: [Repository name]
topic: "[User's Question/Topic]"
tags: [research, codebase, relevant-component-names]
status: complete
last_updated: [Current date in YYYY-MM-DD format]
last_updated_by: [Researcher name]
---
# Research: [User's Question/Topic]
**Date**: [Current date and time with timezone from step 5]
**Researcher**: [Researcher name]
**Git Commit**: [Current commit hash from step 5]
**Branch**: [Current branch name from step 5]
**Repository**: [Repository name]
## Research Question
[Original user query]
## Summary
[High-level findings answering the user's question]
## Detailed Findings
### [Component/Area 1]
- Finding with reference ([file.ext:line](link))
- Connection to other components
- Implementation details
### [Component/Area 2]
...
## Code References
- `path/to/file.py:123` - Description of what's there
- `another/file.ts:45-67` - Description of the code block
## Architecture Insights
[Patterns, conventions, and design decisions discovered]
## Historical Context (from prior changes)
[Relevant insights from `context/changes/**/` and `context/archive/**/` with references]
- `context/changes/<other-change>/plan.md` - Historical decision about X
- `context/archive/YYYY-MM-DD-<other-change>/research.md` - Past exploration of Y
## Related Research
[Links to other research artifacts under `context/changes/**/research.md` or `context/archive/**/research.md`]
## Open Questions
[Any areas that need further investigation]
Add GitHub permalinks (if applicable):
git branch --show-current and git statusgh repo view --json owner,namehttps://github.com/{owner}/{repo}/blob/{commit}/{file}#L{line}Sync and present findings:
Handle follow-up questions:
last_updated and last_updated_by to reflect the updatelast_updated_note: "Added follow-up research for [brief description]" to frontmatter## Follow-up Research [timestamp]context/changes/**/ and context/archive/**/ as supplementary historical context