// internal/skills/retrospective/skill.go package retrospective import ( "context" "encoding/json" iexec "github.com/mathiasbq/supervisor/internal/exec" "github.com/mathiasbq/supervisor/internal/registry" ) // ExecutorFn allows injecting a test double for the subprocess executor. type ExecutorFn func(ctx context.Context, req iexec.Request) (iexec.Result, error) // Config holds retrospective skill configuration. type Config struct { SkillPrompt string // content of retrospective.md DefaultModel string // model to use when not specified in args SessionsDir string // path to brain/sessions/ ExecutorFn ExecutorFn // injected executor } // Skill implements registry.Skill for the retrospective tool. type Skill struct { cfg Config } // New constructs a retrospective Skill. func New(cfg Config) *Skill { return &Skill{cfg: cfg} } // Name returns the skill name. func (s *Skill) Name() string { return "retrospective" } // Tools returns the MCP tool definitions. func (s *Skill) Tools() []registry.ToolDef { return []registry.ToolDef{ { Name: "retrospective", Description: "Run a retrospective on a completed session. Reads the session log, identifies novel learnings, and writes structured entries to the brain for ingestion. Call at the end of each coding session.", InputSchema: json.RawMessage(`{ "type": "object", "required": ["session_id"], "properties": { "session_id": {"type": "string"}, "model": {"type": "string"} } }`), }, } }