Decsr-Code

module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: MIT

README

DECSR

Decsr Code — command: decsr

License Latest Release CI Go version Go Reference

Features · Install · Usage · Pipeline · Theme · Docs

What Is It?

Decsr Code (command: decsr) is an open-source CLI tool written in Go that drives a team of specialized AI agents through a structured software development pipeline. Instead of chatting with a single LLM, you describe a task in plain text and DECSR runs a full Context → Spec → Plan → Tests → Implement → Build/Fix → Review → Done workflow — with human approval gates before any code is written.

It ships with a terminal UI (built with Bubble Tea) and also supports a headless plain-text mode for CI or scripting.

Why DECSR

Manual back-and-forth with AI coding assistants is slow, error-prone, and hard to reproduce. DECSR:

✦ Structures the work
into well-defined phases so nothing gets skipped.
✦ Runs multiple specialist agents
(PM, Coder, QA, UX Reviewer, Security Auditor) — each with its own prompt, skills, and model.
✦ Iterates automatically
— if tests fail or reviewers find must-fix issues, the Coder fixes and the entire quality gate restarts.
✦ Keeps humans in the loop
— approval gates let you review and revise the task spec and execution plan before any code is written.

Features

5 Specialized Agents

Agent Role
PM Negotiates the task spec, decomposes work into sub-tasks, and arbitrates review feedback
Coder Writes and fixes code, runs builds and tests
QA Generates tests (TDD), verifies test runs, and reviews code quality, logic, and corner cases
UX Reviewer UX/UI heuristic review
Security Security audit and vulnerability scanning

Workspace

decsr opens one screen: the node graph with a prompt under it. Describe a task, a lead agent splits it into sub-tasks shown as a node graph, you assign a role to each node, and assigned nodes run in parallel (3 at a time by default). A final Build & test node checks the result. Nothing runs until you press r or R. Roles are plain data (a name, a description and a model), so you can add your own under agents: in .decsr/project.yaml.

Each project keeps its own sessions in .decsr/sessions/: decsr resume (or /resume) continues one, /clear starts a new one, /compact folds finished nodes into a summary. /profile saves the role settings once in ~/.decsr/profiles/ and applies them to any project, /project switches project, and markdown files in .decsr/commands/ and .decsr/skills/ add your own /commands and role skills. The classic pipeline stays available from the Home menu (/config). See doc/workspace.md.

Interactive TUI

Terminal user interface built around a Workflow Cockpit: a phase spine with the subtask tree, an Activity-first work pane, and a run inspector for gates, tokens, tests, agents, and changes. Live token streaming, artifact viewer, chat-based revision, and project picker are included.

The cockpit removes host CPU/memory/network metrics. It focuses on how the work is decomposed, which agent owns each subtask, what they are doing, and where the tokens went. Tokens are shown per agent and per subtask; a trailing ~ marks an estimated count.

See doc/tui.md for the full reference of panes, tabs, status indicators, keyboard shortcuts, and token notation.

Configurable LLM Backends

Supports multiple runners out of the box:

CLI runners (drive an external coding-agent CLI):

  • OpenCode (default)
  • Claude CLI
  • Codex CLI
  • GitHub Copilot CLI

