Skip to content

design: agent role badge system for v0.9.0 workforce expansion#600

Open
geoffjay wants to merge 5 commits intomainfrom
design/agent-role-badges
Open

design: agent role badge system for v0.9.0 workforce expansion#600
geoffjay wants to merge 5 commits intomainfrom
design/agent-role-badges

Conversation

@geoffjay
Copy link
Owner

Summary

  • Adds AgentRole type + inferAgentRole() utility that derives an agent's functional role from its name (e.g. refactor-agentrefactor). This is a stopgap until the orchestrator exposes a dedicated role field on Agent — the inference logic is isolated in ui/src/types/agent-roles.ts and can be replaced with a direct field read when the backend lands.
  • Adds AgentRoleBadge component with three variants: badge (coloured pill + icon), dot (status circle), icon-only (icon with tooltip). All ten agent roles have distinct Tailwind colours and lucide-react icons chosen to reflect their purpose.
  • Updates AgentTable with a Role column between Name and Status.
  • Updates AgentFilters with a Role dropdown filter (synced to the ?role= URL param, bookmarkable).
  • Updates useAgents hook to apply client-side role filtering.

Role → Colour design rationale

Role Colour Semantic intent
planner blue strategic, directional
worker emerald execution, active doing
reviewer amber scrutiny, caution
documenter violet knowledge, writing
designer pink visual creativity
refactor teal transformation, cleanliness
research indigo deep investigation
enricher sky augmentation, expanding context
tester lime quality gates (green = pass)
auditor rose security, vigilance

All badge styles follow the same bg-{colour}-100 / text-{colour}-800 (light) + dark:bg-{colour}-900/30 / dark:text-{colour}-400 (dark) pattern established in StatusBadge — no new design tokens needed.

Follow-up (not in scope for this PR)

  • When the orchestrator adds a role field to AgentConfig/Agent, update AgentRoleBadge to read agent.config.role directly and deprecate inferAgentRole.
  • Update ui/design/agentd.pen with role badge specs once Pencil is available.
  • Consider a role-breakdown view on the AgentSummary dashboard card.

Test plan

  • Agents with names matching known roles (e.g. planner, refactor-agent, tester-agent-1) show the correct coloured badge in the table
  • Agents with unknown names show the neutral gray badge
  • Role dropdown in filters correctly narrows the agent list
  • ?role=tester URL param is respected on page load and cleared on reset
  • Both light and dark themes render correct contrast for all 10 role colours
  • Column count in AgentTable remains correct (11 cols, loading/empty states updated)

🤖 Generated with Claude Code

geoffjay and others added 4 commits March 20, 2026 21:32
Introduces visual role differentiation for all ten agent roles
(5 original + 5 new: refactor, research, enricher, tester, auditor).

- New AgentRole type + inferAgentRole() in ui/src/types/agent-roles.ts
  Derives role from agent name until orchestrator exposes a role field
- New AgentRoleBadge component with badge/dot/icon-only variants
  Each role has a distinct Tailwind colour and lucide-react icon
- AgentTable: new Role column between Name and Status
- AgentFilters: new Role dropdown filter (URL param: ?role=)
- useAgents hook: client-side role filter via inferred role

Colour assignments follow semantic intent:
  planner→blue, worker→emerald, reviewer→amber, documenter→violet,
  designer→pink, refactor→teal, research→indigo, enricher→sky,
  tester→lime, auditor→rose

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…plans

Adds architect, triage, and release as canonical roles, and registers
aliases for the variant names used across milestones #17/#18/#19:
  researcher   → research
  security     → auditor
  test-writer  → tester
  test         → tester
  release-mgr  → release
  issue-quality→ enricher

Colour/icon additions:
  architect → slate  + Compass  (blueprints, system structure)
  triage    → orange + Tags     (urgency, prioritisation)
  release   → cyan   + Rocket   (shipping, delivery)

Also documents the v0.9.0 triple-milestone naming collision (#17, #18, #19)
in agent-roles.ts so the discrepancy is visible at the type boundary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Renames 'auditor' → 'security' throughout the role badge system to
match the agent name, GitHub label, and canonical naming established
in milestone #19 (Specialized Agent Ecosystem), confirmed as the
authoritative plan by the group analysis session.

Alias direction flipped: auditor → security (was security → auditor).

'enricher' and 'tester' are retained as canonical TS identifiers
(not 'issue-quality' / 'test') because they are hyphen-free and
produce clearer badge labels; inferAgentRole() maps the #19 YAML
agent names to them transparently.

Also updates all three style maps and the component docstring to
reflect #19 as the settled source of truth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the Conductor agent (v0.10.0 Autonomous Development Pipeline,
milestone #20) to the role badge system:
  conductor → purple / Workflow icon

The conductor runs on a 15-min cron, manages the git-spice merge queue,
restacks dependent branches, and escalates conflicts. Purple reflects its
orchestration/coordination function; Workflow is the most semantically
accurate lucide icon for pipeline air-traffic control.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove `architect` and `release` from AgentRole type, BADGE_STYLES,
DOT_STYLES, ROLE_ICONS, ROLE_LABELS, and ALL_AGENT_ROLES. Both roles
were dropped when the planner superseded milestones #17 and #19 with
the consolidated #18 (Autonomous Development Pipeline). PR #595
(architect) was closed without merging.

Both names now alias to `unknown` via ROLE_ALIASES so existing agent
names don't throw at runtime. Removes unused Compass and Rocket lucide
imports. Updates docstrings to reference milestone #18 as authoritative.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.40%. Comparing base (eeca345) to head (7f15830).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #600   +/-   ##
=======================================
  Coverage   55.40%   55.40%           
=======================================
  Files         126      126           
  Lines       13518    13518           
=======================================
  Hits         7490     7490           
  Misses       6028     6028           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant