Drop the three-layer Claude subprocess orchestration (local model →
Claude verifier → cloud escalation). Skills now call LiteLLM directly
and return plain text to Claude Code, which decides what to do with it.
- Delete executor, orchestrator, verifier, result, attempts packages
- Simplify LiteLLMExecutor: Run(Request)→Result becomes Complete(model,sys,user)→(string,int64,error)
- Replace ExecutorFn with CompleteFunc in all 6 skill configs
- Rewrite all skill handlers to call Complete and return {"text","model","duration_ms"}
- Simplify config/models: remove Verifier/LlamaSwapURL, add ModelFor
- Bump version to v0.5.0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
56 lines
1.5 KiB
Go
56 lines
1.5 KiB
Go
// internal/skills/review/skill.go
|
|
package review
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
|
|
"github.com/mathiasbq/supervisor/internal/registry"
|
|
)
|
|
|
|
// CompleteFunc is the function used to call a local model.
|
|
type CompleteFunc func(ctx context.Context, model, system, user string) (string, int64, error)
|
|
|
|
// Config holds dependencies for the review skill.
|
|
type Config struct {
|
|
SkillPrompt string
|
|
DefaultModel string
|
|
CompleteFunc CompleteFunc
|
|
SessionsDir string
|
|
IngestBaseURL string
|
|
}
|
|
|
|
// Skill implements the review MCP tool.
|
|
type Skill struct{ cfg Config }
|
|
|
|
// New creates a new review Skill.
|
|
func New(cfg Config) *Skill { return &Skill{cfg: cfg} }
|
|
|
|
// Name returns the skill identifier.
|
|
func (s *Skill) Name() string { return "review" }
|
|
|
|
// Tools returns the MCP tool definitions for this skill.
|
|
func (s *Skill) Tools() []registry.ToolDef {
|
|
schema := func(required []string, props map[string]any) json.RawMessage {
|
|
b, _ := json.Marshal(map[string]any{"type": "object", "required": required, "properties": props})
|
|
return b
|
|
}
|
|
str := map[string]any{"type": "string"}
|
|
return []registry.ToolDef{
|
|
{
|
|
Name: "review",
|
|
Description: "Consult a local model for a structured code review of the specified files. Returns findings with severity levels.",
|
|
InputSchema: schema(
|
|
[]string{"project_root", "files"},
|
|
map[string]any{
|
|
"project_root": str,
|
|
"files": map[string]any{"type": "array", "items": map[string]any{"type": "string"}},
|
|
"context": str,
|
|
"model": str,
|
|
"session_id": str,
|
|
},
|
|
),
|
|
},
|
|
}
|
|
}
|