Local model backends (talk to a local OpenAI-compatible server):

  • Ollama (http://127.0.0.1:11434)
  • LM Studio (http://127.0.0.1:1234)
  • oMLX (Apple Silicon, http://127.0.0.1:8000)

Each agent can use a different runner and model — configure globally (~/.decsr/config.yaml) or per-project (.decsr/project.yaml).

Human Approval Gates

The pipeline pauses for your approval before any code is written:

  • Repository context pack — the PM reads the repository and writes a compact Markdown briefing (.decsr/context_pack.md) with a user-editable section for extra text, notes, and URLs. Review, edit, and approve it before planning starts. See doc/context-pack.md for the format and configuration.
  • Task spec — title, scope, and description negotiated with the PM
  • Execution plan — the decomposition into sub-tasks (task_plan.md), pre-reviewed by Security and QA

You can review, revise via chat, and approve — all from the TUI.

Layered Configuration — three-layer config with sensible defaults

Three-layer config with sensible defaults:

  1. Built-in defaults — the language is auto-detected from marker files (Go, C/C++ with CMake, C#/.NET, Java, Python, Rust, JS/TS, Ruby, Elixir) and can be overridden with project.language
  2. Global user config (~/.decsr/config.yaml) — your preferred models, runners, and reasoning effort
  3. Project config (.decsr/project.yaml) — project-specific overrides (language, test commands, scoping)

Each agent can set a reasoning effort next to its runner and model:

agents:
  coder:
    runner: opencode
    model: opencode/gpt-5.3-codex
    effort: high

Effort levels depend on the model/provider (for example low, medium, high, xhigh, max); effort: default leaves the choice to the provider. The TUI's setup screens show only the levels the selected model supports.

Local Model Memory Cap — bound RAM / context for Ollama, LM Studio, oMLX

When running local models (Ollama, LM Studio, oMLX), the Model Memory screen lets you bound resource use: pick a RAM limit (auto-converted to a per-agent context window based on the model and your system RAM) or a fixed context-token limit applied verbatim to every agent. This keeps large local models from exhausting memory.

Skills System — embedded skill documents injected into agent prompts

Agents are augmented with embedded skill documents (Go patterns, testing strategies, security checklists, etc.) that are injected into their system prompts.

Project Memory — Markdown files in .decsr/memory/

DECSR persists everything important about a project as Markdown files in .decsr/memory/:

  • MEMORY.md — pinned facts and decisions, prepended verbatim to every agent prompt.
  • memory/daily/YYYY-MM-DD.md — auto-appended event log per pipeline run.
  • memory/tasks/<task-id>.md — per-task summary on completion.

Files are indexed into a local SQLite database (FTS5/BM25) so a new task recalls relevant fragments from past work. Optional embedder backends (OpenAI-compatible, Ollama) enable hybrid semantic search. See doc/memory.md for details.

decsr memory show
decsr memory search "JWT auth"
decsr memory add "Use sqlc for typed queries"

Pipeline

How the pipeline works

Pipeline Algorithm

DECSR runs a deterministic, resumable pipeline:

  1. Collect context — scans the project (greenfield vs. brownfield, language, toolchain) and recalls relevant fragments from project memory.
  2. Compact context (human gate) — the PM reads the repository and writes .decsr/context_pack.md: architecture, key files, commands, conventions, risks, and a user-editable section for extra text, notes, and URLs. You edit and approve it, then the PM asks what you want to do.
  3. Negotiate (human gate) — the PM turns your task request into a structured TaskSpec; you approve or re-negotiate via chat.
  4. Decompose (human gate) — the PM splits the spec into ordered sub-tasks. The plan is pre-reviewed by Security and QA, then rendered to task_plan.md for your approval. Sub-tasks are tracked as beads (durable issues) so the run is resumable.
  5. Implement + Quality Review loop (autonomous, capped iterations):
    • Phase A — Tests first (TDD): QA writes tests for all sub-tasks before any implementation.
    • Phase B — Implement: the Coder implements every sub-task in bead order.
    • Phase C — Global build/test/fix: one project-wide build → test → fix loop after all sub-tasks are implemented.
    • Phase D — Quality review: QA, UX Reviewer, and Security review the result. The PM arbitrates all feedback in a single verdict; must-fix issues become new beads and the loop restarts. Nice-to-haves are deferred.
  6. Finalize — emits a summary and nice_to_have.md, updates project memory, closes the beads, and clears resume state.

Any interrupted run can be resumed: DECSR reloads the spec and sub-task plan, re-establishes build/test state, and finishes the remaining open beads without re-negotiating.

See doc/context-pack.md for the context pack format, editing flow, and configuration.

Install

Prerequisites

  • Go 1.26+
  • Git repository to work in
  • A monospace terminal font — Monaspace Krypton is recommended for the TUI
  • At least one LLM backend installed and configured — a CLI runner (OpenCode, Claude CLI, Codex CLI, or GitHub Copilot CLI) or a local model server (Ollama, LM Studio, or oMLX)
  • bd (beads) — recommended. Sub-tasks are tracked as durable beads, which makes runs resumable across sessions. Without bd the pipeline still runs, but multi-session resume of a bead-backed task is unavailable.

Option 1 — Prebuilt binaries

Download an archive for Linux, macOS or Windows (amd64/arm64) from the Releases page, unpack it and put decsr on your PATH.

Option 2 — go install

go install github.com/Decsr/Decsr-Code/cmd/decsr@latest

Option 3 — From source

# Clone and build
git clone https://github.com/Decsr/Decsr-Code.git
cd Decsr-Code
make build install

# Verify
decsr help

Usage

Interactive mode — launch the Workspace: type a task, assign agents to the nodes, run them (/config opens the classic pipeline and requirements picker):

cd /path/to/your/project
decsr            # new session
decsr resume     # pick a saved session of this project

Or, from this repository:

make run

Task from a description — opens the TUI by default:

decsr task --description "Add JWT auth to the login endpoint"

Headless mode — plain-text output for CI or scripting:

decsr task --description "Add JWT auth to the login endpoint" --ui plain

From a file:

decsr task --from-file task.md

On a feature branch:

decsr task --description "Add JWT auth to the login endpoint" --branch feat/my-feature

Legacy greenfield workflow:

decsr run --requirements requirements.md

Theme: Galaxy × Pixel

A deep-space navy base with starlight text and azure, comet and star-gold accents.

Role legend: PM azure #4a86ff · Coder comet cyan #5ce1e6 · Coder fixer teal #3fb8c0 · QA sky #7cb8ff · UX frost #bfe3ff · Security star gold #ffd166 · PR ice #9ee8ff. Errors use pulsar red #ff5c7a, passing tests use aurora mint #6ff2b4, and gates use star gold.

Docs

  • doc/workspace.md — Workspace: node graph, sessions, profiles, commands, roles, keys, and parallel runs
  • doc/tui.md — workflow cockpit: panes, tabs, gates, keyboard shortcuts, and token notation
  • doc/memory.md — project memory details
  • doc/context-pack.md — context pack format, editing flow, and configuration

Development

make build      # build bin/decsr
make test       # run the test suite
make lint       # vet and lint

MIT © DECSR
✦ built in the terminal ✦

Directories

Path Synopsis
cmd
decsr command
internal
beads
Package beads is a thin wrapper around the `bd` CLI from github.com/gastownhall/beads.
Package beads is a thin wrapper around the `bd` CLI from github.com/gastownhall/beads.
bus
chunker
Package chunker splits source files into syntactic units (functions, types, etc.) so they can be selected whole when a file does not fit within a token budget.
Package chunker splits source files into syntactic units (functions, types, etc.) so they can be selected whole when a file does not fit within a token budget.
contextpack
Package contextpack defines the user-editable markers and helpers for the repository context pack.
Package contextpack defines the user-editable markers and helpers for the repository context pack.
embedder
Package embedder produces dense vector embeddings for text snippets.
Package embedder produces dense vector embeddings for text snippets.
index
Package index stores embeddings for source-code chunks and answers nearest-neighbor queries via cosine similarity.
Package index stores embeddings for source-code chunks and answers nearest-neighbor queries via cosine similarity.
lang
Package lang detects a project's language from marker files and maps a language to its dependency, build and test commands.
Package lang detects a project's language from marker files and maps a language to its dependency, build and test commands.
memory
Package memory implements OpenClaw-style persistent project memory.
Package memory implements OpenClaw-style persistent project memory.
notify
Package notify sends best-effort desktop/terminal notifications to external tools.
Package notify sends best-effort desktop/terminal notifications to external tools.
tui
workspace
Package workspace holds the node-workspace graph model, its storage, roles, the task-split prompt/parser and the scheduler.
Package workspace holds the node-workspace graph model, its storage, roles, the task-split prompt/parser and the scheduler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL