Skip to content

Built-in base roles for faster team casting #368

@spboyer

Description

@spboyer

Problem

Team creation during squad init is expensive and inconsistent:

  • High token cost — The LLM improvises all role definitions from scratch every time (charter content, expertise, boundaries, voice)
  • Slow setup — Multiple LLM round-trips to generate boilerplate charters that end up thin and generic
  • Inconsistent quality — Charter depth varies wildly depending on the LLM's creativity in that moment
  • No institutional knowledge — There's no curated baseline for what makes a good "Backend Developer" charter vs a "Frontend Developer" charter
  • Limited scope — Squad is used for all kinds of teams (marketing, sales, game dev, etc.), but the current personalityForRole() in cast.ts only knows ~9 engineering-flavored patterns

Proposed Solution

Add 20 built-in base roles that serve as starting points during team casting. Each base role includes deep, curated charter content (expertise, boundaries, voice, ownership, routing patterns) that provides ~90% of the charter out of the box. A lightweight LLM refinement pass adapts each base role to the specific project context (stack, frameworks, domain) — adding the remaining 10% at ~1/5th the current token cost.

The 20 Base Roles

12 Software Development roles (primary use case):
lead, frontend, backend, fullstack, reviewer, tester, devops, security, data, docs, ai, designer

8 Category Generalist roles (covering broader team types):
marketing, sales, product, project-mgmt, support, game-dev, media, compliance

Init Flow: Start from Base, Refine for Context

  1. User describes their project
  2. Deterministic keyword matching picks 4-5 base roles from catalog (no LLM needed)
  3. Present matches with one-liner descriptions; user confirms/swaps/adds
  4. Lightweight LLM pass refines each base role for project context (e.g., base backend → "Node.js/Express Backend Dev with Stripe knowledge")
  5. Character name casting uses existing universe system
  6. Fallback to full LLM generation if no base role fits

Deliverables

  • packages/squad-sdk/src/roles/ — types, catalog (20 role objects), public API
  • useRole('backend', { name: 'kane' }) — SDK builder for squad.config.ts
  • squad roles — CLI command to list/search base roles
  • Updated cast.tsgenerateCharter() and personalityForRole() use catalog
  • Updated coordinator.ts — Init mode uses catalog-based matching + refinement
  • Updated Init Mode prompts in squad.agent.md templates

Attribution

Base role content is inspired by and adapted from msitarzewski/agency-agents (MIT License) by AgentLand Contributors. Proper attribution will be included in source comments, generated charter headers, and documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationpriority:p1This sprintsquadSquad triage inbox — Lead will assign to a membertype:featureNew capability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions