kata-research-phase
Research how to implement a phase standalone, investigating implementation approaches before planning, or re-researching after planning is complete. Triggers include "research phase", "investigate phase", "how to implement", "research implementation", and "phase research".
What this skill does
<objective>
Research how to implement a phase. Spawns kata-phase-researcher agent with phase context.
**Note:** This is a standalone research command. For most workflows, use `/kata-plan-phase` which integrates research automatically.
**Use this command when:**
- You want to research without planning yet
- You want to re-research after planning is complete
- You need to investigate before deciding if a phase is feasible
**Orchestrator role:** Parse phase, validate against roadmap, check existing research, gather context, spawn researcher agent, present results.
**Why subagent:** Research burns context fast (WebSearch, Context7 queries, source verification). Fresh 200k context for investigation. Main context stays lean for user interaction.
</objective>
<context>
Phase number: $ARGUMENTS (required)
Normalize phase input in step 1 before any directory lookups.
</context>
<process>
## 0. Resolve Model Profile
Read model profile for agent spawning:
```bash
MODEL_PROFILE=$(node "${CLAUDE_PLUGIN_ROOT}/skills/kata-research-phase/scripts/kata-lib.cjs" read-config "model_profile" "balanced")
```
Default to "balanced" if not set.
**Model lookup table:**
| Agent | quality | balanced | budget |
| --------------------- | ------- | -------- | ------ |
| kata-phase-researcher | opus | sonnet | haiku |
Store resolved model for use in Task calls below.
## 1. Normalize and Validate Phase
```bash
# Normalize phase number (8 → 08, but preserve decimals like 2.1 → 02.1)
if [[ "$ARGUMENTS" =~ ^[0-9]+$ ]]; then
PHASE=$(printf "%02d" "$ARGUMENTS")
elif [[ "$ARGUMENTS" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
PHASE=$(printf "%02d.%s" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")
else
PHASE="$ARGUMENTS"
fi
grep -A5 "Phase ${PHASE}:" .planning/ROADMAP.md 2>/dev/null
```
**If not found:** Error and exit. **If found:** Extract phase number, name, description.
## 2. Find Phase Directory and Check Existing Research
```bash
# Universal phase discovery
PADDED=$(printf "%02d" "$PHASE" 2>/dev/null || echo "$PHASE")
PHASE_DIR=""
for state in active pending completed; do
PHASE_DIR=$(find .planning/phases/${state} -maxdepth 1 -type d -name "${PADDED}-*" 2>/dev/null | head -1)
[ -z "$PHASE_DIR" ] && PHASE_DIR=$(find .planning/phases/${state} -maxdepth 1 -type d -name "${PHASE}-*" 2>/dev/null | head -1)
[ -n "$PHASE_DIR" ] && break
done
# Fallback: flat directory (backward compatibility)
if [ -z "$PHASE_DIR" ]; then
PHASE_DIR=$(find .planning/phases -maxdepth 1 -type d -name "${PADDED}-*" 2>/dev/null | head -1)
[ -z "$PHASE_DIR" ] && PHASE_DIR=$(find .planning/phases -maxdepth 1 -type d -name "${PHASE}-*" 2>/dev/null | head -1)
fi
ls ${PHASE_DIR}/RESEARCH.md 2>/dev/null
```
**If exists:** Offer: 1) Update research, 2) View existing, 3) Skip. Wait for response.
**If doesn't exist:** Continue.
## 3. Gather Phase Context
```bash
grep -A20 "Phase ${PHASE}:" .planning/ROADMAP.md
cat .planning/REQUIREMENTS.md 2>/dev/null
cat ${PHASE_DIR}/${PHASE}-CONTEXT.md 2>/dev/null
grep -A30 "### Decisions Made" .planning/STATE.md 2>/dev/null
```
Present summary with phase description, requirements, prior decisions.
## 3.5. Load Phase-Researcher Instructions
Read the phase-researcher agent instructions for inlining into Task() calls:
```bash
phase_researcher_instructions_content=$(cat references/phase-researcher-instructions.md)
```
## 4. Spawn kata-phase-researcher Agent
Research modes: ecosystem (default), feasibility, implementation, comparison.
```markdown
<research_type>
Phase Research — investigating HOW to implement a specific phase well.
</research_type>
<key_insight>
The question is NOT "which library should I use?"
The question is: "What do I not know that I don't know?"
For this phase, discover:
- What's the established architecture pattern?
- What libraries form the standard stack?
- What problems do people commonly hit?
- What's SOTA vs what Claude's training thinks is SOTA?
- What should NOT be hand-rolled?
</key_insight>
<objective>
Research implementation approach for Phase {phase_number}: {phase_name}
Mode: ecosystem
</objective>
<context>
**Phase description:** {phase_description}
**Requirements:** {requirements_list}
**Prior decisions:** {decisions_if_any}
**Phase context:** {context_md_content}
</context>
<downstream_consumer>
Your RESEARCH.md will be loaded by `/kata-plan-phase` which uses specific sections:
- `## Standard Stack` → Plans use these libraries
- `## Architecture Patterns` → Task structure follows these
- `## Don't Hand-Roll` → Tasks NEVER build custom solutions for listed problems
- `## Common Pitfalls` → Verification steps check for these
- `## Code Examples` → Task actions reference these patterns
Be prescriptive, not exploratory. "Use X" not "Consider X or Y."
</downstream_consumer>
<quality_gate>
Before declaring complete, verify:
- [ ] All domains investigated (not just some)
- [ ] Negative claims verified with official docs
- [ ] Multiple sources for critical claims
- [ ] Confidence levels assigned honestly
- [ ] Section names match what phase-plan expects
</quality_gate>
<output>
Write to: ${PHASE_DIR}/${PHASE}-RESEARCH.md
</output>
```
```
Task(
prompt="<agent-instructions>\n{phase_researcher_instructions_content}\n</agent-instructions>\n\n" + filled_prompt,
subagent_type="general-purpose",
model="{researcher_model}",
description="Research Phase {phase}"
)
```
## 5. Handle Agent Return
**`## RESEARCH COMPLETE`:** Display summary.
**Next steps:** Offer: Plan phase, Dig deeper, Brainstorm ideas, Review full, Done.
- **"Brainstorm ideas":** Run `/kata-brainstorm` to explore ideas based on research findings. After brainstorm completes, return to this menu.
**`## CHECKPOINT REACHED`:** Present to user, get response, spawn continuation.
**`## RESEARCH INCONCLUSIVE`:** Show what was attempted, offer: Add context, Try different mode, Manual.
## 6. Spawn Continuation Agent
```markdown
<objective>
Continue research for Phase {phase_number}: {phase_name}
</objective>
<prior_state>
Research file: @${PHASE_DIR}/${PHASE}-RESEARCH.md
</prior_state>
<checkpoint_response>
**Type:** {checkpoint_type}
**Response:** {user_response}
</checkpoint_response>
```
```
Task(
prompt="<agent-instructions>\n{phase_researcher_instructions_content}\n</agent-instructions>\n\n" + continuation_prompt,
subagent_type="general-purpose",
model="{researcher_model}",
description="Continue research Phase {phase}"
)
```
</process>
<success_criteria>
- [ ] Phase validated against roadmap
- [ ] Existing research checked
- [ ] kata-phase-researcher spawned with context
- [ ] Checkpoints handled correctly
- [ ] User knows next steps
</success_criteria>
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.