teamassign

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package teamassign provides AI-powered automatic task assignment based on inferred skill match between task descriptions and team member history.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAssignments

func ApplyAssignments(plan *pm.Plan, assignments []AssignmentResult) int

ApplyAssignments writes the AI-proposed assignments back into the plan. Only assignments whose task_id exists in the plan are applied. Returns the number of tasks actually updated.

func AssignPrompt

func AssignPrompt(tasks []*pm.Task, members []Member) string

AssignPrompt builds the prompt that asks the AI to assign unassigned tasks to team members based on skill match, workload, and overdue priority.

func LeastLoadedMember

func LeastLoadedMember(members []Member, counts map[string]int) string

LeastLoadedMember returns the member from the list with the fewest active tasks. Ties are broken alphabetically for determinism.

func SkillTagsFromHistory

func SkillTagsFromHistory(plan *pm.Plan, memberName string) []string

SkillTagsFromHistory derives skill tags for a team member by analysing the titles, descriptions, roles, and tags of their completed tasks. Returns deduplicated lowercase skill tokens.

func WorkloadCount

func WorkloadCount(plan *pm.Plan) map[string]int

WorkloadCount returns the number of pending/in-progress tasks assigned to each member. Used for least-loaded selection for overdue tasks.

Types

type AssignmentResult

type AssignmentResult struct {
	TaskID    int    `json:"task_id"`
	Assignee  string `json:"assignee"`
	Reasoning string `json:"reasoning"`
}

AssignmentResult is the AI's decision for a single task.

func ParseAssignments

func ParseAssignments(raw string) ([]AssignmentResult, error)

ParseAssignments extracts the JSON assignment array from raw AI output.

func Run

func Run(ctx context.Context, p provider.Provider, model string, tasks []*pm.Task, members []Member) ([]AssignmentResult, error)

Run calls the provider with the assignment prompt and returns the parsed results.

type Member

type Member struct {
	Name   string   // display name / login
	Role   string   // optional job role (e.g. "backend engineer")
	Skills []string // inferred skill tags derived from completed task history
}

Member represents a team member available for assignment.

func MembersWithSkills

func MembersWithSkills(plan *pm.Plan, onlyMember string) []Member

MembersWithSkills builds a []Member list from the current plan, enriching each known assignee with skill tags derived from their completed task history. If onlyMember is non-empty, only that member is included.

Jump to

Keyboard shortcuts

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