- Add fc-047: Consider JSON minification for OpenCode instructions - Add brainstorming plan for OpenCode Claude sync enhancements - Add implementation status plan 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.0 KiB
3.0 KiB
Implementation Plan: OpenCode Claude Sync Enhancements
Overview
Transpose Claude Code agent/skill setup to OpenCode in parallel, per decisions from brainstorming session (enumerated-giggling-scone.md).
Key Decisions (from brainstorming)
| Decision | Value |
|---|---|
| Primary agent | Use built-in build (don't port PA) |
| Agents to skip | personal-assistant, master-orchestrator |
| Other agents | All become mode: subagent |
| Model inheritance | Use model: inherit for subagents |
| State sharing | Reference via instructions, don't copy |
| Source of truth | Claude Code (~/.claude/) |
Files to Modify
~/.config/opencode/scripts/claude_sync.py- Main sync script~/.config/opencode/opencode.json- Config file
Files to Create
~/.config/opencode/README.md- Documentation
Implementation Steps
Step 1: Backup (DONE)
Created backups:
~/.config/opencode-backup-20260107_120135.tar.gz~/opencode-home-backup-20260107_120136.tar.gz
Step 2: Enhance claude_sync.py
Location: ~/.config/opencode/scripts/claude_sync.py
Modifications:
- Add constants near top of file:
SKIP_AGENTS = {"personal-assistant", "master-orchestrator"}
MODEL_MAP = {
"opus": "anthropic/claude-opus-4",
"sonnet": "anthropic/claude-sonnet-4-5",
"haiku": "anthropic/claude-haiku-4-5",
}
-
Modify
transform_frontmatter()for agents:- Check if agent name in
SKIP_AGENTS, returnNoneto signal skip - Add
frontmatter["mode"] = "subagent" - Set
frontmatter["model"] = "inherit" - Map explicit models using
MODEL_MAP
- Check if agent name in
-
Modify
sync_tree()to handleNonereturn from transform (skip file) -
Update
expected_dest_paths_for_tree()to exclude skipped agents
Step 3: Run Sync
python3 ~/.config/opencode/scripts/claude_sync.py --dry-run
python3 ~/.config/opencode/scripts/claude_sync.py
python3 ~/.config/opencode/scripts/claude_sync.py --clean --apply
Step 4: Update opencode.json
Add to existing config:
{
"model": "anthropic/claude-sonnet-4-5",
"small_model": "anthropic/claude-haiku-4-5",
"instructions": [
"~/.claude/CLAUDE.md",
"~/.claude/state/kb.json",
"~/.claude/state/personal-assistant/memory/facts.json",
"~/.claude/state/personal-assistant/memory/preferences.json"
],
"permission": {
"edit": "ask",
"bash": {
"*": "ask",
"pacman -Q*": "allow",
"systemctl status*": "allow",
"kubectl get*": "allow"
}
}
}
Step 5: Test
- Run
opencodeand verify skill discovery - Test
@linux-sysadminsubagent invocation - Verify permissions work
Step 6: Create README.md
Document:
- Architecture (Claude Code as source of truth)
- Sync workflow
- Agent mapping table
- How to invoke subagents
Step 7: Add Future Consideration
Add entry to ~/.claude/state/future-considerations.json about JSON minification for large instruction files.
Estimated Time
~2 hours total (Step 1 already done)