---
description: Research within task constraints or open exploration
argument-hint: "[topic or task-id]"
agent: oracle
---

# Research: $ARGUMENTS

## For Open-Ended Research

1. Define research scope
2. Use tools: GKG, Context7, Exa, web search
3. Summarize findings
4. Save to `.opencode/memory/research/YYYY-MM-DD-topic.md` if significant

## For Task-Constrained Research

1. **Check task:** `backlog_task_view({ id: "$ARGUMENTS" })`
2. **If not found:** STOP. Create with `/task-with-spec` first.
3. **Load boundaries from:**
   - `@backlog/tasks/$ARGUMENTS/prd.md` - Goal, Scope
   - `@backlog/tasks/$ARGUMENTS/spec.md` - Constraints, Edge Cases

## Research Sources (In Order)

1. **Internal (GKG)** - Existing codebase patterns
2. **Framework (Context7)** - Library docs for spec-allowed libs only
3. **Examples (Exa)** - GitHub examples matching goal
4. **Memory** - Check `.opencode/memory/research/` for prior work

## Filter Findings

For each finding ask:

- Within PRD scope?
- Follows spec constraints?
- Uses allowed libraries?

**If NO:** Discard.

## Output

Save to `.opencode/memory/research/YYYY-MM-DD-$ARGUMENTS.md`:

- Findings within scope
- Recommended implementation
- Edge case handling
- References

**Next:** `/research-and-implement $ARGUMENTS`
