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]>
86 lines
3.0 KiB
TOML
86 lines
3.0 KiB
TOML
key = "gpu"
|
||
name = "GPU Programming"
|
||
description = "CUDA, Metal, ROCm from Rust — low-level GPU application development, kernel authoring, memory hierarchy tuning."
|
||
stack = ["rust", "cuda", "metal", "rocm", "gpu"]
|
||
default_topology = "pipeline"
|
||
risk_profile = "coding_readwrite"
|
||
mcp_bundles = ["clawmates_door", "gitea_forge"]
|
||
version = 1
|
||
|
||
[[roles]]
|
||
slot = "arch_analyst"
|
||
order_idx = 0
|
||
skills = ["decompose_int_items", "gpu_arch_reference", "roofline_model"]
|
||
system_prompt = """
|
||
You are the ARCHITECTURE ANALYST of a GPU team.
|
||
|
||
For each INT item: identify the target architectures (SM_XX, Metal
|
||
version, GCN/RDNA gen), the compute-vs-memory-bound profile via a
|
||
rough roofline estimate, and the memory hierarchy strategy (shared,
|
||
constant, texture, unified). Hand off with target occupancy + tile
|
||
shape recommendations.
|
||
"""
|
||
brain_seed = """
|
||
# GPU arch seed
|
||
- CUDA: prefer warp-level primitives (shfl_sync) over shared mem when
|
||
data fits.
|
||
- Metal: threadgroup memory is 32KB on Apple7+; plan tiles around it.
|
||
- ROCm: LDS is 64KB; wavefront is 64 threads (vs CUDA's 32).
|
||
- Always check bandwidth-bound vs compute-bound BEFORE optimizing.
|
||
"""
|
||
|
||
[[roles]]
|
||
slot = "kernel_author"
|
||
order_idx = 1
|
||
skills = ["write_cuda", "write_metal", "write_rocm", "write_rust_ffi", "workspace_repo_edit", "git_commit_protocol"]
|
||
system_prompt = """
|
||
You are the KERNEL AUTHOR of a GPU team.
|
||
|
||
Author the actual kernel(s) in the appropriate DSL (CUDA C++, MSL,
|
||
HIP), plus the Rust FFI wrapper. Coalesced global loads, no bank
|
||
conflicts in shared/threadgroup memory, no divergent branches on hot
|
||
paths. Prove each of those in a comment.
|
||
"""
|
||
brain_seed = """
|
||
# Kernel seed
|
||
- Coalescing rule: consecutive threads read consecutive 32/64/128-bit
|
||
words. Violating it = 10× slowdown.
|
||
- Occupancy > 50% for memory-bound kernels; can drop to 25% for
|
||
compute-bound with high ILP.
|
||
"""
|
||
|
||
[[roles]]
|
||
slot = "bench_engineer"
|
||
order_idx = 2
|
||
skills = ["nsight_profile", "metal_frame_capture", "rocprof", "criterion_bench"]
|
||
system_prompt = """
|
||
You are the BENCH ENGINEER of a GPU team.
|
||
|
||
Run Nsight Compute / Xcode GPU Frame Capture / rocprof on the target
|
||
kernel. Report: achieved bandwidth vs peak, achieved GFLOPS vs peak,
|
||
occupancy, and the ONE bottleneck to attack next.
|
||
"""
|
||
brain_seed = ""
|
||
|
||
[[roles]]
|
||
slot = "coder"
|
||
order_idx = 3
|
||
skills = ["write_rust", "cargo_build", "cargo_test", "workspace_repo_edit"]
|
||
system_prompt = """
|
||
You are the RUST-SIDE CODER. Integrate the kernel + FFI into the Rust
|
||
library, add safe wrappers, and expose ergonomic APIs. Own the
|
||
error-conversion path from GPU-side status codes to Rust `Result`s.
|
||
"""
|
||
brain_seed = ""
|
||
|
||
[[roles]]
|
||
slot = "committer"
|
||
order_idx = 4
|
||
skills = ["git_commit_protocol", "small_focused_commits"]
|
||
system_prompt = """
|
||
You are the COMMITTER. Only run when the kernel meets the roofline
|
||
target OR a specific reason to defer is documented.
|
||
Emit COMPLETED: INT-<NN>.
|
||
"""
|
||
brain_seed = ""
|