Cocobox

Workflows

Start from a workflow that already works.

A workflow is a list of steps an agent works through: agent steps, checks Cocobox runs itself, and approvals that wait for you. Open one in Cocobox, fill in your own commands, and run it in any agent tab.

Ticket to pull request

Read a Jira or Linear ticket, agree a plan, build it on a branch with tests, and open a pull request.

  1. Agent
    Read the ticket
  2. Approval
    Agree the plan
    Does this plan match the ticket? Refuse with a note to correct it.
  3. Agent
    Build it on a branch
    {{fill: test command}}
  4. Check
    Lint and types
    {{fill: lint or typecheck command}}
  5. Approval
    Push and open the PR
    Push the branch and open a pull request?
  6. Agent
    Open the pull request

Runs 2 commands as you, shown before the first run. You fill in 2 first.

What each agent step is told (in English, as in the file)
Read the ticket
The ticket is in the run note: a Jira or Linear key, a URL, or the pasted text. Read it with what you have: the Jira or Linear MCP server, a CLI, or the pasted text. Do not guess a ticket you cannot open; fail the step and say so.
Write back, in at most 8 lines: the goal, each acceptance criterion, the files you expect to touch, and any open question. Do not change code in this step.
Build it on a branch
Create a branch named after the ticket key and a short title (proj-123-short-title) from the latest default branch.
Build the plan as agreed. Add or update tests for every acceptance criterion. Keep the diff to the ticket: no drive-by refactors.
Open the pull request
Push the branch and open a pull request (gh pr create, or your forge's CLI). Title: the ticket key and a short summary. Body: what changed, how it was tested, which acceptance criteria are met, and a link to the ticket. Open it as a draft if any criterion is not met, and say which.

Suits Any agent that can reach your tracker: a Jira or Linear MCP server, a CLI, or paste the ticket in the run note. Needs gh (or your forge's CLI) to open the PR.

Fix failing CI

Find why CI is red on this branch, reproduce it locally, fix the cause (not the test), push and watch the new run.

  1. Agent
    Read the failed run
  2. Agent
    Reproduce it here
  3. Agent
    Fix the cause
    {{fill: the command CI failed on}}
  4. Check
    Full test suite
    {{fill: test command}}
  5. Approval
    Push the fix
    Push the fix and rerun CI?
  6. Agent
    Push and watch

Runs 2 commands as you, shown before the first run. You fill in 2 first.

What each agent step is told (in English, as in the file)
Read the failed run
Find the latest failed CI run for this branch: gh run list --branch "$(git branch --show-current)" --status failure --limit 1, then gh run view <id> --log-failed. Other CI systems: use their CLI or the URL in the run note.
Name the failing job, the step, and the first real error (not the last line). Say whether it looks flaky (network, timeout, rate limit) or like a fault in the code.
Reproduce it here
Run the failing command locally. If it passes here, compare this machine with the CI job: runtime and tool versions, lockfile, environment variables, OS, test order. Say what differs.
Fix the cause
Fix the root cause. Do not skip, delete, retry-wrap or loosen a test or a lint rule to make it pass. If that is the only way, fail the step and explain why.
Push and watch
Commit with a message naming the failing job and the cause. Push, then watch the new run (gh run watch) and report its result. If it fails again on something else, say what and stop.

Suits Any agent with a shell and the gh CLI signed in. Claude Code, Codex and Gemini CLI read long CI logs well.

Dependency upgrade with tests

Upgrade dependencies in safe batches, read the breaking changes, fix what breaks, and prove it with tests before and after.

  1. Check
    Tests pass before
    {{fill: test command}}
  2. Agent
    Choose what to upgrade
  3. Agent
    Upgrade and fix
    {{fill: test command}}
  4. Check
    It builds
    {{fill: build command}}
  5. Agent
    Commit with a summary

Runs 3 commands as you, shown before the first run. You fill in 2 first.

What each agent step is told (in English, as in the file)
Choose what to upgrade
List outdated dependencies with the ecosystem's own tool (npm outdated, cargo outdated, pip list --outdated, bundle outdated, go list -u -m all). If the run note names packages, upgrade only those.
Otherwise: patch and minor upgrades together, each major upgrade on its own. For every major upgrade, read its changelog or release notes and list the breaking changes that touch this code. Do not change files in this step.
Upgrade and fix
Upgrade the chosen packages and update the lockfile with the package manager (never by hand). Fix what the breaking changes break. Keep the diff to the upgrade: no unrelated refactors, no new dependencies.
Commit with a summary
Commit. The message lists each package as old -> new version, and one line per breaking change you handled and how.

Suits Any agent with a shell. Works for npm, pnpm, Cargo, pip, Bundler and Go modules.

Add tests for a module

Map a module's behaviour and edge cases, write tests in the project's own style, and prove they catch a broken line.

  1. Agent
    Map the module
  2. Agent
    Write the tests
    {{fill: test command}}
  3. Agent
    Prove the tests bite
    {{fill: test command}}

Runs 2 commands as you, shown before the first run. You fill in 1 first.

What each agent step is told (in English, as in the file)
Map the module
The module is in the run note (a path or a name). Read it and its callers. List its public behaviour, its edge cases (empty, very large, invalid input, error paths, concurrency) and what is already tested.
Find the project's test framework and conventions from its existing tests. Do not add a new framework. Do not change files in this step.
Write the tests
Write tests for the untested behaviour, in the project's style. Test through the public interface, not private details. No large snapshot tests.
Do not change the module itself. If a test shows a bug, keep the test, mark it expected-to-fail the way this project does, and report the bug.
Prove the tests bite
Pick three of the new tests. For each, break the line of the module it guards, run it and see it fail, then restore the line exactly. Report which tests you checked. Leave the module unchanged: git diff on it must be empty.

Suits Any agent. Pick a careful one (Claude Code, Codex) for the mutation step.

Release notes from merged PRs

Collect the pull requests merged since the last release and write release notes users can read, in CHANGELOG.md.

  1. Agent
    Collect merged PRs
  2. Agent
    Write the notes
    git diff --name-only | grep -qx CHANGELOG.md
  3. Approval
    Read the notes
    Are these release notes right? Refuse with a note to change them.
  4. Agent
    Commit

Runs 1 command as you, shown before the first run.

What each agent step is told (in English, as in the file)
Collect merged PRs
Find the last release tag (git describe --tags --abbrev=0) and its date. List the pull requests merged into the default branch since then: gh pr list --state merged --search "merged:>=<date>" --limit 200 --json number,title,author,labels,body. If the run note names a range or a version, use that instead. Do not change files in this step.
Write the notes
Add a section to CHANGELOG.md (create it if missing; follow its existing style) headed with the version in the run note, or Unreleased.
Group into New, Fixed, Changed and Breaking (with what users must do). One line per change, in users' words, with the PR number. Leave out CI, refactors and dependency bumps users never notice. Thank outside contributors by their GitHub handle.
Commit
Commit CHANGELOG.md alone. Do not tag, push or publish a release: that stays with the person.

Suits Any agent with the gh CLI signed in. Cheap and fast: a small model is fine.

Database migration, tried on a copy

Write a reversible migration, run it up, down and up again on the tab's own database copy, review its locks, then open a PR.

  1. Agent
    Write the migration
  2. Agent
    Run it on the dev copy
    {{fill: migrate command}}
  3. Check
    Down and up again
    {{fill: rollback command}} && {{fill: migrate command}}
  4. Check
    Tests
    {{fill: test command}}
  5. Agent
    Review the locks
  6. Approval
    Open the PR
    The migration ran on the copy, down and up. Open a pull request?
  7. Agent
    Open the pull request

Runs 3 commands as you, shown before the first run. You fill in 3 first.

What each agent step is told (in English, as in the file)
Write the migration
The schema change is in the run note. Write it with the project's migration tool (Prisma, Rails, Alembic, Django, Flyway, sqlx, goose...). Write the down migration too.
Avoid long locks on big tables: add columns nullable or with a default the database adds without a rewrite, build indexes concurrently where supported, and backfill data in batches in a separate migration.
Run it on the dev copy
Run the migration against this tab's own database copy (Cocobox gives each agent tab one when the space has database copies on). Never against a shared, staging or production database: if this tab has no copy of its own, fail the step and say so.
Report the row counts of the tables it touches.
Review the locks
Read the migration as a reviewer: table locks and rewrites, data lost on down, defaults on big tables, missing indexes for new foreign keys. Fix what you find. Say how long it would lock and roughly how many rows it touches, from the copy's row counts.
Open the pull request
Push the branch and open a pull request. In its body: what the migration does, the lock estimate and row counts, and how to roll it back.

Suits Any agent, in a space with database copies on (Postgres or SQLite), so each tab migrates its own copy.

Code review sweep

Review a branch or pull request for bugs, security holes and untested changes, check each finding twice, fix the ones you approve.

  1. Agent
    Find what is wrong
  2. Approval
    Choose what to fix
    Fix these findings? Approve with a note naming the ones to fix (or all); refuse to stop at the report.
  3. Agent
    Fix with a test each
    {{fill: test command}}

Runs 1 command as you, shown before the first run. You fill in 1 first.

What each agent step is told (in English, as in the file)
Find what is wrong
Review the pull request in the run note (gh pr diff <n>), or this branch against the default branch (git diff origin/HEAD...HEAD). Read the code around each change, not only the diff.
List findings, most severe first: bugs (wrong results, crashes, races, data loss), security (injection, missing auth checks, secrets, unchecked input), then changed behaviour with no test. For each: file:line, what breaks, and an input that breaks it. Skip what a formatter would fix. Do not edit code.
On a later pass, check each finding against the code again and drop any you cannot back with a concrete failing case.
Fix with a test each
Fix the findings named in the approval note, or every bug and security finding if it named none. Each fix comes with a test that fails without it.

Suits Best with a different agent from the one that wrote the code: one model reviewing another.

Docs from the code

Find what the docs miss or get wrong by reading the code, then write short docs with examples taken from real runs.

  1. Agent
    What the code does
  2. Agent
    Write the docs
    {{fill: docs build or link check command}}
  3. Approval
    Read the docs
    Do the docs read right? Refuse with a note to change them.

Runs 1 command as you, shown before the first run. You fill in 1 first.

What each agent step is told (in English, as in the file)
What the code does
From the code, not the existing docs, list the public API, CLI commands and flags, configuration keys and environment variables. If the run note names a module or a reader (new users, operators, contributors), keep to it.
Then list what is undocumented, and what the docs say that the code no longer does. Do not change files in this step.
Write the docs
Update the docs where this project keeps them (README, docs/, doc comments). Every example comes from a real run or a test, never invented: run it and paste what it printed. Short pages with one working example beat long prose. Fix what the docs got wrong. Do not change code.

Suits Any agent. Gemini CLI's long context suits big codebases.

2D plan to BIM

Brief from a plan, words or images; model and check it against the brief; a tab per discipline (structure, plumbing, electrical, HVAC); clash check and federated review.

  1. Agent
    Write the design brief
  2. Check
    The brief is a checklist
    python3 -c "import re; t = open('bim/design-brief.md').read(); n = len(re.findall(r'^\s*- \[[ xX~]\]', t, re.M)); assert n >= 5, f'{n} checklist items'; assert re.search(r'must', t, re.I), 'must-haves'; print(n, 'items')"
  3. Approval
    Confirm the brief
    The design brief is in bim/design-brief.md. Is it what was asked for? Edit it, or approve to start modelling.
  4. Agent
    Model the architecture, check it against the brief
  5. Check
    The federation file holds together
    python3 -c "import json; m = json.load(open('bim/project.bim.json')); assert m['grid']['x'] and m['grid']['y'] and m['levels'], 'grid and levels'; assert {x['discipline'].lower() for x in m['models']} >= {'architecture', 'structure', 'plumbing', 'electrical', 'hvac'}, 'five disciplines'; print('ok')" && test -s bim/architecture.ifc
  6. Approval
    Open the discipline tabs
    The architecture, grid and levels are in bim/, with the brief checklist and renders. Check them, then open a tab each for structure, plumbing, electrical and HVAC?
  7. Agent
    A tab per discipline
  8. Agent
    Clash check
  9. Approval
    Send the clashes to the tabs
    Send each clash to the tab that owns the element to move, and check again when they are done?
  10. Agent
    Fix and check again

Runs 2 commands as you, shown before the first run.

What each agent step is told (in English, as in the file)
Write the design brief
Before any modelling, turn the request into bim/design-brief.md: the checklist this model is held to, and the review checks it. Read everything the person gave: the run note, their messages, a floor plan, attached reference images.
Sections, each item a checklist line ("- [ ] ..."), with sizes in metres where they matter:
1. Program: storeys, and every room with its rough size and what is in it (furnished rooms list their furniture).
2. Style and palette: the look in a few words, and named colours for walls, trim, roof, doors.
3. Key features: each one the person named or showed (say, a bay window, a round-topped door, a garage with its own gable, a chimney, a treehouse), with where it goes.
4. Must-haves and nice-to-haves: every key feature is a must-have unless the person said otherwise. Level of detail is a must-have too: if they asked for a richly detailed or lived-in model, say what that means here (furniture in every room, trim, fixtures).
5. Assumptions: what you had to decide yourself.
Reference images are for intent: layout, mood, level of detail. If the person asks to copy a copyrighted design (a show's house, a game's building, an architect's work), say so in one line in the brief and keep the design original unless they insist.
Restate the brief in your answer, short, so the person can confirm or change it.
Model the architecture, check it against the brief
Model from bim/design-brief.md (read it again: the person may have edited it) and, if there is one, the floor plan. A DXF plan is best: read its layers (walls, doors, windows, grid) with ezdxf, and its scale from $INSUNITS. An image or a PDF page works too if the note gives one known dimension (say "the south wall is 15 m"): measure everything from that, and say how sure you are. Turn a PDF page into a PNG first (pdftoppm or sips).
Work in a bim/ folder in this tab. Use IfcOpenShell (in a venv if it is not installed). Call cad_kit first and build with its cocobox_bim.py blocks (walls with openings, roofs, bay windows, stairs, chimney, porch, furniture kits) rather than hand-made boxes. Write a script, not a one-off: a change is a rerun.
1. bim/architecture.ifc: the brief's must-haves first, then its nice-to-haves. One storey per level, GlobalIds derived from element names, so a rerun keeps them.
2. bim/project.bim.json, the federation file every discipline aligns to: name; units "m"; grid {x, y: [{name, at}]} from the plan's grid (or from the structural walls if it has none); levels [{name, elevation}] (ground floor, ceiling, beam soffit, roof structure, foundation); underlay {path, scale, origin, elevation} pointing at the plan if there is one (scale in metres per drawing unit or pixel); models: one entry per discipline (Architecture, Structure, Plumbing, Electrical, HVAC) with path architecture.ifc, structure.ifc and so on. Leave tab off Architecture: a comment on it then comes to the tab the person is in, normally this one.
3. Look at it: cad_render bim/architecture.ifc with views iso, front, back, left, right and a cutaway per storey (cutaway:<height>, 1.5 m over each floor; or render bim/project.bim.json with cutaway:<storey name>). Then go through bim/design-brief.md item by item and mark each met (- [x]), partial (- [~]) or missing (- [ ]), naming the image that shows it. Fix what is partial or missing and render again, up to two rounds. Anything you still leave out or simplify, say so and flag it: never drop a brief item silently.
4. Answer with the checklist and the rendered images embedded (![front](/full/path.png)), and bim/project.bim.json embedded so the person can orbit it and pin comments.
A tab per discipline
Open four tabs with open_tabs, one each for Structure, Plumbing, Electrical and HVAC, with permissions "bypass" if the person allows it. Each tab works only in its own worktree: it writes its file there, never in this folder. Give each, standing alone (they do not see this chat):
- the full path of bim/project.bim.json to read (never to change), and to use its grid and levels as they are, with one IfcBuildingStorey per level, the same names and elevations;
- to write bim/structure.ifc, bim/plumbing.ifc, bim/electrical.ifc or bim/hvac.ifc inside its own worktree, with an IfcOpenShell script kept there, GlobalIds derived from element names;
- its scope. Structure: pad footings, columns, beams and the ground slab on the grid. Plumbing: fixtures, cold and hot supply, drains. Electrical: panel, outlets, switches, lights and cable runs. HVAC: the unit(s) and ducts, with air terminals;
- to keep services in the ceiling zone between the Ceiling and Beam soffit levels where they fit, and say where they do not;
- to end its report with the absolute path of its file, and to say its model is a draft for a licensed professional to check;
- that a review comment may come later naming this project's copy of its file: it changes its own file and reports the path again;
- to render its file with cad_render (iso and a cutaway per storey) and check it before reporting, and to say plainly anything it left out or simplified;
- to end its turn after it reports, and never wait, sleep or poll for an answer: a message sent to a tab while its turn runs is queued until that turn ends, so waiting only delays it.
Write each tab's agent name into the federation file as that discipline's tab, so a comment pinned on its file goes to it. Answer their questions. End your turn while they work: their reports come back here. As each report arrives, copy the file it names into bim/ (overwrite). When all four are in, cad_render bim/project.bim.json (iso and a cutaway per storey), embed it and the images, and mark this step done.
Clash check
Write bim/clash.py with IfcOpenShell and run it: every element's bounding box in world coordinates (ifcopenshell.geom, use-world-coords), every pair from two different discipline files compared, Architecture against Structure skipped (columns sit in walls by design), overlaps under 10 mm ignored. An overlap that runs right through a wall's or slab's thickness is a penetration to sleeve, not a clash: count those apart. Write bim/clashes.json.
Report: how many clashes, each with the two elements (discipline, name, GlobalId), where (grid reference and level) and the likely fix; the penetrations as a count. Embed bim/project.bim.json so the person can pin a comment on a clash: a pin on a discipline's element goes to that discipline's tab. Say plainly that the structural, plumbing, electrical and HVAC models are drafts that a licensed professional must check before anything is built.
Fix and check again
Send each clash to the tab that should move its element (message_tab; ducts and pipes usually move, structure usually stays), with the two GlobalIds, the point and your suggested fix. As their reports come back, copy each file they name into bim/ again, then rerun bim/clash.py and report what is left.
End with the final report: bim/design-brief.md's checklist (each item met, partial or missing, with what is left to do), the cad_render images of the federated model (iso, front and a cutaway per storey) embedded, and bim/project.bim.json embedded again.

Suits Architects and engineers with a floor plan (DXF best; an image or PDF page with one known dimension). Any agent with a shell: it installs IfcOpenShell in a venv. Needs the CAD & BIM add-on to review the model. Structural and MEP output is a draft for licensed professionals to check.

Nothing happened when you clicked Open?

Open in Cocobox needs Cocobox 0.13.13 or later. Otherwise press Download, then in the app open the Workflows panel, press Import… and choose the file (or drop it on the panel). Get Cocobox, free.

Share your own

In the app, open a workflow and press Share…: Cocobox takes out paths, tokens, emails and host names first and shows you exactly what leaves. Copy link gives you a link like the ones on this page; the workflow travels inside the link, so nothing is uploaded anywhere.

Guides: how workflows run, the gallery and shared links, and 2D plan to BIM.