Welcome to the OpenCode Framework, a cognitive partnership model designed to transform how you work with AI agents.
This project is more than just a template; it is a structured environment that elevates the AI from a simple "code generator" or "copilot" to a Senior Architect and Critical Thinking Partner.
The framework is built on the belief that AI is most effective when it is constrained by rigorous engineering standards and empowered by deep project context. We operate on three fundamental pillars:
The agent is mandated to challenge ideas before implementing them. It identifies technical flaws, security risks, or redundant logic, acting as a "peer reviewer" in real-time.
All significant work must be preceded or accompanied by a structured journal entry. The framework enforces this via a timestamp-based pre-commit hook, ensuring that the project's history is an accurate, human-and-AI-readable audit trail of intent and execution.
Every non-trivial change follows a strict, non-negotiable lifecycle.
- Discovery & Audit: The agent first researches the domain (
/research), audits the codebase (/audit), or investigates bugs (/debug) without modifying anything. - Strategy: A detailed implementation plan is proposed (
/plan) based on discovery artifacts and requires user approval. - Execution: Only then does the agent begin writing code (
/task) or content (/draft). This is enforced by the TCR (Test-Commit-Revert) protocol, ensuring a "Green-only" development path.
The makefile is the ultimate source of truth for project health. Automated hooks ensure that every agent action is followed by a validation run (linting, testing, formatting) to prevent regressions.
All development work is strictly performed on dedicated, auto-generated feature branches. This keeps the main branch protected and always in a deployable state, while providing a clean, granular history for every task.
The fastest way to bootstrap a new project or integrate the framework into an existing one is to run the following command in your terminal:
curl -fsSL https://apiad.github.io/opencode/install.sh | bash!!! success "Next Steps"
After installation, run opencode /onboard to get an overview of the repository and start your first session.
- Deep Discovery: Use
/researchfor multi-phase domain investigations. - Architectural Design: Use
/designfor architecture and system design work. - Literate Commands: Create guided, multi-step workflows with variables and conditional logic.
- Isolated Execution: Run commands in sandboxed Docker environments for safety.
- Forensic Debugging: Use
/debugfor root-cause analysis without immediate (and potentially incorrect) fixes. - Evidence-Based Audits: Use
/auditto identify technical debt and architecture issues. - Procedural Roadmap Management: Use
/todoand thetodowritetool to maintain a structured project task list.
- Onboarding: Run
/onboardto get a high-signal overview of the repository. - Scaffolding: Use
/scaffoldto initialize new project components with modern tooling. - Iterative Development: Follow the Discovery -> Plan -> Execute cycle for every feature.
- Quality Control: Rely on the
pre-commithook to maintain codebase integrity. - Releasing: Use
/releaseto automate versioning, changelog updates, and git tagging.
Next: See Deployment & Setup to get started.