feat(ultraplan-local)!: v2.0.0 — brief-driven four-command pipeline

Extract interview from /ultraplan-local into new /ultrabrief-local command.
/ultraplan-local now requires --brief or --project (breaking). All pipeline
artifacts land in one project directory: .claude/projects/{date}-{slug}/
with brief.md, research/, plan.md, sessions/, progress.json.

Breaking changes:
- /ultraplan-local requires --brief <path> or --project <dir>
- /ultraplan-local --spec removed (convert specs to briefs per MIGRATION.md)
- Interview phase moved to /ultrabrief-local
- spec-reviewer renamed to brief-reviewer with 5th dimension (Research Plan validity)

Added:
- /ultrabrief-local command (interactive interview → brief.md with research plan)
- templates/ultrabrief-template.md (task brief format with intent + research plan)
- brief-reviewer agent (5-dimension brief quality review)
- --project <dir> flag on /ultraresearch-local, /ultraplan-local, /ultraexecute-local
- MIGRATION.md (v1 → v2 upgrade guide)

Changed:
- planning-orchestrator accepts Brief file: input (was Spec file:)
- planning-orchestrator Phase 1b uses brief-reviewer
- README + CLAUDE.md rewritten for four-command pipeline and task/research brief terminology
- CHANGELOG.md [2.0.0] entry with rationale
- Marketplace root README + CLAUDE.md updated to v2.0.0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-04-18 07:22:08 +02:00
commit 2bc405e14a
15 changed files with 1799 additions and 592 deletions

View file

