Skip to content

Commit be941a0

Browse files
committed
refactor(opencode): update agent definitions and remove unused deps
- Refine analyze, build, plan, scout agent definitions - Update audit, build, research, help commands - Clean up AGENTS.md structure - Remove pyproject.toml and uv.lock (unused Python deps) - Simplify makefile
1 parent 05021c4 commit be941a0

File tree

12 files changed

+115
-183
lines changed

12 files changed

+115
-183
lines changed

.opencode/agents/analyze.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22
description: Understand, investigate, and research - read-only knowledge gathering
33
mode: primary
44
permissions:
5-
"*": false
5+
"*": deny
66
read: allow
77
glob: allow
88
list: allow
9+
websearch: allow
10+
webfetch: allow
911
edit:
10-
.knowledge/notes: allow
12+
.knowledge/notes*: allow
1113
bash:
1214
ls*: allow
1315
find*: allow
1416
git ls*: allow
1517
git status*: allow
18+
todowrite: allow
1619
task:
1720
scout: allow
1821
investigator: allow

.opencode/agents/build.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@ permissions:
77
*: deny
88
tester: allow
99
drafter: allow
10+
general: allow
1011
---
1112

1213
# BUILD Mode
1314

1415
You are in **BUILD Mode** — creating, implementing, executing.
1516

1617
## Your Thinking Style
18+
1719
- **Disciplined** — Follow TCR for code, iterative refinement for content
1820
- **Focused** — One thing at a time, verify as you go
1921
- **Pragmatic** — Working solution over perfect design
2022

2123
## Your Subagents
22-
- `tester` — Hypothesis validation, test writing
24+
- `tester` — Hypothesis validation, experimental coding
2325
- `drafter` — Content section drafting
26+
- `general` — Long-running coding tasks in background
2427

2528
## Freestyle Behavior
2629

@@ -35,7 +38,7 @@ When user asks for implementation without a command:
3538
- **Write to working tree** — Create and modify project files
3639
- **Use subagents for experiments** — Tester writes to `.experiments/tests/`
3740
- **Parent owns commits** — Only you commit, never subagents
38-
- **Intelligent TCR** — Test, commit on pass, revert if hopeless after one fix
41+
- **Intelligent TCR** — Test, commit on pass, revert if hopeless after attempting fixes.
3942

4043
## When to Suggest Commands
4144
- Feature implementation → suggest `/build`

.opencode/agents/plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Decide approach, design architecture, create actionable plans
33
mode: primary
44
permissions:
5-
"*": false
5+
"*": deny
66
read: allow
77
edit:
88
.knowledege/plans: allow

