oh-my-opencode-slim 2.0.5 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja-JP.md +64 -38
- package/README.ko-KR.md +62 -36
- package/README.md +82 -47
- package/README.zh-CN.md +63 -39
- package/dist/agents/council.d.ts +1 -1
- package/dist/agents/index.d.ts +7 -2
- package/dist/agents/orchestrator.d.ts +1 -1
- package/dist/cli/custom-skills-registry.d.ts +18 -0
- package/dist/cli/custom-skills.d.ts +3 -19
- package/dist/cli/index.js +1130 -195
- package/dist/cli/providers.d.ts +12 -16
- package/dist/cli/skills.d.ts +2 -2
- package/dist/companion/manager.d.ts +10 -0
- package/dist/config/constants.d.ts +2 -1
- package/dist/config/council-schema.d.ts +37 -12
- package/dist/config/loader.d.ts +5 -2
- package/dist/config/schema.d.ts +17 -6
- package/dist/council/council-manager.d.ts +7 -3
- package/dist/hooks/auto-update-checker/skill-sync.d.ts +59 -1
- package/dist/hooks/filter-available-skills/index.d.ts +1 -2
- package/dist/hooks/foreground-fallback/index.d.ts +40 -2
- package/dist/hooks/image-hook.d.ts +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/loop-command/index.d.ts +13 -0
- package/dist/hooks/phase-reminder/index.d.ts +4 -3
- package/dist/hooks/post-file-tool-nudge/index.d.ts +15 -9
- package/dist/hooks/session-lifecycle.d.ts +11 -0
- package/dist/hooks/task-session-manager/index.d.ts +15 -4
- package/dist/hooks/task-session-manager/pending-call-tracker.d.ts +13 -0
- package/dist/hooks/task-session-manager/task-context-tracker.d.ts +14 -0
- package/dist/hooks/types.d.ts +3 -1
- package/dist/index.js +2890 -986
- package/dist/interview/dashboard-manager.d.ts +21 -0
- package/dist/interview/manager.d.ts +0 -14
- package/dist/interview/service.d.ts +9 -0
- package/dist/interview/session-server.d.ts +21 -0
- package/dist/interview/types.d.ts +3 -1
- package/dist/loop/loop-session.d.ts +64 -0
- package/dist/multiplexer/factory.d.ts +5 -5
- package/dist/multiplexer/herdr/index.d.ts +33 -0
- package/dist/multiplexer/index.d.ts +1 -0
- package/dist/multiplexer/session-manager.d.ts +6 -5
- package/dist/multiplexer/shared.d.ts +24 -0
- package/dist/multiplexer/tmux/index.d.ts +0 -1
- package/dist/multiplexer/types.d.ts +4 -4
- package/dist/multiplexer/zellij/index.d.ts +0 -1
- package/dist/tools/cancel-task.d.ts +2 -2
- package/dist/tui.d.ts +1 -0
- package/dist/tui.js +123 -45
- package/dist/utils/background-job-board.d.ts +22 -2
- package/dist/utils/background-job-coordinator.d.ts +72 -0
- package/dist/utils/background-job-store.d.ts +46 -0
- package/dist/utils/councillor-models.d.ts +20 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/internal-initiator.d.ts +6 -1
- package/dist/utils/session.d.ts +2 -2
- package/oh-my-opencode-slim.schema.json +18 -1
- package/package.json +1 -1
- package/src/skills/clonedeps/SKILL.md +2 -2
- package/src/skills/clonedeps/codemap.md +23 -32
- package/src/skills/codemap/SKILL.md +2 -2
- package/src/skills/codemap.md +63 -36
- package/src/skills/loop-engineering/SKILL.md +30 -0
- package/src/skills/oh-my-opencode-slim/SKILL.md +3 -3
- package/src/skills/reflect/SKILL.md +133 -0
- package/src/skills/release-smoke-test/SKILL.md +159 -0
- package/src/skills/simplify/SKILL.md +6 -6
|
@@ -217,9 +217,9 @@ sentence so future agents do not need an extra read just to know what is there:
|
|
|
217
217
|
Read-only dependency source repositories are available under
|
|
218
218
|
`.slim/clonedeps/repos/` for inspection. Do not edit these clones.
|
|
219
219
|
|
|
220
|
-
- `.slim/clonedeps/repos/<safe-name>/`
|
|
220
|
+
- `.slim/clonedeps/repos/<safe-name>/` - `<repo>` at `<ref>`; <one sentence on
|
|
221
221
|
why this source is useful>.
|
|
222
|
-
- `.slim/clonedeps/repos/<safe-name-2>/`
|
|
222
|
+
- `.slim/clonedeps/repos/<safe-name-2>/` - `<repo>` at `<ref>`; <one sentence on
|
|
223
223
|
why this source is useful>.
|
|
224
224
|
```
|
|
225
225
|
|
|
@@ -1,41 +1,32 @@
|
|
|
1
1
|
# src/skills/clonedeps/
|
|
2
2
|
|
|
3
3
|
## Responsibility
|
|
4
|
-
|
|
5
|
-
Workflow-only bundled OpenCode skill for local dependency source mirroring. It
|
|
6
|
-
instructs the orchestrator to use `@librarian` for dependency discovery and
|
|
7
|
-
source URL/ref resolution, then perform approved git/filesystem operations
|
|
8
|
-
directly.
|
|
4
|
+
Manages the cloning and management of read-only dependency source repositories into `.slim/clonedeps/repos/` for offline inspection. This skill provides a workflow (not a command wrapper) that guides the orchestrator and `@librarian` through cloning dependency sources so agents can inspect library internals without requiring network access.
|
|
9
5
|
|
|
10
6
|
## Design
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
- No
|
|
15
|
-
|
|
16
|
-
- State is trackable project metadata stored in `.slim/clonedeps.json`; clone
|
|
17
|
-
contents live under `.slim/clonedeps/repos/<safe-dependency-name>/` and are
|
|
18
|
-
ignored by git.
|
|
19
|
-
- The workflow updates `.gitignore`, `.ignore`, and root `AGENTS.md` with
|
|
20
|
-
concise marker sections so cloned source stays out of git but visible to
|
|
21
|
-
OpenCode and discoverable by future agents.
|
|
7
|
+
- **Workflow skill, not a command wrapper**: No helper scripts or TypeScript utility functions. The orchestrator owns the decision-making; `@librarian` recommends sources; the orchestrator performs filesystem/git operations directly.
|
|
8
|
+
- **Read-only clones**: Dependencies are cloned into `.slim/clonedeps/repos/` and should not be modified.
|
|
9
|
+
- **Cache strategy**: Existing clones are reused when they satisfy the task. Only fetch when the manifest entry is missing or stale.
|
|
10
|
+
- **Agent-driven**: No runtime TS helpers (no `getClonedDepPath` utility). Agents resolve paths from `.slim/clonedeps.json` if needed.
|
|
11
|
+
- **Configuration**: Uses `.slim/clonedeps.json` in the project root to define which repositories are cloned and their checked-out refs.
|
|
22
12
|
|
|
23
13
|
## Flow
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
`.slim/clonedeps/repos/<safe-repo-name>/`.
|
|
32
|
-
5. Orchestrator writes `.slim/clonedeps.json` with paths, refs, and reasons.
|
|
33
|
-
6. Orchestrator updates `.gitignore`, `.ignore`, and root `AGENTS.md`; the
|
|
34
|
-
AGENTS section lists each read-only clone path directly with a one-sentence
|
|
35
|
-
purpose.
|
|
14
|
+
1. **Check existing state**: Read `.slim/clonedeps.json` (if it exists). Check whether each listed `path` exists under `.slim/clonedeps/repos/`.
|
|
15
|
+
2. **Ask librarian for plan**: Delegate dependency discovery and source resolution to `@librarian`, who returns a small plan (dependency name, repo URL, ref, package subdirectory, reason).
|
|
16
|
+
3. **Verify and confirm**: Orchestrator verifies refs with `git ls-remote`, avoids unsafe URLs, presents plan to user, and gets approval before cloning.
|
|
17
|
+
4. **Clone sources**: Orchestrator runs git commands directly. Creates one folder per source under `.slim/clonedeps/repos/<safe-repo-name>/`. Prefers shallow clones, pinned tags, HTTPS URLs.
|
|
18
|
+
5. **Write local state**: Writes `.slim/clonedeps.json` with structured manifest (version, updatedAt, dependencies array).
|
|
19
|
+
6. **Update ignore files**: Adds idempotent marker blocks to `.gitignore` and `.ignore`.
|
|
20
|
+
7. **Register in AGENTS.md**: Appends a `## Cloned Dependency Source` section so future agents know what exists.
|
|
36
21
|
|
|
37
22
|
## Integration
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
23
|
+
- **Consumed by**: Agents that need to inspect dependency internals (e.g., `@librarian`, `@explorer`) via the registered paths in AGENTS.md.
|
|
24
|
+
- **Depends on**: Git CLI (for `git clone`, `git ls-remote`), `.slim/clonedeps.json` manifest.
|
|
25
|
+
- **Outputs**: Local filesystem paths under `.slim/clonedeps/repos/` for agent inspection.
|
|
26
|
+
|
|
27
|
+
## Notes
|
|
28
|
+
- Cloned repositories are read-only and should not be edited.
|
|
29
|
+
- The cache directory (`.slim/clonedeps/repos/`) is in the **project directory**, not the user's home directory.
|
|
30
|
+
- This skill is for development and debugging; it does not affect runtime behavior.
|
|
31
|
+
- `.slim/clonedeps.json` is small structured metadata that can be committed.
|
|
32
|
+
- Only `.slim/clonedeps/repos/` is gitignored.
|
|
@@ -87,7 +87,7 @@ Once all specific directories are mapped, the Orchestrator must create or update
|
|
|
87
87
|
|
|
88
88
|
**OpenCode auto-loads `AGENTS.md` into agent context on every session.** To ensure agents automatically discover and use the codemap, update (or create) `AGENTS.md` at the repo root:
|
|
89
89
|
|
|
90
|
-
1. If `AGENTS.md` already exists and already contains a `## Repository Map` section, **skip this step**
|
|
90
|
+
1. If `AGENTS.md` already exists and already contains a `## Repository Map` section, **skip this step** - the reference is already set up.
|
|
91
91
|
2. If `AGENTS.md` exists but has no `## Repository Map` section, **append** the section below.
|
|
92
92
|
3. If `AGENTS.md` doesn't exist, **create** it with the section below.
|
|
93
93
|
|
|
@@ -104,7 +104,7 @@ Before working on any task, read `codemap.md` to understand:
|
|
|
104
104
|
For deep work on a specific folder, also read that folder's `codemap.md`.
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
This is idempotent
|
|
107
|
+
This is idempotent - repeated codemap runs will detect the existing section and skip. No duplication.
|
|
108
108
|
|
|
109
109
|
## Codemap Content
|
|
110
110
|
|
package/src/skills/codemap.md
CHANGED
|
@@ -2,48 +2,75 @@
|
|
|
2
2
|
|
|
3
3
|
## Responsibility
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
plugin dependencies.
|
|
5
|
+
- Owns metadata-driven OpenCode custom skills shipped with this package
|
|
6
|
+
- Maintains the skill contract artifacts (`SKILL.md`, `README.md`, per-skill helper files) that are copied into `${configDir}/skills` at install time
|
|
7
|
+
- Preserves a canonical registry boundary: runtime code consumes skill definitions as data, not as executable plugin dependencies
|
|
8
|
+
- Skills are partitioned into orchestrator-only workflows and general-purpose skills for broad reuse
|
|
10
9
|
|
|
11
10
|
## Design
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- `
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
### Skill Registry
|
|
13
|
+
|
|
14
|
+
- `CUSTOM_SKILLS` in `src/cli/custom-skills.ts` is the authoritative skill manifest for bundled skills
|
|
15
|
+
- Each entry maps folder name + `sourcePath` to an install-time consumer
|
|
16
|
+
- Skills are categorized by purpose and access scope:
|
|
17
|
+
|
|
18
|
+
| Skill | Type | Purpose |
|
|
19
|
+
|-------|------|-------|
|
|
20
|
+
| `codemap/` | General-purpose | Repository mapping and codebase documentation skill |
|
|
21
|
+
| `clonedeps/` | General-purpose | Workflow skill for dependency source mirroring and inspection |
|
|
22
|
+
| `simplify/` | General-purpose | Readability and maintainability guidance skill |
|
|
23
|
+
| `deepwork/` | Orchestrator-only | Heavy coding sessions, multi-phase implementation, and risky refactors |
|
|
24
|
+
| `reflect/` | Orchestrator-only | Learning from repeated work and suggesting reusable improvements |
|
|
25
|
+
| `worktrees/` | Orchestrator-only | Safe Git worktree lanes for parallel, risky, or isolated work |
|
|
26
|
+
| `oh-my-opencode-slim/` | Orchestrator-only | Plugin configuration and self-improvement guidance |
|
|
27
|
+
|
|
28
|
+
### Installation Pipeline
|
|
29
|
+
|
|
30
|
+
- `install.ts` runs `installCustomSkill()` which recursively copies bundled skill directories into the OpenCode skills directory
|
|
31
|
+
- During plugin release, the `files` whitelist in `package.json` must include `src/skills` so `src/skills/**` survive `npm pack`
|
|
32
|
+
- OpenCode plugin startup discovers these installed folders and reads each `SKILL.md` as a prompt-level contract
|
|
33
|
+
|
|
34
|
+
### Runtime Consumption
|
|
35
|
+
|
|
36
|
+
- Files are considered static runtime payload
|
|
37
|
+
- No plugin TS module in `src/` imports these files directly
|
|
38
|
+
- They are loaded by OpenCode via filesystem installation at runtime
|
|
27
39
|
|
|
28
40
|
## Flow
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`src/skills/**` survive `npm pack`.
|
|
36
|
-
- OpenCode plugin startup discovers these installed folders and reads each `SKILL.md` as a prompt-level contract.
|
|
42
|
+
1. **Skill Discovery**: `src/cli/custom-skills.ts` defines `CUSTOM_SKILLS` array with skill metadata
|
|
43
|
+
2. **Installation**: `bun run install` delegates to `src/cli/install.ts`, where `installCustomSkills()` gates copying of each `CUSTOM_SKILLS` entry
|
|
44
|
+
3. **Validation**: `installCustomSkill()` computes `packageRoot`, validates `sourcePath`, then performs a recursive directory copy via `copyDirRecursive()`
|
|
45
|
+
4. **Distribution**: During plugin release, `package.json` `files` whitelist ensures `src/skills/**` are included in the published tarball
|
|
46
|
+
5. **Runtime Discovery**: OpenCode plugin startup discovers installed skill folders and reads each `SKILL.md` as a prompt-level contract
|
|
37
47
|
|
|
38
48
|
## Integration
|
|
39
49
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- `
|
|
44
|
-
|
|
45
|
-
`src/skills/
|
|
46
|
-
`src/skills/
|
|
47
|
-
`src/skills/
|
|
48
|
-
|
|
49
|
-
- `
|
|
50
|
+
### Build & Release Dependencies
|
|
51
|
+
|
|
52
|
+
- `src/cli/custom-skills.ts`: Source-of-truth registry consumed by installer and permission helpers
|
|
53
|
+
- `src/cli/install.ts`: Contains `installCustomSkills()` and `installCustomSkill()` functions
|
|
54
|
+
- `verify-release-artifact.ts`: Enforces artifact completeness by asserting key bundled skill payloads are present in the tarball:
|
|
55
|
+
- `src/skills/simplify/SKILL.md`
|
|
56
|
+
- `src/skills/codemap/SKILL.md`
|
|
57
|
+
- `src/skills/clonedeps/SKILL.md`
|
|
58
|
+
- `src/skills/deepwork/SKILL.md`
|
|
59
|
+
- `src/skills/reflect/SKILL.md`
|
|
60
|
+
- `src/skills/worktrees/SKILL.md`
|
|
61
|
+
- `src/skills/oh-my-opencode-slim/SKILL.md`
|
|
62
|
+
- `package.json` scripts (`verify:release`, `build`) rely on these assets to ensure install-time skill availability
|
|
63
|
+
|
|
64
|
+
### Permission System
|
|
65
|
+
|
|
66
|
+
- `src/cli/skills.ts:getSkillPermissionsForAgent()` auto-populates permission rules for bundled skills when agent policy is derived from built-in recommendations
|
|
67
|
+
- Bundled skills are treated as data payloads with explicit permission boundaries defined in the skill manifests
|
|
68
|
+
|
|
69
|
+
### Skill Contracts
|
|
70
|
+
|
|
71
|
+
Each skill directory contains:
|
|
72
|
+
- `SKILL.md`: Skill contract defining name, description, and usage contract
|
|
73
|
+
- `README.md`: Documentation and examples for the skill
|
|
74
|
+
- Optional helper files and subdirectories for skill-specific functionality
|
|
75
|
+
|
|
76
|
+
These artifacts are copied verbatim to the OpenCode skills directory during installation and serve as the skill's interface definition.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: loop-engineering
|
|
3
|
+
description: Loop engineering runtime Grill + Monitor
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Loop Engineering Skill
|
|
7
|
+
|
|
8
|
+
## Grill (orchestrator interview)
|
|
9
|
+
|
|
10
|
+
1. Goal: "What are you trying to accomplish?"
|
|
11
|
+
2. Success criteria: "Describe how we know the loop succeeded."
|
|
12
|
+
3. Success type: choose from `test`, `build`, `lint`, `command`, `fileExists`, `oracle`, `observer`, `manual`. For CLI steps provide `successCommand`; for file detection provide `successPath`.
|
|
13
|
+
4. Execute agent: fixer / designer / explorer / librarian
|
|
14
|
+
5. Verify agent: oracle / observer / test
|
|
15
|
+
6. Max attempts (default 3)
|
|
16
|
+
7. Optional context files: which files or directories should be read before execution?
|
|
17
|
+
|
|
18
|
+
## Loop Monitor
|
|
19
|
+
|
|
20
|
+
- Listen to callbacks:
|
|
21
|
+
- `onLoopComplete(loopID, success)` → report final outcome
|
|
22
|
+
- `onEscalated(loopID, reason)` → escalate to human
|
|
23
|
+
- `onManualReview(loopID, reason)` → prompt human to approve/fail and call `resolveManualReview(loopID, passed, reason)`
|
|
24
|
+
- Show current state and attempt count on each callback
|
|
25
|
+
- For manual verification, present the failure reason before asking for pass/fail
|
|
26
|
+
- If human forces cancellation, call `cancel(loopID)` through the orchestrator
|
|
27
|
+
|
|
28
|
+
## Notes
|
|
29
|
+
- Manual verification is the minimal on-ramp (autoresearch pattern). It pauses the loop until `resolveManualReview` is called. Do not auto-resolve.
|
|
30
|
+
- BackgroundJobBoard signals (totalErrors, timeoutCount) are already baked into the runtime.
|
|
@@ -122,13 +122,13 @@ Edit the active preset under `presets.<preset>.<agent>`:
|
|
|
122
122
|
"presets": {
|
|
123
123
|
"openai": {
|
|
124
124
|
"orchestrator": {
|
|
125
|
-
"model": "openai/gpt-5.
|
|
125
|
+
"model": "openai/gpt-5.6-terra",
|
|
126
126
|
"variant": "high",
|
|
127
127
|
"skills": ["*"],
|
|
128
128
|
"mcps": ["*", "!context7"]
|
|
129
129
|
},
|
|
130
130
|
"librarian": {
|
|
131
|
-
"model": "openai/gpt-5.
|
|
131
|
+
"model": "openai/gpt-5.6-luna",
|
|
132
132
|
"variant": "low",
|
|
133
133
|
"skills": [],
|
|
134
134
|
"mcps": ["websearch", "context7", "gh_grep"]
|
|
@@ -233,7 +233,7 @@ Use this shape as a starting point:
|
|
|
233
233
|
{
|
|
234
234
|
"agents": {
|
|
235
235
|
"api-reviewer": {
|
|
236
|
-
"model": "openai/gpt-5.
|
|
236
|
+
"model": "openai/gpt-5.6",
|
|
237
237
|
"variant": "high",
|
|
238
238
|
"prompt": "You review API design, compatibility, error semantics, and migration risk. Return concise findings with file references.",
|
|
239
239
|
"orchestratorPrompt": "Delegate to @api-reviewer for API contract changes, public SDK changes, backwards-compatibility questions, or migration-risk review. Do not use it for routine implementation.",
|
|
@@ -17,6 +17,7 @@ The goal is to identify real repeated friction and suggest practical improvement
|
|
|
17
17
|
Use Reflect when the user asks to:
|
|
18
18
|
|
|
19
19
|
- run `/reflect` or `/reflect <focus>`;
|
|
20
|
+
- run `/reflect --sessions` for session archaeology;
|
|
20
21
|
- learn from recent sessions or repeated workflows;
|
|
21
22
|
- find work they keep doing manually;
|
|
22
23
|
- improve their oh-my-opencode-slim setup based on actual usage using oh-my-opencode-slim skill;
|
|
@@ -26,6 +27,136 @@ Use Reflect when the user asks to:
|
|
|
26
27
|
Do not use Reflect for ordinary implementation work, one-off debugging, broad
|
|
27
28
|
architecture review, or speculative agent creation without workflow evidence.
|
|
28
29
|
|
|
30
|
+
## Session Mode
|
|
31
|
+
|
|
32
|
+
When the user includes `--sessions` in their reflect command, shift to session
|
|
33
|
+
archaeology: analyze historical OpenCode sessions across all repos to find
|
|
34
|
+
repeated patterns, friction, and improvement opportunities.
|
|
35
|
+
|
|
36
|
+
### Session Discovery
|
|
37
|
+
|
|
38
|
+
1. **Load recent sessions** - Query the SQLite database directly:
|
|
39
|
+
```bash
|
|
40
|
+
bun -e "import Database from 'bun:sqlite'; const db = new Database('/home/mhenke/.local/share/opencode/opencode.db'); console.log(db.query('SELECT id, directory, title, agent, model, time_created, cost, tokens_input, tokens_output FROM session ORDER BY time_created DESC LIMIT 50').all())"
|
|
41
|
+
```
|
|
42
|
+
Adjust `LIMIT 50` to `--last N` if specified.
|
|
43
|
+
|
|
44
|
+
**Session table columns:** `id, directory, title, agent, model, time_created, cost, tokens_input, tokens_output`
|
|
45
|
+
|
|
46
|
+
2. **Load session messages** - For each session ID, query the message table:
|
|
47
|
+
```bash
|
|
48
|
+
bun -e "import Database from 'bun:sqlite'; const db = new Database('/home/mhenke/.local/share/opencode/opencode.db'); console.log(db.query('SELECT data FROM message WHERE session_id = ?').all('ses_14de9c68effegtZtlATm42wnz7'))"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Message table columns:** `id, session_id, time_created, time_updated, data` (data is JSON with role, agent, model, summary, etc.)
|
|
52
|
+
|
|
53
|
+
### Per-Session Analysis
|
|
54
|
+
|
|
55
|
+
For each session, analyze and produce a structured summary:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"session": "ses_14de9c68effegtZtlATm42wnz7",
|
|
60
|
+
"project": "/home/user/Projects/oh-my-opencode-slim",
|
|
61
|
+
"timestamp": "2026-06-10T15:08:45.427Z",
|
|
62
|
+
"goal": "Fix CI failure",
|
|
63
|
+
"success": true,
|
|
64
|
+
"frictions": [
|
|
65
|
+
"Repeated grep to find test file",
|
|
66
|
+
"Three failed test runs before passing"
|
|
67
|
+
],
|
|
68
|
+
"recommendations": [
|
|
69
|
+
"Create /test-ci command"
|
|
70
|
+
],
|
|
71
|
+
"duration_minutes": 18,
|
|
72
|
+
"models_used": ["opencode/mimo-v2.5-free"],
|
|
73
|
+
"agents_used": ["orchestrator", "fixer", "explorer"],
|
|
74
|
+
"tools_used": ["Read", "Edit", "Bash"],
|
|
75
|
+
"confidence": 0.85
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Confidence scoring:**
|
|
80
|
+
- 0.9-1.0: Clear success/failure, obvious patterns
|
|
81
|
+
- 0.7-0.9: Likely outcome, patterns inferred from tool usage
|
|
82
|
+
- 0.5-0.7: Uncertain outcome, limited evidence
|
|
83
|
+
- <0.5: Skip or mark as "needs more evidence"
|
|
84
|
+
|
|
85
|
+
### Storage and Caching
|
|
86
|
+
|
|
87
|
+
Store session summaries in `~/.config/opencode/oh-my-opencode-slim/reflections/sessions/`.
|
|
88
|
+
|
|
89
|
+
**Cache logic:**
|
|
90
|
+
1. Check if `<session-id>.json` exists in reflections directory
|
|
91
|
+
2. If yes, load it (saves tokens)
|
|
92
|
+
3. If no, analyze session and save summary
|
|
93
|
+
4. Aggregate across all summaries for final report
|
|
94
|
+
|
|
95
|
+
### Aggregation
|
|
96
|
+
|
|
97
|
+
After analyzing all sessions, aggregate findings:
|
|
98
|
+
|
|
99
|
+
1. **Group by theme** - sessions with similar frictions cluster together
|
|
100
|
+
2. **Count frequency** - "42/50 sessions had repeated grep before editing"
|
|
101
|
+
3. **Rank by impact** - prioritize recommendations that appear most often
|
|
102
|
+
4. **Filter noise** - skip one-off issues, focus on repeated patterns
|
|
103
|
+
5. **Cross-reference** - see if patterns correlate with specific models, agents, or repos
|
|
104
|
+
|
|
105
|
+
**Scope categories:**
|
|
106
|
+
- **Global** - applies to all repos (pattern seen in >50% of repos)
|
|
107
|
+
- **Cross-repo** - applies to specific repos where pattern appears
|
|
108
|
+
- **Project-specific** - only relevant to one repo
|
|
109
|
+
|
|
110
|
+
### Output Format
|
|
111
|
+
|
|
112
|
+
Return a compact report with scope and confidence:
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
Session Reflection Report
|
|
116
|
+
Analyzing 50 most recent sessions across 8 repos.
|
|
117
|
+
|
|
118
|
+
Repos analyzed:
|
|
119
|
+
- <repo> (<N> sessions)
|
|
120
|
+
- ... (M more)
|
|
121
|
+
|
|
122
|
+
Findings
|
|
123
|
+
- <pattern>: N/50 sessions across M repos.
|
|
124
|
+
- Scope: global | cross-repo (<repos>) | project-specific (<repo>)
|
|
125
|
+
- Confidence: 0.95
|
|
126
|
+
- Impact: High | Medium | Low
|
|
127
|
+
|
|
128
|
+
Recommended changes
|
|
129
|
+
- <asset>: <purpose>
|
|
130
|
+
- Scope: global | cross-repo (<repos>) | project-specific (<repo>)
|
|
131
|
+
- Confidence: 0.97
|
|
132
|
+
- Estimated time saved: High | Medium | Low
|
|
133
|
+
|
|
134
|
+
Skipped
|
|
135
|
+
- <candidate>: why not worth packaging now.
|
|
136
|
+
- Scope: <reason>
|
|
137
|
+
- Confidence: <score>
|
|
138
|
+
|
|
139
|
+
Needs more evidence
|
|
140
|
+
- <candidate>: what would make it actionable.
|
|
141
|
+
- Current scope: <what we've seen>
|
|
142
|
+
- Required scope: <what would confirm>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Error Handling
|
|
146
|
+
|
|
147
|
+
**Log file issues:**
|
|
148
|
+
- Log doesn't exist → "No OpenCode log found at <path>. Run OpenCode in at least one repo first."
|
|
149
|
+
- Log is empty → "OpenCode log is empty. No sessions to analyze."
|
|
150
|
+
|
|
151
|
+
**Session loading issues:**
|
|
152
|
+
- Session ID not loadable → Skip with warning: "Session <id> could not be loaded, skipping."
|
|
153
|
+
- Session has no messages → Skip: "Session <id> has no messages."
|
|
154
|
+
|
|
155
|
+
**Recovery pattern:**
|
|
156
|
+
- Log the failure
|
|
157
|
+
- Continue with remaining sessions
|
|
158
|
+
- Report failures at end: "3 sessions skipped due to load errors"
|
|
159
|
+
|
|
29
160
|
## Core Contract
|
|
30
161
|
|
|
31
162
|
Reflect must be conservative and evidence-driven.
|
|
@@ -66,6 +197,8 @@ Reflect can be triggered directly:
|
|
|
66
197
|
```text
|
|
67
198
|
/reflect
|
|
68
199
|
/reflect release workflow and checks
|
|
200
|
+
/reflect --sessions
|
|
201
|
+
/reflect --sessions --last 100
|
|
69
202
|
```
|
|
70
203
|
|
|
71
204
|
With no arguments, review recent work broadly. With arguments, focus the review
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: release-smoke-test
|
|
3
|
+
description: Test an oh-my-opencode-slim release candidate or bugfix before publishing. Use when validating a packed plugin artifact, release branch, crash fix, OpenCode runtime compatibility, or model-specific smoke test such as OpenCode 1.17.11 message transform regressions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Release Smoke Test
|
|
7
|
+
|
|
8
|
+
Use this skill to validate an `oh-my-opencode-slim` release candidate before
|
|
9
|
+
public npm publish. Test the packed artifact, not `@latest` and not the source
|
|
10
|
+
tree.
|
|
11
|
+
|
|
12
|
+
## Core Workflow
|
|
13
|
+
|
|
14
|
+
1. Start from the release-prep branch or commit.
|
|
15
|
+
2. Build and pack the candidate.
|
|
16
|
+
3. Install the tarball into a throwaway app.
|
|
17
|
+
4. Create an isolated OpenCode config pointing at the installed
|
|
18
|
+
`node_modules/oh-my-opencode-slim/dist/index.js`.
|
|
19
|
+
5. Run `opencode debug config` and verify `plugin_origins` contains only the
|
|
20
|
+
intended plugin when doing an isolation smoke.
|
|
21
|
+
6. Run non-pure `opencode run --print-logs --log-level DEBUG`.
|
|
22
|
+
7. Search isolated logs for the original crash signature.
|
|
23
|
+
8. Record exact artifact, model, OpenCode version, command shape, result, and
|
|
24
|
+
limitations on the release issue or PR.
|
|
25
|
+
|
|
26
|
+
## Pack Candidate
|
|
27
|
+
|
|
28
|
+
Use a temp directory so release validation never depends on the local package
|
|
29
|
+
cache.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
SMOKE=/tmp/oh-my-opencode-slim-release-smoke
|
|
33
|
+
rm -rf "$SMOKE"
|
|
34
|
+
mkdir -p "$SMOKE/pkg" "$SMOKE/app" "$SMOKE/home" "$SMOKE/xdg/opencode" "$SMOKE/run"
|
|
35
|
+
|
|
36
|
+
bun run build
|
|
37
|
+
npm pack --pack-destination "$SMOKE/pkg"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Install the tarball:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
cd "$SMOKE/app"
|
|
44
|
+
bun init -y
|
|
45
|
+
bun add "$SMOKE/pkg"/oh-my-opencode-slim-*.tgz
|
|
46
|
+
node -p "require('./node_modules/oh-my-opencode-slim/package.json').version"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Isolated Config
|
|
50
|
+
|
|
51
|
+
Write the minimal OpenCode config:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cat > "$SMOKE/xdg/opencode/opencode.json" <<EOF
|
|
55
|
+
{
|
|
56
|
+
"model": "opencode/deepseek-v4-flash-free",
|
|
57
|
+
"plugin": [
|
|
58
|
+
"file://$SMOKE/app/node_modules/oh-my-opencode-slim/dist/index.js"
|
|
59
|
+
],
|
|
60
|
+
"agent": {
|
|
61
|
+
"orchestrator": {
|
|
62
|
+
"model": "opencode/deepseek-v4-flash-free"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
EOF
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Use `env -i` for the cleanest smoke. This strips host `OPENCODE_*`, `ORCA_*`,
|
|
70
|
+
and project overlay variables that can silently add plugins or provider aliases.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
env -i PATH="$PATH" HOME="$SMOKE/home" XDG_CONFIG_HOME="$SMOKE/xdg" \
|
|
74
|
+
opencode debug config
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Confirm:
|
|
78
|
+
|
|
79
|
+
- `plugin_origins` has exactly one entry.
|
|
80
|
+
- That entry points to the temp app's packed `dist/index.js`.
|
|
81
|
+
- The model is the one intended for the smoke.
|
|
82
|
+
|
|
83
|
+
If OpenCode needs provider aliases from the host environment, run a second
|
|
84
|
+
non-isolated model-specific smoke and clearly label it as weaker isolation.
|
|
85
|
+
|
|
86
|
+
## Runtime Smoke
|
|
87
|
+
|
|
88
|
+
Run the actual prompt with timeout:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
env -i PATH="$PATH" HOME="$SMOKE/home" XDG_CONFIG_HOME="$SMOKE/xdg" \
|
|
92
|
+
timeout 120 \
|
|
93
|
+
opencode run --print-logs --log-level DEBUG "Say OK only."
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Expected result:
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
OK
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Search logs for the bug signature. For the OpenCode 1.17.11 malformed-message
|
|
103
|
+
crash, use:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
rg "message\\.info\\.role|undefined is not an object|Cannot read properties of undefined|TypeError" \
|
|
107
|
+
"$SMOKE/home/.local/share/opencode/log" -n 2>/dev/null || true
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
No matches should appear.
|
|
111
|
+
|
|
112
|
+
## OpenAI / Host-Provider Smoke
|
|
113
|
+
|
|
114
|
+
If the fully isolated environment cannot resolve OpenAI provider aliases, run a
|
|
115
|
+
separate host-provider smoke while keeping the plugin path pointed at the
|
|
116
|
+
tarball install.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
mkdir -p "$SMOKE/config"
|
|
120
|
+
cat > "$SMOKE/config/opencode.json" <<EOF
|
|
121
|
+
{
|
|
122
|
+
"model": "openai/gpt-5.6-fast",
|
|
123
|
+
"plugin": [
|
|
124
|
+
"file://$SMOKE/app/node_modules/oh-my-opencode-slim/dist/index.js"
|
|
125
|
+
],
|
|
126
|
+
"agent": {
|
|
127
|
+
"orchestrator": {
|
|
128
|
+
"model": "openai/gpt-5.6-fast"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
EOF
|
|
133
|
+
|
|
134
|
+
OPENCODE_CONFIG_DIR="$SMOKE/config" \
|
|
135
|
+
timeout 120 \
|
|
136
|
+
opencode run --print-logs --log-level DEBUG "Say OK only."
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Report this as a host-provider smoke because existing project, user, or Orca
|
|
140
|
+
OpenCode config may still merge in. Use `opencode debug config` to disclose
|
|
141
|
+
what else loaded.
|
|
142
|
+
|
|
143
|
+
## Reporting Template
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
## Release-candidate smoke validation
|
|
147
|
+
|
|
148
|
+
- Commit under test:
|
|
149
|
+
- Tarball:
|
|
150
|
+
- Installed package version:
|
|
151
|
+
- OpenCode version:
|
|
152
|
+
- Config isolation: sanitized `env -i` / host-provider
|
|
153
|
+
- Plugin origin:
|
|
154
|
+
- Model:
|
|
155
|
+
- Command:
|
|
156
|
+
- Result:
|
|
157
|
+
- Crash signature search:
|
|
158
|
+
- Limitations:
|
|
159
|
+
```
|
|
@@ -7,7 +7,7 @@ description: Simplifies code for clarity without changing behavior. Use for read
|
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines
|
|
10
|
+
Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines - it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"
|
|
11
11
|
|
|
12
12
|
## When to Use
|
|
13
13
|
|
|
@@ -20,16 +20,16 @@ Simplify code by reducing complexity while preserving exact behavior. The goal i
|
|
|
20
20
|
|
|
21
21
|
**When NOT to use:**
|
|
22
22
|
|
|
23
|
-
- Code is already clean and readable
|
|
24
|
-
- You don't understand what the code does yet
|
|
23
|
+
- Code is already clean and readable - don't simplify for the sake of it
|
|
24
|
+
- You don't understand what the code does yet - comprehend before you simplify
|
|
25
25
|
- The code is performance-critical and the "simpler" version would be measurably slower
|
|
26
|
-
- You're about to rewrite the module entirely
|
|
26
|
+
- You're about to rewrite the module entirely - simplifying throwaway code wastes effort
|
|
27
27
|
|
|
28
28
|
## The Five Principles
|
|
29
29
|
|
|
30
30
|
### 1. Preserve Behavior Exactly
|
|
31
31
|
|
|
32
|
-
Don't change what the code does
|
|
32
|
+
Don't change what the code does - only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.
|
|
33
33
|
|
|
34
34
|
Before every change, ask:
|
|
35
35
|
|
|
@@ -48,7 +48,7 @@ Before simplifying:
|
|
|
48
48
|
2. Study how neighboring code handles similar patterns
|
|
49
49
|
3. Match the project's style for imports, naming, function style, error handling, and type annotations
|
|
50
50
|
|
|
51
|
-
Simplification that breaks project consistency is not simplification
|
|
51
|
+
Simplification that breaks project consistency is not simplification - it's churn.
|
|
52
52
|
|
|
53
53
|
### 3. Prefer Clarity Over Cleverness
|
|
54
54
|
|