# Clone
git clone https://github.com/weebcoder101/dreamcode
cd dreamcode
# Install dependencies
bun install
# Install Python dependencies (for skill scripts)
pip3 install -r .dreamcode/requirements.txt
# Build
cd packages/opencode && OPENCODE_VERSION=1.2.8 bun run build --singledreamcode/
├── packages/
│ ├── opencode/ # Main CLI + TUI binary
│ │ ├── src/ # TypeScript source
│ │ └── script/ # Build scripts
│ ├── core/ # @opencode-ai/core — Effect-TS services
│ ├── cli/ # @opencode-ai/cli
│ ├── app/ # Web UI (embedded in binary)
│ └── desktop/ # Electron desktop app
├── .dreamcode/ # Skill scripts and configurations
│ └── skills/ # 37 skill definitions
└── docs/ # Documentation
See AGENTS.md for the full style guide. Key rules:
- Use
Effect.gen(function* () { ... })for effectful code - Never use
any— useunknownwith type guards - Prefer
constoverlet - Use early returns, avoid
else - No star imports or renamed imports
- Use snake_case for database column names
Follow conventional commits:
feat(core): add session recovery
fix(tui): simplify thinking toggle styling
docs: update contributing guide
chore(sdk): regenerate types
Valid types: feat, fix, docs, chore, refactor, test
Short names, no slashes, max 3 words:
session-recoveryfix-scroll-stateregenerate-sdk
# Typecheck (from package directory only!)
cd packages/opencode && bun run typecheck
# Run tests
cd packages/opencode && bun test --timeout 30000
# NEVER run from repo root: bun turbo typecheck
# (causes OOM on WSL)# Single-platform build (local dev)
cd packages/opencode && OPENCODE_VERSION=1.2.8 bun run build --single
# Cross-compile (all 12 platforms)
cd packages/opencode && OPENCODE_VERSION=1.2.8 bun run buildThe build script (packages/opencode/script/build.ts):
- Compiles with Bun.build +
--compile - Patches effect v4 for bun 1.3.x compatibility
- Creates
bin/opencodesymlink → native binary - Runs smoke test on native platform
- Create a branch from
dev - Make changes following code conventions
- Run typecheck + tests
- Push and create PR against
dev - Ensure CI passes (install test, typecheck, lint)
Skills are TypeScript tools in packages/opencode/src/skill/. Each skill needs:
- A TypeScript tool file
- Registration in the skill registry
- Optional: Python scripts in
.dreamcode/skills/<skill>/scripts/
See AGENTS.md for skill implementation patterns.
Open a GitHub Issue or check GUIDE.md for feature documentation.