- Runtime: Bun (≥1.x)
- Language: TypeScript strict mode
- Module: ESM only (
"type": "module") - Source:
src/four-opencode-supertools.ts(NOTsrc/index.ts) - npm name:
@four-bytes/four-opencode-supertools
- No
anyunless absolutely necessary - Prefer
constoverlet - Use
async/await— no raw promises - Error handling: typed catch blocks, meaningful messages
- Output: compact, no unnecessary verbosity
Every tool in this plugin exists to save tokens:
- Tools should return only what the agent needs — not full command output
- Parsed, structured output preferred over raw text
- Error messages should be specific and actionable
- No redundant tool functionality — one tool, one clear purpose
- EVERY code change ends with: version bump in
package.json+mise run build - No merge without current
dist/ dist/is gitignored, freshly built beforenpm publish
- LF line endings
- UTF-8 encoding
.local.mdfiles are gitignored — use for personal dev config- No personal paths in committed code
src/
├── four-opencode-supertools.ts # Plugin entry — registers all 13 tools
├── tools/
│ ├── apply-patch.ts # Unified diff patch application
│ ├── batch-edit.ts # Multi-file search and replace
│ ├── lint-file.ts # Single-file linting
│ ├── run-tests.ts # Targeted test execution
│ ├── curse-score.ts # File risk ranking
│ ├── bus-factor.ts # Ownership concentration
│ ├── implicit-coupling.ts # Co-change dependencies
│ ├── ownership.ts # Author breakdown
│ ├── blast-radius.ts # Impact analysis
│ ├── git-diff.ts # Structured git diff output
│ ├── trend.ts # Curse score trend analysis
│ ├── pr-risk.ts # PR risk assessment
│ └── git-log-structured.ts # Structured git log
└── lib/
├── diff-parse.ts # Unified diff parser
├── diff-apply.ts # Hunk application engine
├── debug-logger.ts # JSONL debug logger
└── git-utils.ts # Shared git utilities (run, log, blame, file list)
All new source files must include:
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2025-2026 Four Bytes