This repository ships an installable payload (payload/) plus an installer
(install_bundle.py) and wrapper script (install.sh).
It can install:
- a shared knowledge base (KB) under
ai-kb/(rules, commands, templates, primary lane docs) - Cursor integration (
.cursor/rules/commands/hooks) - OpenCode integration (
.opencode/runtime files plus optionalopencode.jsonmerge)
Useful entrypoints in this repo:
- KB operational loop:
ai-kb/AGENTS.md - Rules index:
ai-kb/rules/INDEX.md - Commands index:
ai-kb/commands/INDEX.md - OpenCode runtime entrypoint:
payload/.config/opencode/AGENTS.md - OpenCode runtime overview:
payload/.config/opencode/README.md - Troubleshooting:
docs/support/troubleshooting.md
The bundle now installs an autonomy-first OpenCode runtime with these defaults:
planis the default primary lane and acts as the team lead for substantive work.buildis also a primary lane, but it still stays orchestration-first and only performs shared-state edits after delegated discovery narrows the work.- Primary lane prompts are sourced from
ai-kb/agents/*.mdand synced into installedopencode.jsonfiles during install/reinstall. - Installed configs use compact all-tools posture:
tools: {"*": true}. - Installed configs grant unrestricted external directory access:
permission.external_directory: "allow". - Installed configs grant runtime-critical permissions like
task,skill,question,bash,edit, andwebfetchasallow. - Global installs mirror KB content into both
~/ai-kb/and~/.config/opencode/ai-kb/. - Project installs rewrite OpenCode runtime paths to repo-local
.opencode/...locations and keep a repo-localai-kb/copy. - Reinstalls migrate older
generalororchestratoragent configs toplan.
Platform/language domains in the shared KB include:
- Android
- iOS
- Kotlin
- Go
- JavaScript/TypeScript
Cross-cutting domains include architecture, code quality, security, concurrency, testing, and error handling.
The installer supports two modes:
- Project mode (recommended): install into a single repo (
ai-kb/,.cursor/,.opencode/, optionalopencode.jsonmerge) - Global mode: install under a target home directory (
~/ai-kb/,~/.cursor/,~/.config/opencode/)
- Required:
python3,node,git - Optional:
bun,uv - Optional (recommended):
ck(BeaconBay/ck) for semantic KB search via MCP
If tools are missing, the installer prints a warning. With --install-deps it will attempt to
install them via brew (macOS) or apt-get (Linux). For ck, it will try cargo install ck-search
when cargo is available.
This bundle can register the ck MCP server to index ai-kb/ only and use semantic/hybrid
search for KB retrieval instead of manually scanning the KB.
- Install
ck(recommended):cargo install ck-search - Cursor: installs/merges
.cursor/mcp.jsonwith an MCP server namedck - OpenCode: installs/merges
opencode.jsonwith an MCP server namedck - The portable
cklauncher searches, in order: repo-localai-kb/, mirrored~/.config/opencode/ai-kb/, then~/ai-kb/ - Index freshness: semantic/hybrid searches update delta automatically when KB files change (no file watcher needed)
- Optional pre-index:
cd ai-kb && ck --index .(createsai-kb/.ck/, ignored byai-kb/.gitignore) - The payload includes
ai-kb/.ckignoreandai-kb/.gitignoreto avoid indexing bundle backups and committing ck cache
Dry-run preview:
./install.sh --project-dir /path/to/repo --dry-runInstall:
./install.sh --project-dir /path/to/repoOne-click (includes machine-specific config; disables --preserve-existing):
./install.sh --project-dir /path/to/repo --project-fullDry-run preview:
./install.sh --dry-run
./install.sh --target-home /home/newuser --dry-runInstall:
./install.sh
./install.sh --target-home /home/newuser- KB:
ai-kb/(entrypoints:ai-kb/AGENTS.md,ai-kb/rules/INDEX.md,ai-kb/commands/INDEX.md,ai-kb/agents/*.md) - Cursor:
.cursor/commands/,.cursor/rules/,.cursor/hooks/,.cursor/hooks.json,.cursor/mcp.json - OpenCode:
.opencode/AGENTS.md.opencode/commands/.opencode/agents/.opencode/plugins/.opencode/runtime/.opencode/overlays/.opencode/scripts/.opencode/memory/
- If
--include-machine-config(or--project-full):opencode.json(created or merged).opencode/dcp.jsonc
- KB:
<target-home>/ai-kb/and mirrored<target-home>/.config/opencode/ai-kb/ - Cursor:
<target-home>/.cursor/** - OpenCode:
<target-home>/.config/opencode/**
- On conflicts, the installer writes
<file>.bak.<stamp>before overwriting. - It is idempotent: if the rendered destination bytes already match, it does not rewrite or create backups.
--uninstallrestores the latest matching backup for managed files, then removes remaining managed files.--uninstall-alltargets whole managed roots and can remove user-added files under those roots.- With
--preserve-existing, conflicting files are skipped and reported. --project-fulldisables--preserve-existingfor one-click setup.
When installing into a repo, the installer rewrites home-style paths inside text files to keep installed docs and wrappers actionable:
~/ai-kb->ai-kb~/.cursor->.cursor~/.config/opencode->.opencode~/.config/opencode/ai-kb->ai-kb
These hooks/plugins generate recommendation docs; they never auto-edit the KB.
- Cursor hook:
.cursor/hooks/kb-post-turn-analyzer.py(via.cursor/hooks.jsonpreCompact) - OpenCode plugin:
.opencode/plugins/kb-post-turn-analyzer.js(viaexperimental.session.compacting)
Recommendation queues:
- Project:
.cursor/kb-recommendations/*.md,.opencode/kb-recommendations/*.md - Global fallback (when repo-local dirs are absent):
~/.cursor/kb-recommendations/*.md,~/.config/opencode/kb-recommendations/*.md
See docs/support/troubleshooting.md.
Run the repo checks and smoke tests:
./scripts/run-tests.shSee CONTRIBUTING.md for contribution workflow and expectations.
MIT. See LICENSE.
See CHANGELOG.md.