iOfficeAI / iOfficeAI/OfficeCLI
OpenCode detection & skill install path point to ~/.opencode, but OpenCode uses ~/.config/opencode
- Dominant language
- C#
- Stars
- 30.7k
- Forks
- 2.1k
- Avg merge
- 9d 8h
- Merged PRs (30d)
- 5
Description
## Problem
`officecli install` never auto-detects **OpenCode**, and `officecli install opencode` installs the skill to a path OpenCode never reads.
On a machine where OpenCode is installed and actively used, the bare install reports every other agent but omits OpenCode:
```
$ officecli install
Skipping binary install: managed by Homebrew.
Claude Code: officecli installed
GitHub Copilot: officecli installed
Codex CLI: officecli installed
Cursor: officecli installed
Pi: officecli installed
Hermes Agent: officecli installed
(no OpenCode line)
```
## Root cause
In `src/officecli/Core/SkillInstaller.cs`, the OpenCode entry in the `Tools` array uses the wrong directories:
```csharp
(["opencode"], "OpenCode", ".opencode", Path.Combine(".opencode", "skills")),
```
| | officecli expects | OpenCode actually uses |
|---|---|---|
| Config / detect dir | `~/.opencode` | `~/.config/opencode` |
| Global skills dir | `~/.opencode/skills` | `~/.config/opencode/skills` |
This causes **two** bugs:
1. **Auto-detect misses OpenCode.** `InstallBaseToAll()` checks `Directory.Exists(~/.opencode)`. That directory doesn't exist on a normal OpenCode install (config lives at `~/.config/opencode`), so OpenCode is never detected by the bare `officecli install`.
2. **Targeted install lands in a dead path.** `officecli install opencode` successfully writes `SKILL.md` to `~/.opencode/skills/officecli/SKILL.md`, but OpenCode only discovers global skills from ([docs](https://opencode.ai/docs/skills)):
- `~/.config/opencode/skills//SKILL.md`
- `~/.claude/skills//SKILL.md`
- `~/.agents/skills//SKILL.md`
`~/.opencode/skills/` is not scanned, so the skill is invisible to OpenCode.
> Note: OpenCode does read `~/.agents/skills/` (covered by the Codex CLI row) and `~/.claude/skills/`, so the skill is *incidentally* usable today via those compat paths — but the native OpenCode target is broken.
## Suggested fix
One-line change in `SkillInstaller.cs`:
```csharp
// before
(["opencode"], "OpenCode", ".opencode", Path.Combine(".opencode", "skills")),
// after
(["opencode"], "OpenCode", Path.Combine(".config", "opencode"), Path.Combine(".config", "opencode", "skills")),
```
This matches the pattern already used by NanoBot/ZeroClaw (`Path.Combine(...)` for multi-segment dirs) and aligns with the actual OpenCode paths documented at https://opencode.ai/docs/skills.
## Environment
- officecli 1.0.139 (Homebrew, macOS arm64)
- OpenCode with config at `~/.config/opencode/`
## Workaround (current)
Symlink so officecli's expected path resolves to the real one:
```bash
rm -rf ~/.opencode && ln -s .config/opencode ~/.opencode
```
Then `officecli install` detects OpenCode and skills land at `~/.config/opencode/skills/officecli/SKILL.md`.
Contributor guide
Research direction
Read src/officecli/Core/SkillInstaller.cs, especially the OpenCode entry in the Tools array and the InstallBaseToAll() detection path. Verify the config and global skills directories against the OpenCode documentation, then run officecli install and officecli install opencode; done means detection succeeds and SKILL.md is written under OpenCode’s native skills directory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100