This guide covers the day-to-day workflow differences between using OCGS with OpenCode vs Pi.
| Aspect | OpenCode | Pi |
|---|---|---|
| Session start | opencode |
pi |
| Skills | Auto-discovered from .opencode/skills/ (symlink → .agents/skills/) |
Registered via ocgs-core resources_discover handler |
| Commands | Slash commands via .opencode/commands/ |
Prompt templates + extension commands |
| Delegation | Built-in Task tool + OCGS plugin |
ocgs-delegation extension |
| Decision capture | OCGS plugin (question tool) |
ocgs-question extension with TUI |
| Path-scoped rules | OpenCode rule loading | ocgs-path-guard extension |
| Audit log | ccgs-hooks.ts plugin |
ocgs-audit extension (byte-identical) |
| Drift detection | drift-detector.ts plugin |
ocgs-drift-detector extension (richer — inline tool_result mutation) |
| Changelog | changelog-generator.ts plugin |
ocgs-changelog extension (TUI modal) |
| Content validation | validate.mjs CI script |
ocgs-validate extension + CI script |
| Model routing | opencode.json agent config |
.pi/settings.json scopedModels |
| Config location | opencode.json + .opencode/plugins/ |
.pi/extensions/ + .pi/settings.json |
| Extensions/plugins | TypeScript plugins (OpenCode API) | TypeScript extensions (Pi ExtensionAPI) |
# Instead of:
opencode
# Use:
piAll OCGS skills are available via /command-name (same as OpenCode). Pi's enableSkillCommands: true setting handles the routing.
Agent prompts reference the Task tool identically in both harnesses:
"Use the
Tasktool to delegate togame-designer: 'Review the combat system GDD'"
In Pi, ocgs-delegation registers this tool with all 52 agent names discovered from .agents/agents/. The subagent runs in-memory and returns the result.
"Consult
qa-testerabout: 'Review the current test coverage'"
In Pi, /consult spawns a read-only subagent session. The consultant can inspect files but cannot write or execute commands.
Pi's ocgs-path-guard injects rules dynamically based on the LLM's working context. Unlike OpenCode which loads rules by directory convention, Pi tracks the last 20 file paths the LLM has touched and matches them against rule globs.
Check which rules are active by looking at Pi's status bar: rules: ai-code, engine-code.
The audit log at production/session-logs/agent-audit.log is identical between OpenCode and Pi. This means you can switch harnesses mid-project without losing audit history.
Pi provides several features that go beyond what OpenCode's plugin API supports:
When ocgs-drift-detector finds a missing section after a write/edit, it appends the warning directly to the tool result. The LLM sees the warning immediately and can respond to it. In OpenCode, the same warning is only recorded in the audit log — the LLM never sees it.
The question tool renders as a full-screen TUI picker with option descriptions, recommended defaults, and custom input. In OpenCode, the question tool is text-only.
/generate-changelog shows a preview modal with Accept/Edit/Cancel actions. OpenCode's /changelog version outputs plain text.
Pi extensions use ctx.ui.setStatus() to show real-time status in the footer:
rules: ai-code, engine-code— active path-guard rulesdrift: 3 files— drift detector findingsvalidation: 2 issues— validate extension findings
Agent files in .agents/agents/ do not include model:, mode:, or permission: fields. In Pi, model assignment and tool permissions are configured through .pi/settings.json:
{
"enableSkillCommands": true,
"packages": []
}For per-agent model routing (future), Pi supports scopedModels in settings.
If you've been using OCGS with OpenCode and want to try Pi:
- The
.agents/directory already exists (canonical content) - The
.pi/extensions/directory has all extensions ready - Your
.opencode/configurations remain unchanged — OpenCode still works - Start
pi— theocgs-corebarrel loads everything
To switch back, just run opencode instead. Both harnesses share the same .agents/ content.
| Symptom | Likely Cause | Fix |
|---|---|---|
| Skills not showing in Pi | ocgs-core not loading |
Check .pi/extensions/ocgs-core/index.ts exists |
Task tool not recognized |
ocgs-delegation failed to load |
Check for console errors at Pi startup |
| No rules being injected | Path patterns don't match | Check rule paths: globs match actual file paths |
| Audit log empty | ocgs-audit not registered |
Verify barrel imports ocgs-audit |
question tool shows no TUI |
Pi running in non-TUI mode | Use interactive mode or check ctx.mode |