Skip to content

BaratovSokhibjon/opencode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode logo

opencode config

Personal opencode configuration with custom AI agents for code review, semantic commits, and refactoring.


Overview

This repository contains a ready-to-use opencode workspace configuration. It ships with three purpose-built agents and sensible defaults for permissions and formatting.

Getting Started

  1. Install opencode

    npm install -g opencode-ai
  2. Clone this config into your project

    Copy the files below into the root of any project you want to use opencode with:

    .env.example      → environment variable template
    .ignore           → paths opencode should never index
    opencode.json     → main configuration
    .opencode/        → agent definitions
    
  3. Set up your environment

    cp .env.example .env
    Variable Description
    OPENCODE_ENABLE_EXA Set to 1 to enable Exa web search
    OPENCODE_EXPERIMENTAL Set to true to unlock experimental features
  4. Run opencode

    opencode

Configuration

opencode.json sets the following defaults:

Setting Value
Formatter Prettier (npx prettier --write $FILE)
Instructions CONTRIBUTING.md, docs/guidelines.md (add to your project)
Permissions Read / grep / glob / list / LSP / question / todowrite / webfetch → allow; bash → ask

Custom Agents

review — Code Review

Performs a structured read-only code review of all current changes and writes a report to /tmp/code-review.md.

Findings are categorised as:

  • 🔴 CRITICAL — bugs, security issues, data-loss risks
  • 🟡 WARNING — style violations, performance concerns, missing error handling
  • 🔵 SUGGESTION — readability improvements and structural enhancements

Usage:

/agent review

commit — Semantic Commits

Analyses all uncommitted changes, groups them by logical concern (not by file), and creates clean Conventional Commits — one commit per feature/fix/chore.

Commit types supported: feat, fix, refactor, chore, docs, style, test, perf, ci, build

The agent always presents a plan and waits for your confirmation before staging anything.

Usage:

/agent commit

refactor — Google Style Refactor

Refactors changed files to follow Google Style Guides for Python, TypeScript/JavaScript, Go, Java, and C++. It adds section markers (MARK:), removes dead code, enforces naming conventions, and breaks down long functions.

Usage:

/agent refactor

File Structure

.
├── .env.example             # Environment variable template
├── .ignore                  # Paths excluded from opencode indexing
├── opencode.json            # Main opencode configuration
└── .opencode/
    └── agents/
        ├── commit.md        # Semantic commit agent
        ├── refactor.md      # Google-style refactor agent
        └── review.md        # Code review agent

License

MIT

About

OC configurations, focusing on easier development using agents.

Topics

Resources

Stars

Watchers

Forks

Contributors