Skip to content

Commit d98424b

Browse files
committed
πŸ› fix(core): use absolute paths in global install config
- Replace `stripDotOpencode()` with `toGlobalPath()` that produces absolute paths (e.g., `/home/user/.config/opencode/skills/...`) instead of relative paths like `skills/...` - Pass `opencodeHome` to `rewriteTemplatePathsForGlobal()` so it can resolve `.opencode/...` relative to the global config directory - Update SKILL.md documentation to explain why absolute paths are required (OpenCode resolves config paths relative to the current project directory) - Bump version to 1.3.7 across `package.json`, migration manifests, and landing page - Fix will prevent all skill, instruction, and agent references from breaking when `opencode` is run from any project directory
1 parent 7996489 commit d98424b

8 files changed

Lines changed: 124 additions & 50 deletions

File tree

β€Ž.opencode/skills/global-install/SKILL.mdβ€Ž

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,21 @@ Explicitly copies everything locally (traditional behavior). Use when:
198198

199199
On macOS and Linux, OpenCode automatically reads `~/.config/opencode/opencode.jsonc`. All skills, prompts, commands, and instructions are stored flat in that directory. When you run `opencode` in any project, OpenCode finds this global config and loads everything.
200200

201-
The template's `opencode.json` paths (which use `.opencode/skills/...`) are rewritten during global install to flat paths (`skills/...`):
201+
The template's `opencode.json` paths (which use `.opencode/skills/...`) are rewritten during global install to **absolute paths** pointing into the global directory. This is critical β€” OpenCode resolves config paths relative to the **current project directory**, so relative paths like `skills/...` would break in every project. Absolute paths guarantee the files are found regardless of where you run `opencode`.
202202

203-
| Template Path | Global Path |
204-
|---------------|-------------|
205-
| `.opencode/skills/coding-standards/SKILL.md` | `skills/coding-standards/SKILL.md` |
206-
| `.opencode/instructions/INSTRUCTIONS.md` | `instructions/INSTRUCTIONS.md` |
207-
| `.opencode/prompts/agents/it-leader.md` | `prompts/agents/it-leader.md` |
203+
For example, the resulting config will contain paths like:
208204

209-
Your existing `opencode.jsonc` (with provider config, MCP servers, etc.) is preserved and merged with the new kit entries.
205+
```json
206+
{
207+
"instructions": [
208+
"/Users/me/.config/opencode/instructions/INSTRUCTIONS.md",
209+
"/Users/me/.config/opencode/skills/coding-standards/SKILL.md",
210+
"..."
211+
]
212+
}
213+
```
214+
215+
Instead of broken relative paths like `skills/coding-standards/SKILL.md` that would resolve against whatever project directory you're in.
210216

211217
## Per-Project Setup
212218

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4949