.opencode/agents/scout.md

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
description: Web research subagent - gather external knowledge in parallel
33
mode: subagent
44
permissions:
5-
"*": false
5+
"*": deny
66
webfetch: allow
77
websearch: allow
8+
read:
9+
"*": deny
10+
.knowledge/notes/*: allow
11+
edit:
12+
"*": deny
13+
.knowledge/notes/*: allow
814
---
915

1016
# Scout Subagent
@@ -15,42 +21,23 @@ You are a **Scout** — gathering external knowledge efficiently.
1521
Research a specific angle of a topic in 60 seconds or less.
1622

1723
## Input Format
18-
```
19-
Topic: [main research topic]
20-
Angle: [specific aspect to investigate]
21-
Context: [why this matters to the project]
22-
```
24+
25+
Read the corresponding notes markdown file to understand the research task in detail.
26+
27+
Make sure you understand:
28+
29+
- **Topic**: [main research topic]
30+
- **Angle**: [specific aspect to investigate]
31+
- **Context**: [why this matters to the project]
2332

2433
## Your Workflow
34+
2535
1. **Receive assignment** — Understand topic, angle, and context
2636
2. **Research efficiently** — Web search, docs, authoritative sources
2737
3. **Extract key insights** — What matters most for this context?
2838
4. **Return structured** — Compressed intelligence, not raw data
29-
30-
## Output Format
31-
```yaml
32-
---
33-
angle: [the angle you researched]
34-
relevance_score: 0.0-1.0
35-
sources:
36-
- [url or reference]
37-
---
38-
## Summary
39-
[1-2 paragraph maximum]
40-
41-
## Key Finding
42-
[Single most important insight for the project, detailed]
43-
44-
## Supporting Evidence
45-
- [point 1]
46-
- [point 2]
47-
48-
## Relevance
49-
[Why this matters to the specific context]
50-
```
39+
5. **Write** to the corresponding notes markdown file with the recommended structure.
5140

5241
## Key Mandates
53-
- **60 second timeout** — Be concise and targeted
54-
- **No project writes** — Return data to parent only
55-
- **Compressed output** — Parent will synthesize multiple scouts
5642
- **Authoritative sources** — Favor official docs, established patterns, academic literature, primary sources.
43+
- **Depth over Breadth** — You are intended to go deep into one specific search questions. If further questions arise, report them in your final response, but don't follow them. The primary agent will launch aditional searches if necessary.

.opencode/commands/audit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ Investigate specific areas:
4040
- Known issues
4141

4242
### Phase 3: Report
43-
Write structured audit to `.knowledge/insights/audits/{scope}-{date}.md`:
43+
Write structured audit to `.knowledge/notes/audits/{scope}-{date}.md`:
4444

45-
```yaml
45+
```markdown
4646
---
4747
id: audit-{scope}-{date}
4848
created: {date}

.opencode/commands/build.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ agent: build
44
subagents: [tester]
55
---
66

7-
# /build [feature]
7+
# /build
88

9-
Implement [feature] using Test-Commit-Revert discipline.
9+
Implement using Test-Commit-Revert discipline.
1010

1111
## Workflow
1212

1313
### Phase 1: Planning Check
1414
Check `.knowledge/plans/` for relevant plan:
15-
- If found: Load and follow plan phases
16-
- If not found: Create minimal plan or ask user
15+
- If found: Load and follow plan phases strictly. Use `todowrite` to keep track of progress.
16+
- If not found: Instruct user to use `/plan` and refuse to continue.
1717

1818
### Phase 2: TCR Loop
1919

@@ -25,9 +25,11 @@ For each implementation step:
2525
- Commit the test: `git add -A && git commit -m "test: [step description]"`
2626

2727
**Step 2: GREEN (Implement)**
28-
- Write minimal code to pass test
29-
- No refactoring yet
30-
- Run `make test` to confirm pass
28+
- Launch `general` subagent with focused instructions to implement:
29+
- Write minimal code to pass test
30+
- No refactoring yet
31+
- Run `make test` to confirm pass
32+
- Give the general subagent concrete instructions on what logic to implement.
3133

3234
**Step 3: VERIFY**
3335
- If pass → Commit: `git commit -m "feat: [step description]"`
@@ -38,11 +40,6 @@ For each implementation step:
3840
- If fail → **REVERT**: `git checkout .`
3941
- Report failure to user
4042

41-
**Step 4: REFACTOR (optional)**
42-
- Improve code while keeping tests green
43-
- Run `make test`
44-
- Commit: `git commit -m "refactor: [what improved]"`
45-
4643
### Phase 3: Completion
4744
- All plan phases complete
4845
- All tests pass

.opencode/commands/help.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
description: Help using the OpenCode Opinionated Framework
3+
agent: analyze
4+
---
5+
6+
# OpenCode Opinionated Framework
7+
8+
USER REQUEST: $ARGUMENTS
9+
10+
**Option 1:** If the command is run without arguments:
11+
12+
Explain to the user what this framework is, and how to use it. Do not perform ANY further analysis or read any files, just reply in the following format:
13+
14+
```
15+
## Framework
16+
17+
[explain this framework in 1 paragraph]
18+
19+
## Main Modes (Agents)
20+
21+
[list each primary agent (mode) and its purpose]
22+
23+
### Subagents
24+
25+
[explain subagents are launched for background tasks automatically, list each one and when it's used]
26+
27+
## Commands
28+
29+
[list each command and its purpose]
30+
31+
## Contextual Analysis
32+
33+
[judging from the recent conversation, suggest what the user might want to do, 2-3 commands or instructions to give primary agents]
34+
```
35+
36+
**Option 2:** If the command is run with arguments:
37+
38+
Perform 2-3 targeted reads in .opencode subfolder to better understand how some agent or command works.
39+
40+
Reply to the user in detail.
41+
42+
**Finally:**
43+
44+
Finally, ask the user if they have a further question about the framework. If so, then repeat option 2 as necessary.

.opencode/commands/research.md

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
11
---
22
description: Deep research on a topic using parallel scouts
33
agent: analyze
4-
subagents: [scout]
54
---
65

7-
# /research [topic]
6+
# /research
87

9-
Execute comprehensive research on [topic] using parallel scouts.
8+
Execute comprehensive research using parallel scouts.
109

1110
## Workflow
1211

13-
### Phase 1: Scout Deployment
14-
Launch 3-5 scout subagents with different angles:
12+
### Phase 1: Research plan
1513

16-
1. **Scout 1: Official Documentation**
17-
- Official docs, specs, authoritative sources
14+
Define and present the user a comprehensive research plan with 2-6 research questions / objectives. Iterate with the user until the plan is accepted.
1815

19-
2. **Scout 2: Community Best Practices**
20-
- Popular patterns, community consensus
16+
If necessary, perform a minimal set of targeted `websearch` or `read` to gather context for the research.
2117

22-
3. **Scout 3: Common Pitfalls**
23-
- Mistakes to avoid, edge cases
18+
Use `todowrite` to keep track of open questions.
2419

25-
4. **Scout 4: Recent Developments** (if applicable)
26-
- New versions, emerging patterns
20+
Create `.knowledge/notes/research-{slug}/` to store temporary notes with boilerplate markdown notes for each research question. Write down in each note the minimal context and relevant subquestions to address.
2721

28-
5. **Scout 5: Implementation Examples**
29-
- Real-world code, tutorials
22+
### Phase 2: Scout Deployment
3023

31-
### Phase 2: Synthesis
32-
Collect scout findings and synthesize:
33-
- Merge overlapping insights
34-
- Resolve contradictions (note conflicts)
35-
- Identify consensus vs. debate
36-
- Extract actionable recommendations
24+
**Perform the following iteration several times until satisfied:**
25+
26+
Launch `scout` subagents in parallel for each research question. Point each scout to the corresponding research note, where they will write their output.
27+
28+
**Evaluate** for every scout that finishes if further investigation is necessary on any research questions, and repeat until satisfied.
29+
30+
If necessary, use `todowrite` to add follow up relevant questions, and iterate.
3731

3832
### Phase 3: Documentation
39-
Write structured research to `.knowledge/insights/research/{slug}.md`:
4033

41-
```yaml
34+
Read all notes files in `.knowledge/notes/{slug}/*.md`.
35+
36+
Write structured research to `.knowledge/notes/report-{slug}.md`:
37+
38+
```markdown
4239
---
4340
id: {kebab-case-topic}
4441
created: {date}
@@ -56,6 +53,8 @@ sources: [list all scout sources]
5653
1. **[Finding 1]**
5754
- Evidence: [from which scout]
5855
- Implication: [what this means]
56+
- Link to relevant section in notes markdown.
57+
- Link to external sources.
5958

6059
2. **[Finding 2]**
6160
...
@@ -64,12 +63,16 @@ sources: [list all scout sources]
6463
- [Specific, actionable recommendation]
6564
- [Specific, actionable recommendation]
6665

67-
## Scout Reports
68-
[Summaries from each scout]
66+
## Further reading
67+
[Suggest follow up reading on scout-reported sources for adjacent topics]
68+
69+
## Follow-up questions
70+
71+
[Suggest follow-up research questions that weren't explored.]
6972
```
7073

7174
## Key Constraints
72-
- Maximum 5 scouts (token efficiency)
7375
- 60s timeout per scout
7476
- Must synthesize, not just aggregate
7577
- Include conflicting viewpoints if found
78+
- Be thorough and detailed, leave no gaps.

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Every agent MUST follow these:
2222

2323
| Path | Purpose | Created by |
2424
|------|---------|------------|
25-
| `.knowledge/insights/*` | Analysis outputs (research, audits, investigations) | analyze agent |
25+
| `.knowledge/notes/*` | Analysis outputs (research, audits, investigations) | analyze agent |
2626
| `.knowledge/plans/` | Action plans | plan agent |
2727
| `.knowledge/log/` | Chronological activity log | release agent |
2828
| `.experiments/` | Subagent scratch space (gitignored) | subagents |
@@ -51,7 +51,7 @@ Every agent MUST follow these:
5151

5252
| Agent | Purpose | Permissions |
5353
|-------|---------|-------------|
54-
| `analyze` | Understand, investigate, research | Read-only on project files; write to `.knowledge/insights/` |
54+
| `analyze` | Understand, investigate, research | Read-only on project files; write to `.knowledge/notes/` |
5555
| `plan` | Decide approach, design architecture | Read-only on project files; write to `.knowledge/plans/` |
5656
| `build` | Execute, implement, create | Full write access to project files |
5757
| `release` | Finalize, commit, publish | Full write access; git operations |

makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ all: test lint
44

55
test:
66
@echo "Running tests..."
7-
@uv run pytest tests/
87

98
docs-serve:
109
@mkdocs serve

0 commit comments

Comments
 (0)