Skip to content
    ↑↓ select↵ openesc close
    English中文
    dpshde

    Jj Opencode

    v0.2.0Agent Orchestration
    jj-opencode

    OpenCode plugin for JJ VCS - enforces 'define change before implementation' workflow

    GitHub stars

    24

    Monthly installs

    50

    27 in 7 days

    Composite scoreSCORE

    29.7

    Multi-signal model

    Last commit

    7 months ago

    2026-01-06

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["jj-opencode@0.2.0"]
    }

    opencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    Describe intent. Edit. Commit. Repeat.

    npm version License: MIT

    An OpenCode plugin that blocks edits until you declare intent.

    How It Works

    AI: jj describe -m "Add validation"  ← declare intent, unlocks
    AI: [edits files]                    ← all edits in this commit
    [session ends]                       ← auto-commits, locks again
    
    AI: jj describe -m "Add tests"       ← declare intent, unlocks
    AI: [edits files]
    [session ends]                       ← auto-commits, locks again
    
    User: "undo that"
    AI: jj undo                          ← reverts last commit
    

    jj new runs automatically when the session goes idle — can't accidentally mix work.

    Installation

    npm install -g jj-opencode
    

    Add to ~/.config/opencode/config.json:

    {
      "plugin": ["jj-opencode"]
    }
    

    Commands

    Task Command
    Start work jj describe -m "what you're doing"
    Finish work (automatic)
    Undo jj undo
    Status jj st
    History jj log
    Push jj_push tool

    Tools

    jj_push

    Safely pushes changes to a bookmark.

    jj_push                      ← push to main (default)
    jj_push bookmark="feature"   ← push to specific branch
    

    Auto-detects what to push:

    • If @ has changes → pushes @
    • If @ is empty (common after session idle) → pushes @-
    • If both empty → searches for unpushed commits, requires confirmation

    Flow:

    1. Shows preview with commits and files
    2. Requires user confirmation
    3. Moves bookmark → pushes → verifies clean working copy

    Only specify bookmark if user explicitly requested it.

    JJ ≠ Git

    JJ uses bookmarks, not branches. Key difference for pushing:

    Git Model JJ Model
    Push commits one by one Move bookmark to tip, push once
    Can rewrite after push (with force) Commits are immutable after push

    Anti-pattern: Don't try to push commits sequentially or squash after pushing.

    Subagents

    Subagents that hit the edit gate are blocked and told to return to the parent agent. JJ workflow (describe/new/push) should only be managed by the primary agent.

    Why?

    • Guaranteed separationjj new runs automatically on session idle
    • Never lose work — every edit is in a described commit
    • Clear history — every commit has meaning

    License

    MIT