core/

directory
v0.0.0-...-ffd5c47 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT

README

Lightweight autonomous dev team (native Claude Code subagents)

A small, abstract team that lives inside the Telegram bot. You describe a feature in chat; the bot's Claude (the Lead) plans it, implements it on a branch, tests it, reviews it, and opens a PR. No board, no issue queue — the conversation is the task source. You only review and merge the PR.

Designed for a microservices workspace: a feature can span several services, and the team coordinates branches + PRs across all of them.

Roles

Subagent Job Tools
planner Spec (≥3 acceptance criteria) + which services are affected + ordered plan + risks read-only
coder Implements on a branch; contract-safe across services read + edit + bash
tester Runs/writes tests incl. the cross-service seam; green-build gate read + edit + bash
reviewer Adversarial read-only review + RISK score + cross-service checks read-only
arbiter Enforces the gate; decides continue/ship/escalate — the loop-breaker read-only

Deployed at the project level (/workspace/.claude/agents/) so the bot loads them via setting_sources=["project"].

Pipeline (per chat request)

you (chat): "implement X across the api + web services"
   → Lead → planner → coder → tester → reviewer → arbiter ─┬ CONTINUE ↺ coder
                                                            ├ SHIP → branch(es) → PR per repo (cross-linked)
                                                            └ ESCALATE → asks you in chat

The arbiter — not the reviewer — decides when the loop stops. Gate to SHIP: acceptance criteria met + tests green + no open blocker. You merge the PR(s).

Borrowed from ruflo (patterns, not the framework)

  • SPARC — a spec-first lifecycle with quality gates → the planner's ≥3 acceptance criteria and the arbiter's explicit ship-gate.
  • multi-repo-swarm — cross-service coordination → identify all affected services up front, same branch name everywhere, one cross-linked PR per repo.
  • agentic-jujutsu — diff risk scoring → the reviewer's RISK level, which the arbiter weighs (higher risk → lean ESCALATE / flag in the PR).

Deliberately left out the heavy machinery (MCP swarm server, vector memory/AgentDB, webhooks, dashboards) — out of scope for a lightweight, subscription-driven setup.

Guardrails

  • Quality gate BEFORE a PR: acceptance criteria met + tests green + arbiter says SHIP.
  • Loop termination via the arbiter (biased to SHIP/ESCALATE) + a hard backstop of 3 cycles.
  • Never merge; never touch a default branch directly.
  • Cap turns/cost per request; on ESCALATE → ask the user in chat.

How it runs

The bot itself is the orchestrator (no separate runner). The subagents + a focus/Lead CLAUDE.md are mounted into the bot's workspace by the Ansible role; the bot picks them up per chat message. For a feature too large for one session, an optional detached mode can run the pipeline in the background and ping you when the PR is ready (build later if needed).

Directories

