@glrs-dev/cli 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/README.md +14 -15
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/chunk-6RHN2EDH.js +93 -0
- package/dist/chunk-DEODG2LC.js +55 -0
- package/dist/chunk-FSAGM22T.js +17 -0
- package/dist/chunk-GQBZREK5.js +136 -0
- package/dist/chunk-HWMRY35D.js +139 -0
- package/dist/chunk-LMRDQ4GW.js +129 -0
- package/dist/chunk-NLPX2KOF.js +149 -0
- package/dist/chunk-P7PRH4I3.js +177 -0
- package/dist/chunk-VCN7RNLU.js +60 -0
- package/dist/chunk-VJFNIKQJ.js +120 -0
- package/dist/chunk-W37UX3U2.js +35 -0
- package/dist/chunk-YBCA3IP6.js +25 -0
- package/dist/chunk-YGNDPKIW.js +99 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +89 -36
- package/dist/commands/cleanup.d.ts +19 -0
- package/dist/commands/cleanup.js +11 -0
- package/dist/commands/create.d.ts +17 -0
- package/dist/commands/create.js +12 -0
- package/dist/commands/delete.d.ts +17 -0
- package/dist/commands/delete.js +12 -0
- package/dist/commands/go.d.ts +4 -0
- package/dist/commands/go.js +11 -0
- package/dist/commands/list.d.ts +15 -0
- package/dist/commands/list.js +12 -0
- package/dist/commands/switch.d.ts +11 -0
- package/dist/commands/switch.js +12 -0
- package/dist/commands/types.d.ts +10 -0
- package/dist/commands/types.js +0 -0
- package/dist/index.d.ts +16 -19
- package/dist/index.js +4 -1
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.js +14 -0
- package/dist/lib/fmt.d.ts +12 -0
- package/dist/lib/fmt.js +25 -0
- package/dist/lib/git.d.ts +26 -0
- package/dist/lib/git.js +25 -0
- package/dist/lib/registry.d.ts +14 -0
- package/dist/lib/registry.js +13 -0
- package/dist/lib/select.d.ts +21 -0
- package/dist/lib/select.js +10 -0
- package/dist/lib/worktree.d.ts +35 -0
- package/dist/lib/worktree.js +17 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/agents-md-writer.md +89 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/architecture-advisor.md +46 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/build.md +93 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/code-searcher.md +54 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/docs-maintainer.md +128 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/gap-analyzer.md +44 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/lib-reader.md +39 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/pilot-builder.md +107 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/pilot-planner.md +153 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/plan-reviewer.md +49 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/plan.md +144 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/prime.md +374 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/qa-reviewer.md +68 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/qa-thorough.md +63 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/research.md +138 -0
- package/dist/vendor/harness-opencode/dist/agents/shared/index.ts +26 -0
- package/dist/vendor/harness-opencode/dist/agents/shared/workflow-mechanics.md +32 -0
- package/dist/vendor/harness-opencode/dist/bin/memory-mcp-launcher.sh +145 -0
- package/dist/vendor/harness-opencode/dist/bin/plan-check.sh +255 -0
- package/dist/vendor/harness-opencode/dist/chunk-VJUETC6A.js +205 -0
- package/dist/vendor/harness-opencode/dist/chunk-VVMP6QWS.js +731 -0
- package/dist/vendor/harness-opencode/dist/chunk-XCZ3NOXR.js +703 -0
- package/dist/vendor/harness-opencode/dist/cli.d.ts +1 -0
- package/dist/vendor/harness-opencode/dist/cli.js +5096 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/autopilot.md +96 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/costs.md +94 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/fresh.md +382 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/init-deep.md +196 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/research.md +27 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/review.md +96 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/ship.md +104 -0
- package/dist/vendor/harness-opencode/dist/index.d.ts +21 -0
- package/dist/vendor/harness-opencode/dist/index.js +2092 -0
- package/dist/vendor/harness-opencode/dist/install-4EYR56OR.js +9 -0
- package/dist/vendor/harness-opencode/dist/skills/agent-estimation/SKILL.md +159 -0
- package/dist/vendor/harness-opencode/dist/skills/paths.ts +18 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/SKILL.md +49 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/dag-shape.md +47 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/decomposition.md +36 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/first-principles.md +29 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/milestones.md +57 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/self-review.md +46 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/task-context.md +47 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/touches-scope.md +47 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/verify-design.md +53 -0
- package/dist/vendor/harness-opencode/dist/skills/research/SKILL.md +350 -0
- package/dist/vendor/harness-opencode/dist/skills/research-auto/SKILL.md +283 -0
- package/dist/vendor/harness-opencode/dist/skills/research-local/SKILL.md +268 -0
- package/dist/vendor/harness-opencode/dist/skills/research-web/SKILL.md +119 -0
- package/dist/vendor/harness-opencode/dist/skills/review-plan/SKILL.md +32 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/AGENTS.md +946 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/README.md +60 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/SKILL.md +89 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/architecture-compound-components.md +112 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/state-context-interface.md +191 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/state-lift-state.md +125 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/AGENTS.md +2975 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/README.md +123 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/SKILL.md +137 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +142 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/dist/vendor/harness-opencode/dist/skills/web-design-guidelines/SKILL.md +39 -0
- package/dist/vendor/harness-opencode/package.json +11 -0
- package/package.json +20 -15
- package/LICENSE +0 -21
- package/dist/chunk-TU23AE2F.js +0 -69
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research-local
|
|
3
|
+
description: Deep codebase research using parallel Explore subagents. Decomposes a question about the local codebase into research tasks, launches parallel explorations, reviews for gaps, iterates, and synthesizes findings with specific file paths and line numbers. Use when user says 'how does X work in this codebase', 'where is Y implemented', 'trace the data flow for Z', 'what patterns does this repo use', 'explain the architecture of'. Provide the research topic as arguments.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /research-local — Deep Codebase Research
|
|
7
|
+
|
|
8
|
+
Given a topic or question, deeply explore the codebase using subagents to produce a comprehensive understanding with specific code references.
|
|
9
|
+
|
|
10
|
+
**Research Topic:** $ARGUMENTS
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
THE IRON LAW: YOU ARE AN ORCHESTRATOR ONLY. NO EXCEPTIONS.
|
|
14
|
+
|
|
15
|
+
Every phase is a subagent. Decomposition is a subagent. Exploration is subagents.
|
|
16
|
+
Gap analysis is a subagent. Synthesis is a subagent. Review is a subagent.
|
|
17
|
+
|
|
18
|
+
You NEVER use Glob, Grep, Read, or any exploration tool directly.
|
|
19
|
+
You NEVER synthesize, analyze, or review findings yourself.
|
|
20
|
+
You launch subagents and pass their outputs to other subagents.
|
|
21
|
+
|
|
22
|
+
Your ONLY job: decide which subagents to launch, write their prompts, and
|
|
23
|
+
pass results between them. That's it.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If no topic is provided as $ARGUMENTS, ask the user what they want to research.
|
|
27
|
+
|
|
28
|
+
## Phase 1: Decompose — Subagent
|
|
29
|
+
|
|
30
|
+
Launch a **general-purpose subagent** to decompose the research topic:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
PROMPT:
|
|
34
|
+
"You are a research planner. Given a research topic about a codebase, decompose it
|
|
35
|
+
into 4-6 distinct, non-overlapping research questions that together would fully
|
|
36
|
+
answer the topic.
|
|
37
|
+
|
|
38
|
+
Research Topic: [TOPIC]
|
|
39
|
+
|
|
40
|
+
For each question, provide:
|
|
41
|
+
1. The specific question to answer
|
|
42
|
+
2. What aspects of the codebase to explore (file patterns, module names, concepts)
|
|
43
|
+
3. What a thorough answer would include (data flow, patterns, dependencies, etc.)
|
|
44
|
+
|
|
45
|
+
Output as a numbered list. Each question should be independently explorable.
|
|
46
|
+
Do NOT overlap — each question covers a unique facet of the topic."
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If the topic is too broad, the decomposition agent will produce too many questions. If it returns >6, ask the user to narrow the scope.
|
|
50
|
+
|
|
51
|
+
## Phase 2: Explore — Parallel Subagents
|
|
52
|
+
|
|
53
|
+
Launch **one Explore subagent per research question** from Phase 1 — ALL in a SINGLE message.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
PROMPT TEMPLATE (one per question):
|
|
57
|
+
"Research Topic: [ORIGINAL TOPIC]
|
|
58
|
+
Specific Question: [QUESTION FROM PHASE 1]
|
|
59
|
+
|
|
60
|
+
Thoroughly explore the codebase to answer this question. You must:
|
|
61
|
+
|
|
62
|
+
1. Search broadly first — glob for relevant files, grep for key terms
|
|
63
|
+
2. Read actual code — not just file names. Follow imports, trace call chains.
|
|
64
|
+
3. Go deep on critical paths — read functions line by line, understand logic
|
|
65
|
+
|
|
66
|
+
Provide a structured answer with:
|
|
67
|
+
- **Relevant Files**: Every file with full paths and line numbers for key code
|
|
68
|
+
- **Code Patterns**: Patterns, conventions, or idioms used
|
|
69
|
+
- **Data Flow**: How data moves through the relevant code paths
|
|
70
|
+
- **Dependencies**: What this code depends on and what depends on it
|
|
71
|
+
- **Key Insights**: Non-obvious findings, gotchas, important context
|
|
72
|
+
|
|
73
|
+
Be exhaustive. Read every file that could be relevant. Follow every import.
|
|
74
|
+
A file mentioned without a line number is incomplete."
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
CRITICAL: ALL Explore subagents launch in ONE message.
|
|
79
|
+
Minimum 4 subagents. Never fewer unless the decomposition produced fewer questions.
|
|
80
|
+
Do NOT launch them sequentially.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Phase 3: Gap Analysis — Subagent
|
|
84
|
+
|
|
85
|
+
Launch a **general-purpose subagent** to review findings and identify gaps:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
PROMPT:
|
|
89
|
+
"You are a research reviewer. Given a research topic and findings from multiple
|
|
90
|
+
parallel explorations, identify what's MISSING.
|
|
91
|
+
|
|
92
|
+
Research Topic: [TOPIC]
|
|
93
|
+
|
|
94
|
+
Research Questions Asked:
|
|
95
|
+
[LIST FROM PHASE 1]
|
|
96
|
+
|
|
97
|
+
Findings:
|
|
98
|
+
[ALL RESULTS FROM PHASE 2 EXPLORE SUBAGENTS]
|
|
99
|
+
|
|
100
|
+
Analyze the findings and identify:
|
|
101
|
+
1. **Unanswered questions** — aspects of the topic not adequately covered
|
|
102
|
+
2. **Shallow areas** — sections where files were mentioned but code wasn't read deeply
|
|
103
|
+
3. **Missing connections** — relationships between components that weren't traced
|
|
104
|
+
4. **Absent file references** — claims made without specific file:line references
|
|
105
|
+
5. **Cross-cutting gaps** — interactions between explored areas that weren't examined
|
|
106
|
+
|
|
107
|
+
For each gap, provide:
|
|
108
|
+
- What is missing
|
|
109
|
+
- Where to look (suggested file patterns, module names, search terms)
|
|
110
|
+
- Why it matters for understanding the topic
|
|
111
|
+
|
|
112
|
+
If the findings are comprehensive and no significant gaps exist, say 'NO GAPS FOUND'.
|
|
113
|
+
Otherwise, list each gap as a specific, explorable question."
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Phase 4: Fill Gaps — Parallel Subagents (If Needed)
|
|
117
|
+
|
|
118
|
+
If Phase 3 found gaps, launch **Explore subagents** for each gap — ALL in a SINGLE message.
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
PROMPT TEMPLATE (one per gap):
|
|
122
|
+
"Research Topic: [ORIGINAL TOPIC]
|
|
123
|
+
Specific Gap to Fill: [GAP FROM PHASE 3]
|
|
124
|
+
|
|
125
|
+
Context from prior research:
|
|
126
|
+
[RELEVANT PRIOR FINDINGS THAT BORDER THIS GAP]
|
|
127
|
+
|
|
128
|
+
Fill this specific gap in our understanding. Search the codebase thoroughly.
|
|
129
|
+
Provide file paths with line numbers for every finding.
|
|
130
|
+
Focus on what the prior research missed — don't repeat what's already known."
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
If no gaps were found, skip directly to Phase 5.
|
|
134
|
+
|
|
135
|
+
## Phase 5: Synthesize — Subagent
|
|
136
|
+
|
|
137
|
+
Launch a **general-purpose subagent** to synthesize ALL findings (Phase 2 + Phase 4):
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
PROMPT:
|
|
141
|
+
"You are a technical writer synthesizing codebase research. Combine all findings
|
|
142
|
+
into a single comprehensive document.
|
|
143
|
+
|
|
144
|
+
Research Topic: [TOPIC]
|
|
145
|
+
|
|
146
|
+
All Research Findings:
|
|
147
|
+
[EVERY FINDING FROM PHASE 2 AND PHASE 4]
|
|
148
|
+
|
|
149
|
+
Create a structured summary with these sections:
|
|
150
|
+
|
|
151
|
+
## Overview
|
|
152
|
+
A 2-3 sentence summary of what was learned.
|
|
153
|
+
|
|
154
|
+
## Architecture
|
|
155
|
+
Key components, their responsibilities, how they interact, design patterns used.
|
|
156
|
+
|
|
157
|
+
## Code Locations
|
|
158
|
+
Organized list of relevant files:
|
|
159
|
+
- Full paths with line numbers (format: path/to/file.ts:123)
|
|
160
|
+
- Brief description of what each file/section does
|
|
161
|
+
- Importance level (critical, important, reference)
|
|
162
|
+
|
|
163
|
+
## Data Flow
|
|
164
|
+
Entry points → transformations → exit points for the relevant system.
|
|
165
|
+
|
|
166
|
+
## Patterns & Conventions
|
|
167
|
+
Naming conventions, error handling, testing patterns observed.
|
|
168
|
+
|
|
169
|
+
## Dependencies
|
|
170
|
+
Internal (packages/modules) and external (npm packages, services).
|
|
171
|
+
|
|
172
|
+
## Gotchas & Edge Cases
|
|
173
|
+
Non-obvious findings, potential issues, tech debt, surprises.
|
|
174
|
+
|
|
175
|
+
## Related Areas
|
|
176
|
+
Parts of the codebase that relate but weren't the main focus.
|
|
177
|
+
|
|
178
|
+
## Open Questions
|
|
179
|
+
Things that couldn't be fully answered or need human clarification.
|
|
180
|
+
|
|
181
|
+
IMPORTANT: Every claim must reference a specific file:line. Remove any finding
|
|
182
|
+
that lacks a concrete code reference."
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Phase 6: Quality Review — Subagent
|
|
186
|
+
|
|
187
|
+
Launch a **general-purpose subagent** to review the synthesis:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
PROMPT:
|
|
191
|
+
"You are a quality reviewer for codebase research. Given a research topic and a
|
|
192
|
+
synthesized report, evaluate its quality.
|
|
193
|
+
|
|
194
|
+
Research Topic: [TOPIC]
|
|
195
|
+
Synthesized Report: [OUTPUT FROM PHASE 5]
|
|
196
|
+
|
|
197
|
+
Score each dimension 1-5:
|
|
198
|
+
1. **Completeness** — Does it fully answer the research topic?
|
|
199
|
+
2. **Specificity** — Does every claim have a file:line reference?
|
|
200
|
+
3. **Accuracy** — Are the architectural descriptions consistent with the code locations?
|
|
201
|
+
4. **Depth** — Does it go beyond surface-level file listing to explain WHY and HOW?
|
|
202
|
+
5. **Actionability** — Could someone use this to confidently modify the code?
|
|
203
|
+
|
|
204
|
+
Overall score: average of all dimensions.
|
|
205
|
+
|
|
206
|
+
If overall score >= 4: Output 'QUALITY: PASS' and list any minor suggestions.
|
|
207
|
+
If overall score < 4: Output 'QUALITY: NEEDS WORK' and list specific deficiencies
|
|
208
|
+
that would need additional exploration to resolve. Frame each deficiency as a
|
|
209
|
+
specific, explorable question."
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**If NEEDS WORK:** Go back to Phase 4 — launch Explore subagents for the deficiencies, then re-synthesize (Phase 5) and re-review (Phase 6). Maximum 2 review iterations.
|
|
213
|
+
|
|
214
|
+
**If PASS:** Proceed to Phase 7.
|
|
215
|
+
|
|
216
|
+
## Phase 7: Report
|
|
217
|
+
|
|
218
|
+
Present the synthesized findings to the user:
|
|
219
|
+
1. The full structured report from Phase 5
|
|
220
|
+
2. A "quick reference" block of the 5-10 most important file paths
|
|
221
|
+
3. Quality score from Phase 6
|
|
222
|
+
4. Suggestions for follow-up research if any Open Questions remain
|
|
223
|
+
|
|
224
|
+
## Subagent Rules
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
EVERY PHASE IS A SUBAGENT. THERE ARE NO EXCEPTIONS.
|
|
228
|
+
|
|
229
|
+
Phase 1 (Decompose): 1 general-purpose subagent
|
|
230
|
+
Phase 2 (Explore): 4-6 Explore subagents IN PARALLEL
|
|
231
|
+
Phase 3 (Gap Analysis): 1 general-purpose subagent
|
|
232
|
+
Phase 4 (Fill Gaps): 1+ Explore subagents IN PARALLEL (if gaps found)
|
|
233
|
+
Phase 5 (Synthesize): 1 general-purpose subagent
|
|
234
|
+
Phase 6 (Review): 1 general-purpose subagent
|
|
235
|
+
Phase 4-6 may repeat: up to 2 iterations
|
|
236
|
+
|
|
237
|
+
Minimum subagent count for any research: 8 (decompose + 4 explore + gap + synth + review)
|
|
238
|
+
Typical subagent count: 10-14
|
|
239
|
+
|
|
240
|
+
PARALLELIZATION:
|
|
241
|
+
- ALL Explore subagents in a SINGLE message (Phase 2 and Phase 4)
|
|
242
|
+
- Sequential phases wait for prior phase to complete
|
|
243
|
+
- NEVER launch Phase 3 before ALL Phase 2 agents return
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Red Flags — STOP
|
|
247
|
+
|
|
248
|
+
- About to use Glob, Grep, or Read directly — DELEGATE TO A SUBAGENT
|
|
249
|
+
- About to synthesize findings yourself — LAUNCH A SYNTHESIS SUBAGENT
|
|
250
|
+
- About to skip gap analysis — PHASE 3 IS MANDATORY
|
|
251
|
+
- About to skip quality review — PHASE 6 IS MANDATORY
|
|
252
|
+
- About to launch Explore subagents one at a time — ONE MESSAGE, ALL AGENTS
|
|
253
|
+
- About to report without running quality review — REVIEW FIRST
|
|
254
|
+
- About to decompose the topic yourself — LAUNCH A DECOMPOSITION SUBAGENT
|
|
255
|
+
- About to decide "no gaps" without a gap analysis subagent — THE SUBAGENT DECIDES, NOT YOU
|
|
256
|
+
|
|
257
|
+
## Common Rationalizations
|
|
258
|
+
|
|
259
|
+
| Excuse | Reality |
|
|
260
|
+
|--------|---------|
|
|
261
|
+
| "I already know where this code is" | You might be wrong. Launch an Explore subagent. |
|
|
262
|
+
| "I can synthesize this myself" | You are biased by what you expect. A synthesis subagent has fresh eyes. |
|
|
263
|
+
| "Gap analysis is overkill" | The first pass ALWAYS misses something. Phase 3 is mandatory. |
|
|
264
|
+
| "The quality is obviously fine" | Your intuition is not a quality gate. Launch the review subagent. |
|
|
265
|
+
| "One subagent is enough" | Minimum 4 Explore subagents. Parallel exploration finds what serial misses. |
|
|
266
|
+
| "I'll just do a quick grep to check" | You are an orchestrator. Every grep is an Explore subagent. |
|
|
267
|
+
| "Decomposition is simple enough to do myself" | The decomposition subagent produces better, non-overlapping questions. |
|
|
268
|
+
| "I'll save time by skipping the review" | Skipping review produces incomplete reports. The 2 minutes are worth it. |
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research-web
|
|
3
|
+
description: Multi-agent research orchestrator. Decomposes a research question into parallel agent workstreams, launches them, monitors progress, and synthesizes results. Use when user says 'research this topic', 'I need to understand', 'deep dive into', 'investigate the market for', 'what do we know about'. Provide the research topic and context.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /research-web — Multi-Agent Research Orchestrator
|
|
7
|
+
|
|
8
|
+
Decompose a research question into parallel agent workstreams, launch them, monitor progress, and synthesize results.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Phase 1: Plan the Research
|
|
13
|
+
|
|
14
|
+
When the user asks to research something:
|
|
15
|
+
|
|
16
|
+
1. **Understand the question.** What exactly are we trying to learn? Who is it for? What decisions will it inform?
|
|
17
|
+
|
|
18
|
+
2. **Decompose into agent workstreams.** Each agent should have:
|
|
19
|
+
- A clear, non-overlapping scope (e.g., "Market sizing & competitive landscape", "Technical feasibility & architecture", "Regulatory & compliance landscape")
|
|
20
|
+
- 3-6 specific sections they must write
|
|
21
|
+
- A target output length (~500-1500 lines of markdown per agent is the sweet spot)
|
|
22
|
+
|
|
23
|
+
3. **Plan the synthesis agent.** This runs AFTER all research agents complete. Its job is to read all agent outputs and produce a single coherent synthesis document with cross-cutting insights, contradictions, and recommendations.
|
|
24
|
+
|
|
25
|
+
4. **Present the plan to the user.** Format:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
## Research Plan: [Topic]
|
|
29
|
+
|
|
30
|
+
### Agent 1: [Name]
|
|
31
|
+
**Scope:** [1-2 sentence scope]
|
|
32
|
+
**Sections:**
|
|
33
|
+
1. [Section name]
|
|
34
|
+
2. [Section name]
|
|
35
|
+
3. ...
|
|
36
|
+
**Output file:** research/[topic]/[agent-name].md
|
|
37
|
+
|
|
38
|
+
### Agent 2: [Name]
|
|
39
|
+
...
|
|
40
|
+
|
|
41
|
+
### Synthesis Agent
|
|
42
|
+
**Runs after:** All research agents complete
|
|
43
|
+
**Output file:** research/[topic]/synthesis.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
5. **Wait for user approval** before proceeding. Do NOT launch agents until the user confirms the plan.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Phase 2: Create Skeleton Files
|
|
51
|
+
|
|
52
|
+
Once the user approves the plan:
|
|
53
|
+
|
|
54
|
+
1. **Create the output directory:** `research/[topic]/`
|
|
55
|
+
|
|
56
|
+
2. **For each research agent, create a skeleton markdown file** at the planned path. The skeleton MUST include:
|
|
57
|
+
- Title, Status: IN PROGRESS, Last updated timestamp
|
|
58
|
+
- Critical instructions block telling the agent to follow Search -> Edit -> Search -> Edit pattern
|
|
59
|
+
- Numbered section headings with placeholder text
|
|
60
|
+
|
|
61
|
+
3. **Also create the synthesis skeleton** with similar critical instructions, but noting it should read from the other agent output files.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Phase 3: Launch Research Agents
|
|
66
|
+
|
|
67
|
+
Launch ALL research agents in parallel using the Agent tool with `run_in_background: true`.
|
|
68
|
+
|
|
69
|
+
Each agent prompt MUST include:
|
|
70
|
+
|
|
71
|
+
1. **The research question and their specific scope** -- be precise about boundaries
|
|
72
|
+
2. **The exact file path they must write to** -- absolute path
|
|
73
|
+
3. **The section list they must complete** -- numbered, in order
|
|
74
|
+
4. **The critical write protocol** -- the agent MUST Edit its output file after EVERY SINGLE search or web fetch. Never two searches in a row without a write. Work through sections in order. Every number needs an inline source URL.
|
|
75
|
+
5. **Any relevant context files they should read first** -- provide absolute paths
|
|
76
|
+
|
|
77
|
+
**IMPORTANT:** Use `run_in_background: true` for all research agents so they run in parallel.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Phase 4: Monitor Progress
|
|
82
|
+
|
|
83
|
+
Use escalating check-in intervals:
|
|
84
|
+
|
|
85
|
+
- **~30 seconds:** Verify agents have started writing
|
|
86
|
+
- **~2 minutes:** Check approximate progress (line counts, sections done)
|
|
87
|
+
- **~5 minutes:** Check for completion. **STUCK AGENT RULE:** If an agent's line count hasn't increased between two consecutive check-ins, stop it immediately and relaunch with pre-loaded data from its search results.
|
|
88
|
+
- **Every 5 minutes thereafter** until all agents complete.
|
|
89
|
+
|
|
90
|
+
Use `wc -l` via Bash for quick line count checks. Keep reports concise.
|
|
91
|
+
|
|
92
|
+
### Stuck Agent Recovery
|
|
93
|
+
|
|
94
|
+
1. Stop the agent immediately
|
|
95
|
+
2. Read the output file to see what sections are complete
|
|
96
|
+
3. Check the agent's process output for useful data it found but never wrote
|
|
97
|
+
4. Relaunch with a new agent that skips completed sections and has pre-loaded data
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Phase 5: Synthesis
|
|
102
|
+
|
|
103
|
+
Once ALL research agents are complete:
|
|
104
|
+
|
|
105
|
+
1. Launch the synthesis agent
|
|
106
|
+
2. It MUST read all research agent outputs, identify cross-cutting themes, contradictions, and gaps
|
|
107
|
+
3. Produce: executive summary, key findings by theme, contradictions, confidence assessment, recommended next steps
|
|
108
|
+
4. Follow the same write protocol (write after every read)
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Critical Rules
|
|
113
|
+
|
|
114
|
+
1. **Never launch agents without user approval of the plan.**
|
|
115
|
+
2. **Every agent gets the critical write protocol.** Non-negotiable — agent MUST Edit after EVERY search. Never two searches without a write.
|
|
116
|
+
3. **Kill stuck agents immediately.** They do NOT self-correct. Relaunch with pre-loaded data from prior search results.
|
|
117
|
+
4. **Source integrity.** Every number needs an inline URL.
|
|
118
|
+
5. **Monitor proactively** using escalating intervals. Don't wait for the user to ask.
|
|
119
|
+
6. **Keep check-in reports concise.**
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-plan
|
|
3
|
+
description: After changes are made to a plan, review for inconsistencies in structure, concepts, or terminology that may derail the implementation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Review Plan Skill
|
|
7
|
+
|
|
8
|
+
## Instructions
|
|
9
|
+
|
|
10
|
+
1. Review the recently updated plan file for consistency in language used and concepts described.
|
|
11
|
+
2. Identify problematic areas of ambiguity in the plan that may cause issues in implementation.
|
|
12
|
+
3. If inconsistencies or ambiguity are identified, present the user with questions to clear things up.
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
### Example 1
|
|
17
|
+
|
|
18
|
+
In the beginning of the plan file, in an overview section, we see a summary that says:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
The new endpoint will be POST /requests/queue and it will create both the Request and Tracker resource
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
But at the end of the plan file in implementation examples we see:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
curl -X POST http://localhost:3001/requests/add
|
|
28
|
+
// Get request and tracker IDs back
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This is a clear inconsistency in language and structure. In this case, we'd ask the user what the intended
|
|
32
|
+
path is for the new endpoint.
|