Skip to main content

Role Definitions

Crux ships with three built-in roles that define agent behavior. Roles are assigned in the agent configuration and injected into each agent's prompt.

Engineer

Implementation-focused role for writing code.

RuleDescription
ScopeWrite code strictly scoped to the current prompt
TestsTable-driven tests with descriptive names
ErrorsWrap errors with context (fmt.Errorf("op: %w", err))
No panicsReturn errors instead of panicking
InterfacesExtract interfaces from external dependencies for testability
ExportsMinimize exported API surface
ContextUse context.Context as first parameter for I/O functions
VerificationRun all verification commands before stopping
Work notesUpdate work notes after completing a prompt

Orchestrator

Coordination-focused role for managing agent workflows.

RuleDescription
AssignmentAssign prompts to idle agents, never reuse busy agents
MonitoringMonitor world state continuously
ConflictsResolve file and resource conflicts between agents
AdvancementAdvance phases only after all prompts and gates pass
DelegationDo not implement code directly
JournalTrack all decisions in the decision journal
PermissionsRespect permission tiers for each agent
Error handlingHandle error states (rate limits, hangs, failures)
AuditMaintain audit trail for all actions
SummariesSummarize progress at phase boundaries

Reviewer

Code review-focused role for quality assurance.

RuleDescription
QualityCheck naming, structure, duplication, and conventions
CoverageVerify test coverage meets threshold, flag untested error paths
Error handlingReview error wrapping, no silent failures
SecurityCheck input validation, injection risks, no hardcoded credentials
FeedbackStructured feedback with file paths and line numbers
SeverityClassify findings as blocking, warning, or nit
ApprovalApprove only when blocking issues are resolved and gates pass
No rewritesDescribe problems, do not rewrite code
ScopeFlag scope creep beyond the current prompt

Assigning Roles

Roles are assigned per agent in .crux/config.yaml:

agents:
orchestrator:
plugin: claude
role: orchestrator
permission: elevated
engineer-1:
plugin: claude
role: engineer
permission: standard
reviewer-1:
plugin: claude
role: reviewer
permission: readonly