--- name: dev-research description: > Use when the user asks for the dev research workflow to create PRDs, database designs, architecture docs, API specs, and UX mocks for a new feature or app. Triggers on `/dev research ` or when the user says "research this", "design this feature", "create a PRD", "brainstorm this idea". Combines codebase scanning, brainstorming dialogue, and design document generation into one phase. disable-model-invocation: false --- # Phase 1: Research Deep research and design for a new feature or app. Outputs a complete design document with PRD, database design, architecture, API docs, and optionally UX mocks. **This phase uses superpowers:brainstorming as its core workflow.** The brainstorming skill handles the iterative dialogue, approach exploration, and design document creation. This skill wraps it with app-specific context loading and Linear integration. ## Input Parse `$ARGUMENTS`: first word is the **app name** (golf, portfolio, hive), rest is the **idea description**. Can also start from: - An existing Linear project (pass project name or URL) - A pasted spec or requirements document ## Steps ### 1. Load App Context 1. Read `.claude/planner.local.md` for app config (team key, work path) 2. Read `docs/MAP.md` (retrieval contract) and the app overview it points at (`docs/architecture/overview.md`) for condensed app context 3. Read relevant pattern docs from the marketplace (resolve via the context-patterns skill: `${CLAUDE_PLUGIN_ROOT}/../../references/patterns/`): - Always: `testing.md` - If backend: `ddd.md`, `api.md` - If frontend: `frontend.md` - If mobile: `mobile.md` 4. Read existing planning docs at `docs/planning/` to understand what's already planned ### 2. Architecture Scan Launch an architecture-scanner agent (from this plugin's `agents/` directory) to gather: - Existing domain structure in `packages//domains/` - Database schema in `packages//db/src/models/` - API surface in `apps//api/src/` - Recent git activity in the app's directories ### 3. Brainstorm **Invoke `superpowers:brainstorming` via the Skill tool.** Provide all context gathered in steps 1-2. The brainstorming skill will: - Explore the user's intent through clarifying questions (one at a time) - Propose 2-3 approaches with tradeoffs - Design the solution collaboratively - Present the design for approval **For visual features:** Invoke the `design` skill (from this plugin). It's the unified orchestrator — it internally loads `taste-skill`, `ui-ux-pro-max`, `impeccable`, and the app-specific token files. Use `design` instead of calling those individually so the taste floor, token loading, and mock-first decision flow all fire correctly. **MOCK-FIRST DECISION RULE (applies to every clarifying question during brainstorm):** When the brainstorming skill is about to ask the user to pick between options, **build a visual comparison instead of asking a text question** whenever possible: - **UI/layout/component choices** → HTML mock showcase with options side-by-side, styled with the real app tokens, realistic scenario data, Pro/Con annotations. Save to `docs/planning//mocks/NN-.html`. - **Backend / data-flow / schema / architecture choices** → Mermaid diagram (flowchart, sequence, ERD, or state diagram). Inline in the message or in a Mermaid-rendering HTML file. Show the options visually — which tables differ, which arrows flip, which nodes appear in A but not B. - **Decision-tree / branching options** → comparison table matrix, not a prose list. - **Only fall back to plain text questions when the decision is truly abstract** (tone, naming, yes/no confirms, priority ordering). Never for layout, color, component, data flow, schema, or flow ordering. **Mock versioning and single persistent tunnel:** see the `design` skill's "Mock versioning + single persistent tunnel" section for the full rule. Summary: 1. Every iteration gets its own numbered file in the mocks folder (`NN-.html` / `NN--v2.html` etc.) — never overwrite history. 2. Maintain a `current.html` in the same folder — always a copy of the newest iteration. 3. Start ONE tunnel per initiative serving `current.html`. On subsequent iterations, `cp .html current.html` and tell the user to refresh the same URL. Do not start new tunnels. 4. Tear the tunnel down at the end of the decision session with `stop.sh