Path Synopsis
Package agent defines the provider-neutral runtime contract spoken by the conversation layer and implemented by AI backends.
Package agent defines the provider-neutral runtime contract spoken by the conversation layer and implemented by AI backends.
Package autobudget persists a small, durable per-chat per-day accumulator of the USD cost spent by AUTONOMOUS runs — runs no human triggered: PR-poller relays, CI-watch fix-ups, scheduled tasks, goal-evaluator rounds and their injected follow-ups.
Package autobudget persists a small, durable per-chat per-day accumulator of the USD cost spent by AUTONOMOUS runs — runs no human triggered: PR-poller relays, CI-watch fix-ups, scheduled tasks, goal-evaluator rounds and their injected follow-ups.
Package chat is the transport-neutral conversation layer: it receives a text message from an allowed user, resolves that chat's isolated workspace, runs the message through the configured AI provider Runner, and renders the event stream into one live "Working… (Ns)" progress message with a Stop button, replacing it with the final answer on completion.
Package chat is the transport-neutral conversation layer: it receives a text message from an allowed user, resolves that chat's isolated workspace, runs the message through the configured AI provider Runner, and renders the event stream into one live "Working… (Ns)" progress message with a Stop button, replacing it with the final answer on completion.
Package ciwatch closes the CI feedback loop without a human relay: a background loop discovers every duck/<chatid>/...
Package ciwatch closes the CI feedback loop without a human relay: a background loop discovers every duck/<chatid>/...
Package claude runs a prompt through the `claude` CLI and exposes its stream-json output as a typed Go event stream.
Package claude runs a prompt through the `claude` CLI and exposes its stream-json output as a typed Go event stream.
Package codex runs prompts through the Codex CLI and adapts its JSONL stream to the common agent.Runner event contract used by chat.Service.
Package codex runs prompts through the Codex CLI and adapts its JSONL stream to the common agent.Runner event contract used by chat.Service.
Package cost persists a small, durable per-user accumulator of Claude run cost in USD so the inbound message path can enforce a cumulative per-user cost cap across messages and process restarts.
Package cost persists a small, durable per-user accumulator of Claude run cost in USD so the inbound message path can enforce a cumulative per-user cost cap across messages and process restarts.
Package dispatch provides per-chat job serialization with a global concurrency cap.
Package dispatch provides per-chat job serialization with a global concurrency cap.
Package followup gives a run a LEGAL way to come back later.
Package followup gives a run a LEGAL way to come back later.
Package ghstar is a minimal GitHub "stars" client used by the post-task star nudge: it can check whether the deployment's own account (the GIT_TOKEN owner) has starred a repository and, on an explicit user action, star it.
Package ghstar is a minimal GitHub "stars" client used by the post-task star nudge: it can check whether the deployment's own account (the GIT_TOKEN owner) has starred a repository and, on an explicit user action, star it.
Package gitsetup performs the bot's startup git configuration: identity, default branch, and — when a host + token are configured — an inline credential helper that reads the username/token from the live process environment at call time, so no secret ever lands in a git config file.
Package gitsetup performs the bot's startup git configuration: identity, default branch, and — when a host + token are configured — an inline credential helper that reads the username/token from the live process environment at call time, so no secret ever lands in a git config file.
Package goal implements the /goal evaluator loop: the user states a "done" criterion once, and after every clean run an INDEPENDENT evaluator — a fresh Claude session with no shared context, so it cannot inherit the working session's blind spots — judges the workspace against that criterion.
Package goal implements the /goal evaluator loop: the user states a "done" criterion once, and after every clean run an INDEPENDENT evaluator — a fresh Claude session with no shared context, so it cannot inherit the working session's blind spots — judges the workspace against that criterion.
Package knowledge exposes only authorized read-only knowledge operations to delegated agents.
Package knowledge exposes only authorized read-only knowledge operations to delegated agents.
Package nudge persists a single, durable "starred resolved" flag for the deployment's GitHub account so the post-task star nudge stops once the repo is known to be starred (whether observed via the API or set by a successful button press).
Package nudge persists a single, durable "starred resolved" flag for the deployment's GitHub account so the post-task star nudge stops once the repo is known to be starred (whether observed via the API or set by a successful button press).
Package openaicompat runs prompts through an OpenAI-compatible chat completions API and adapts responses to the common agent.Runner contract.
Package openaicompat runs prompts through an OpenAI-compatible chat completions API and adapts responses to the common agent.Runner contract.
Package pending persists a small, durable per-chat QUEUE of "interrupted run" markers so a run that is still in-flight (or merely queued) when the process is killed (e.g.
Package pending persists a small, durable per-chat QUEUE of "interrupted run" markers so a run that is still in-flight (or merely queued) when the process is killed (e.g.
Package poller inverts the Gitea webhook dependency: inbound webhooks can't always reach the bot, but the bot can reach Gitea.
Package poller inverts the Gitea webhook dependency: inbound webhooks can't always reach the bot, but the bot can reach Gitea.
Package ratelimit provides an in-memory, goroutine-safe, fixed-window per-user request limiter for the inbound message path.
Package ratelimit provides an in-memory, goroutine-safe, fixed-window per-user request limiter for the inbound message path.
Package schedule persists a durable per-chat set of cron JOBS and runs a background scheduler that fires each due job into the same dispatch lane a normal message uses (via a fire callback wired to chat.Service.Inject).
Package schedule persists a durable per-chat set of cron JOBS and runs a background scheduler that fires each due job into the same dispatch lane a normal message uses (via a fire callback wired to chat.Service.Inject).
Package session persists a small, durable map of chatID -> Claude session_id so the adapter can resume each chat's context across messages (and across process restarts) via the CLI's --resume flag.
Package session persists a small, durable map of chatID -> Claude session_id so the adapter can resume each chat's context across messages (and across process restarts) via the CLI's --resume flag.
Package teambranch owns the team-branch naming contract: every branch the dev team pushes is named duck/<chatid>[/<slug>], and the <chatid> segment is what routes host-side events (PR comments, CI state) back to the owning chat.
Package teambranch owns the team-branch naming contract: every branch the dev team pushes is named duck/<chatid>[/<slug>], and the <chatid> segment is what routes host-side events (PR comments, CI state) back to the owning chat.
Package textformat renders assistant Markdown for bot transports.
Package textformat renders assistant Markdown for bot transports.
Package verify is the deterministic post-run quality gate: after a run finishes cleanly, the bot re-runs the affected repos' OWN check runner (task/make/npm — the same entrypoint CI uses) from the Go side and compares reality against the agent's claim.
Package verify is the deterministic post-run quality gate: after a run finishes cleanly, the bot re-runs the affected repos' OWN check runner (task/make/npm — the same entrypoint CI uses) from the Go side and compares reality against the agent's claim.
Package voice transcribes spoken audio (e.g.
Package voice transcribes spoken audio (e.g.
Package workspace renders a per-chat isolated workspace under a base directory: <base>/chat_<id>, containing a CLAUDE.md rendered from the shared template plus the dev-team agents under .claude/agents/.
Package workspace renders a per-chat isolated workspace under a base directory: <base>/chat_<id>, containing a CLAUDE.md rendered from the shared template plus the dev-team agents under .claude/agents/.

Jump to

Keyboard shortcuts

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