roles

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package roles provides reference role implementations.

These roles demonstrate how to use the role package's features:

  • Behaviors: context-aware actions
  • Policies: governance rules
  • Workflows: structured action sequences
  • Metrics: success measurements
  • Delegation: sub-agent orchestration

Available Roles

CodeReviewer reviews code changes with configurable strictness:

reviewer := roles.NewCodeReviewer(roles.CodeReviewerConfig{
    Strictness: roles.StrictnessBalanced,
})
err := reviewer.Init(ctx, skills)

MeetingPM manages meeting preparation and follow-up:

pm := roles.NewMeetingPM()
err := pm.Init(ctx, skills)

Using Reference Roles

Reference roles can be used directly or as templates for custom roles. Each role documents its required and optional skills.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeReviewer

type CodeReviewer struct {
	role.BaseRole
	// contains filtered or unexported fields
}

CodeReviewer is a role that reviews code changes.

Required skills: git (for diff access) Optional skills: linter (for automated checks)

func NewCodeReviewer

func NewCodeReviewer(cfg CodeReviewerConfig) *CodeReviewer

NewCodeReviewer creates a new code reviewer role.

func (*CodeReviewer) Behaviors

func (r *CodeReviewer) Behaviors() []role.Behavior

Behaviors implements BehaviorProvider.

func (*CodeReviewer) Init

func (r *CodeReviewer) Init(ctx context.Context, skills map[string]skill.Skill) error

Init initializes the code reviewer with skills.

func (*CodeReviewer) Metrics

func (r *CodeReviewer) Metrics() []role.MetricDefinition

Metrics implements MetricsProvider.

func (*CodeReviewer) Policies

func (r *CodeReviewer) Policies() []role.Policy

Policies implements PolicyProvider.

func (*CodeReviewer) Spec

func (r *CodeReviewer) Spec() *role.RoleSpec

Spec returns the complete role specification.

func (*CodeReviewer) SystemPrompt

func (r *CodeReviewer) SystemPrompt(ctx context.Context) (string, error)

SystemPrompt returns the system prompt for the code reviewer.

type CodeReviewerConfig

type CodeReviewerConfig struct {
	// Strictness controls how thorough the review is.
	Strictness Strictness

	// FocusAreas limits review to specific categories.
	// Empty means review all categories.
	FocusAreas []string

	// BlockOnSeverity blocks approval if issues of this severity or higher exist.
	// Valid values: "critical", "high", "medium", "low"
	BlockOnSeverity string
}

CodeReviewerConfig configures the code reviewer role.

type MeetingPM

type MeetingPM struct {
	role.BaseRole
}

MeetingPM is a role that manages meeting preparation and follow-up.

Required skills: calendar (for meeting access) Optional skills: notes (for meeting notes), tasks (for action items)

func NewMeetingPM

func NewMeetingPM() *MeetingPM

NewMeetingPM creates a new meeting PM role.

func (*MeetingPM) Behaviors

func (r *MeetingPM) Behaviors() []role.Behavior

Behaviors implements BehaviorProvider.

func (*MeetingPM) Init

func (r *MeetingPM) Init(ctx context.Context, skills map[string]skill.Skill) error

Init initializes the meeting PM with skills.

func (*MeetingPM) Metrics

func (r *MeetingPM) Metrics() []role.MetricDefinition

Metrics implements MetricsProvider.

func (*MeetingPM) Policies

func (r *MeetingPM) Policies() []role.Policy

Policies implements PolicyProvider.

func (*MeetingPM) Spec

func (r *MeetingPM) Spec() *role.RoleSpec

Spec returns the complete role specification.

func (*MeetingPM) SystemPrompt

func (r *MeetingPM) SystemPrompt(ctx context.Context) (string, error)

SystemPrompt returns the system prompt for the meeting PM.

func (*MeetingPM) Workflows

func (r *MeetingPM) Workflows() []role.Workflow

Workflows returns the workflows this role supports.

type Strictness

type Strictness string

Strictness levels for code review.

const (
	// StrictnessLenient focuses on major issues only.
	StrictnessLenient Strictness = "lenient"

	// StrictnessBalanced balances thoroughness with pragmatism.
	StrictnessBalanced Strictness = "balanced"

	// StrictnessStrict catches all issues including style.
	StrictnessStrict Strictness = "strict"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL