opencodekit 0.23.3 → 0.23.4
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/README.md +7 -14
- package/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +89 -17
- package/dist/template/.opencode/README.md +43 -6
- package/dist/template/.opencode/artifacts/harness-workflows/plan.md +317 -0
- package/dist/template/.opencode/command/audit.md +65 -0
- package/dist/template/.opencode/command/init.md +19 -2
- package/dist/template/.opencode/command/research.md +67 -16
- package/dist/template/.opencode/command/ship.md +55 -5
- package/dist/template/.opencode/command/verify.md +5 -5
- package/dist/template/.opencode/opencode.json +12 -0
- package/dist/template/.opencode/plugin/README.md +0 -6
- package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +0 -2
- package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +11 -9
- package/dist/template/.opencode/skill/manifest.json +77 -0
- package/dist/template/.opencode/workflows/audit-pattern.md +51 -0
- package/dist/template/.opencode/workflows/batch-implement.md +82 -0
- package/dist/template/.opencode/workflows/deep-research.md +58 -0
- package/dist/template/.opencode/workflows/development-lifecycle-workflow.md +129 -0
- package/package.json +1 -1
- package/dist/template/.opencode/command/clarify.md +0 -46
- package/dist/template/.opencode/command/commit.md +0 -53
- package/dist/template/.opencode/command/design.md +0 -129
- package/dist/template/.opencode/command/explore.md +0 -169
- package/dist/template/.opencode/command/improve-architecture.md +0 -55
- package/dist/template/.opencode/command/pr.md +0 -148
- package/dist/template/.opencode/command/refactor.md +0 -65
- package/dist/template/.opencode/command/review-codebase.md +0 -128
- package/dist/template/.opencode/command/test.md +0 -66
- package/dist/template/.opencode/command/ui-review.md +0 -109
- package/dist/template/.opencode/opencodex-fast.jsonc +0 -3
- package/dist/template/.opencode/plugin/rtk.ts +0 -43
- package/dist/template/.opencode/skill/agent-teams/SKILL.md +0 -268
- package/dist/template/.opencode/skill/code-navigation/SKILL.md +0 -142
- package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +0 -135
- package/dist/template/.opencode/skill/condition-based-waiting/example.ts +0 -171
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +0 -176
- package/dist/template/.opencode/skill/memory-system/SKILL.md +0 -147
- package/dist/template/.opencode/skill/structured-edit/SKILL.md +0 -191
- package/dist/template/.opencode/skill/ubiquitous-language/SKILL.md +0 -184
- package/dist/template/.opencode/skill/v0/SKILL.md +0 -158
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# deep-research
|
|
2
|
+
|
|
3
|
+
Fan out web searches across multiple angles on a question, cross-check sources for contradictions, and produce a cited report with confidence levels. Use when you need multi-source verification or current-events coverage.
|
|
4
|
+
|
|
5
|
+
## Args
|
|
6
|
+
|
|
7
|
+
- `question` (required) — The research question or topic
|
|
8
|
+
|
|
9
|
+
## Phases
|
|
10
|
+
|
|
11
|
+
### Phase 1: research
|
|
12
|
+
|
|
13
|
+
- **Agent:** @scout
|
|
14
|
+
- **Concurrency:** Dynamic (1 agent per distinct angle, min 3, max 10)
|
|
15
|
+
- **Prompt:**
|
|
16
|
+
|
|
17
|
+
Search for different perspectives on the question: {question}. Cover opposing viewpoints, authoritative sources, and recent developments. For each finding, include the URL and publication date. Return findings grouped by angle in this format:
|
|
18
|
+
|
|
19
|
+
## Angle: [angle name]
|
|
20
|
+
- **Finding:** [summary]
|
|
21
|
+
- **Source:** [URL]
|
|
22
|
+
- **Date:** [publication date]
|
|
23
|
+
- **Confidence:** [high/medium/low]
|
|
24
|
+
|
|
25
|
+
Keep each finding under 200 words.
|
|
26
|
+
|
|
27
|
+
### Phase 2: cross-check
|
|
28
|
+
|
|
29
|
+
- **Depends on:** Phase 1
|
|
30
|
+
- **Agent:** @review
|
|
31
|
+
- **Concurrency:** Dynamic (estimate ~5 findings per agent, min 2, max 10)
|
|
32
|
+
- **Prompt:**
|
|
33
|
+
|
|
34
|
+
Cross-check these findings: {phase_1_output}. Flag contradictions between sources, identify confirmable facts with supporting citations, and note where sources disagree or lack evidence. Return a verified fact set in this format:
|
|
35
|
+
|
|
36
|
+
## Verified Facts
|
|
37
|
+
- **Fact:** [statement]
|
|
38
|
+
- **Confidence:** [high/medium/low]
|
|
39
|
+
- **Supporting sources:** [list of URLs]
|
|
40
|
+
|
|
41
|
+
## Contradictions
|
|
42
|
+
- **Claim A:** [statement]
|
|
43
|
+
- **Claim B:** [contradicting statement]
|
|
44
|
+
- **Resolution:** [which is more credible and why]
|
|
45
|
+
|
|
46
|
+
Keep each item under 150 words.
|
|
47
|
+
|
|
48
|
+
## Final Synthesis (Main Agent)
|
|
49
|
+
|
|
50
|
+
After Phase 2 completes, synthesize the final report directly from {phase_2_output}.
|
|
51
|
+
|
|
52
|
+
Write a final cited report using markdown with sections:
|
|
53
|
+
1. **Executive Summary** — Brief overview of key findings
|
|
54
|
+
2. **Key Findings** — Detailed findings with inline citations
|
|
55
|
+
3. **Contradictions & Uncertainties** — Areas of disagreement or low confidence
|
|
56
|
+
4. **Sources** — Complete list of all sources consulted
|
|
57
|
+
|
|
58
|
+
Annotate each claim with confidence level (high/medium/low). Keep the report under 2000 words.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# development-lifecycle-workflow
|
|
2
|
+
|
|
3
|
+
Multi-agent workflow that chains the development lifecycle phases with parallelism. Uses specialized agents (scouts, reviewers, planners) and composes with the batch-implement workflow for parallel implementation.
|
|
4
|
+
|
|
5
|
+
## Args
|
|
6
|
+
|
|
7
|
+
- `feature` (required) — The feature or change to implement
|
|
8
|
+
|
|
9
|
+
## Phases
|
|
10
|
+
|
|
11
|
+
### Phase 1: Research Approaches
|
|
12
|
+
|
|
13
|
+
- **Agent:** @scout
|
|
14
|
+
- **Concurrency:** Dynamic (1 agent per approach, min 2, max 5)
|
|
15
|
+
- **Prompt:**
|
|
16
|
+
|
|
17
|
+
Research different approaches to implementing: {feature}. For each approach, analyze:
|
|
18
|
+
1. Technical feasibility
|
|
19
|
+
2. Trade-offs and risks
|
|
20
|
+
3. Implementation complexity
|
|
21
|
+
4. Dependencies and constraints
|
|
22
|
+
|
|
23
|
+
Return findings in this format:
|
|
24
|
+
|
|
25
|
+
## Approach 1: [name]
|
|
26
|
+
- **Description:** [summary]
|
|
27
|
+
- **Pros:** [list]
|
|
28
|
+
- **Cons:** [list]
|
|
29
|
+
- **Complexity:** [low/medium/high]
|
|
30
|
+
- **Risks:** [list]
|
|
31
|
+
|
|
32
|
+
Keep each approach under 300 words.
|
|
33
|
+
|
|
34
|
+
### Phase 2: Validate Requirements
|
|
35
|
+
|
|
36
|
+
- **Depends on:** Phase 1
|
|
37
|
+
- **Agent:** @review
|
|
38
|
+
- **Concurrency:** Dynamic (1 agent per approach, min 1, max 5)
|
|
39
|
+
- **Prompt:**
|
|
40
|
+
|
|
41
|
+
Review these approaches: {phase_1_output}. Validate the requirements and constraints for each approach. Check for:
|
|
42
|
+
1. Technical accuracy
|
|
43
|
+
2. Feasibility given project constraints
|
|
44
|
+
3. Alignment with existing patterns
|
|
45
|
+
4. Missing considerations
|
|
46
|
+
|
|
47
|
+
Return validated requirements in this format:
|
|
48
|
+
|
|
49
|
+
## Validated Requirements
|
|
50
|
+
- **Approach 1:** [validated requirements]
|
|
51
|
+
- **Approach 2:** [validated requirements]
|
|
52
|
+
- **Approach 3:** [validated requirements]
|
|
53
|
+
|
|
54
|
+
## Recommendations
|
|
55
|
+
- **Recommended approach:** [which approach and why]
|
|
56
|
+
- **Critical constraints:** [list]
|
|
57
|
+
|
|
58
|
+
Keep each section under 200 words.
|
|
59
|
+
|
|
60
|
+
### Phase 3: Create Implementation Plan
|
|
61
|
+
|
|
62
|
+
- **Depends on:** Phase 2
|
|
63
|
+
- **Agent:** @plan
|
|
64
|
+
- **Concurrency:** 1
|
|
65
|
+
- **Prompt:**
|
|
66
|
+
|
|
67
|
+
Based on the validated requirements: {phase_2_output}, create a detailed implementation plan for the recommended approach. Break down into independent tasks that can be implemented in parallel.
|
|
68
|
+
|
|
69
|
+
Return the plan in this format:
|
|
70
|
+
|
|
71
|
+
## Implementation Plan
|
|
72
|
+
|
|
73
|
+
### Overview
|
|
74
|
+
[Brief description of the approach]
|
|
75
|
+
|
|
76
|
+
### Tasks
|
|
77
|
+
- **Task 1:** [description]
|
|
78
|
+
- Files: [list]
|
|
79
|
+
- Dependencies: [none or task names]
|
|
80
|
+
- **Task 2:** [description]
|
|
81
|
+
- Files: [list]
|
|
82
|
+
- Dependencies: [none or task names]
|
|
83
|
+
|
|
84
|
+
Keep each task description under 100 words.
|
|
85
|
+
|
|
86
|
+
### Phase 4: Parallel Implementation
|
|
87
|
+
|
|
88
|
+
- **Depends on:** Phase 3
|
|
89
|
+
- **Workflow:** batch-implement
|
|
90
|
+
- **Args:** plan from Phase 3
|
|
91
|
+
|
|
92
|
+
Execute the batch-implement workflow with the implementation plan from Phase 3. This will:
|
|
93
|
+
1. Review the plan for task independence
|
|
94
|
+
2. Implement tasks in parallel
|
|
95
|
+
3. Verify each implementation
|
|
96
|
+
4. Merge the results
|
|
97
|
+
|
|
98
|
+
### Phase 5: Verify Different Aspects
|
|
99
|
+
|
|
100
|
+
- **Depends on:** Phase 4
|
|
101
|
+
- **Agent:** @review
|
|
102
|
+
- **Concurrency:** 3 (one per aspect: correctness, code-quality, performance-security)
|
|
103
|
+
- **Prompt:**
|
|
104
|
+
|
|
105
|
+
Verify the implementation from different aspects: {phase_4_output}. Each reviewer should focus on a different aspect:
|
|
106
|
+
|
|
107
|
+
**Reviewer 1: Correctness**
|
|
108
|
+
- Verify all requirements are met
|
|
109
|
+
- Check for logic errors
|
|
110
|
+
- Validate edge cases
|
|
111
|
+
|
|
112
|
+
**Reviewer 2: Code Quality**
|
|
113
|
+
- Check for code style and patterns
|
|
114
|
+
- Identify code smells
|
|
115
|
+
- Verify test coverage
|
|
116
|
+
|
|
117
|
+
**Reviewer 3: Performance & Security**
|
|
118
|
+
- Check for performance bottlenecks
|
|
119
|
+
- Identify security vulnerabilities
|
|
120
|
+
- Validate error handling
|
|
121
|
+
|
|
122
|
+
Return findings in this format:
|
|
123
|
+
|
|
124
|
+
## Aspect: [correctness/code-quality/performance-security]
|
|
125
|
+
- **Status:** [pass/fail]
|
|
126
|
+
- **Issues:** [list with file:line refs]
|
|
127
|
+
- **Recommendations:** [list]
|
|
128
|
+
|
|
129
|
+
Keep each finding under 150 words.
|
package/package.json
CHANGED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Reduce ambiguity before planning or implementation
|
|
3
|
-
argument-hint: "<request> [--quick|--deep]"
|
|
4
|
-
agent: build
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Clarify: $ARGUMENTS
|
|
8
|
-
|
|
9
|
-
Reduce ambiguity before planning or implementation. Use when the request is real but still fuzzy.
|
|
10
|
-
|
|
11
|
-
## Load Skills
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
skill({ name: "brainstorming" });
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Parse Arguments
|
|
18
|
-
|
|
19
|
-
| Argument | Default | Description |
|
|
20
|
-
|---|---|---|
|
|
21
|
-
| `<request>` | required | Freeform request text |
|
|
22
|
-
| `--quick` | false | Minimize to 1-3 high-leverage questions |
|
|
23
|
-
| `--deep` | false | Cover non-goals, risks, interfaces, success criteria |
|
|
24
|
-
|
|
25
|
-
**Mode rules:** Default → make next command obvious. `--quick` → 1-3 questions. `--deep` → exhaustive. `--deep` wins if both appear.
|
|
26
|
-
|
|
27
|
-
## When to Use / Not Use
|
|
28
|
-
|
|
29
|
-
**Use:** Request is fuzzy, scope unclear, multiple interpretations of "done," `/plan` would be premature because main decision is unresolved.
|
|
30
|
-
**Skip:** Request is specific enough to plan directly, task is mechanical, ambiguity is only about codebase facts you can inspect.
|
|
31
|
-
|
|
32
|
-
## Core Rules
|
|
33
|
-
|
|
34
|
-
- **Inspect first, ask second** — never ask for codebase facts you can discover directly
|
|
35
|
-
- **One question at a time** — each must reduce a real ambiguity
|
|
36
|
-
- **Prefer structured choices** (multiple choice, yes/no)
|
|
37
|
-
- **Surface non-goals explicitly** — what should *not* change is as important as what should
|
|
38
|
-
- **Stop once the next command is obvious**
|
|
39
|
-
|
|
40
|
-
## Process
|
|
41
|
-
|
|
42
|
-
1. Read request, identify unknowns blocking execution
|
|
43
|
-
2. Search memory, check existing patterns
|
|
44
|
-
3. Ask questions one at a time, resolve before next
|
|
45
|
-
4. Surface non-goals and constraints
|
|
46
|
-
5. Recommend next command: `/plan`, `/create`, `/ship`, or `/design`
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Create a well-structured conventional commit from staged or unstaged changes
|
|
3
|
-
argument-hint: "[--all] [--amend] [message override]"
|
|
4
|
-
agent: build
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Commit: $ARGUMENTS
|
|
8
|
-
|
|
9
|
-
Create a well-structured conventional commit from current changes.
|
|
10
|
-
|
|
11
|
-
## Load Skills
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
skill({ name: "verification-before-completion" });
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Process
|
|
18
|
-
|
|
19
|
-
### Phase 1: Inspect Changes
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
git status --short
|
|
23
|
-
git diff --cached --stat # if staged
|
|
24
|
-
git diff --stat # if unstaged
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Phase 2: Review Diffs
|
|
28
|
-
|
|
29
|
-
Read each changed file. Look for:
|
|
30
|
-
- Debug code, console.log, TODOs that should be resolved
|
|
31
|
-
- Accidental changes outside scope
|
|
32
|
-
- Missing error handling or edge cases
|
|
33
|
-
|
|
34
|
-
### Phase 3: Construct Commit
|
|
35
|
-
|
|
36
|
-
Format: `type(scope): description`
|
|
37
|
-
|
|
38
|
-
Types: `feat` (feature), `fix` (bug), `test` (test-only), `refactor` (no behavior change), `chore` (config/tooling), `docs`, `style`, `perf`.
|
|
39
|
-
|
|
40
|
-
### Phase 4: Commit
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
git add <files> # stage specific files — never git add .
|
|
44
|
-
git commit -m "type(scope): description
|
|
45
|
-
|
|
46
|
-
- bullet points of key changes"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Phase 5: Verify
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
git log --oneline -3
|
|
53
|
-
```
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: UI/UX visual design with aesthetic direction and code output
|
|
3
|
-
argument-hint: "<component|page|system> [topic] [--quick]"
|
|
4
|
-
agent: vision
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Design: $ARGUMENTS
|
|
8
|
-
|
|
9
|
-
Design a component, page, or design system with a clear aesthetic point of view.
|
|
10
|
-
|
|
11
|
-
> **Design track (optional):** Not part of the core `/create → /ship` workflow.
|
|
12
|
-
> Use when you need visual design guidance before or during implementation.
|
|
13
|
-
|
|
14
|
-
## Parse Arguments
|
|
15
|
-
|
|
16
|
-
| Argument | Default | Description |
|
|
17
|
-
| ----------- | -------- | ------------------------------------------- |
|
|
18
|
-
| `component` | — | Design a specific component |
|
|
19
|
-
| `page` | — | Design a page layout |
|
|
20
|
-
| `system` | — | Create or extend a design system |
|
|
21
|
-
| `[topic]` | required | What to design (e.g. "button", "dashboard") |
|
|
22
|
-
| `--quick` | false | High-level direction only, skip code |
|
|
23
|
-
|
|
24
|
-
## Load Skills
|
|
25
|
-
|
|
26
|
-
```typescript
|
|
27
|
-
skill({ name: "frontend-design" }); // Design system guidance, anti-patterns, references
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Phase 1: Detect Existing Design System
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
srcwalk files "**/tailwind.config.{js,ts,mjs}"
|
|
36
|
-
srcwalk files "**/globals.css"
|
|
37
|
-
srcwalk files "**/components.json" # shadcn
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Read what exists. Don't design in a vacuum — build on the project's current system.
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Phase 2: Check Memory
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
memory - search({ query: "[topic] design UI", limit: 3 });
|
|
48
|
-
memory - search({ query: "design system colors typography", limit: 3 });
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Reuse existing aesthetic decisions. Don't contradict previous design choices unless the user asks.
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Phase 3: UX Structure Decisions
|
|
56
|
-
|
|
57
|
-
Before visual design, define the interaction structure. A beautiful screen with unclear scope, weak recovery, or missing states is still failed design.
|
|
58
|
-
|
|
59
|
-
State these decisions explicitly:
|
|
60
|
-
|
|
61
|
-
1. **Primary action** — the one dominant action for the component/page/flow
|
|
62
|
-
2. **User-facing vocabulary** — entity/action names the UI will use consistently
|
|
63
|
-
3. **Scope and relationships** — what this UI affects, where the user is, and what related objects matter
|
|
64
|
-
4. **Dangerous actions** — destructive/bulk/account/security actions and their confirm/undo/recovery pattern
|
|
65
|
-
5. **State model** — empty, loading, error, success, disabled, and optimistic states required
|
|
66
|
-
6. **Pattern selection** — form, table/list/grid, notification, modal, or navigation pattern if applicable
|
|
67
|
-
|
|
68
|
-
Keep these decisions concrete and explicit.
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Phase 4: Design
|
|
73
|
-
|
|
74
|
-
The `frontend-design` skill provides all reference material:
|
|
75
|
-
|
|
76
|
-
- Aesthetic directions and design philosophy
|
|
77
|
-
- Typography and font pairing guidance
|
|
78
|
-
- Color systems (OKLCH)
|
|
79
|
-
- Animation patterns (Motion + Tailwind)
|
|
80
|
-
- Anti-patterns and AI slop avoidance
|
|
81
|
-
- shadcn/ui component patterns
|
|
82
|
-
- Tailwind v4 configuration
|
|
83
|
-
|
|
84
|
-
**Before designing, state:**
|
|
85
|
-
|
|
86
|
-
1. **Aesthetic direction** — which style and why
|
|
87
|
-
2. **Key characteristics** — 3 specific elements you'll apply
|
|
88
|
-
3. **UX gates satisfied** — primary action, states, recovery, and accessibility baseline
|
|
89
|
-
|
|
90
|
-
Then produce the design:
|
|
91
|
-
|
|
92
|
-
| Task Type | Output |
|
|
93
|
-
| ----------- | ------------------------------------- |
|
|
94
|
-
| `component` | Spec (variants, sizes, states) + code |
|
|
95
|
-
| `page` | Layout structure + section breakdown |
|
|
96
|
-
| `system` | Tokens (CSS variables) + guidelines |
|
|
97
|
-
|
|
98
|
-
For `--quick`: Skip code output. Provide direction + key decisions only.
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Phase 5: Record Decision
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
observation({
|
|
106
|
-
type: "decision",
|
|
107
|
-
title: "Design: [topic]",
|
|
108
|
-
narrative: "Chose [direction] because [rationale]. Key tokens: [colors, fonts].",
|
|
109
|
-
concepts: "design, ui, [topic]",
|
|
110
|
-
confidence: "high",
|
|
111
|
-
});
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## Examples
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
/design component button # Full component design with code
|
|
120
|
-
/design page landing --quick # High-level page direction only
|
|
121
|
-
/design system # Create/extend design system tokens
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## Related Commands
|
|
125
|
-
|
|
126
|
-
| Need | Command |
|
|
127
|
-
| ------------------ | -------------- |
|
|
128
|
-
| Review existing UI | `/ui-review` |
|
|
129
|
-
| Ship it | `/ship <bead>` |
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Think through an idea with structured alternatives before committing to a change
|
|
3
|
-
argument-hint: "<idea or question>"
|
|
4
|
-
agent: plan
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Explore: $ARGUMENTS
|
|
8
|
-
|
|
9
|
-
Think through an idea, problem, or approach with structured alternatives and tradeoffs — before committing to a plan.
|
|
10
|
-
|
|
11
|
-
> **Workflow:** **`/explore`** → `/create` (if worth pursuing) or discard
|
|
12
|
-
>
|
|
13
|
-
> Use when you're not sure WHAT to build or HOW to approach it. This is ideation with rigor, not open-ended brainstorming.
|
|
14
|
-
>
|
|
15
|
-
> **When to use:** Before `/create`, when the approach isn't obvious. Skip for clear, well-scoped work.
|
|
16
|
-
|
|
17
|
-
## Load Skills
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
skill({ name: "brainstorming" }); // Collaborative refinement
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Phase 1: Ground
|
|
24
|
-
|
|
25
|
-
Search for prior art and past decisions:
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
memory_search({ query: "<topic keywords>", limit: 5 });
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
# What exists in the codebase already?
|
|
33
|
-
git log --oneline -20 | grep -i "<keyword>"
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Spawn an explore agent to understand the current state:
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
task({
|
|
40
|
-
subagent_type: "explore",
|
|
41
|
-
description: "Map existing patterns for this area",
|
|
42
|
-
prompt: `Search the codebase for existing implementations, patterns, and conventions related to: $ARGUMENTS
|
|
43
|
-
|
|
44
|
-
Return: what exists today, what patterns are used, what files are involved.`,
|
|
45
|
-
});
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Phase 2: Frame the Problem
|
|
49
|
-
|
|
50
|
-
Before proposing solutions, state the problem clearly:
|
|
51
|
-
|
|
52
|
-
1. **What's the goal?** (outcome, not task)
|
|
53
|
-
2. **What constraints exist?** (tech stack, time, compatibility, user preferences)
|
|
54
|
-
3. **What's the risk of doing nothing?** (is this urgent or nice-to-have?)
|
|
55
|
-
|
|
56
|
-
If the problem isn't clear after reading context, ask the user to clarify — but max 2 questions.
|
|
57
|
-
|
|
58
|
-
## Phase 3: Generate Alternatives
|
|
59
|
-
|
|
60
|
-
Produce 2-3 approaches. For each:
|
|
61
|
-
|
|
62
|
-
| Aspect | What to Cover |
|
|
63
|
-
| ------------ | -------------------------------------- |
|
|
64
|
-
| **Approach** | 1-2 sentence summary |
|
|
65
|
-
| **How** | Key implementation steps (3-5 bullets) |
|
|
66
|
-
| **Pros** | What this gets right |
|
|
67
|
-
| **Cons** | What this gets wrong or makes harder |
|
|
68
|
-
| **Effort** | S (<1h), M (1-3h), L (1-2d), XL (>2d) |
|
|
69
|
-
| **Risk** | What could go wrong |
|
|
70
|
-
|
|
71
|
-
**Rules for alternatives:**
|
|
72
|
-
|
|
73
|
-
- At least one must be the simplest viable option
|
|
74
|
-
- At least one must be different in kind, not just degree (different architecture, not just different library)
|
|
75
|
-
- Don't pad with bad options to make the recommended one look good
|
|
76
|
-
|
|
77
|
-
## Phase 4: Recommend
|
|
78
|
-
|
|
79
|
-
Pick one approach and explain why:
|
|
80
|
-
|
|
81
|
-
```markdown
|
|
82
|
-
## Recommendation
|
|
83
|
-
|
|
84
|
-
**Approach:** [Name]
|
|
85
|
-
**Effort:** [S/M/L/XL]
|
|
86
|
-
**Why:** [2-3 sentences — why this over the others]
|
|
87
|
-
**When to reconsider:** [What signals would make you switch to an alternative]
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Phase 5: Output Proposal
|
|
91
|
-
|
|
92
|
-
Write the proposal as a structured document:
|
|
93
|
-
|
|
94
|
-
```markdown
|
|
95
|
-
# Exploration: [Topic]
|
|
96
|
-
|
|
97
|
-
## Problem
|
|
98
|
-
|
|
99
|
-
[What we're trying to solve]
|
|
100
|
-
|
|
101
|
-
## Constraints
|
|
102
|
-
|
|
103
|
-
- [Constraint 1]
|
|
104
|
-
- [Constraint 2]
|
|
105
|
-
|
|
106
|
-
## Alternatives
|
|
107
|
-
|
|
108
|
-
### Option A: [Name]
|
|
109
|
-
|
|
110
|
-
- **How:** ...
|
|
111
|
-
- **Pros:** ...
|
|
112
|
-
- **Cons:** ...
|
|
113
|
-
- **Effort:** S/M/L/XL
|
|
114
|
-
|
|
115
|
-
### Option B: [Name]
|
|
116
|
-
|
|
117
|
-
- **How:** ...
|
|
118
|
-
- **Pros:** ...
|
|
119
|
-
- **Cons:** ...
|
|
120
|
-
- **Effort:** S/M/L/XL
|
|
121
|
-
|
|
122
|
-
### Option C: [Name] (if applicable)
|
|
123
|
-
|
|
124
|
-
...
|
|
125
|
-
|
|
126
|
-
## Recommendation
|
|
127
|
-
|
|
128
|
-
**Option [X]** because [reasoning].
|
|
129
|
-
**Reconsider if:** [triggers for switching]
|
|
130
|
-
|
|
131
|
-
## Next Step
|
|
132
|
-
|
|
133
|
-
`/create "[description based on chosen approach]"`
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
**If a plan exists:** Save to `.opencode/artifacts/$(cat .opencode/artifacts/.active)/research.md`
|
|
137
|
-
**If no plan:** Display inline, don't create files.
|
|
138
|
-
|
|
139
|
-
## Phase 6: Ask User
|
|
140
|
-
|
|
141
|
-
Present the proposal and ask:
|
|
142
|
-
|
|
143
|
-
```typescript
|
|
144
|
-
question({
|
|
145
|
-
questions: [
|
|
146
|
-
{
|
|
147
|
-
header: "Approach",
|
|
148
|
-
question: "Which approach do you want to pursue?",
|
|
149
|
-
options: [
|
|
150
|
-
{ label: "Option A (Recommended)", description: "[brief]" },
|
|
151
|
-
{ label: "Option B", description: "[brief]" },
|
|
152
|
-
{ label: "Option C", description: "[brief]" },
|
|
153
|
-
{ label: "None — need more research", description: "Spawn scout agents" },
|
|
154
|
-
],
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
});
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
If user picks an approach → suggest `/create "[description]"` with the chosen approach baked in.
|
|
161
|
-
If user wants more research → spawn `@scout` for the specific unknowns.
|
|
162
|
-
|
|
163
|
-
## Related Commands
|
|
164
|
-
|
|
165
|
-
| Need | Command |
|
|
166
|
-
| ------------------------- | ----------------------------------- |
|
|
167
|
-
| Commit to an approach | `/create` |
|
|
168
|
-
| Research external options | `/research` |
|
|
169
|
-
| Open-ended ideation | Load `brainstorming` skill directly |
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Proactive architecture health check — find shallow modules, propose deep-module redesigns
|
|
3
|
-
argument-hint: "[path|module|'all'] [--scope surface|deep]"
|
|
4
|
-
agent: review
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Improve Architecture: $ARGUMENTS
|
|
8
|
-
|
|
9
|
-
Proactive architecture health check. Find shallow modules and propose deep-module redesigns.
|
|
10
|
-
|
|
11
|
-
## Load Skills
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
skill({ name: "deep-module-design" });
|
|
15
|
-
skill({ name: "verification-before-completion" });
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Architecture Check
|
|
19
|
-
|
|
20
|
-
Apply Ousterhout's deep module principles:
|
|
21
|
-
- **Small interface** — does this module expose more than it should?
|
|
22
|
-
- **Information hiding** — are implementation details leaking?
|
|
23
|
-
- **Pull complexity downward** — are callers doing work the module should own?
|
|
24
|
-
|
|
25
|
-
## Process
|
|
26
|
-
|
|
27
|
-
### Phase 1: Scan
|
|
28
|
-
|
|
29
|
-
If path given, focus on that directory. If `all`, scan the full project.
|
|
30
|
-
|
|
31
|
-
For each module, assess:
|
|
32
|
-
- Lines of interface vs lines of implementation
|
|
33
|
-
- Number of callers and how they use it
|
|
34
|
-
- What knowledge is embedded but not encapsulated
|
|
35
|
-
- What would break if the module were redesigned
|
|
36
|
-
|
|
37
|
-
### Phase 2: Propose
|
|
38
|
-
|
|
39
|
-
For each finding:
|
|
40
|
-
|
|
41
|
-
| Module | Issue | Proposed Redesign | Effort | Risk |
|
|
42
|
-
|---|---|---|---|---|
|
|
43
|
-
| path/to/module | Shallow interface exposing internals | Encapsulate behind 3 functions | M | Low |
|
|
44
|
-
|
|
45
|
-
### Phase 3: Prioritize
|
|
46
|
-
|
|
47
|
-
Rank proposals by impact/effort ratio. Recommend top 1-3 changes worth making.
|
|
48
|
-
|
|
49
|
-
## Output
|
|
50
|
-
|
|
51
|
-
Report:
|
|
52
|
-
1. Modules reviewed
|
|
53
|
-
2. Findings (current issue, proposed redesign, effort, risk)
|
|
54
|
-
3. Top recommendations
|
|
55
|
-
4. Quick wins (S-effort changes)
|