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 ¶
- type CodeReviewer
- func (r *CodeReviewer) Behaviors() []role.Behavior
- func (r *CodeReviewer) Init(ctx context.Context, skills map[string]skill.Skill) error
- func (r *CodeReviewer) Metrics() []role.MetricDefinition
- func (r *CodeReviewer) Policies() []role.Policy
- func (r *CodeReviewer) Spec() *role.RoleSpec
- func (r *CodeReviewer) SystemPrompt(ctx context.Context) (string, error)
- type CodeReviewerConfig
- type MeetingPM
- func (r *MeetingPM) Behaviors() []role.Behavior
- func (r *MeetingPM) Init(ctx context.Context, skills map[string]skill.Skill) error
- func (r *MeetingPM) Metrics() []role.MetricDefinition
- func (r *MeetingPM) Policies() []role.Policy
- func (r *MeetingPM) Spec() *role.RoleSpec
- func (r *MeetingPM) SystemPrompt(ctx context.Context) (string, error)
- func (r *MeetingPM) Workflows() []role.Workflow
- type Strictness
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeReviewer ¶
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) 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 ¶
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 (*MeetingPM) Metrics ¶
func (r *MeetingPM) Metrics() []role.MetricDefinition
Metrics implements MetricsProvider.
func (*MeetingPM) SystemPrompt ¶
SystemPrompt returns the system prompt for the meeting PM.
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" )