Skip to main content

Collaborative Brainstorming and LLM Development — spec-driven development with a brainstorming phase and agent-managed state documents

Project description

CoBILD

Collaborative Brainstorming and LLM Development: a small MCP server and Python library for running spec-driven development with coding agents.

CoBILD adds two habits to normal spec-driven development:

  1. Brainstorm before implementation. The user and agent clarify goals, trade-offs, constraints, and edge cases before code changes begin.
  2. Keep agent-readable state. Each spec scope has a STATE.yaml file that records how the current implementation relates to SPEC.md.

The result is a workflow where the spec remains the durable source of intent, and the state file gives agents a fast, explicit place to see what is already implemented, what is missing, and where reality has drifted.

Install

Run the MCP server directly from PyPI with uvx:

uvx --from cobild cobild-mcp

Register With An Agent

CoBILD is exposed as a stdio MCP server. Any MCP-compatible coding agent can run it with this command:

uvx --from cobild cobild-mcp

For Claude Code:

claude mcp add cobild -- uvx --from cobild cobild-mcp

For Codex:

codex mcp add cobild -- uvx --from cobild cobild-mcp

For Hermes Agent:

hermes mcp add cobild --command uvx --args --from cobild cobild-mcp

Or add the server directly to ~/.hermes/config.yaml:

mcp_servers:
  cobild:
    command: "uvx"
    args: ["--from", "cobild", "cobild-mcp"]

Generic MCP JSON configuration:

{
  "mcpServers": {
    "cobild": {
      "command": "uvx",
      "args": ["--from", "cobild", "cobild-mcp"]
    }
  }
}

Agent Workflow

Tell your coding agent to use CoBILD before it starts a feature:

Use the cobild MCP server for this work. Start with cobild_process, brainstorm
the spec with me first, write or update SPEC.md when we agree, implement only
after that, then reconcile STATE.yaml before you finish.

The intended loop is:

  1. Call cobild_process to load the workflow.
  2. Brainstorm with the user until the spec is clear.
  3. Create or update SPEC.md.
  4. Implement against the spec.
  5. Run cobild_check_repo or cobild_check_staleness.
  6. For stale scopes, run cobild_prepare_reconciliation.
  7. Compare the changed files to the spec.
  8. Finish with cobild_apply_reconciliation.

Scopes

Any directory containing SPEC.md is a scope. A scope owns its subtree except for nested directories that have their own SPEC.md.

Example:

my-app/
  SPEC.md              # top-level product/system spec
  STATE.yaml           # top-level implementation state
  api/
    SPEC.md            # deeper API-specific spec
    STATE.yaml         # API-specific implementation state

Each STATE.yaml records:

  • the digest of the spec it was reconciled against
  • when reconciliation happened
  • implementation status for spec components
  • concrete drift between the spec and code

This repository is itself a CoBILD scope; see SPEC.md and the adjacent STATE.yaml for a small self-hosted example.

MCP Tools

Tool Purpose
cobild_process Return the full CoBILD workflow for agents.
cobild_list_scopes List directories under a root that contain SPEC.md.
cobild_check_repo Check every scope for stale state.
cobild_check_staleness Check one scope for stale state.
cobild_prepare_reconciliation Return spec text, previous state, staleness info, and changed file contents.
cobild_apply_reconciliation Validate and write an updated STATE.yaml.
cobild_init_scope Create a new scope by writing SPEC.md.

The server also exposes a brainstorm prompt that puts an agent into questions-and-trade-offs mode before implementation.

Python API

from cobild import (
    Scope,
    apply_reconciliation,
    check_staleness,
    find_scopes,
    load_state,
    prepare_reconciliation,
)

scopes = find_scopes("path/to/repo")
scope = scopes[0]

if check_staleness(scope).stale:
    bundle = prepare_reconciliation(scope)
    # The agent compares bundle["spec_text"] with bundle["changed_file_contents"].
    apply_reconciliation(
        scope,
        {
            "summary": "Auth is implemented; rate limiting is still missing.",
            "components": [
                {"name": "auth", "status": "implemented", "files": ["auth.py"]},
                {"name": "rate-limiting", "status": "missing"},
            ],
            "drift": [
                {
                    "kind": "missing",
                    "description": "The spec requires rate limiting.",
                }
            ],
        },
    )

state = load_state(scope)
assert not state.in_sync

Component statuses:

implemented | partial | missing | drifted | extra

Drift kinds:

missing | incomplete | divergent | undocumented | stale-spec

Development

uv sync
uv run pytest
uv build

To run the MCP server from a local checkout:

uv run cobild-mcp

To register a local checkout with an agent:

claude mcp add cobild -- uv run --directory /path/to/cobild cobild-mcp
codex mcp add cobild -- uv run --directory /path/to/cobild cobild-mcp
hermes mcp add cobild --command uv --args run --directory /path/to/cobild cobild-mcp

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cobild-0.2.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cobild-0.2.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file cobild-0.2.0.tar.gz.

File metadata

  • Download URL: cobild-0.2.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cobild-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9e5765377921caddf32d7136974945b76385a97826f5b594ebe09ed6895de22e
MD5 f7d49e9f3aebdbe4b6769815797c7f03
BLAKE2b-256 328fa4115871c4896588a651b4965576513baaa52fd2c60dd4ca598df619d82e

See more details on using hashes here.

File details

Details for the file cobild-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cobild-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cobild-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78bbd597b871c7b1d78c1e79ecb28e3e4b887632ca7639e9c9106eaf470f3cac
MD5 0e030a5641b16774ea6930cf8d11a91c
BLAKE2b-256 adc56edc35aca018c47442ebfe68c36e80fcd2a206bbd8d62a88288cccef4604

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page