Adds two new MCP skill packages:
- internal/skills/org: exposes the tier tool, calling an injected TierFn
for testability; returns current operating tier as structured JSON
- internal/skills/sessionlog: exposes the session_log tool, appending
structured JSONL entries to brain/sessions/{session_id}.jsonl; requires
session_id, wraps internal/session.Append
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
50 lines
1.3 KiB
Go
50 lines
1.3 KiB
Go
// 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"}
|
|
}
|
|
}`),
|
|
},
|
|
}
|
|
}
|