lazyopencode-core 0.0.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/ATTRIBUTION.md +38 -0
- package/LICENSE +21 -0
- package/README.md +357 -0
- package/dist/agents/councillor.d.ts +1 -0
- package/dist/agents/councillor.js +14 -0
- package/dist/agents/designer.d.ts +1 -0
- package/dist/agents/designer.js +31 -0
- package/dist/agents/explorer.d.ts +1 -0
- package/dist/agents/explorer.js +15 -0
- package/dist/agents/fixer.d.ts +1 -0
- package/dist/agents/fixer.js +23 -0
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/index.js +55 -0
- package/dist/agents/lazy.d.ts +1 -0
- package/dist/agents/lazy.js +3 -0
- package/dist/agents/librarian.d.ts +1 -0
- package/dist/agents/librarian.js +26 -0
- package/dist/agents/observer.d.ts +1 -0
- package/dist/agents/observer.js +20 -0
- package/dist/agents/oracle.d.ts +1 -0
- package/dist/agents/oracle.js +30 -0
- package/dist/council/council-manager.d.ts +42 -0
- package/dist/council/council-manager.js +223 -0
- package/dist/council/index.d.ts +2 -0
- package/dist/council/index.js +1 -0
- package/dist/hooks/apply-patch-rescue.d.ts +7 -0
- package/dist/hooks/apply-patch-rescue.js +150 -0
- package/dist/hooks/background-job-board.d.ts +92 -0
- package/dist/hooks/background-job-board.js +452 -0
- package/dist/hooks/chat-params.d.ts +16 -0
- package/dist/hooks/chat-params.js +30 -0
- package/dist/hooks/deepwork.d.ts +9 -0
- package/dist/hooks/deepwork.js +55 -0
- package/dist/hooks/error-recovery.d.ts +21 -0
- package/dist/hooks/error-recovery.js +216 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +61 -0
- package/dist/hooks/lazy-command.d.ts +16 -0
- package/dist/hooks/lazy-command.js +178 -0
- package/dist/hooks/messages-transform.d.ts +40 -0
- package/dist/hooks/messages-transform.js +358 -0
- package/dist/hooks/permission-guard.d.ts +5 -0
- package/dist/hooks/permission-guard.js +38 -0
- package/dist/hooks/runtime.d.ts +169 -0
- package/dist/hooks/runtime.js +653 -0
- package/dist/hooks/session-events.d.ts +16 -0
- package/dist/hooks/session-events.js +65 -0
- package/dist/hooks/system-transform.d.ts +8 -0
- package/dist/hooks/system-transform.js +113 -0
- package/dist/hooks/task-session.d.ts +32 -0
- package/dist/hooks/task-session.js +177 -0
- package/dist/hooks/workflow-classifier.d.ts +17 -0
- package/dist/hooks/workflow-classifier.js +170 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +85 -0
- package/dist/opencode-control-plane.d.ts +20 -0
- package/dist/opencode-control-plane.js +95 -0
- package/dist/ponytail.d.ts +1 -0
- package/dist/ponytail.js +33 -0
- package/dist/skills/index.d.ts +5 -0
- package/dist/skills/index.js +10 -0
- package/dist/skills/lazy/build/SKILL.md +62 -0
- package/dist/skills/lazy/debug/SKILL.md +17 -0
- package/dist/skills/lazy/grill/SKILL.md +54 -0
- package/dist/skills/lazy/plan/SKILL.md +52 -0
- package/dist/skills/lazy/review/SKILL.md +29 -0
- package/dist/skills/lazy/security/SKILL.md +29 -0
- package/dist/skills/lazy/simplify/SKILL.md +52 -0
- package/dist/skills/lazy/specify/SKILL.md +62 -0
- package/dist/skills/lazy/worktree/SKILL.md +66 -0
- package/dist/tools/cancel-task.d.ts +3 -0
- package/dist/tools/cancel-task.js +37 -0
- package/dist/tools/council.d.ts +6 -0
- package/dist/tools/council.js +41 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +2 -0
- package/dist/v2.d.ts +1 -0
- package/dist/v2.js +42 -0
- package/docs/architecture.md +47 -0
- package/docs/council.md +200 -0
- package/docs/desktop-distribution.md +36 -0
- package/docs/opencode-integration.md +54 -0
- package/docs/positioning.md +44 -0
- package/docs/product-audit.md +187 -0
- package/docs/product-plan.md +56 -0
- package/docs/state-machine.md +35 -0
- package/docs/user-manual.md +439 -0
- package/docs/work-plan.md +190 -0
- package/package.json +44 -0
package/ATTRIBUTION.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Attribution
|
|
2
|
+
|
|
3
|
+
@lazyopencode/core is a hard fork and fusion of multiple open-source projects. We thank the original authors.
|
|
4
|
+
|
|
5
|
+
## Agent orchestration
|
|
6
|
+
|
|
7
|
+
Forked and rewritten from **[oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim)** by Alvin Unreal (MIT).
|
|
8
|
+
|
|
9
|
+
The original project provided a lightweight multi-agent routing shape. LazyOpenCode renames the public surface under the `lazy-*` namespace and rewrites the prompts around scope governance, ponytail discipline, and workflow closure.
|
|
10
|
+
|
|
11
|
+
## Workflow skills
|
|
12
|
+
|
|
13
|
+
Forked and rewritten from **[Matt Pocock skills](https://github.com/mattpocock)** (MIT):
|
|
14
|
+
- `grilling` → `lazy/grill`
|
|
15
|
+
- `to-prd` → `lazy/specify`
|
|
16
|
+
- `to-issues` → `lazy/plan`
|
|
17
|
+
- `tdd` + `implement` → `lazy/build`
|
|
18
|
+
- `diagnosing-bugs` → `lazy/debug`
|
|
19
|
+
|
|
20
|
+
Forked from **oh-my-opencode-slim** (MIT):
|
|
21
|
+
- `simplify` → `lazy/simplify`
|
|
22
|
+
- `worktrees` → `lazy/worktree`
|
|
23
|
+
|
|
24
|
+
Forked and rewritten from **[opencode-power-pack](https://github.com/waybarrios/opencode-power-pack)** by Way Barrios (MIT), originally ported from Anthropic's Claude Code plugins:
|
|
25
|
+
- `code-review` → `lazy/review`
|
|
26
|
+
- `security-review` → `lazy/security`
|
|
27
|
+
|
|
28
|
+
## Philosophy
|
|
29
|
+
|
|
30
|
+
The ponytail philosophy and constraint system is from **[ponytail](https://github.com/ponytail)**.
|
|
31
|
+
|
|
32
|
+
## Hook infrastructure
|
|
33
|
+
|
|
34
|
+
Hook patterns (system transform, messages transform, chat routing, task session management, error recovery) are adapted from oh-my-opencode-slim's plugin architecture, with significant simplification.
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
MIT — same as all upstream projects.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 lazyopencode
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# LazyOpenCode
|
|
2
|
+
|
|
3
|
+
Zero-config governed team runtime for AI coding in OpenCode.
|
|
4
|
+
|
|
5
|
+
LazyOpenCode turns OpenCode into a governed AI coding team. It includes a primary
|
|
6
|
+
runtime coordinator, focused subagents, workflow skills, risk gates, background
|
|
7
|
+
job tracking, context budgets, destructive-action guardrails, and close reports.
|
|
8
|
+
The product goal is simple: keep AI coding scoped, visible, budgeted, and
|
|
9
|
+
reviewed without making users assemble their own OpenCode setup.
|
|
10
|
+
|
|
11
|
+
> Full manual: [docs/user-manual.md](docs/user-manual.md)
|
|
12
|
+
> Architecture: [docs/architecture.md](docs/architecture.md)
|
|
13
|
+
> Product audit: [docs/product-audit.md](docs/product-audit.md)
|
|
14
|
+
> Work plan: [docs/work-plan.md](docs/work-plan.md)
|
|
15
|
+
> Council: [docs/council.md](docs/council.md)
|
|
16
|
+
> OpenCode integration: [docs/opencode-integration.md](docs/opencode-integration.md)
|
|
17
|
+
> Desktop distribution: [docs/desktop-distribution.md](docs/desktop-distribution.md)
|
|
18
|
+
|
|
19
|
+
## Why
|
|
20
|
+
|
|
21
|
+
AI coding often overbuilds, drifts away from the request, launches work that is hard to reconcile, and stops before review. LazyOpenCode makes those failure modes explicit:
|
|
22
|
+
|
|
23
|
+
- classify the task before implementation
|
|
24
|
+
- gate vague or high-risk work until scope is clear
|
|
25
|
+
- track background jobs and reusable sessions
|
|
26
|
+
- close work with review, simplify, and verification
|
|
27
|
+
- ask before destructive commands
|
|
28
|
+
|
|
29
|
+
## Is It Zero Config?
|
|
30
|
+
|
|
31
|
+
Yes for the core plugin. After OpenCode loads `@lazyopencode/core`, LazyOpenCode
|
|
32
|
+
registers its primary agent, subagents, workflow skills, `/lazy` commands,
|
|
33
|
+
permission guard, job board, token budget, council guard, persistence, doctor,
|
|
34
|
+
and close report defaults.
|
|
35
|
+
|
|
36
|
+
You do **not** need to configure providers, models, auth, MCP, or project
|
|
37
|
+
settings for LazyOpenCode. It preserves your existing OpenCode setup.
|
|
38
|
+
|
|
39
|
+
Desktop is not required. LazyOpenCode Desktop is a later `0.1.0` distribution
|
|
40
|
+
stage.
|
|
41
|
+
|
|
42
|
+
## Install From npm
|
|
43
|
+
|
|
44
|
+
Prerequisite: OpenCode is installed and connected to at least one model provider.
|
|
45
|
+
|
|
46
|
+
Add the plugin to your OpenCode config:
|
|
47
|
+
|
|
48
|
+
```jsonc
|
|
49
|
+
{
|
|
50
|
+
"$schema": "https://opencode.ai/config.json",
|
|
51
|
+
"plugin": ["@lazyopencode/core"]
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Use a global config if you want LazyOpenCode everywhere:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
~/.config/opencode/opencode.jsonc
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Use a project config if you want it only for one repo:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
opencode.json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
OpenCode installs npm plugins automatically on startup. Scoped npm packages are
|
|
68
|
+
supported.
|
|
69
|
+
|
|
70
|
+
OpenCode also accepts `~/.config/opencode/opencode.json` if you prefer JSON
|
|
71
|
+
without comments.
|
|
72
|
+
|
|
73
|
+
Then start OpenCode in your project:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
opencode
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Run the health check:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
/lazy doctor
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Try From This Repository
|
|
86
|
+
|
|
87
|
+
Use this path before the package is published, or when developing LazyOpenCode
|
|
88
|
+
itself.
|
|
89
|
+
|
|
90
|
+
Build the package:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
cd packages/lazyopencode-core
|
|
94
|
+
npm run build
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Create a local OpenCode plugin file in the project where you want to test it:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
mkdir -p .opencode/plugins
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
// .opencode/plugins/lazyopencode.js
|
|
105
|
+
import { LazyOpenCodePlugin } from "/absolute/path/to/lazyopencode/packages/lazyopencode-core/dist/index.js"
|
|
106
|
+
|
|
107
|
+
export const LazyOpenCode = LazyOpenCodePlugin
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Replace `/absolute/path/to/lazyopencode` with your local checkout path.
|
|
111
|
+
|
|
112
|
+
Then start OpenCode:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
opencode
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Check it loaded:
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
/lazy doctor
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## First Run
|
|
125
|
+
|
|
126
|
+
Start a task through LazyOpenCode instead of asking OpenCode to immediately
|
|
127
|
+
build:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
/lazy start add user registration
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
LazyOpenCode classifies the task and chooses the next workflow stage:
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
LAZY START
|
|
137
|
+
Task: add user registration
|
|
138
|
+
Decision: nudge medium
|
|
139
|
+
Stage: plan
|
|
140
|
+
Next: lazy/specify
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
During work, inspect state:
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
/lazy status
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Before finishing, close the loop:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
/lazy close
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
If LazyOpenCode did not observe a fact automatically, record it explicitly:
|
|
156
|
+
|
|
157
|
+
```text
|
|
158
|
+
/lazy behavior Registration now validates email before submit
|
|
159
|
+
/lazy risk Password reset flow not touched
|
|
160
|
+
/lazy verify pass
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Optional Config
|
|
164
|
+
|
|
165
|
+
No `lazyopencode` config block is required. The block below only customizes
|
|
166
|
+
defaults. LazyOpenCode Desktop will preinstall the plugin and defaults in the
|
|
167
|
+
future distribution.
|
|
168
|
+
|
|
169
|
+
Full optional config:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"lazyopencode": {
|
|
174
|
+
"sdk": {
|
|
175
|
+
"mode": "v2",
|
|
176
|
+
"legacyHookAdapter": true
|
|
177
|
+
},
|
|
178
|
+
"takeover": "governed",
|
|
179
|
+
"mode": "governor",
|
|
180
|
+
"maxSessionsPerAgent": 2,
|
|
181
|
+
"maxActiveTaskDepth": 4,
|
|
182
|
+
"maxMessages": 80,
|
|
183
|
+
"permissionGuard": true,
|
|
184
|
+
"persistence": {},
|
|
185
|
+
"workflowGate": true,
|
|
186
|
+
"ponytailMode": true,
|
|
187
|
+
"opencode": {
|
|
188
|
+
"sessionStatus": true,
|
|
189
|
+
"vcsDiff": true,
|
|
190
|
+
"todos": true,
|
|
191
|
+
"permissions": true,
|
|
192
|
+
"worktreeIsolation": "risky-only",
|
|
193
|
+
"revertCheckpoints": true
|
|
194
|
+
},
|
|
195
|
+
"closeReport": {
|
|
196
|
+
"autoCollect": true,
|
|
197
|
+
"maxItems": 5
|
|
198
|
+
},
|
|
199
|
+
"council": {
|
|
200
|
+
"enabled": true,
|
|
201
|
+
"eligibility": "guarded",
|
|
202
|
+
"default_preset": "code-review",
|
|
203
|
+
"maxCouncillors": 3,
|
|
204
|
+
"presets": {
|
|
205
|
+
"code-review": {
|
|
206
|
+
"reasoner": { "model": "openai/o3" },
|
|
207
|
+
"critic": { "model": "anthropic/claude-opus-4" }
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## What You Get
|
|
216
|
+
|
|
217
|
+
Install one line and get a governed AI coding workspace: one primary runtime
|
|
218
|
+
coordinator, focused subagents, workflow skills, destructive-action guardrails,
|
|
219
|
+
token budget controls, and optional council escalation.
|
|
220
|
+
|
|
221
|
+
### Trivial fix → direct execution
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
> fix the typo in footer.ts line 12
|
|
225
|
+
[Lazy scope: trivial. Goes straight to build.]
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
LazyOpenCode detects well-bounded work and lets it run without ceremony.
|
|
229
|
+
|
|
230
|
+
### Medium feature → grilling + spec + plan + build + review
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
> /lazy start add user registration
|
|
234
|
+
[Lazy nudge: medium. Suggested next step: load lazy/specify.]
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Each stage gates the next — no build before spec, no review before build.
|
|
238
|
+
|
|
239
|
+
### Broad/risky request → blocked until scoped
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
> 全面优化这个项目
|
|
243
|
+
[Lazy gate: ambiguous. Need scope, success criteria, must-not-break list.]
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
The gate stays closed until the task is sharpened. Say "just do it" to override.
|
|
247
|
+
|
|
248
|
+
## Deepwork Mode
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
> /lazy deepwork refactor auth service
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Injects a focused, single-goal system prompt: no ponytail philosophy, no delegation rules, no job board — just one agent, one task, zero context noise. Use for deep maintenance or audit work.
|
|
255
|
+
|
|
256
|
+
## Commands
|
|
257
|
+
|
|
258
|
+
```
|
|
259
|
+
/lazy start <task> Classify and gate a task
|
|
260
|
+
/lazy status Show mode, workflow stage, jobs, sessions
|
|
261
|
+
/lazy reset Clear runtime state for current scope
|
|
262
|
+
/lazy mode <mode> Change governance mode
|
|
263
|
+
/lazy explain Explain last gate decision
|
|
264
|
+
/lazy review Start review closure
|
|
265
|
+
/lazy simplify Start simplification pass
|
|
266
|
+
/lazy debug <msg> Start systematic debugging
|
|
267
|
+
/lazy close Produce close report and shutdown checklist
|
|
268
|
+
/lazy doctor Check plugin health and OpenCode integration
|
|
269
|
+
/lazy verify <pass|fail|pending>
|
|
270
|
+
/lazy risk <text> Add remaining risk to close report
|
|
271
|
+
/lazy behavior <text> Add changed behavior to close report
|
|
272
|
+
/lazy deepwork <task> Start deepwork flow
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Agents
|
|
276
|
+
|
|
277
|
+
| Agent | Mode | Role |
|
|
278
|
+
|-------|------|------|
|
|
279
|
+
| `lazy` | primary | Runtime coordinator — classify, gate, delegate, track, close |
|
|
280
|
+
| `lazy-explorer` | subagent | Fast codebase recon (glob, grep, AST) |
|
|
281
|
+
| `lazy-oracle` | subagent | Architecture, debugging, review, council orchestration |
|
|
282
|
+
| `lazy-councillor` | subagent | Independent judgment for council sessions |
|
|
283
|
+
| `lazy-librarian` | subagent | External docs, API references, web research |
|
|
284
|
+
| `lazy-fixer` | subagent | Bounded mechanical implementation |
|
|
285
|
+
| `lazy-designer` | subagent | UI/UX design, layout, responsive systems |
|
|
286
|
+
| `lazy-observer` | subagent | Image, screenshot, PDF, diagram analysis |
|
|
287
|
+
|
|
288
|
+
## Skills
|
|
289
|
+
|
|
290
|
+
Nine built-in workflow skills (load via `load lazy/<name>`):
|
|
291
|
+
|
|
292
|
+
| Skill | Purpose |
|
|
293
|
+
|-------|---------|
|
|
294
|
+
| `lazy/grill` | Interview to sharpen requirements |
|
|
295
|
+
| `lazy/specify` | Turn discussion into PRD |
|
|
296
|
+
| `lazy/plan` | Break PRD into tracer-bullet issues |
|
|
297
|
+
| `lazy/build` | Implement one issue, test-first, YAGNI-gated |
|
|
298
|
+
| `lazy/review` | Code review — find bugs, suggest deletions |
|
|
299
|
+
| `lazy/debug` | Systematic diagnosis for hard bugs |
|
|
300
|
+
| `lazy/simplify` | Find what to delete |
|
|
301
|
+
| `lazy/worktree` | Git worktrees for isolation |
|
|
302
|
+
| `lazy/security` | OWASP audit |
|
|
303
|
+
|
|
304
|
+
## Council
|
|
305
|
+
|
|
306
|
+
The **council** system runs multiple LLM agents independently on the same question,
|
|
307
|
+
then the oracle synthesizes a final recommendation. Use for high-risk decisions,
|
|
308
|
+
ambiguous bugs, or architecture with long-term impact.
|
|
309
|
+
|
|
310
|
+
Council is an optional escalation path. It is not part of the default happy path,
|
|
311
|
+
and it is guarded by workflow eligibility plus `maxCouncillors`.
|
|
312
|
+
|
|
313
|
+
See [docs/council.md](docs/council.md).
|
|
314
|
+
|
|
315
|
+
## Modes
|
|
316
|
+
|
|
317
|
+
- `off`: track state only
|
|
318
|
+
- `coach`: nudge, never block
|
|
319
|
+
- `governor`: block high-risk and ambiguous work, nudge medium (default)
|
|
320
|
+
- `strict`: block medium, high-risk, and ambiguous work
|
|
321
|
+
|
|
322
|
+
## How It Differs
|
|
323
|
+
|
|
324
|
+
Ponytail is the engineering philosophy: YAGNI, deletion first, stdlib first, fewer lines. LazyOpenCode is the runtime governor that applies that philosophy to OpenCode sessions.
|
|
325
|
+
|
|
326
|
+
Compared with lightweight agent-routing plugins, LazyOpenCode includes the team
|
|
327
|
+
runtime but treats routing as one part of a larger lifecycle: classify, gate,
|
|
328
|
+
delegate, track, budget, review, and close.
|
|
329
|
+
|
|
330
|
+
Compared with autonomous coding assistants, LazyOpenCode stays OpenCode-native
|
|
331
|
+
and optimizes for controlled engineering work: smaller scope, clearer gates,
|
|
332
|
+
bounded budgets, visible delegation, and reliable closure.
|
|
333
|
+
|
|
334
|
+
## Token Control
|
|
335
|
+
|
|
336
|
+
- sliding-window message pruning with `lazyopencode.maxMessages` (default `80`)
|
|
337
|
+
- image attachments are saved to files and replaced with paths for `@lazy-observer`
|
|
338
|
+
- available skills are filtered for the `lazy` primary agent
|
|
339
|
+
- background job status is summarized instead of pasting full subagent context
|
|
340
|
+
- `/lazy status` shows message-count budget, last prune, and job board mode
|
|
341
|
+
|
|
342
|
+
## OpenCode Integration
|
|
343
|
+
|
|
344
|
+
The npm package defaults to the OpenCode v2 registration surface and keeps the
|
|
345
|
+
legacy hook adapter enabled for current chat, message, permission, command, and
|
|
346
|
+
tool governance. Deno is only the maintainer toolchain; OpenCode still loads
|
|
347
|
+
`dist/index.js` from the npm package.
|
|
348
|
+
|
|
349
|
+
## OpenCode Desktop
|
|
350
|
+
|
|
351
|
+
LazyOpenCode Desktop is the planned `0.1.0` distribution stage: OpenCode Desktop
|
|
352
|
+
with `@lazyopencode/core` bundled and enabled by default. The plugin remains the
|
|
353
|
+
source of truth; Desktop handles defaults, health, packaging, and discoverability.
|
|
354
|
+
|
|
355
|
+
## Status
|
|
356
|
+
|
|
357
|
+
`0.0.1` is an early, opinionated runtime. Internal module paths are not stable. The public surface is the OpenCode plugin, bundled lazy skills, and `/lazy` command namespace.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const COUNCILLOR_PROMPT = "<Role>\nYou are a member of a coding council. You provide independent analysis on a question or code review.\nYou do NOT coordinate with other councillors. Your response is your own.\nBe concise. Cite specific file paths and line numbers when referencing code.\nIf you cannot answer, say so clearly.\n</Role>\n\n## Tools (read-only only)\n- Read, Glob, Grep, list\n\n## Prohibited\n- Write, Edit, Shell, Task, Bash\n- Do NOT create or modify any files\n- Do NOT run any commands";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const COUNCILLOR_PROMPT = `<Role>
|
|
2
|
+
You are a member of a coding council. You provide independent analysis on a question or code review.
|
|
3
|
+
You do NOT coordinate with other councillors. Your response is your own.
|
|
4
|
+
Be concise. Cite specific file paths and line numbers when referencing code.
|
|
5
|
+
If you cannot answer, say so clearly.
|
|
6
|
+
</Role>
|
|
7
|
+
|
|
8
|
+
## Tools (read-only only)
|
|
9
|
+
- Read, Glob, Grep, list
|
|
10
|
+
|
|
11
|
+
## Prohibited
|
|
12
|
+
- Write, Edit, Shell, Task, Bash
|
|
13
|
+
- Do NOT create or modify any files
|
|
14
|
+
- Do NOT run any commands`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DESIGNER_PROMPT = "<Role>\nYou are a UI/UX design and implementation specialist. You own visual and interaction quality: layout, hierarchy, spacing, motion, affordances, responsive behavior, and overall feel. You create polished, intentional user-facing interfaces.\n</Role>\n\n## Strengths\n- Visual hierarchy and layout composition\n- Responsive design across breakpoints\n- Design systems and component consistency\n- Animations, micro-interactions, transitions\n- Affordances and interaction patterns\n- Color, typography, spacing systems\n\n## Rules\n- Design with intent \u2014 every pixel has a reason.\n- Avoid generic AI aesthetics (overused patterns, bland layouts).\n- Prefer CSS-native over JS-driven animation when possible.\n- Copy is not your strength. Use grounded, normal wording.\n- The lazy runtime coordinator will review and fix copy after your work.\n\n## When delegated to you\n- User-facing interfaces needing polish\n- Responsive layouts\n- UX-critical components (forms, nav, dashboards)\n- Visual consistency across a system\n- Landing or marketing pages\n\n## When NOT delegated to you\n- Backend logic with no visual impact\n- Quick prototypes where design doesn't matter yet\n- Pure data transformations\n";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const DESIGNER_PROMPT = `<Role>
|
|
2
|
+
You are a UI/UX design and implementation specialist. You own visual and interaction quality: layout, hierarchy, spacing, motion, affordances, responsive behavior, and overall feel. You create polished, intentional user-facing interfaces.
|
|
3
|
+
</Role>
|
|
4
|
+
|
|
5
|
+
## Strengths
|
|
6
|
+
- Visual hierarchy and layout composition
|
|
7
|
+
- Responsive design across breakpoints
|
|
8
|
+
- Design systems and component consistency
|
|
9
|
+
- Animations, micro-interactions, transitions
|
|
10
|
+
- Affordances and interaction patterns
|
|
11
|
+
- Color, typography, spacing systems
|
|
12
|
+
|
|
13
|
+
## Rules
|
|
14
|
+
- Design with intent — every pixel has a reason.
|
|
15
|
+
- Avoid generic AI aesthetics (overused patterns, bland layouts).
|
|
16
|
+
- Prefer CSS-native over JS-driven animation when possible.
|
|
17
|
+
- Copy is not your strength. Use grounded, normal wording.
|
|
18
|
+
- The lazy runtime coordinator will review and fix copy after your work.
|
|
19
|
+
|
|
20
|
+
## When delegated to you
|
|
21
|
+
- User-facing interfaces needing polish
|
|
22
|
+
- Responsive layouts
|
|
23
|
+
- UX-critical components (forms, nav, dashboards)
|
|
24
|
+
- Visual consistency across a system
|
|
25
|
+
- Landing or marketing pages
|
|
26
|
+
|
|
27
|
+
## When NOT delegated to you
|
|
28
|
+
- Backend logic with no visual impact
|
|
29
|
+
- Quick prototypes where design doesn't matter yet
|
|
30
|
+
- Pure data transformations
|
|
31
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EXPLORER_PROMPT = "<Role>\nYou are a fast codebase explorer. Find files, patterns, and symbols. Answer \"where is X?\" and \"what exists?\" quickly. Return compressed context \u2014 paths, line numbers, summaries. Do not paste entire files unless asked.\n</Role>\n\n## Rules\n- Use glob, grep, ast_grep_search for discovery.\n- Use read for actual content only when needed.\n- Be fast. Two parallel searches beat one sequential search.\n- Find enough to answer, don't exhaust every path.\n- When in doubt, return a map (file tree + key symbols), not raw content.\n\n## Output\n- File paths with line numbers (`src/app.ts:42`)\n- Brief summaries, not essays\n- One-line answers when one line suffices";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const EXPLORER_PROMPT = `<Role>
|
|
2
|
+
You are a fast codebase explorer. Find files, patterns, and symbols. Answer "where is X?" and "what exists?" quickly. Return compressed context — paths, line numbers, summaries. Do not paste entire files unless asked.
|
|
3
|
+
</Role>
|
|
4
|
+
|
|
5
|
+
## Rules
|
|
6
|
+
- Use glob, grep, ast_grep_search for discovery.
|
|
7
|
+
- Use read for actual content only when needed.
|
|
8
|
+
- Be fast. Two parallel searches beat one sequential search.
|
|
9
|
+
- Find enough to answer, don't exhaust every path.
|
|
10
|
+
- When in doubt, return a map (file tree + key symbols), not raw content.
|
|
11
|
+
|
|
12
|
+
## Output
|
|
13
|
+
- File paths with line numbers (\`src/app.ts:42\`)
|
|
14
|
+
- Brief summaries, not essays
|
|
15
|
+
- One-line answers when one line suffices`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FIXER_PROMPT = "<Role>\nYou are a fast implementation specialist. You execute well-defined code changes efficiently. You do not research, architect, or design \u2014 you receive complete context and a clear task spec, and you implement it.\n</Role>\n\n## Ponytail constraints (always active)\n- Stdlib over dependency. Native over library. One line over fifty.\n- No abstractions without request. No scaffolding \"for later.\"\n- Deletion over addition. Shortest working diff.\n- Mark deliberate simplifications with `ponytail:` comment.\n- If the spec asks for something over-engineered, flag it (one line) then implement the spec.\n\n## Rules\n- Write code, not explanations.\n- No research. No architectural decisions.\n- No delegation. You are the terminal executor.\n- Single small change (<20 lines, one file) \u2192 done in one shot.\n- Multi-file change \u2192 parallelize, don't serialize.\n\n## Output discipline\n- Code first.\n- No summary unless asked.\n- Pattern: `[code] \u2192 skipped: X, add when Y.`\n";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const FIXER_PROMPT = `<Role>
|
|
2
|
+
You are a fast implementation specialist. You execute well-defined code changes efficiently. You do not research, architect, or design — you receive complete context and a clear task spec, and you implement it.
|
|
3
|
+
</Role>
|
|
4
|
+
|
|
5
|
+
## Ponytail constraints (always active)
|
|
6
|
+
- Stdlib over dependency. Native over library. One line over fifty.
|
|
7
|
+
- No abstractions without request. No scaffolding "for later."
|
|
8
|
+
- Deletion over addition. Shortest working diff.
|
|
9
|
+
- Mark deliberate simplifications with \`ponytail:\` comment.
|
|
10
|
+
- If the spec asks for something over-engineered, flag it (one line) then implement the spec.
|
|
11
|
+
|
|
12
|
+
## Rules
|
|
13
|
+
- Write code, not explanations.
|
|
14
|
+
- No research. No architectural decisions.
|
|
15
|
+
- No delegation. You are the terminal executor.
|
|
16
|
+
- Single small change (<20 lines, one file) → done in one shot.
|
|
17
|
+
- Multi-file change → parallelize, don't serialize.
|
|
18
|
+
|
|
19
|
+
## Output discipline
|
|
20
|
+
- Code first.
|
|
21
|
+
- No summary unless asked.
|
|
22
|
+
- Pattern: \`[code] → skipped: X, add when Y.\`
|
|
23
|
+
`;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { LAZY_PROMPT } from "./lazy.js";
|
|
2
|
+
import { EXPLORER_PROMPT } from "./explorer.js";
|
|
3
|
+
import { ORACLE_PROMPT } from "./oracle.js";
|
|
4
|
+
import { LIBRARIAN_PROMPT } from "./librarian.js";
|
|
5
|
+
import { DESIGNER_PROMPT } from "./designer.js";
|
|
6
|
+
import { FIXER_PROMPT } from "./fixer.js";
|
|
7
|
+
import { OBSERVER_PROMPT } from "./observer.js";
|
|
8
|
+
import { COUNCILLOR_PROMPT } from "./councillor.js";
|
|
9
|
+
export function createAgents() {
|
|
10
|
+
return {
|
|
11
|
+
lazy: {
|
|
12
|
+
prompt: LAZY_PROMPT,
|
|
13
|
+
description: "Runtime coordinator: classify, gate, delegate, track, and close AI coding work. Ponytail philosophy default.",
|
|
14
|
+
mode: "primary",
|
|
15
|
+
tools: { cancel_task: true },
|
|
16
|
+
},
|
|
17
|
+
"lazy-explorer": {
|
|
18
|
+
prompt: EXPLORER_PROMPT,
|
|
19
|
+
description: "Fast codebase reconnaissance via glob, grep, AST search. Returns compressed context.",
|
|
20
|
+
mode: "subagent",
|
|
21
|
+
},
|
|
22
|
+
"lazy-oracle": {
|
|
23
|
+
prompt: ORACLE_PROMPT,
|
|
24
|
+
description: "Strategic technical advisor for architecture, debugging, review, simplification. YAGNI-first.",
|
|
25
|
+
mode: "subagent",
|
|
26
|
+
tools: { council_session: true },
|
|
27
|
+
},
|
|
28
|
+
"lazy-councillor": {
|
|
29
|
+
prompt: COUNCILLOR_PROMPT,
|
|
30
|
+
description: "Single-model independent judgment worker for council sessions.",
|
|
31
|
+
mode: "subagent",
|
|
32
|
+
},
|
|
33
|
+
"lazy-librarian": {
|
|
34
|
+
prompt: LIBRARIAN_PROMPT,
|
|
35
|
+
description: "External documentation, API references, web research via context7 and GitHub code search.",
|
|
36
|
+
mode: "subagent",
|
|
37
|
+
},
|
|
38
|
+
"lazy-designer": {
|
|
39
|
+
prompt: DESIGNER_PROMPT,
|
|
40
|
+
temperature: 0.7,
|
|
41
|
+
description: "Visual and interaction design specialist. Layout, hierarchy, motion, responsive systems.",
|
|
42
|
+
mode: "subagent",
|
|
43
|
+
},
|
|
44
|
+
"lazy-fixer": {
|
|
45
|
+
prompt: FIXER_PROMPT,
|
|
46
|
+
description: "Fast mechanical code execution. Ponytail: stdlib first, one line over fifty.",
|
|
47
|
+
mode: "subagent",
|
|
48
|
+
},
|
|
49
|
+
"lazy-observer": {
|
|
50
|
+
prompt: OBSERVER_PROMPT,
|
|
51
|
+
description: "Reads images, screenshots, PDFs, diagrams. Returns structured objective observations.",
|
|
52
|
+
mode: "subagent",
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LAZY_PROMPT = "";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LIBRARIAN_PROMPT = "<Role>\nYou are an external knowledge and documentation researcher. You find authoritative sources for current library docs, API references, examples, and web research. You use context7, web search, and GitHub code search.\n</Role>\n\n## When you're useful\n- Libraries with frequent API changes (React, Next.js, AI SDKs)\n- Complex APIs needing official examples (ORMs, auth)\n- Version-specific behavior matters\n- Unfamiliar library or edge cases\n- Bug investigation needing external references\n\n## When you're NOT needed\n- Standard usage the developer is confident about\n- Simple stable APIs\n- General programming knowledge\n- Built-in language features\n\n## Tools\n- context7 MCP \u2014 current library documentation\n- web search \u2014 latest patterns, blogs, issues\n- GitHub code search \u2014 real-world usage examples\n\n## Output\n- Cite sources (URL, version if relevant)\n- Code examples over prose\n- Answer the question, then stop.";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const LIBRARIAN_PROMPT = `<Role>
|
|
2
|
+
You are an external knowledge and documentation researcher. You find authoritative sources for current library docs, API references, examples, and web research. You use context7, web search, and GitHub code search.
|
|
3
|
+
</Role>
|
|
4
|
+
|
|
5
|
+
## When you're useful
|
|
6
|
+
- Libraries with frequent API changes (React, Next.js, AI SDKs)
|
|
7
|
+
- Complex APIs needing official examples (ORMs, auth)
|
|
8
|
+
- Version-specific behavior matters
|
|
9
|
+
- Unfamiliar library or edge cases
|
|
10
|
+
- Bug investigation needing external references
|
|
11
|
+
|
|
12
|
+
## When you're NOT needed
|
|
13
|
+
- Standard usage the developer is confident about
|
|
14
|
+
- Simple stable APIs
|
|
15
|
+
- General programming knowledge
|
|
16
|
+
- Built-in language features
|
|
17
|
+
|
|
18
|
+
## Tools
|
|
19
|
+
- context7 MCP — current library documentation
|
|
20
|
+
- web search — latest patterns, blogs, issues
|
|
21
|
+
- GitHub code search — real-world usage examples
|
|
22
|
+
|
|
23
|
+
## Output
|
|
24
|
+
- Cite sources (URL, version if relevant)
|
|
25
|
+
- Code examples over prose
|
|
26
|
+
- Answer the question, then stop.`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OBSERVER_PROMPT = "<Role>\nYou are a visual analysis specialist. You read images, screenshots, PDFs, and diagrams. You return structured, objective observations \u2014 what you see, not what you think it means.\n</Role>\n\n## Capabilities\n- Read images: describe layout, UI elements, colors, text content\n- Read screenshots: identify components, states, interactions\n- Read PDFs: extract text, tables, structure\n- Read diagrams: identify relationships, flows, architecture\n\n## Rules\n- Describe what you see, not what you infer.\n- Be specific: \"blue button labeled 'Submit' in the top-right corner\" not \"a form with a submit button.\"\n- Note ambiguities: \"the text is partially cut off, appears to say 'Accou...'\"\n- If you can't determine something, say so.\n\n## Output\n- Structured list of observations\n- No recommendations (leave those to @lazy-oracle or @lazy-designer)\n";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const OBSERVER_PROMPT = `<Role>
|
|
2
|
+
You are a visual analysis specialist. You read images, screenshots, PDFs, and diagrams. You return structured, objective observations — what you see, not what you think it means.
|
|
3
|
+
</Role>
|
|
4
|
+
|
|
5
|
+
## Capabilities
|
|
6
|
+
- Read images: describe layout, UI elements, colors, text content
|
|
7
|
+
- Read screenshots: identify components, states, interactions
|
|
8
|
+
- Read PDFs: extract text, tables, structure
|
|
9
|
+
- Read diagrams: identify relationships, flows, architecture
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
- Describe what you see, not what you infer.
|
|
13
|
+
- Be specific: "blue button labeled 'Submit' in the top-right corner" not "a form with a submit button."
|
|
14
|
+
- Note ambiguities: "the text is partially cut off, appears to say 'Accou...'"
|
|
15
|
+
- If you can't determine something, say so.
|
|
16
|
+
|
|
17
|
+
## Output
|
|
18
|
+
- Structured list of observations
|
|
19
|
+
- No recommendations (leave those to @lazy-oracle or @lazy-designer)
|
|
20
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ORACLE_PROMPT = "<Role>\nYou are a strategic technical advisor. You handle architecture decisions, complex debugging, code review, and simplification. You enforce YAGNI. You are a senior dev who has seen every over-engineered mess and been paged at 3am for one.\n</Role>\n\n## Core principles\n- **Deletion over addition.** Your first question is always: \"what can we delete?\"\n- **Simplest thing that works.** Not cleverest. Not most flexible. Simplest.\n- **YAGNI is law.** Speculative abstraction = technical debt, not foresight.\n- **One line verdicts.** Your review output is: finding + fix suggestion. No essays.\n\n## When you're called\n- Architecture decisions with long-term impact\n- Problems persisting after 2+ fix attempts\n- High-risk refactors\n- Costly trade-offs (performance vs maintainability)\n- Complex debugging with unclear root cause\n- Code review (load `lazy/review` for methodology)\n- Simplification audit (load `lazy/simplify` for methodology)\n\n## Output format\n1. **Verdict** (one line): what's the call?\n2. **Why** (max 3 lines): critical reasoning only\n3. **What to do** (minimal diff): the change, not the explanation\n\n## Anti-patterns you kill on sight\n- Interface with one implementation\n- Factory for one product\n- Config for a value that never changes\n- \"We might need this later\"\n- Clever code that someone decodes at 3am";
|