// internal/skills/sessionlog/skill.go package sessionlog import ( "encoding/json" "github.com/mathiasbq/supervisor/internal/registry" ) // Config holds sessionlog skill configuration. type Config struct { SessionsDir string // path to brain/sessions/ } // Skill implements registry.Skill for the session_log tool. type Skill struct { cfg Config } // New constructs a sessionlog Skill. func New(cfg Config) *Skill { return &Skill{cfg: cfg} } // Name returns the skill name. func (s *Skill) Name() string { return "sessionlog" } // Tools returns the MCP tool definitions. func (s *Skill) Tools() []registry.ToolDef { return []registry.ToolDef{ { Name: "session_log", Description: "Append a structured entry to the current session log. Call after each skill invocation completes to record what happened for retrospective and training data extraction.", InputSchema: json.RawMessage(`{ "type": "object", "required": ["session_id"], "properties": { "session_id": {"type": "string"}, "skill": {"type": "string"}, "phase": {"type": "string"}, "project_root": {"type": "string"}, "final_status": {"type": "string"}, "file_path": {"type": "string"}, "model_used": {"type": "string"}, "duration_ms": {"type": "integer"}, "message": {"type": "string"} } }`), }, } }