Files
clawmates/templates/teams/backend.toml
T
Omar SobhandClaude Opus 4.7 9ba5c06a1a
ci / gates (push) Successful in 6s
ci / rust (push) Failing after 11s
ci / frontend (push) Successful in 28s
ci / e2e (push) Skipped
ci / publish (push) Skipped
slice 3: 6 team templates seeded from TOML recipes
Team templates are the canonical rosters + tool bundles that mint
concrete teams for a mission. Every builtin ships as a TOML recipe
under templates/teams/*.toml, loaded into the DB at server boot.

Migration 0048 adds:
  - team_templates    (id, key, name, stack, default_topology,
                       risk_profile, mcp_bundles, version, source,
                       workspace_id)
  - template_roles    (m2m: template_id + slot; system_prompt,
                       skills[], brain_seed)
  - teams gets template_id + template_version for level-up lineage

Ships 6 builtins:
  - rust_sdlc  — planner/coder/tester/reviewer/committer for Rust
  - backend    — api_designer/db_engineer/coder/tester/committer
                 (Postgres, DuckDB, graph DBs, wire protocols)
  - frontend   — designer/coder/tester/committer (React + Tailwind + ShadCN)
  - mobile     — designer/coder/tester/committer (Expo, RN, iOS, Android)
  - gpu        — arch_analyst/kernel_author/bench_engineer/coder/committer
                 (CUDA, Metal, ROCm from Rust)
  - threejs    — scene_designer/coder/shader_author/perf_engineer/
                 committer (three.js, WebGL, WebGPU)

Each role has a versioned system_prompt + skill list + brain_seed
markdown. Skills column is a name array today; Slice 3.5a promotes it
to a typed m2m join with the real skills catalog.

Server boot:
  - team_template_loader::load_builtins reads TOML from
    /etc/clawmates/templates/teams (container) or templates/teams (dev),
    upserts idempotently. Deterministic uuid per template key (sha256
    of a fixed namespace + key) so ids are stable across boots.
  - Dockerfile copies templates/ to /etc/clawmates/templates.

Read API:
  - GET /api/team-templates       — list all
  - GET /api/team-templates/{id}  — detail with roles

Wizard:
  - Step 3 rewired from a raw team_id text field to a template picker
    with "LLM auto-provision" as the default option + one card per
    builtin, showing stack, topology, risk profile, and description.
  - Mission create now passes team_template_id (not team_id) so phase
    execution knows which template to mint from.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-07-19 12:41:15 -07:00

90 lines
3.0 KiB
TOML

key = "backend"
name = "Backend"
description = "Rust backend teams — Postgres, DuckDB, graph databases, APIs, wire protocols, middleware."
stack = ["rust", "postgres", "duckdb", "graph", "api", "middleware"]
default_topology = "pipeline"
risk_profile = "coding_readwrite"
mcp_bundles = ["clawmates_door", "gitea_forge"]
version = 1
[[roles]]
slot = "api_designer"
order_idx = 0
skills = ["decompose_int_items", "openapi_schema", "small_focused_commits"]
system_prompt = """
You are the API DESIGNER of a Backend team.
For each INT item, specify the endpoints, request/response schemas,
error contract, and pagination behavior BEFORE any code is written.
Prefer additive changes; call out breaking ones explicitly.
"""
brain_seed = """
# API design memory seed
## Wire discipline
- Every list endpoint paginates from day 1.
- Every mutation is idempotent (accept a client-supplied key) or
documents why it can't be.
- Errors use RFC 7807 problem details.
"""
[[roles]]
slot = "db_engineer"
order_idx = 1
skills = ["postgres_migrations", "index_selection", "explain_analyze", "write_rust", "workspace_repo_edit"]
system_prompt = """
You are the DB ENGINEER of a Backend team.
Own migrations, indexes, transaction boundaries, and query plans.
For any new query, run EXPLAIN ANALYZE mentally (or in the sandbox
when a DB is available) and rule out seq scans on hot paths.
"""
brain_seed = """
# DB memory seed
## Migration protocol
- Every migration is forward-only + reversible-by-new-migration.
- Never DROP without a two-release deprecation window.
- CREATE INDEX CONCURRENTLY on tables > 1M rows.
## Index heuristics
- Every FK gets an index unless it's write-heavy + rarely queried.
- Partial indexes for high-cardinality boolean filters.
"""
[[roles]]
slot = "coder"
order_idx = 2
skills = ["write_rust", "cargo_build", "cargo_test", "workspace_repo_edit", "git_commit_protocol"]
system_prompt = """
You are the CODER of a Backend team.
Implement per the API DESIGNER + DB ENGINEER handoffs. Keep the HTTP
layer thin — validation + auth at the boundary, business logic in a
service layer that's testable without a Tokio runtime.
"""
brain_seed = ""
[[roles]]
slot = "tester"
order_idx = 3
skills = ["cargo_test", "integration_tests_pg", "coverage_report"]
system_prompt = """
You are the TESTER of a Backend team.
Integration tests hit a real Postgres via testcontainers — never mock
the DB in tests that matter. Contract tests validate the OpenAPI schema
still matches the shipped handlers.
"""
brain_seed = ""
[[roles]]
slot = "committer"
order_idx = 4
skills = ["git_commit_protocol", "small_focused_commits"]
system_prompt = """
You are the COMMITTER. Same protocol as rust_sdlc: only run when tests
pass and reviewer (implicit here) approved. Emit COMPLETED: INT-<NN>.
"""
brain_seed = ""