oh-my-opencode-slim 2.0.0 → 2.0.2

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.
Files changed (39) hide show
  1. package/README.ja-JP.md +69 -20
  2. package/README.ko-KR.md +66 -19
  3. package/README.md +72 -19
  4. package/README.zh-CN.md +78 -31
  5. package/dist/agents/orchestrator.d.ts +0 -2
  6. package/dist/cli/index.js +50 -37
  7. package/dist/config/agent-mcps.d.ts +0 -4
  8. package/dist/config/constants.d.ts +1 -7
  9. package/dist/config/council-schema.d.ts +0 -15
  10. package/dist/config/runtime-preset.d.ts +0 -1
  11. package/dist/config/schema.d.ts +2 -68
  12. package/dist/hooks/auto-update-checker/skill-sync.d.ts +9 -0
  13. package/dist/hooks/filter-available-skills/index.d.ts +1 -13
  14. package/dist/hooks/foreground-fallback/index.d.ts +1 -1
  15. package/dist/hooks/image-hook.d.ts +1 -13
  16. package/dist/hooks/index.d.ts +3 -2
  17. package/dist/hooks/phase-reminder/index.d.ts +10 -16
  18. package/dist/hooks/reflect/index.d.ts +13 -0
  19. package/dist/hooks/task-session-manager/index.d.ts +2 -16
  20. package/dist/hooks/types.d.ts +23 -0
  21. package/dist/index.js +391 -289
  22. package/dist/tui.js +16 -25
  23. package/dist/utils/agent-variant.d.ts +0 -40
  24. package/dist/utils/compat.d.ts +0 -1
  25. package/dist/utils/guards.d.ts +4 -0
  26. package/dist/utils/index.d.ts +1 -2
  27. package/dist/utils/logger.d.ts +1 -1
  28. package/dist/utils/task.d.ts +0 -2
  29. package/oh-my-opencode-slim.schema.json +2 -249
  30. package/package.json +1 -1
  31. package/src/skills/codemap.md +4 -1
  32. package/src/skills/reflect/SKILL.md +193 -0
  33. package/src/skills/worktrees/SKILL.md +164 -0
  34. package/dist/config/fallback-chains.d.ts +0 -1
  35. package/dist/hooks/apply-patch/patch.d.ts +0 -2
  36. package/dist/hooks/delegate-task-retry/guidance.d.ts +0 -2
  37. package/dist/hooks/delegate-task-retry/index.d.ts +0 -4
  38. package/dist/hooks/json-error-recovery/index.d.ts +0 -1
  39. package/dist/utils/env.d.ts +0 -1
