opencodekit 0.21.9 → 0.22.0
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/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +116 -499
- package/dist/template/.opencode/README.md +1 -1
- package/dist/template/.opencode/agent/build.md +56 -396
- package/dist/template/.opencode/agent/explore.md +15 -16
- package/dist/template/.opencode/agent/general.md +2 -2
- package/dist/template/.opencode/agent/plan.md +3 -3
- package/dist/template/.opencode/agent/review.md +2 -3
- package/dist/template/.opencode/agent/scout.md +34 -16
- package/dist/template/.opencode/agent/vision.md +0 -1
- package/dist/template/.opencode/command/clarify.md +48 -0
- package/dist/template/.opencode/command/commit.md +53 -0
- package/dist/template/.opencode/command/design.md +4 -4
- package/dist/template/.opencode/command/fix.md +56 -0
- package/dist/template/.opencode/command/improve-architecture.md +55 -0
- package/dist/template/.opencode/command/init.md +88 -68
- package/dist/template/.opencode/command/refactor.md +66 -0
- package/dist/template/.opencode/command/review-codebase.md +1 -1
- package/dist/template/.opencode/command/ship.md +1 -1
- package/dist/template/.opencode/command/test.md +66 -0
- package/dist/template/.opencode/dcp.jsonc +29 -46
- package/dist/template/.opencode/memory/README.md +3 -5
- package/dist/template/.opencode/memory/_templates/adr.md +45 -0
- package/dist/template/.opencode/memory/project/gotchas.md +1 -1
- package/dist/template/.opencode/memory/project/user.md +1 -2
- package/dist/template/.opencode/memory/session-context.md +1 -1
- package/dist/template/.opencode/opencode.json +10 -332
- package/dist/template/.opencode/plugin/README.md +1 -1
- package/dist/template/.opencode/plugin/guard.ts +62 -0
- package/dist/template/.opencode/plugin/{lib/memory-admin-tools.ts → memory/admin.ts} +4 -4
- package/dist/template/.opencode/plugin/{lib → memory}/capture.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/compile.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/context.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/curator.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/observations.ts +102 -3
- package/dist/template/.opencode/plugin/{lib → memory}/db/schema.ts +43 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/types.ts +22 -0
- package/dist/template/.opencode/plugin/{lib/memory-db.ts → memory/db.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/distill.ts +1 -1
- package/dist/template/.opencode/plugin/{lib/memory-helpers.ts → memory/helpers.ts} +5 -1
- package/dist/template/.opencode/plugin/{lib/memory-hooks.ts → memory/hooks.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/index-generator.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/inject.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/lint.ts +2 -2
- package/dist/template/.opencode/plugin/memory/tools.ts +322 -0
- package/dist/template/.opencode/plugin/{lib → memory}/validate.ts +2 -2
- package/dist/template/.opencode/plugin/memory.ts +7 -17
- package/dist/template/.opencode/plugin/srcwalk.ts +721 -0
- package/dist/template/.opencode/skill/agent-code-quality-gate/SKILL.md +98 -0
- package/dist/template/.opencode/skill/behavioral-kernel/SKILL.md +52 -0
- package/dist/template/.opencode/skill/browser-testing-with-devtools/SKILL.md +85 -0
- package/dist/template/.opencode/skill/code-cleanup/SKILL.md +114 -0
- package/dist/template/.opencode/skill/code-navigation/SKILL.md +142 -0
- package/dist/template/.opencode/skill/code-review-and-quality/SKILL.md +131 -0
- package/dist/template/.opencode/skill/debugging-and-error-recovery/SKILL.md +109 -0
- package/dist/template/.opencode/skill/deep-module-design/SKILL.md +207 -0
- package/dist/template/.opencode/skill/git-workflow-and-versioning/SKILL.md +77 -0
- package/dist/template/.opencode/skill/grill-me/SKILL.md +140 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +9 -10
- package/dist/template/.opencode/skill/planning-and-task-breakdown/SKILL.md +116 -0
- package/dist/template/.opencode/skill/shipping-and-launch/SKILL.md +95 -0
- package/dist/template/.opencode/skill/source-driven-development/SKILL.md +103 -0
- package/dist/template/.opencode/skill/spec-driven-development/SKILL.md +121 -0
- package/dist/template/.opencode/skill/srcwalk/SKILL.md +161 -0
- package/dist/template/.opencode/skill/ubiquitous-language/SKILL.md +184 -0
- package/dist/template/.opencode/tool/context7.ts +1 -1
- package/dist/template/.opencode/tool/grepsearch.ts +1 -1
- package/package.json +1 -1
- package/dist/template/.opencode/AGENT_ALIGNMENT.md +0 -564
- package/dist/template/.opencode/agent/painter.md +0 -83
- package/dist/template/.opencode/command/compound.md +0 -240
- package/dist/template/.opencode/command/curate.md +0 -299
- package/dist/template/.opencode/command/handoff.md +0 -149
- package/dist/template/.opencode/command/health.md +0 -356
- package/dist/template/.opencode/command/init-context.md +0 -297
- package/dist/template/.opencode/command/init-user.md +0 -125
- package/dist/template/.opencode/command/iterate.md +0 -200
- package/dist/template/.opencode/command/lfg.md +0 -173
- package/dist/template/.opencode/command/resume.md +0 -78
- package/dist/template/.opencode/command/status.md +0 -126
- package/dist/template/.opencode/command/ui-slop-check.md +0 -169
- package/dist/template/.opencode/plugin/lib/memory-tools.ts +0 -535
- package/dist/template/.opencode/skill/agent-evals/SKILL.md +0 -208
- package/dist/template/.opencode/skill/anti-ai-slop/SKILL.md +0 -76
- package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +0 -122
- package/dist/template/.opencode/skill/augment-context-engine/mcp.json +0 -6
- package/dist/template/.opencode/skill/brand-asset-protocol/SKILL.md +0 -222
- package/dist/template/.opencode/skill/code-search-patterns/SKILL.md +0 -253
- package/dist/template/.opencode/skill/code-simplification/SKILL.md +0 -211
- package/dist/template/.opencode/skill/context-condensation/SKILL.md +0 -149
- package/dist/template/.opencode/skill/context-initialization/SKILL.md +0 -69
- package/dist/template/.opencode/skill/context-management/SKILL.md +0 -390
- package/dist/template/.opencode/skill/deep-research/SKILL.md +0 -384
- package/dist/template/.opencode/skill/design-direction-advisor/SKILL.md +0 -139
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +0 -191
- package/dist/template/.opencode/skill/executing-plans/SKILL.md +0 -247
- package/dist/template/.opencode/skill/figma-go/SKILL.md +0 -65
- package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +0 -357
- package/dist/template/.opencode/skill/full-output-enforcement/SKILL.md +0 -62
- package/dist/template/.opencode/skill/gh-address-comments/SKILL.md +0 -29
- package/dist/template/.opencode/skill/gh-address-comments/scripts/fetch_comments.py +0 -237
- package/dist/template/.opencode/skill/gh-fix-ci/SKILL.md +0 -38
- package/dist/template/.opencode/skill/gh-fix-ci/scripts/inspect_pr_checks.py +0 -509
- package/dist/template/.opencode/skill/hi-fi-prototype-html/SKILL.md +0 -253
- package/dist/template/.opencode/skill/html-deck-export/SKILL.md +0 -189
- package/dist/template/.opencode/skill/index-knowledge/SKILL.md +0 -413
- package/dist/template/.opencode/skill/memory-grounding/SKILL.md +0 -68
- package/dist/template/.opencode/skill/playwriter/SKILL.md +0 -158
- package/dist/template/.opencode/skill/portless/SKILL.md +0 -109
- package/dist/template/.opencode/skill/prd/SKILL.md +0 -146
- package/dist/template/.opencode/skill/prd-task/SKILL.md +0 -182
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +0 -124
- package/dist/template/.opencode/skill/prompt-leverage/SKILL.md +0 -90
- package/dist/template/.opencode/skill/prompt-leverage/references/framework.md +0 -91
- package/dist/template/.opencode/skill/prompt-leverage/scripts/augment_prompt.py +0 -157
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +0 -263
- package/dist/template/.opencode/skill/reconcile/SKILL.md +0 -183
- package/dist/template/.opencode/skill/reflection-checkpoints/SKILL.md +0 -183
- package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +0 -443
- package/dist/template/.opencode/skill/requesting-code-review/references/specialist-profiles.md +0 -108
- package/dist/template/.opencode/skill/requesting-code-review/review.md +0 -160
- package/dist/template/.opencode/skill/rtk-command-compression/SKILL.md +0 -134
- package/dist/template/.opencode/skill/screenshot/SKILL.md +0 -48
- package/dist/template/.opencode/skill/screenshot/scripts/ensure_macos_permissions.sh +0 -54
- package/dist/template/.opencode/skill/screenshot/scripts/macos_display_info.swift +0 -22
- package/dist/template/.opencode/skill/screenshot/scripts/macos_permissions.swift +0 -40
- package/dist/template/.opencode/skill/screenshot/scripts/macos_window_info.swift +0 -126
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.ps1 +0 -163
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.py +0 -585
- package/dist/template/.opencode/skill/security-threat-model/SKILL.md +0 -36
- package/dist/template/.opencode/skill/security-threat-model/references/prompt-template.md +0 -255
- package/dist/template/.opencode/skill/security-threat-model/references/security-controls-and-assets.md +0 -32
- package/dist/template/.opencode/skill/sharing-skills/SKILL.md +0 -214
- package/dist/template/.opencode/skill/skill-creator/SKILL.md +0 -181
- package/dist/template/.opencode/skill/skill-installer/SKILL.md +0 -58
- package/dist/template/.opencode/skill/skill-installer/scripts/github_utils.py +0 -21
- package/dist/template/.opencode/skill/skill-installer/scripts/install-skill-from-github.py +0 -313
- package/dist/template/.opencode/skill/skill-installer/scripts/list-skills.py +0 -106
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +0 -244
- package/dist/template/.opencode/skill/swarm-coordination/references/architecture.md +0 -39
- package/dist/template/.opencode/skill/swarm-coordination/references/delegation-worker-protocol.md +0 -145
- package/dist/template/.opencode/skill/swarm-coordination/references/dependency-graph.md +0 -50
- package/dist/template/.opencode/skill/swarm-coordination/references/drift-check.md +0 -90
- package/dist/template/.opencode/skill/swarm-coordination/references/integration-beads.md +0 -20
- package/dist/template/.opencode/skill/swarm-coordination/references/launch-flow.md +0 -186
- package/dist/template/.opencode/skill/swarm-coordination/references/reconciler.md +0 -172
- package/dist/template/.opencode/skill/swarm-coordination/references/tier-enforcement.md +0 -78
- package/dist/template/.opencode/skill/swarm-coordination/references/tmux-integration.md +0 -134
- package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +0 -402
- package/dist/template/.opencode/skill/terse-output-mode/SKILL.md +0 -95
- package/dist/template/.opencode/skill/think-in-code/SKILL.md +0 -136
- package/dist/template/.opencode/skill/ux-quality-gates/SKILL.md +0 -137
- package/dist/template/.opencode/skill/v1-run/SKILL.md +0 -175
- package/dist/template/.opencode/skill/v1-run/mcp.json +0 -6
- package/dist/template/.opencode/skill/verification-gates/SKILL.md +0 -63
- package/dist/template/.opencode/skill/visual-analysis/SKILL.md +0 -154
- package/dist/template/.opencode/skill/web-design-guidelines/SKILL.md +0 -46
- package/dist/template/.opencode/skill/workspace-setup/SKILL.md +0 -76
- package/dist/template/.opencode/skill/writing-plans/SKILL.md +0 -320
- /package/dist/template/.opencode/plugin/{lib → memory}/compact.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/graph.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/maintenance.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/pipeline.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/notify.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/operation-log.ts +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: External research specialist for library docs and patterns
|
|
2
|
+
description: External research specialist for library docs, dependency source, and patterns
|
|
3
3
|
mode: subagent
|
|
4
4
|
temperature: 0.2
|
|
5
5
|
steps: 30
|
|
6
6
|
tools:
|
|
7
|
-
memory-update: false
|
|
8
7
|
observation: false
|
|
9
8
|
todowrite: false
|
|
10
9
|
question: false
|
|
@@ -32,40 +31,46 @@ You are OpenCode, the best coding agent on the planet.
|
|
|
32
31
|
|
|
33
32
|
# Scout Agent
|
|
34
33
|
|
|
35
|
-
**Purpose**: Knowledge seeker — you find the signal in the noise of external information.
|
|
34
|
+
**Purpose**: Knowledge seeker — you find the signal in the noise of external information. You inspect dependency source, compare local code against upstream, and return evidence-backed findings.
|
|
36
35
|
|
|
37
36
|
> _"Good research doesn't dump facts; it creates actionable clarity."_
|
|
38
37
|
|
|
39
38
|
## Identity
|
|
40
39
|
|
|
41
|
-
You are a read-only research agent. You output concise recommendations backed by verifiable sources only.
|
|
40
|
+
You are a read-only research agent. You output concise recommendations backed by verifiable sources only. Do not modify the user's workspace.
|
|
42
41
|
|
|
43
42
|
## Task
|
|
44
43
|
|
|
45
|
-
Find trustworthy external references quickly and return concise, cited guidance.
|
|
44
|
+
Find trustworthy external references quickly and return concise, cited guidance — starting with the direct answer, then the evidence.
|
|
46
45
|
|
|
47
46
|
## Success Criteria
|
|
48
47
|
|
|
48
|
+
- **Lead with the answer** — state the finding first, then the evidence
|
|
49
49
|
- Answer the research question with the smallest set of authoritative sources that supports the recommendation
|
|
50
50
|
- Lock factual claims to retrieved sources; do not rely on model memory for current facts, APIs, specs, or release status
|
|
51
51
|
- Separate verified facts from assumptions, estimates, and lower-confidence context
|
|
52
52
|
- State source conflicts explicitly and prefer higher-ranked sources
|
|
53
53
|
- Stop when more searching is unlikely to change the recommendation
|
|
54
|
+
- If a repository or resource is inaccessible, say so explicitly and continue with whatever evidence is still available
|
|
54
55
|
|
|
55
56
|
## Rules
|
|
56
57
|
|
|
57
58
|
- Never modify project files
|
|
58
59
|
- Never invent URLs; only use verified links
|
|
59
|
-
- Cite every non-trivial claim
|
|
60
|
+
- Cite every non-trivial claim with exact file paths and line references when available
|
|
60
61
|
- Prefer high-signal synthesis over long dumps
|
|
61
62
|
- **Never refer to tools by name** — say "I'm going to search for..." not "I'll use the websearch tool"
|
|
63
|
+
- When reading a cloned repo, note that findings reflect the default clone state unless the caller specifies a branch/commit
|
|
62
64
|
|
|
63
65
|
## When to Use Scout
|
|
64
66
|
|
|
67
|
+
- Inspecting dependency repositories or library source code
|
|
68
|
+
- Comparing local code against upstream implementations
|
|
65
69
|
- Finding library docs, API references, or framework patterns
|
|
66
70
|
- Comparing alternatives or evaluating package options
|
|
67
71
|
- Researching external integrations before implementation
|
|
68
72
|
- Getting latest ecosystem info, release notes, or migration guides
|
|
73
|
+
- Explaining how a library or framework works by reading its source
|
|
69
74
|
|
|
70
75
|
## When NOT to Use Scout
|
|
71
76
|
|
|
@@ -107,10 +112,19 @@ If lower-ranked sources conflict with higher-ranked sources, follow higher-ranke
|
|
|
107
112
|
1. Check memory first:
|
|
108
113
|
|
|
109
114
|
```typescript
|
|
110
|
-
memory-search({ query: "<topic keywords>", limit: 3 });
|
|
115
|
+
memory - search({ query: "<topic keywords>", limit: 3 });
|
|
111
116
|
```
|
|
112
117
|
|
|
113
|
-
2. If memory is insufficient, choose
|
|
118
|
+
2. If memory is insufficient, choose the primary approach by task type:
|
|
119
|
+
|
|
120
|
+
**Task involves a GitHub repo or dependency source code:**
|
|
121
|
+
- Use `grepsearch` or `codesearch` for targeted code search across public repos (no clone needed)
|
|
122
|
+
- Use `webclaw` scrape on `raw.githubusercontent.com` URLs to read specific files directly
|
|
123
|
+
- For deep inspection: `git clone <url> /tmp/<name>` via bash, then use glob/grep/read on the cloned path
|
|
124
|
+
- Use official docs only as a supplement when source alone is insufficient
|
|
125
|
+
- If multiple repos are relevant, inspect each before drawing conclusions
|
|
126
|
+
|
|
127
|
+
**Task involves docs, APIs, or ecosystem research:**
|
|
114
128
|
| Need | Tool |
|
|
115
129
|
|------|------|
|
|
116
130
|
| docs/API | `context7`, `codesearch` |
|
|
@@ -124,19 +138,23 @@ If lower-ranked sources conflict with higher-ranked sources, follow higher-ranke
|
|
|
124
138
|
**Web content priority:** Always try `webclaw` tools first for URL extraction. They handle 403s, bot protection, and produce 67% fewer tokens than raw HTML. Fall back to `webfetch` only if webclaw is unavailable.
|
|
125
139
|
|
|
126
140
|
3. Run independent calls in parallel
|
|
127
|
-
4. Return
|
|
141
|
+
4. Return findings: direct answer first, then evidence organized by repo/source
|
|
128
142
|
|
|
129
143
|
## Examples
|
|
130
144
|
|
|
131
|
-
| Good
|
|
132
|
-
|
|
|
133
|
-
| "
|
|
145
|
+
| Good | Bad |
|
|
146
|
+
| -------------------------------------------------------------------------------- | ------------------------------------------ |
|
|
147
|
+
| "The function is at `lib/auth.ts:42`. It validates JWT via RS256." + source link | "Best practice is Y" with no source links. |
|
|
148
|
+
| "Use pattern X; cited docs + 2 production examples with permalinks." | Dumping raw file contents without analysis |
|
|
149
|
+
| "Repo was inaccessible; continuing with official docs found at [url]..." | Blocking on inaccessible resource silently |
|
|
134
150
|
|
|
135
151
|
## Output
|
|
136
152
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
153
|
+
**Structure every response in this order:**
|
|
154
|
+
|
|
155
|
+
1. **Direct answer** — the finding or recommendation, upfront
|
|
156
|
+
2. **Evidence** — organized by repo or source, with file:line references
|
|
157
|
+
3. **Sources** — verified URLs or paths
|
|
158
|
+
4. **Risks/tradeoffs** — if relevant
|
|
141
159
|
|
|
142
160
|
**IMPORTANT:** Only your final message is returned to the main agent. Make it comprehensive and self-contained — include all key findings, not just a summary of what you explored.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Reduce ambiguity before planning or implementation
|
|
3
|
+
argument-hint: "<request or bead-id> [--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: "beads" });
|
|
15
|
+
skill({ name: "brainstorming" });
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Parse Arguments
|
|
19
|
+
|
|
20
|
+
| Argument | Default | Description |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| `<request or bead-id>` | required | Freeform request text or existing bead ID |
|
|
23
|
+
| `--quick` | false | Minimize to 1-3 high-leverage questions |
|
|
24
|
+
| `--deep` | false | Cover non-goals, risks, interfaces, success criteria |
|
|
25
|
+
|
|
26
|
+
**Mode rules:** Default → make next command obvious. `--quick` → 1-3 questions. `--deep` → exhaustive. `--deep` wins if both appear.
|
|
27
|
+
|
|
28
|
+
## When to Use / Not Use
|
|
29
|
+
|
|
30
|
+
**Use:** Request is fuzzy, scope unclear, multiple interpretations of "done," `/plan` would be premature because main decision is unresolved.
|
|
31
|
+
**Skip:** Request is specific enough to plan directly, task is mechanical, ambiguity is only about codebase facts you can inspect.
|
|
32
|
+
|
|
33
|
+
## Core Rules
|
|
34
|
+
|
|
35
|
+
- **Inspect first, ask second** — never ask for codebase facts you can discover directly
|
|
36
|
+
- **One question at a time** — each must reduce a real ambiguity
|
|
37
|
+
- **Prefer structured choices** (multiple choice, yes/no)
|
|
38
|
+
- **Surface non-goals explicitly** — what should *not* change is as important as what should
|
|
39
|
+
- **Stop once the next command is obvious**
|
|
40
|
+
|
|
41
|
+
## Process
|
|
42
|
+
|
|
43
|
+
1. Read request, identify unknowns blocking execution
|
|
44
|
+
2. If bead ID: `br show $ID`, inspect artifacts
|
|
45
|
+
3. If freeform text: search memory, check existing patterns
|
|
46
|
+
4. Ask questions one at a time, resolve before next
|
|
47
|
+
5. Surface non-goals and constraints
|
|
48
|
+
6. Recommend next command: `/plan`, `/create`, `/ship`, or `/design`
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
```
|
|
@@ -32,10 +32,10 @@ skill({ name: "ux-quality-gates" }); // IA, forms, recovery, loading, usability
|
|
|
32
32
|
|
|
33
33
|
## Phase 1: Detect Existing Design System
|
|
34
34
|
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
```bash
|
|
36
|
+
srcwalk files "**/tailwind.config.{js,ts,mjs}"
|
|
37
|
+
srcwalk files "**/globals.css"
|
|
38
|
+
srcwalk files "**/components.json" # shadcn
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Read what exists. Don't design in a vacuum — build on the project's current system.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Debug and fix a bug or failing test
|
|
3
|
+
argument-hint: "<description of bug or error>"
|
|
4
|
+
agent: build
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fix: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Systematically debug and fix the reported issue.
|
|
10
|
+
|
|
11
|
+
## Load Skills
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
skill({ name: "systematic-debugging" });
|
|
15
|
+
skill({ name: "root-cause-tracing" });
|
|
16
|
+
skill({ name: "verification-before-completion" });
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Process
|
|
20
|
+
|
|
21
|
+
### Phase 1: Reproduce
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Reproduce the issue with the exact steps or command
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Phase 2: Isolate
|
|
28
|
+
|
|
29
|
+
- Search for the error message or symptom in the codebase
|
|
30
|
+
- Trace the execution path to find the root cause
|
|
31
|
+
- Read the 2-4 most relevant files
|
|
32
|
+
- Distinguish symptom from root cause
|
|
33
|
+
|
|
34
|
+
### Phase 3: Fix
|
|
35
|
+
|
|
36
|
+
- Apply the minimal fix for the root cause
|
|
37
|
+
- Do not add speculative guards, tolerant readers, or defensive copies
|
|
38
|
+
- Prefer making the bad state impossible over handling all bad states
|
|
39
|
+
|
|
40
|
+
### Phase 4: Verify
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm run typecheck
|
|
44
|
+
npm run lint
|
|
45
|
+
npm test # or vitest relevant test
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If verification fails twice on the same approach, escalate with learnings.
|
|
49
|
+
|
|
50
|
+
## Output
|
|
51
|
+
|
|
52
|
+
Report:
|
|
53
|
+
1. Root cause (with file:line)
|
|
54
|
+
2. Fix applied
|
|
55
|
+
3. Verification results
|
|
56
|
+
4. What else was considered and rejected
|
|
@@ -0,0 +1,55 @@
|
|
|
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)
|
|
@@ -1,31 +1,49 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Initialize
|
|
3
|
-
argument-hint: "[--deep]"
|
|
2
|
+
description: Initialize project setup — AGENTS.md, planning context, user profile, and tech stack
|
|
3
|
+
argument-hint: "[--deep] [--context|--user|--all]"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Init: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Initialize project setup. Run once per project. Supports three modes via argument flags.
|
|
10
10
|
|
|
11
|
-
> **Next
|
|
11
|
+
> **Next step for fresh projects:** `/plan` to create first implementation plan.
|
|
12
|
+
> **Next step for brownfield:** `/review-codebase` for deep codebase analysis.
|
|
12
13
|
|
|
13
14
|
## Load Skills
|
|
14
15
|
|
|
15
16
|
```typescript
|
|
16
17
|
skill({ name: "index-knowledge" });
|
|
18
|
+
skill({ name: "context-initialization" });
|
|
19
|
+
skill({ name: "brainstorming" });
|
|
20
|
+
skill({ name: "verification-before-completion" });
|
|
21
|
+
skill({ name: "swarm-coordination" }); // For --brownfield analysis
|
|
17
22
|
```
|
|
18
23
|
|
|
19
|
-
##
|
|
24
|
+
## Parse Arguments
|
|
20
25
|
|
|
21
|
-
| Argument | Default | Description
|
|
22
|
-
|
|
23
|
-
| `--deep` | false
|
|
26
|
+
| Argument | Default | Description |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `--deep` | false | Comprehensive research for AGENTS.md (~100+ tool calls) |
|
|
29
|
+
| `--context` | false | Init planning context (roadmap, state) |
|
|
30
|
+
| `--user` | false | Init user profile |
|
|
31
|
+
| `--all` | false | Full init: AGENTS.md + context + user profile |
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
**Mode rules:**
|
|
34
|
+
- No flags (default): Core project setup — AGENTS.md + tech stack only
|
|
35
|
+
- `--context`: Planning context (roadmap.md, state.md)
|
|
36
|
+
- `--user`: User profile (user.md)
|
|
37
|
+
- `--all`: Everything
|
|
38
|
+
- `--deep` applies to AGENTS.md generation only
|
|
26
39
|
|
|
27
|
-
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Mode 1: Core Setup (Default)
|
|
28
43
|
|
|
44
|
+
### Phase 1: Detect Project
|
|
45
|
+
|
|
46
|
+
Detect and validate:
|
|
29
47
|
- Package manager and dependencies (with versions)
|
|
30
48
|
- Build, test, lint, dev commands — **validate each actually works**
|
|
31
49
|
- CI/CD configuration
|
|
@@ -34,82 +52,84 @@ Detect and validate:
|
|
|
34
52
|
|
|
35
53
|
With `--deep`: Also analyze git history, source patterns, subsystem candidates.
|
|
36
54
|
|
|
37
|
-
|
|
55
|
+
### Phase 2: Preview Detection
|
|
38
56
|
|
|
39
|
-
|
|
57
|
+
Show detected summary and ask for confirmation before writing.
|
|
40
58
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{ label: "Show me what you'll write first" },
|
|
50
|
-
{ label: "Cancel" },
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
});
|
|
55
|
-
```
|
|
59
|
+
### Phase 3: Create AGENTS.md
|
|
60
|
+
|
|
61
|
+
Create `./AGENTS.md` — target <60 lines (max 150). Follow `index-knowledge` format:
|
|
62
|
+
- Tech stack with versions, file structure, validated commands
|
|
63
|
+
- Code example from actual codebase
|
|
64
|
+
- Testing conventions, boundaries, gotchas
|
|
65
|
+
|
|
66
|
+
**Principles:** Examples > explanations. Pointers > copies. If AGENTS.md exists, improve it — don't overwrite blindly.
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
### Phase 4: Create tech-stack.md
|
|
58
69
|
|
|
59
|
-
|
|
70
|
+
Write detected values to `.opencode/memory/project/tech-stack.md`. Persist with memory update.
|
|
60
71
|
|
|
61
|
-
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Mode 2: Planning Context (`--context`)
|
|
75
|
+
|
|
76
|
+
Initialize project planning context with roadmap and state files.
|
|
62
77
|
|
|
63
|
-
|
|
64
|
-
- File structure
|
|
65
|
-
- Commands (validated)
|
|
66
|
-
- Code example from actual codebase (5-10 lines)
|
|
67
|
-
- Testing conventions
|
|
68
|
-
- Boundaries (always/ask-first/never)
|
|
69
|
-
- Gotchas
|
|
78
|
+
### Phase 1: Discovery
|
|
70
79
|
|
|
71
|
-
|
|
80
|
+
If `--brownfield` (detected from existing codebase), run parallel codebase analysis:
|
|
81
|
+
- `explore` for architecture patterns
|
|
82
|
+
- `explore` for data flow
|
|
83
|
+
- `explore` for domain boundaries
|
|
72
84
|
|
|
73
|
-
|
|
85
|
+
If greenfield, skip to requirements gathering.
|
|
74
86
|
|
|
75
|
-
|
|
87
|
+
### Phase 2: Requirements Gathering
|
|
76
88
|
|
|
77
|
-
|
|
89
|
+
Ask questions to define:
|
|
90
|
+
- Project vision and goals (1-2 sentences each)
|
|
91
|
+
- Target users and their needs
|
|
92
|
+
- Core features (what must exist)
|
|
93
|
+
- Technical constraints
|
|
94
|
+
- Success criteria
|
|
78
95
|
|
|
79
|
-
|
|
96
|
+
### Phase 3: Create Files
|
|
80
97
|
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
- `.opencode/memory/project/roadmap.md` — vision, goals, user personas, feature roadmap, constraints, success criteria
|
|
99
|
+
- `.opencode/memory/project/state.md` — current status, active decisions, known issues, next priorities
|
|
100
|
+
- Update `.opencode/opencode.json` instructions to include roadmap.md and state.md
|
|
101
|
+
|
|
102
|
+
---
|
|
86
103
|
|
|
87
|
-
##
|
|
104
|
+
## Mode 3: User Profile (`--user`)
|
|
88
105
|
|
|
89
|
-
|
|
106
|
+
Create personalized user profile at `.opencode/memory/project/user.md`.
|
|
90
107
|
|
|
91
|
-
|
|
92
|
-
- `frontend/` vs `backend/` directories
|
|
93
|
-
- Significantly different subsystem patterns
|
|
108
|
+
### Phase 1: Gather Preferences
|
|
94
109
|
|
|
95
|
-
Ask
|
|
110
|
+
Ask questions about:
|
|
111
|
+
- **Identity**: Name, role, experience level
|
|
112
|
+
- **Communication**: Verbosity preference, feedback style, update frequency
|
|
113
|
+
- **Workflow**: Branch strategy, commit style, review expectations, test expectations
|
|
114
|
+
- **Technical**: Preferred tools, avoided patterns, dev environment
|
|
96
115
|
|
|
97
|
-
|
|
116
|
+
### Phase 2: Create user.md
|
|
98
117
|
|
|
99
|
-
|
|
118
|
+
Write to `.opencode/memory/project/user.md` with the captured preferences.
|
|
100
119
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
120
|
+
### Phase 3: Update opencode.json
|
|
121
|
+
|
|
122
|
+
Ensure user.md is in `instructions[]` as one of the 4 auto-injected files (user.md, tech-stack.md, project.md, git-context.md).
|
|
123
|
+
|
|
124
|
+
> **Warning:** Do not add more files to `instructions[]` unless essential. Per-prompt injection of too many files causes session OOM. Use `memory-search({ file: "..." })` for on-demand access.
|
|
125
|
+
|
|
126
|
+
---
|
|
106
127
|
|
|
107
|
-
Output
|
|
128
|
+
## Output
|
|
108
129
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
- `/review-codebase` — Deep codebase analysis
|
|
130
|
+
Report what was created:
|
|
131
|
+
1. AGENTS.md (if core setup ran)
|
|
132
|
+
2. tech-stack.md (if core setup ran)
|
|
133
|
+
3. roadmap.md + state.md (if `--context`)
|
|
134
|
+
4. user.md (if `--user`)
|
|
135
|
+
5. Recommended next command: `/plan`, `/review-codebase`, or `/resume`
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Refactor code for clarity, performance, or maintainability
|
|
3
|
+
argument-hint: "<file or path> [--scope minimal|moderate|aggressive]"
|
|
4
|
+
agent: build
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Refactor: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Improve code quality without changing external behavior.
|
|
10
|
+
|
|
11
|
+
## Load Skills
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
skill({ name: "code-simplification" });
|
|
15
|
+
skill({ name: "verification-before-completion" });
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Parse Arguments
|
|
19
|
+
|
|
20
|
+
| Argument | Default | Description |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| `<file or path>` | required | File or directory to refactor |
|
|
23
|
+
| `--scope` | minimal | `minimal` (rename/restructure), `moderate` (extract modules), `aggressive` (redesign) |
|
|
24
|
+
|
|
25
|
+
## When to Refactor
|
|
26
|
+
|
|
27
|
+
- Module has grown beyond its original purpose
|
|
28
|
+
- Tests are hard to write because of tight coupling
|
|
29
|
+
- Similar logic appears in multiple places
|
|
30
|
+
- Files have crossed 300+ lines with unclear boundaries
|
|
31
|
+
|
|
32
|
+
## Process
|
|
33
|
+
|
|
34
|
+
### Phase 1: Assess
|
|
35
|
+
|
|
36
|
+
1. Read all files in scope
|
|
37
|
+
2. Identify: duplication, shallow interfaces, unclear naming, mixed concerns
|
|
38
|
+
3. Plan the refactor — show plan if >3 files would change
|
|
39
|
+
|
|
40
|
+
### Phase 2: Lock Behavior
|
|
41
|
+
|
|
42
|
+
- If the module has tests, they must still pass after refactor
|
|
43
|
+
- If no tests exist, run existing verification (typecheck, lint)
|
|
44
|
+
- No behavior changes in a refactor — external API must be preserved
|
|
45
|
+
|
|
46
|
+
### Phase 3: Execute
|
|
47
|
+
|
|
48
|
+
- One change at a time, verify after each
|
|
49
|
+
- Prefer small commits with clear messages
|
|
50
|
+
- `refactor(scope): what changed`
|
|
51
|
+
|
|
52
|
+
### Phase 4: Verify
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm run typecheck
|
|
56
|
+
npm run lint
|
|
57
|
+
npm test
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Output
|
|
61
|
+
|
|
62
|
+
Report:
|
|
63
|
+
1. What changed and why
|
|
64
|
+
2. Files modified
|
|
65
|
+
3. Verification results
|
|
66
|
+
4. What was left for future refactors
|
|
@@ -38,7 +38,7 @@ skill({ name: "verification-gates" });
|
|
|
38
38
|
| `explore` | Finding patterns in codebase, prior art |
|
|
39
39
|
| `scout` | External research, best practices |
|
|
40
40
|
| `lsp` | Finding symbol definitions, references |
|
|
41
|
-
| `
|
|
41
|
+
| `srcwalk find` | Finding code patterns |
|
|
42
42
|
| `codesearch` | Real-world usage examples |
|
|
43
43
|
|
|
44
44
|
## Phase 1: Gather Context
|
|
@@ -48,7 +48,7 @@ skill({ name: "reflection-checkpoints" }); // Mid-point + completion checks duri
|
|
|
48
48
|
| `explore` | Finding patterns in codebase, prior art |
|
|
49
49
|
| `scout` | External research, best practices |
|
|
50
50
|
| `lsp` | Finding symbol definitions, references |
|
|
51
|
-
| `
|
|
51
|
+
| `srcwalk find` | Finding code patterns |
|
|
52
52
|
| `task` | Spawning subagents for parallel execution |
|
|
53
53
|
|
|
54
54
|
## Phase 1: Guards
|