Skip to content

Commit 8b7f591

Browse files
kherembourgclaude
andauthored
feat(opencode): add OpenCode plugin install guide and README entry (#6)
Unlocks installation via OpenCode's native plugin spec — no symlinks, no file copies, automatic updates. - .opencode/INSTALL.md — prerequisites, opencode.json one-liner, usage, updating, troubleshooting (plugin not loading, Windows install issues with the npm --prefix workaround, skills not found). - README — adds an OpenCode block in the per-tool setup section pointing at .opencode/INSTALL.md. When the per-harness Quickstart restructure (#4) merges, the README also gets an OpenCode entry in the new Quickstart section. Co-authored-by: Claude <noreply@anthropic.com>
1 parent c661331 commit 8b7f591

2 files changed

Lines changed: 98 additions & 0 deletions

File tree

.opencode/INSTALL.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Installing Purchasely AI Plugin in OpenCode
2+
3+
This guide walks you through adding the Purchasely AI Plugin to your [OpenCode](https://opencode.ai) setup. Once installed, OpenCode loads the Purchasely skills (`integrate`, `review`, `debug`) and the `sdk-expert` agent automatically.
4+
5+
## Prerequisites
6+
7+
- OpenCode installed and configured (`opencode --version`).
8+
- Node.js ≥ 18 (OpenCode plugin loader requirement).
9+
- Git available on `PATH` (the plugin is fetched directly from the GitHub repository).
10+
- An OpenCode project — i.e. a directory with an `opencode.json` (or willingness to create one).
11+
12+
## Installation
13+
14+
Add the plugin entry to your project's `opencode.json`:
15+
16+
```json
17+
{
18+
"plugin": ["purchasely@git+https://github.com/Purchasely/Purchasely-AI-Plugin.git"]
19+
}
20+
```
21+
22+
If you already have other plugins listed, append the entry to the existing `"plugin"` array — do not overwrite it.
23+
24+
The next time you launch OpenCode in this project, the plugin is fetched, cached, and loaded automatically. No manual `cp` of configs, no symlinks.
25+
26+
## Usage
27+
28+
After installation, ask OpenCode anything about the Purchasely SDK:
29+
30+
```
31+
You: Tell me about your Purchasely skills.
32+
OpenCode: I have three task-scoped skills (integrate, review, debug)
33+
and a free-form Q&A command (/purchasely:question) for the
34+
Purchasely SDK on iOS, Android, React Native, Flutter, and Cordova.
35+
```
36+
37+
Other examples:
38+
39+
- `Integrate the Purchasely SDK into this iOS app.`
40+
- `Review my Purchasely integration for common mistakes.`
41+
- `Debug why my paywall shows blank.`
42+
- `How do I display a Purchasely paywall in SwiftUI?`
43+
44+
## Updating
45+
46+
OpenCode honors the version pin in `opencode.json`. To pull the latest changes from `main`:
47+
48+
```bash
49+
# Re-fetch the plugin (clears the cache for this entry)
50+
opencode plugin update purchasely
51+
```
52+
53+
If your version of OpenCode does not expose `plugin update`, remove the plugin cache directory (`~/.opencode/plugins/purchasely/`) and relaunch.
54+
55+
To pin to a specific tag or commit, change the spec to:
56+
57+
```json
58+
{ "plugin": ["purchasely@git+https://github.com/Purchasely/Purchasely-AI-Plugin.git#v1.0.0"] }
59+
```
60+
61+
## Troubleshooting
62+
63+
### Plugin not loading
64+
65+
1. Confirm `opencode.json` is valid JSON (no trailing commas, no comments).
66+
2. Run OpenCode with verbose logging: `opencode --log-level debug` and look for `plugin: purchasely` lines.
67+
3. Make sure git can reach `github.com` from the machine running OpenCode — `git ls-remote https://github.com/Purchasely/Purchasely-AI-Plugin.git` should print refs.
68+
69+
### Windows install issues
70+
71+
The `git+` spec requires git on `PATH` and write access to the user-level OpenCode cache. If install fails with `EACCES` or `EPERM`:
72+
73+
```powershell
74+
# Install the plugin into a writable location explicitly
75+
npm install --prefix %USERPROFILE%\.opencode\plugins git+https://github.com/Purchasely/Purchasely-AI-Plugin.git
76+
```
77+
78+
Then point `opencode.json` at the local copy:
79+
80+
```json
81+
{ "plugin": ["purchasely@file:%USERPROFILE%/.opencode/plugins/node_modules/purchasely"] }
82+
```
83+
84+
### Skills not found
85+
86+
If `/purchasely:integrate` (or asking "use the integrate skill") returns "skill not found":
87+
88+
1. Check that OpenCode loaded the plugin (see verbose logs above).
89+
2. Confirm the cached plugin contains `skills/integrate/SKILL.md`, `skills/review/SKILL.md`, `skills/debug/SKILL.md`. If the cache looks empty or stale, remove it and relaunch.
90+
3. Verify the plugin version in `opencode.json` is recent enough to include the skill set (≥ `1.0.0`).
91+
92+
## See also
93+
94+
- [Purchasely AI Plugin README](../README.md) — overview and per-harness Quickstart.
95+
- [Purchasely SDK documentation](https://docs.purchasely.com).
96+
- [OpenCode documentation](https://opencode.ai/docs).

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ All notable changes to this project are documented here. The format is based on
99
- `AGENTS.md` at the repository root — cross-vendor [agents.md](https://agents.md) standard, auto-detected by Codex, Cursor, Zed, Mistral `vibe`, and other harnesses without running `install.sh`.
1010
- `GEMINI.md` at the repository root — imports the `integrate`, `review`, and `debug` skills via `@./skills/...` so Gemini CLI picks up the full playbook automatically.
1111
- `gemini-extension.json` at the repository root — unlocks one-shot install via `gemini extensions install https://github.com/Purchasely/Purchasely-AI-Plugin`.
12+
- OpenCode plugin support via `.opencode/INSTALL.md` — covers prerequisites, the one-line `opencode.json` install, usage examples, updating, and Windows troubleshooting (`npm install --prefix` workaround).
13+
- README *OpenCode* block in the per-harness Quickstart section pointing at `.opencode/INSTALL.md`.
1214

1315
### Changed
1416

0 commit comments

Comments
 (0)