5050
- **Windows global install path** β€” corrected from `%APPDATA%\opencode\` to `%USERPROFILE%\.config\opencode\` to match official OpenCode documentation. The previous path (`%APPDATA%`) would have caused OpenCode to not find the agent kit on Windows.
5151
- **Official path reference** β€” all paths now confirmed against [opencode.ai/docs/config/](https://opencode.ai/docs/config/) (Global: `~/.config/opencode/opencode.json` on macOS/Linux, `%USERPROFILE%\.config\opencode\` on Windows)
52+
- **Absolute paths in global config** β€” `rewriteTemplatePathsForGlobal()` now produces **absolute paths** (e.g. `/Users/user/.config/opencode/skills/...`) instead of relative paths (`skills/...`). This is critical because OpenCode resolves config paths relative to the **current project directory**, not relative to `~/.config/opencode/`. Relative paths would cause all skill, instruction, and agent references to fail in every project.
5253

5354
### Changed
5455

5556
- `bin/commands/global-path.mjs`: Windows path uses `USERPROFILE` + `.config\opencode` instead of `APPDATA`
5657
- `package.json`: version bumped to 1.3.6
5758
- `.opencode/skills/global-install/SKILL.md`: all Windows path references corrected
5859

60+
## [1.3.7] - 2026-06-27
61+
62+
### Notes
63+
64+
- **Prose `.opencode/` references** (64 occurrences across 17 skill/docs/prompt files) are intentionally **not rewritten** during global install. These are informational text for the LLM, not config paths resolved by OpenCode. The critical fix (absolute config paths in `opencode.jsonc`) was already shipped in v1.3.6.
65+
66+
### Changed
67+
68+
- `package.json`: version bumped to 1.3.7
69+
5970
## [1.3.4] - 2026-06-25
6071

6172
### Added

β€Žbin/commands/init.mjsβ€Ž

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -160,37 +160,39 @@ function mergeJson(target, source, strategy = {}) {
160160
return merged;
161161
}
162162

163-
/**
164-
* Strip the `.opencode/` prefix from a path.
165-
* Used when installing globally: files from `.opencode/skills/...`
166-
* go directly to `skills/...` in the global dir.
167-
*/
168-
function stripDotOpencode(path) {
169-
if (path.startsWith('.opencode/')) {
170-
return path.slice('.opencode/'.length);
171-
}
172-
return path;
173-
}
174-
175163
/**
176164
* Rewrite template opencode.json paths for global install:
177-
* .opencode/skills/... β†’ skills/...
178-
* .opencode/instructions/... β†’ instructions/...
179-
* .opencode/prompts/agents/... β†’ prompts/agents/...
165+
* .opencode/skills/... β†’ /abs/path/to/opencodeHome/skills/...
166+
* .opencode/instructions/... β†’ /abs/path/to/opencodeHome/instructions/...
167+
* .opencode/prompts/agents/... β†’ /abs/path/to/opencodeHome/prompts/agents/...
168+
*
169+
* Absolute paths are REQUIRED so OpenCode can find the files regardless
170+
* of which project directory the user is currently in.
171+
*
172+
* @param {object} config - Parsed template opencode.json
173+
* @param {string} opencodeHome - Absolute path to ~/.config/opencode/
174+
* @returns {object} Config with paths rewritten to absolute
180175
*/
181-
function rewriteTemplatePathsForGlobal(config) {
176+
function rewriteTemplatePathsForGlobal(config, opencodeHome) {
182177
const rewritten = JSON.parse(JSON.stringify(config));
183178

179+
function toGlobalPath(p) {
180+
if (p.startsWith('.opencode/')) {
181+
return join(opencodeHome, p.slice('.opencode/'.length));
182+
}
183+
return p;
184+
}
185+
184186
// Rewrite instructions
185187
if (Array.isArray(rewritten.instructions)) {
186-
rewritten.instructions = rewritten.instructions.map((p) => stripDotOpencode(p));
188+
rewritten.instructions = rewritten.instructions.map((p) => toGlobalPath(p));
187189
}
188190

189191
// Rewrite agent prompt file paths
190192
if (rewritten.agent) {
191193
for (const [, agentConfig] of Object.entries(rewritten.agent)) {
192194
if (agentConfig.file) {
193-
agentConfig.file = stripDotOpencode(agentConfig.file);
195+
agentConfig.file = toGlobalPath(agentConfig.file);
194196
}
195197
}
196198
}
@@ -269,7 +271,7 @@ async function installGlobal(options) {
269271
const templateConfig = JSON.parse(readFileSync(templateConfigPath, 'utf-8'));
270272

271273
// Rewrite paths for flat structure
272-
const kitConfig = rewriteTemplatePathsForGlobal(templateConfig);
274+
const kitConfig = rewriteTemplatePathsForGlobal(templateConfig, opencodeHome);
273275

274276
// Read existing user config (JSONC or JSON)
275277
let userConfig = {};

β€Žbin/migrations/001_initial_setup.mjsβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Migration 001: Initial Setup
3-
* Version: 1.3.6
3+
* Version: 1.3.7
44
*
55
* Establishes the migration system foundation:
66
* - Ensures .kit-version file exists in target .opencode/
@@ -20,7 +20,7 @@
2020
* @param {object} opts.path - Node path module
2121
*/
2222
export default {
23-
version: '1.3.6',
23+
version: '1.3.7',
2424
description:
2525
'Initialize migration system β€” establish .kit-version tracking and validate config structure',
2626

@@ -36,7 +36,7 @@ export default {
3636
// Ensure .kit-version file exists
3737
const versionFile = path.join(opencodeDir, '.kit-version');
3838
if (!fs.existsSync(versionFile)) {
39-
fs.writeFileSync(versionFile, '1.3.6\n', 'utf-8');
39+
fs.writeFileSync(versionFile, '1.3.7\n', 'utf-8');
4040
}
4141

4242
// Validate config has agent and permission fields

β€Žbin/migrations/manifest.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"001_initial_setup.mjs": {
3-
"version": "1.3.6",
3+
"version": "1.3.7",
44
"description": "Initialize migration system β€” establish .kit-version tracking and validate config structure"
55
}
66
}

β€Žindex.htmlβ€Ž

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2897,24 +2897,34 @@ <h2>33 agents, <span class="text-primary">ready to deploy</span></h2>
28972897
<div class="container">
28982898
<div class="section-header reveal">
28992899
<div class="section-tag">Install</div>
2900-
<h2>One command, <span class="text-primary">any way you want</span></h2>
2901-
<p class="section-sub">Install per-project or globally &mdash; OpenCode auto-detects both. Node.js 18+ required.</p>
2900+
<h2>One command, <span class="text-primary">any way you
2901+
want</span></h2>
2902+
<p class="section-sub">Install per-project or globally &mdash;
2903+
OpenCode auto-detects both. Node.js 18+ required.</p>
29022904
</div>
29032905

29042906
<div class="install-tabs reveal">
29052907
<div class="install-tab-bar">
2906-
<button class="install-tab install-tab-active" data-tab="global" onclick="switchInstallTab('global')">
2907-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>
2908+
<button class="install-tab install-tab-active" data-tab="global"
2909+
onclick="switchInstallTab('global')">
2910+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"
2911+
stroke="currentColor" stroke-width="2"><circle cx="12" cy="12"
2912+
r="10" /><line x1="2" y1="12" x2="22" y2="12" /><path
2913+
d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" /></svg>
29082914
Global Install <span class="install-badge">Recommended</span>
29092915
</button>
2910-
<button class="install-tab" data-tab="project" onclick="switchInstallTab('project')">
2911-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>
2916+
<button class="install-tab" data-tab="project"
2917+
onclick="switchInstallTab('project')">
2918+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"
2919+
stroke="currentColor" stroke-width="2"><path
2920+
d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" /></svg>
29122921
Per-Project
29132922
</button>
29142923
</div>
29152924

29162925
<!-- Global Install Tab -->
2917-
<div class="install-tab-content install-tab-content-active" id="tab-global">
2926+
<div class="install-tab-content install-tab-content-active"
2927+
id="tab-global">
29182928
<div class="code-block">
29192929
<div class="code-block-header">
29202930
<div class="code-dots" aria-hidden="true">
@@ -2925,16 +2935,32 @@ <h2>One command, <span class="text-primary">any way you want</span></h2>
29252935
<span class="code-block-title">terminal β€” global install</span>
29262936
</div>
29272937
<div class="code-block-body code-block-body-multi">
2928-
<div class="code-line"><span class="code-prompt">$</span> <span class="code-command">npx opencode-agent-kit init --global</span></div>
2929-
<div class="code-line code-output"><span style="color: var(--text-muted)"> β†’ OpenCode home: ~/.config/opencode/</span></div>
2930-
<div class="code-line code-output"><span style="color: var(--text-muted)"> β†’ Copying skills, prompts, commands...</span></div>
2931-
<div class="code-line code-output"><span style="color: var(--success)"> βœ“</span> <span style="color: var(--text-muted)">Dependencies installed</span></div>
2932-
<div class="code-line code-output"><span style="color: var(--success)"> βœ“</span> <span style="color: var(--text-muted)">agentmemory ready</span></div>
2933-
<div class="code-line code-output code-highlight"><span style="color: var(--success)"> βœ…</span> <span style="color: var(--text-primary)">opencode-agent-kit v1.3.6 installed globally!</span></div>
2938+
<div class="code-line"><span class="code-prompt">$</span> <span
2939+
class="code-command">npx opencode-agent-kit init
2940+
--global</span></div>
2941+
<div class="code-line code-output"><span
2942+
style="color: var(--text-muted)"> β†’ OpenCode home:
2943+
~/.config/opencode/</span></div>
2944+
<div class="code-line code-output"><span
2945+
style="color: var(--text-muted)"> β†’ Copying skills, prompts,
2946+
commands...</span></div>
2947+
<div class="code-line code-output"><span
2948+
style="color: var(--success)"> βœ“</span> <span
2949+
style="color: var(--text-muted)">Dependencies
2950+
installed</span></div>
2951+
<div class="code-line code-output"><span
2952+
style="color: var(--success)"> βœ“</span> <span
2953+
style="color: var(--text-muted)">agentmemory
2954+
ready</span></div>
2955+
<div class="code-line code-output code-highlight"><span
2956+
style="color: var(--success)"> βœ…</span> <span
2957+
style="color: var(--text-primary)">opencode-agent-kit v1.3.7
2958+
installed globally!</span></div>
29342959
</div>
29352960
</div>
29362961
<p class="install-footnote">
2937-
Install once. Use in every project. OpenCode auto-detects it at <code>~/.config/opencode/</code>
2962+
Install once. Use in every project. OpenCode auto-detects it at
2963+
<code>~/.config/opencode/</code>
29382964
</p>
29392965
<div class="install-sub-commands">
29402966
<code>opencode-agent-kit global status</code>
@@ -2960,13 +2986,16 @@ <h2>One command, <span class="text-primary">any way you want</span></h2>
29602986
</div>
29612987
</div>
29622988
<p class="install-footnote">
2963-
73 files created &middot; 33 agents online &middot; 207 skills loaded
2989+
73 files created &middot; 33 agents online &middot; 207 skills
2990+
loaded
29642991
</p>
29652992
</div>
29662993

29672994
<div class="install-actions">
2968-
<a href="https://github.com/defuj/opencode-agent-kit" class="btn btn-primary btn-lg">Install Now</a>
2969-
<a href="https://npmjs.com/package/opencode-agent-kit" class="btn btn-secondary btn-lg">npm</a>
2995+
<a href="https://github.com/defuj/opencode-agent-kit"
2996+
class="btn btn-primary btn-lg">Install Now</a>
2997+
<a href="https://npmjs.com/package/opencode-agent-kit"
2998+
class="btn btn-secondary btn-lg">npm</a>
29702999
</div>
29713000
</div>
29723001
</div>
@@ -3331,7 +3360,7 @@ <h5 class="footer-col-title">Resources</h5>
33313360
delay: 3200,
33323361
},
33333362
{
3334-
text: '<span style="color: var(--success)"> βœ…</span> <span style="color: var(--text-primary)">opencode-agent-kit v1.3.6 installed globally</span>',
3363+
text: '<span style="color: var(--success)"> βœ…</span> <span style="color: var(--text-primary)">opencode-agent-kit v1.3.7 installed globally</span>',
33353364
delay: 4000,
33363365
},
33373366
];
@@ -3372,7 +3401,7 @@ <h5 class="footer-col-title">Resources</h5>
33723401
} else {
33733402
// Show final state for reduced motion
33743403
termBody.innerHTML =
3375-
'<span class="terminal-preview-prompt">$</span> npx opencode-agent-kit init --global<br><span style="color: var(--success)"> βœ…</span> <span style="color: var(--text-primary)">opencode-agent-kit v1.3.6 installed globally</span>';
3404+
'<span class="terminal-preview-prompt">$</span> npx opencode-agent-kit init --global<br><span style="color: var(--success)"> βœ…</span> <span style="color: var(--text-primary)">opencode-agent-kit v1.3.7 installed globally</span>';
33763405
}
33773406
}
33783407

β€Žpackage.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-agent-kit",
3-
"version": "1.3.6",
3+
"version": "1.3.7",
44
"description": "Multi-stack OpenCode agent toolkit β€” 33+ specialized AI agents, 200+ skills, 46 commands, 8 MCP servers (Nuxt, React, Node.js, Laravel, CI3, Android, Flutter, DevOps, SEO, SonarQube, and more)",
55
"type": "module",
66
"bin": {

β€Žsession.mdβ€Ž

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Session Integrasi agentmemory ke agent-kit
2+
Continue opencode -s ses_15b104ae4ffe93tXxFPr9KQcYK
3+
4+
hermes --resume 20260609_145707_9e68e7
5+
hermes -c "Professional OpenCode Agent Kit Upgrade"
6+
7+
Session Mode light/dark default perangkat di index.html
8+
Continue opencode -s ses_149dafdefffenfo4c28tcjTi8Y
9+
10+
Session Bandingkan kualitas agent-kit dengan branch main
11+
Continue opencode -s ses_1273c2d0dffeWpxpqj6JxDNCsv
12+
13+
Session Update index.html UI/UX & informasi agent-kit
14+
Continue opencode -s ses_126fc00c8ffeyllthYrq4HswgA
15+
16+
Session Delegasi langsung ke subagent spesifik
17+
Continue opencode -s ses_12005cc10ffeyW4EVvY1caVSxp
18+
19+
Session Review kesalahan landing page & improvement plan
20+
Continue opencode -s ses_11c0e198cffe83yVLy4s1khTO3
21+
22+
Session Jalankan opencode serve otomatis
23+
Continue opencode -s ses_116025598ffeVM22JN7XT8Nuqu
24+
25+
Session Agent loop dev run preview screenshot fix opencode
26+
Continue opencode -s ses_10e766e4fffesfscbOI5XAKltu

0 commit comments

Comments
Β (0)