Home / Commands / uditgoenka/autoresearch

autoresearch_improve

Research ICP challenges, discover improvements, generate PRDs

commandLicense: MIT Source: uditgoenka/autoresearch

Install

Copy this folder into your Claude Code project (needs Node.js):

curl -fsSL --create-dirs -o .claude/commands/autoresearch-improve.md https://raw.githubusercontent.com/uditgoenka/autoresearch/HEAD/.opencode/commands/autoresearch_improve.md

Or install it for every project:

curl -fsSL --create-dirs -o ~/.claude/commands/autoresearch-improve.md https://raw.githubusercontent.com/uditgoenka/autoresearch/HEAD/.opencode/commands/autoresearch_improve.md

File content

Made by its original authors and shared under MIT. We show it unchanged, with credit and a link to the source. Source β†—

---
name: autoresearch_improve
description: "Research ICP challenges, discover improvements, generate PRDs"
argument-hint: "[Goal: <text>] [--icp <text>] [--discover] [--no-discover] [--seeds <categories>] [--depth shallow|standard|deep] [Iterations: N] [--evals]"
disable-model-invocation: true
---

EXECUTE IMMEDIATELY.

## Parse Arguments

Extract from $ARGUMENTS:
- `Goal:` β€” product area to improve (or full $ARGUMENTS if no keyword)
- `--icp` or `ICP:` β€” ideal customer profile description
- `--discover` β€” force inline codebase scan even when context exists
- `--no-discover` β€” skip auto-discover, warn instead
- `--seeds <categories>` β€” override default research category seeds
- `--depth` β€” shallow (5 iterations), standard (15), deep (30)
- `--features` β€” comma-separated feature names to pre-select for PRD generation
- `Iterations:` or `--iterations` β€” default 15. "unlimited" for unbounded.
- `--evals`, `--evals-interval N`

If upstream `handoff.json` exists in CWD β†’ read it. Map source findings to default seed categories:
- probe β†’ ICP challenges, UX & experience
- predict β†’ Competitor gaps, Revenue & growth
- debug/security β†’ Competitor gaps, ICP challenges
- Override with `--seeds`.

## Setup (if Goal or ICP missing)

question (single batch):
  Q1 (Goal): "What product area to improve?" β€” open text
  Q2 (ICP): "Who is your ideal customer?" β€” open text describing target buyer/user
  Q3 (Pain points): "Top 3 pain points your customers face?" β€” open text
  Q4 (Competitors): "Key competitors?" β€” open text, or "skip"
  Q5 (Depth): "How deep?" β€” shallow (5 iterations, quick scan), standard (15, recommended), deep (30+, exhaustive)
If all provided inline β†’ skip.

## Phase 1: Product Context

Resolve product context (priority chain):
1. Learn summary (`autoresearch/learn-*/summary.md`, most recent) β†’ read it
2. README.md (β‰₯500 chars, non-boilerplate) β†’ extract product description
3. `package.json` / `pyproject.toml` / `Cargo.toml` description (β‰₯10 chars) β†’ use it
4. If ALL above absent AND NOT `--no-discover` β†’ auto-discover: scan 10 key files (manifest, routes, models, config), cap 1500 tokens
5. If `--discover` β†’ force scan regardless of above
6. If nothing found β†’ warn: "No product context. Run `/autoresearch_learn --mode summarize` for better results."

## Phase 2: Research Loop

Create output directory: `autoresearch/improve-{YYMMDD}-{HHMM}/`
TSV header: `# metric_direction: higher_is_better`
Columns: `iteration|timestamp|category|research_question|status|source|insight_problem|insight_mechanism|confidence|classification`

**5 research categories:**
1. ICP challenges β€” pain points, jobs-to-be-done, unmet needs
2. Competitor gaps β€” weaknesses, missing features, technical differentiators
3. Market trends β€” timing signals, emerging patterns, regulatory shifts
4. UX & experience β€” interaction models, onboarding, retention mechanics
5. Revenue & growth β€” pricing, acquisition, monetization, upsell/expansion

**Iteration protocol:**
- Reserve first 5 iterations: one per category (forced breadth)
- Remaining iterations: target categories with richest signal
- Per iteration: form research question β†’ WebSearch β†’ synthesize β†’ normalize to canonical insight schema β†’ classify (new/extension/duplicate) β†’ tag confidence (HIGH: 3+ sources, MEDIUM: 2, LOW: 1) β†’ cross-check against codebase β†’ log
- **Saturation:** net-new insights < 2 for 3 consecutive non-reserved iterations β†’ SATURATED, exit loop
- Hard ceiling (Iterations flag) as infinite-loop guard

**Insight schema:** `{problem: 10-word canonical form, affected_persona: ICP segment, proposed_mechanism: how to address, expected_outcome: what success looks like}`
**Classification:** New = novel {problem, persona} pair. Extension = same pair, different mechanism. Duplicate = same pair + mechanism β†’ skip.

### Eval Checkpoint
If --evals: check if current_iteration % interval == 0 β†’ run checkpoint.
Print: `--- Eval Checkpoint (iterations {X}-{Y}) ---\nInsights: {total} (+{new}) | Categories: {covered}/5 | Saturation: {window}/3\n{recommendation}\n---`

## Phase 3: Feature Ranking + Selection

1. **ICP binary gate** β€” filter insights not serving the stated ICP
2. **3-tier bucketing** β€” Must-have / Nice-to-have / Moonshot
3. **Pairwise ranking** within Must-have tier only (cap 7-10 items)
4. **2-sentence rationale** per item citing research evidence
5. **Confidence indicator** per item (HIGH / MEDIUM / LOW)

Write `improvement-plan.md` with full tiered ranking.

question (multi-select): present tiered list, user selects which features become PRDs.
If `--features` provided β†’ pre-select matching items, still show for confirmation.

## Phase 4: PRD Generation

Per selected feature, write `prd-{feature-slug}.md`:
- Top disclaimer: "Auto-generated from research findings. DECISION NEEDED items and LOW-confidence sections require your judgment."
- Problem statement (from research evidence chain)
- User stories (from ICP + persona data)
- Requirements (functional + non-functional, MoSCoW from tier)
- Acceptance criteria
- Technical approach (from codebase context, framed as "suggested starting points")
- Risks + confidence (evidence tiers: primary = codebase, secondary = web research)
- Success metrics
- `DECISION NEEDED` markers for unresolvable tradeoffs
- `Open Questions` section

Write `research-findings.md` β€” all insights with citations + confidence.
Write `summary.md` β€” overview, research stats, category coverage, saturation status.

## Summary

Print: total iterations, insights discovered (new/extension), categories covered, saturation status, PRDs generated, output directory path.

## Eval Summary (--evals flag)

If --evals: write `evals-summary.md` to output directory with full analysis.

## Handoff

Write `handoff.json`: version "2.1.0", source "improve", timestamp, status (COMPLETE|SATURATED|USER_INTERRUPT|BOUNDED|ERROR), results_tsv path, findings = improvements with tier + confidence + prd_path, config{goal, icp, depth, categories_explored, insights_total, prds_generated}.
Improve is a terminal emitter β€” no downstream chain invocation.