@ -1,7 +1,7 @@
---
name: ultraresearch-local
description: Deep research combining local codebase analysis with external knowledge, producing structured research briefs with triangulation and confidence ratings
argument-hint: "[--quick | --local | --external | --fg] <research question>"
argument-hint: "[--project <dir>] [--quick | --local | --external | --fg] <research question>"
model: opus
allowed-tools: Agent, Read, Glob, Grep, Write, Edit, Bash, AskUserQuestion, WebSearch, WebFetch, mcp__tavily__tavily_search, mcp__tavily__tavily_research
---
@ -42,12 +42,24 @@ Supported flags:
4. `--fg` — foreground mode. Run all phases inline (blocking) instead of
launching the research-orchestrator in background. Set **execution = foreground**.
5. `--project <dir>` — attach this research to an ultrabrief project folder.
The brief will be written to `{dir}/research/{NN}-{slug}.md` (auto-incremented
index) instead of the default `.claude/research/` path. Set **project_dir = {dir}**.
If `{dir}` does not exist:
```
Error: project directory not found: {dir}
Run /ultrabrief-local first to create it.
```
Create `{dir}/research/` if it does not already exist.
Flags can be combined:
- `--local --fg` — local-only research, foreground
- `--external --quick` — external-only, lightweight
- `--project <dir> --external` — attach external research to a project
- `--quick` alone implies both local and external (lightweight)
Defaults: **scope = both**, **execution = background**.
Defaults: **scope = both**, **execution = background**, **project_dir = none**.
After stripping flags, the remaining text is the **research question**.
@ -59,6 +71,7 @@ Usage: /ultraresearch-local <research question>
/ultraresearch-local --local <research question>
/ultraresearch-local --external <research question>
/ultraresearch-local --fg <research question>
/ultraresearch-local --project <dir> [--external|--local|--quick|--fg] <research question>
Modes:
default Interview → background research (local + external) → brief
@ -66,8 +79,9 @@ Modes:
--local Only codebase analysis agents (skip external + Gemini)
--external Only external research agents (skip codebase analysis)
--fg All phases in foreground (blocks session)
--project Write brief into an ultrabrief project folder (auto-indexed)
Flags can be combined: --local --fg, --external --quick
Flags can be combined: --local --fg, --external --quick, --project <dir> --external
Examples:
/ultraresearch-local Should we migrate from Express to Fastify?
@ -75,6 +89,7 @@ Examples:
/ultraresearch-local --local How is error handling structured in this codebase?
/ultraresearch-local --external What are the security implications of using Redis for sessions?
/ultraresearch-local --fg --local What patterns does this codebase use for database access?
/ultraresearch-local --project .claude/projects/2026-04-18-jwt-auth --external What JWT library is best for Node.js?
```
Do not continue past this step if no question was provided.
@ -82,9 +97,23 @@ Do not continue past this step if no question was provided.
Report the detected mode:
```
Mode: {default | quick}, Scope: {both | local | external}, Execution: {background | foreground}
Project: {project_dir or "-"}
Question: {research question}
```
### Compute brief destination
If **project_dir is set**:
- Scan `{project_dir}/research/` for existing files matching `NN-*.md`.
- Find the highest existing index; set `N = highest + 1`. If no files exist, `N = 1`.
- Zero-pad to 2 digits: `01`, `02`, ...
- Brief destination: `{project_dir}/research/{NN}-{slug}.md`
If **project_dir is not set**:
- Brief destination: `.claude/research/ultraresearch-{YYYY-MM-DD}-{slug}.md`
Store as `brief_destination` for use in later phases.
## Phase 2 — Research interview
Use `AskUserQuestion` to clarify the research question. Ask **one question at a time**.
@ -146,7 +175,7 @@ Research dimensions identified:
**If execution = background (default):**
Generate a slug from the research question (first 3-4 meaningful words, lowercase,
hyphens).
hyphens). Use the `brief_destination` computed in Phase 1.
Launch the **research-orchestrator** agent with this prompt:
@ -155,7 +184,8 @@ Research question: {question}
Dimensions: {list of dimensions from interview}
Mode: {default | quick}
Scope: {both | local | external}
Brief destination: .claude/research/ultraresearch-{YYYY-MM-DD}-{slug}.md
Project dir: {project_dir or "-"}
Brief destination: {brief_destination}
Plugin root: ${CLAUDE_PLUGIN_ROOT}
```
@ -168,7 +198,8 @@ Background research started via research-orchestrator.
Question: {research question}
Dimensions: {N} identified
Scope: {both | local | external}
Brief: .claude/research/ultraresearch-{date}-{slug}.md
Project: {project_dir or "-"}
Brief: {brief_destination}
You will be notified when the research brief is ready.
You can continue working on other tasks in the meantime.
@ -317,8 +348,11 @@ Write the research brief following the template. Key rules:
6. **Sources** — every claim traced to URL or codebase path.
Generate the slug from the research question (first 3-4 meaningful words).
Write the brief to: `.claude/research/ultraresearch-{YYYY-MM-DD}-{slug}.md`
Create the `.claude/research/` directory if needed.
Write the brief to the `brief_destination` computed in Phase 1:
- With `--project`: `{project_dir}/research/{NN}-{slug}.md`
- Without `--project`: `.claude/research/ultraresearch-{YYYY-MM-DD}-{slug}.md`
Create the parent directory if it does not exist.
## Phase 8 — Present and track
@ -329,7 +363,8 @@ Present a summary to the user:
**Question:** {research question}
**Mode:** {default | quick}, Scope: {both | local | external}
**Brief:** .claude/research/ultraresearch-{date}-{slug}.md
**Brief:** {brief_destination}
**Project:** {project_dir or "-"}
**Confidence:** {overall confidence 0.0-1.0}
**Dimensions:** {N} researched
**Agents:** {N} local + {N} external + {gemini: used | unavailable | skipped}
@ -346,8 +381,9 @@ Present a summary to the user:
- {Question 1, or "None — all dimensions adequately covered."}
You can:
- Read the full brief at {brief path}
- Feed into planning: `/ultraplan-local --research {brief path} <task>`
- Read the full brief at {brief_destination}
- If `--project` was used: run `/ultraplan-local --project {project_dir}` when all research topics are complete
- Otherwise: `/ultraplan-local --research {brief_destination} --brief <your-brief.md>`
- Ask follow-up questions about specific findings
```
@ -364,6 +400,8 @@ Record format (one JSON line):
"mode": "{default|quick}",
"scope": "{both|local|external}",
"slug": "{brief slug}",
"project_dir": "{project_dir or null}",
"brief_path": "{brief_destination}",
"dimensions": {N},
"agents_local": {N},
"agents_external": {N},