- Meta-repo:
~/four-opencode-plugins/ - Repo:
four-bytes/four-opencode-git - Package:
@four-bytes/four-opencode-gitv0.1.0 - Build:
bun run build→dist/four-opencode-git.js - Test:
bun test
Collapses 7 metrics into 1 tool schema. Pass metric arg to route:
curse_score— rank files by risk (changes × recency × churn)bus_factor— ownership concentration per directoryimplicit_coupling— co-commit pairs → hidden dependenciesownership— per-file/directory author breakdownblast_radius— impact analysis: what breaks when touching a filetrend— curse score trajectory (growing risk detection)pr_risk— uncommitted change risk (staged + unstaged)
git_diff— structured diff output (staged, file, between refs). Saves ~90% tokensgit_log_structured— parsed log with author/date/file filters. Saves ~50% tokens
gh_pr_create— create PR with title/body/base/headgh_pr_comment— add comment to PRgh_pr_review— fetch review comments + stategh_pr_status— PR mergeability (reviews, CI, conflicts)gh_issue_list— list issues with label/assignee/state filtersgh_issue_close— close issue with zombie detectiongh_branch_cleanup— find stale merged branches (dry_run first!)gh_release_info— structured release metadatagh_bot_review— parse AI bot reviews (CodeRabbit, cubic-dev)
gitlab_mr_create— create merge requestgitlab_mr_comment— add comment to MRgitlab_mr_status— check MR state/mergeability/pipelines
- Entry:
src/four-opencode-git.ts— registers all 15 tools - Tools:
src/tools/— one file per tool; analysis tools export execute fns used by git_analyze dispatcher - Lib:
src/lib/— git-utils.ts, gh-utils.ts, gitlab-utils.ts, debug-logger.ts, diff-parse.ts - Tests:
tests/— 146 tests, bun-native
@opencode-ai/plugin1.15.13 (exact pin)- Bun runtime, ESM modules
ghCLI for GitHub tools,glabfor GitLab tools
Optional — omit for projects that don't use git.
- Console logging: Plugins MUST use
_client?.app?.log()for all logging in plugin mode —console.log/console.warn/console.erroris ONLY permitted for the initial startup"init"message. Console output in plugin mode breaks the terminal UI.