@@ -0,0 +1,193 @@
1
+ ---
2
+ name: reflect
3
+ description: Review recent work, find repeated workflow patterns, and suggest reusable skills, agents, commands, config changes, or playbooks. Use when the user asks to learn from past sessions, improve recurring workflows, or identify what should be turned into reusable agent instructions.
4
+ ---
5
+
6
+ # Reflect
7
+
8
+ Reflect is an orchestrator-only workflow for learning from repeated work. It
9
+ looks back over recent sessions, project notes, and existing agent assets, then
10
+ recommends the smallest useful improvement: a skill, custom agent, command,
11
+ configuration change, prompt rule, documentation playbook, or no change.
12
+
13
+ The goal is to identify real repeated friction and suggest practical improvements with evidence.
14
+
15
+ ## When to Use
16
+
17
+ Use Reflect when the user asks to:
18
+
19
+ - run `/reflect` or `/reflect <focus>`;
20
+ - learn from recent sessions or repeated workflows;
21
+ - find work they keep doing manually;
22
+ - improve their oh-my-opencode-slim setup based on actual usage using oh-my-opencode-slim skill;
23
+ - review whether a recurring process should become a reusable playbook;
24
+ - turn repeated workflow friction into a safer future default.
25
+
26
+ Do not use Reflect for ordinary implementation work, one-off debugging, broad
27
+ architecture review, or speculative agent creation without workflow evidence.
28
+
29
+ ## Core Contract
30
+
31
+ Reflect must be conservative and evidence-driven.
32
+
33
+ Required behavior:
34
+
35
+ - inspect existing assets before suggesting new ones;
36
+ - prefer recent, repeated, user-visible friction over isolated incidents;
37
+ - recommend the smallest useful form;
38
+ - treat "create nothing" as a successful result when evidence is weak;
39
+ - ask before changing prompts, skills, commands, agents, MCP access, or config;
40
+ - avoid duplicating existing assets;
41
+ - explain restart requirements for OpenCode config, prompt, agent, skill, MCP, or
42
+ plugin changes.
43
+
44
+ ## Evidence Sources
45
+
46
+ Use available evidence in this order:
47
+
48
+ 1. Current conversation and explicit user instructions.
49
+ 2. Project-local guidance and memories, such as `AGENTS.md`, `.opencode/`,
50
+ `.slim/`, notes, checkpoints, task progress files, and codemaps.
51
+ 3. Existing skills, commands, agents, prompt overrides, MCP permissions, and
52
+ oh-my-opencode-slim configuration.
53
+ 4. Recent OpenCode logs or session artifacts if they are available and safe to
54
+ inspect.
55
+ 5. External docs only when a proposed workflow depends on a third-party tool or
56
+ library whose behavior needs confirmation.
57
+
58
+ Respect privacy and safety boundaries. Do not inspect unrelated personal files,
59
+ credentials, private messages, or external accounts unless the user explicitly
60
+ asks and the workflow requires it.
61
+
62
+ ## Workflow
63
+
64
+ Reflect can be triggered directly:
65
+
66
+ ```text
67
+ /reflect
68
+ /reflect release workflow and checks
69
+ ```
70
+
71
+ With no arguments, review recent work broadly. With arguments, focus the review
72
+ on that workflow area while still checking whether existing assets already cover
73
+ it.
74
+
75
+ ### 1. Inventory Existing Assets
76
+
77
+ Before proposing anything, identify what already exists:
78
+
79
+ - bundled and user-installed skills;
80
+ - custom agents and their `orchestratorPrompt` guidance;
81
+ - custom commands;
82
+ - prompt overrides and append files;
83
+ - active oh-my-opencode-slim preset, model routing, skills, and MCP permissions;
84
+ - project playbooks, docs, codemaps, and local workflow notes.
85
+
86
+ If an existing asset already covers the candidate, recommend extending or using
87
+ that asset instead of creating a near-duplicate.
88
+
89
+ ### 2. Find Repeated Workflow Patterns
90
+
91
+ Look for repeated signals such as:
92
+
93
+ - the same command sequence appears across sessions;
94
+ - the user repeatedly asks for the same review, setup, release, or debugging
95
+ process;
96
+ - the same manual research or context-gathering steps keep recurring;
97
+ - the same specialist routing decision is repeatedly needed;
98
+ - the same project-specific rule is repeatedly re-explained;
99
+ - repeated failures happen because an agent lacks a stable instruction, tool, or
100
+ permission boundary.
101
+
102
+ Strong candidates usually have at least two occurrences, stable inputs, a clear
103
+ output, and a clear stopping condition.
104
+
105
+ ### 3. Score Candidates
106
+
107
+ For each candidate, decide:
108
+
109
+ - **Frequency:** How often has it happened?
110
+ - **Cost:** Does it waste meaningful time, context, money, or attention?
111
+ - **Risk:** Does inconsistent execution cause bugs, regressions, bad decisions,
112
+ or unsafe changes?
113
+ - **Stability:** Are the inputs and desired output predictable?
114
+ - **Coverage:** Is there already an asset that handles it well?
115
+
116
+ Only recommend creating or changing assets when confidence is high.
117
+
118
+ ### 4. Choose the Smallest Useful Form
119
+
120
+ Pick the least powerful form that solves the repeated problem:
121
+
122
+ - **Prompt/config rule:** a small behavior change to an existing agent.
123
+ - **Skill:** reusable workflow guidance for a task shape.
124
+ - **Command:** a repeatable manual trigger with stable inputs.
125
+ - **Custom agent:** a distinct specialist lane with clear delegation rules.
126
+ - **MCP/tool permission change:** a safe access adjustment for an existing agent.
127
+ - **Project playbook/doc:** human-readable process guidance when automation is too
128
+ heavy.
129
+ - **Skip:** weak, one-off, ambiguous, sensitive, or already-covered work.
130
+
131
+ Avoid creating custom agents when a prompt rule or skill is enough. Avoid skills
132
+ when a short project playbook is enough. Avoid config changes when the benefit is
133
+ unclear.
134
+
135
+ ### 5. Propose Before Changing
136
+
137
+ Unless the user explicitly requested a specific edit, present a concise proposal
138
+ before writing files or changing config:
139
+
140
+ ```text
141
+ Found 2 strong repeated workflows and 1 weak candidate.
142
+
143
+ Recommended:
144
+ - Add a small orchestrator prompt rule for <workflow> because <evidence>.
145
+ - Extend existing <skill> instead of creating a new one because <overlap>.
146
+
147
+ Skip:
148
+ - <candidate> because it only appeared once.
149
+
150
+ Proceed with the proposed edits?
151
+ ```
152
+
153
+ When applying changes, preserve existing user settings and prefer narrow,
154
+ append-only edits.
155
+
156
+ ## Output Format
157
+
158
+ Return a compact report:
159
+
160
+ ```text
161
+ Findings
162
+ - <workflow>: evidence, frequency/confidence, recommended form.
163
+
164
+ Recommended changes
165
+ - <asset/config/doc>: one-line purpose and why this is the smallest useful form.
166
+
167
+ Skipped
168
+ - <candidate>: why not worth packaging now.
169
+
170
+ Needs more evidence
171
+ - <candidate>: what would make it actionable.
172
+ ```
173
+
174
+ If nothing qualifies, say:
175
+
176
+ ```text
177
+ No strong repeated workflow found. I would not add or change any reusable assets
178
+ yet.
179
+ ```
180
+
181
+ ## Guardrails
182
+
183
+ - Do not manufacture assets to justify the workflow.
184
+ - Do not create overlapping skills or agents.
185
+ - Do not silently change global config, prompts, or permissions.
186
+ - Do not add broad instructions that make agents more eager, expensive, or
187
+ invasive without a clear benefit.
188
+ - Do not overfit to a single session unless the user explicitly asks for that
189
+ exact reusable workflow.
190
+ - Do not use private or sensitive material as examples in generated assets.
191
+ - When config, prompt, agent, skill, MCP, or plugin files change, tell the user:
192
+ "This should apply on the next OpenCode run; restart OpenCode if you need it
193
+ immediately."
@@ -0,0 +1,164 @@
1
+ ---
2
+ name: worktrees
3
+ description: Manage Git worktrees as OMO safe isolated coding lanes for complex, risky, or parallel work.
4
+ ---
5
+
6
+ # Worktrees Orchestration Protocol
7
+
8
+ The `worktrees` skill provides an opinionated, safe orchestration protocol for
9
+ managing Git worktrees as isolated coding lanes. Its value is giving the Orchestrator a consistent OMO workflow for parallel agents, risky experiments, integration review, and cleanup.
10
+
11
+ ## Core Contract
12
+
13
+ This is an **orchestrator-only** workflow. Other specialists such as `@fixer`
14
+ or `@designer` can be assigned tasks inside a worktree lane, but the
15
+ Orchestrator owns lane planning, branch/path selection, file ownership,
16
+ delegation, diff validation, integration, and cleanup.
17
+
18
+ All worktrees reside under the default path:
19
+
20
+ ```text
21
+ .slim/worktrees/<slug>/
22
+ ```
23
+
24
+ Do not create worktrees as sibling directories of the main repository.
25
+
26
+ ### State Tracking (`.slim/worktrees.json`)
27
+
28
+ Use the optional local metadata manifest `.slim/worktrees.json` to maintain
29
+ structural tracking:
30
+
31
+ ```json
32
+ {
33
+ "version": "1.0.0",
34
+ "updatedAt": "2026-06-14T00:00:00.000Z",
35
+ "lanes": [
36
+ {
37
+ "slug": "feature-auth-v2",
38
+ "branch": "omos/feature-auth-v2",
39
+ "path": ".slim/worktrees/feature-auth-v2",
40
+ "base": "main",
41
+ "purpose": "refactor authentication flow to use OAuth2",
42
+ "owner": "orchestrator",
43
+ "status": "active",
44
+ "areas": ["src/auth", "src/config"],
45
+ "createdAt": "2026-06-14T12:00:00.000Z"
46
+ }
47
+ ]
48
+ }
49
+ ```
50
+
51
+ If `.slim/worktrees.json` does not exist, create it when initializing a lane,
52
+ and keep it updated as lanes are transitioned, integrated, or pruned. Treat it
53
+ as local workflow metadata by default; ask before making it part of a committed
54
+ project convention.
55
+
56
+ ---
57
+
58
+ ## Safety Guidelines
59
+
60
+ Before executing any Git mutation command, the Orchestrator must observe the
61
+ following guards:
62
+
63
+ ### 1. Pre-Flight Checklist
64
+ - Confirm the current directory is inside a Git repository.
65
+ - Check the current branch, base branch, and dirty/uncommitted state.
66
+ - Inspect the output of `git worktree list` to avoid path or branch conflicts.
67
+ - Ensure the branch name (e.g. `omos/<slug>` or custom project convention) does not already exist locally or on remote.
68
+ - Ensure `.slim/worktrees/` is ignored by Git before creating nested worktrees.
69
+
70
+ ### 2. Mandatory User Confirmation
71
+ You must seek explicit user confirmation before executing:
72
+ - `git worktree add` or `git worktree remove`
73
+ - Branch creation, deletion, or renaming
74
+ - Merges, rebases, or cherry-picks
75
+ - `git prune` or `git worktree prune`
76
+ - Destructive commands (e.g., `git reset --hard`, `git clean`, `git push --force`, or removing a dirty worktree directory).
77
+
78
+ Never execute destructive commands, delete branches, remove dirty worktrees, or
79
+ clean uncommitted changes without explicit user confirmation for that exact
80
+ operation.
81
+
82
+ ### 3. Ignore File Setup
83
+
84
+ Before creating lanes, add or update managed marker blocks only.
85
+
86
+ `.gitignore`:
87
+
88
+ ```gitignore
89
+ # BEGIN oh-my-opencode-slim worktrees
90
+ .slim/worktrees/
91
+ .slim/worktrees.json
92
+ # END oh-my-opencode-slim worktrees
93
+ ```
94
+
95
+ `.ignore`:
96
+
97
+ ```ignore
98
+ # BEGIN oh-my-opencode-slim worktrees
99
+ !.slim/
100
+ !.slim/worktrees.json
101
+ !.slim/worktrees/
102
+ !.slim/worktrees/**
103
+ # END oh-my-opencode-slim worktrees
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Workflow Guide
109
+
110
+ ### Phase 1: Planning & Setup
111
+ 1. Identify the task scope and determine a short `<slug>` for the worktree.
112
+ 2. Formulate a branch name. Default to `omos/<slug>` unless project/user conventions dictate otherwise.
113
+ 3. Validate repository safety. Ask the user for confirmation to initialize the lane.
114
+ 4. Ensure the managed ignore blocks are present.
115
+ 5. Run:
116
+ ```bash
117
+ git worktree add -b <branch-name> .slim/worktrees/<slug> <base-commit/branch>
118
+ ```
119
+ 6. Register the metadata in `.slim/worktrees.json`.
120
+
121
+ ### Phase 2: Execution & Delegation
122
+ 1. Run all sub-agents with their working directory set strictly to the worktree
123
+ path, such as `.slim/worktrees/<slug>`.
124
+ 2. Do not modify the main checkout for lane work. Keep build, test, and edit
125
+ operations isolated inside the lane.
126
+ 3. Track file or folder ownership per lane to avoid merge conflicts between
127
+ parallel agents.
128
+ 4. Commit progress within the worktree only when the user asked for commits or
129
+ approved local checkpoint commits.
130
+
131
+ ### Phase 3: Integration & Validation
132
+ Before merging or integrating the worktree branch:
133
+ 1. Run lint, build, formatting, and unit tests inside the worktree directory.
134
+ 2. Generate and display a clear diff comparing the worktree branch to the
135
+ integration base branch.
136
+ 3. Ask the user for confirmation to integrate.
137
+ 4. Perform the approved integration, such as merge or cherry-pick, from the main
138
+ checkout or the user-approved integration checkout.
139
+
140
+ ### Phase 4: Cleanup & Pruning
141
+ 1. Ensure all changes are safely merged or archived.
142
+ 2. Confirm the worktree has no uncommitted changes.
143
+ 3. Request user approval to remove the worktree.
144
+ 4. Safely remove the worktree using:
145
+ ```bash
146
+ git worktree remove .slim/worktrees/<slug>
147
+ ```
148
+ 5. Update `.slim/worktrees.json` to mark the lane as `archived` or remove it.
149
+
150
+ ---
151
+
152
+ ## When to Use vs. Not Use
153
+
154
+ ### Use When:
155
+ - Performing risky or destructive refactoring that could break the active working environment.
156
+ - Working on parallel tasks/bugfixes that require switching contexts without committing half-finished work.
157
+ - Running independent background agents on separate branches.
158
+ - Conducting exploratory spikes or prototyping that may be discarded.
159
+ - Isolating third-party packages or complex upgrades.
160
+ - Explicitly asked to use worktrees for a specific task.
161
+
162
+ ### Do NOT Use When:
163
+ - Making simple single-file changes, documentation updates, or minor bug fixes.
164
+ - Working in a git repository that is not fully initialized or has complex multi-submodule states not supported easily by worktrees.
@@ -1 +0,0 @@
1
- export declare function normalizeFallbackChainsForPreset(chains: Record<string, string[] | undefined>, presetName: string | null | undefined): Record<string, string[]>;
@@ -1,2 +0,0 @@
1
- export { parsePatch } from './codec';
2
- export { preparePatchChanges, rewritePatch, rewritePatchText, } from './operations';
@@ -1,2 +0,0 @@
1
- import { type DetectedError } from './patterns';
2
- export declare function buildRetryGuidance(errorInfo: DetectedError): string;
@@ -1,4 +0,0 @@
1
- export { buildRetryGuidance } from './guidance';
2
- export { createDelegateTaskRetryHook } from './hook';
3
- export type { DelegateTaskErrorPattern, DetectedError } from './patterns';
4
- export { DELEGATE_TASK_ERROR_PATTERNS, detectDelegateTaskError, } from './patterns';
@@ -1 +0,0 @@
1
- export { createJsonErrorRecoveryHook, JSON_ERROR_PATTERNS, JSON_ERROR_REMINDER, JSON_ERROR_TOOL_EXCLUDE_LIST, } from './hook';
@@ -1 +0,0 @@
1
- export declare function getEnv(name: string): string | undefined;