feat: add agent skills and guardrails functionality

- Introduced new tools for managing agent skills and guardrails, including add, remove, and list operations.
- Updated README.md to document new commands and usage patterns for skills and guardrails.
- Enhanced server configuration to support longer read and write timeouts.
- Increased maximum upload size for files to 100 MB and adjusted related configurations.
- Created database migrations for agent skills, guardrails, and their associations with projects.
- Updated relevant code files to integrate new skills and guardrails into the application logic.
This commit is contained in:
2026-03-30 23:35:54 +02:00
parent e6f00ce636
commit 3c1ca83dc9
14 changed files with 862 additions and 14 deletions

View File

@@ -33,6 +33,7 @@ type ToolSet struct {
Calendar *tools.CalendarTool
Meals *tools.MealsTool
CRM *tools.CRMTool
Skills *tools.SkillsTool
}
func New(cfg config.MCPConfig, toolSet ToolSet) http.Handler {
@@ -306,6 +307,69 @@ func New(cfg config.MCPConfig, toolSet ToolSet) http.Handler {
Description: "Append a stored thought to a contact's notes.",
}, toolSet.CRM.LinkThought)
// Agent Skills
addTool(server, &mcp.Tool{
Name: "add_skill",
Description: "Store a reusable agent skill (behavioural instruction or capability prompt).",
}, toolSet.Skills.AddSkill)
addTool(server, &mcp.Tool{
Name: "remove_skill",
Description: "Delete an agent skill by id.",
}, toolSet.Skills.RemoveSkill)
addTool(server, &mcp.Tool{
Name: "list_skills",
Description: "List all agent skills, optionally filtered by tag.",
}, toolSet.Skills.ListSkills)
// Agent Guardrails
addTool(server, &mcp.Tool{
Name: "add_guardrail",
Description: "Store a reusable agent guardrail (constraint or safety rule).",
}, toolSet.Skills.AddGuardrail)
addTool(server, &mcp.Tool{
Name: "remove_guardrail",
Description: "Delete an agent guardrail by id.",
}, toolSet.Skills.RemoveGuardrail)
addTool(server, &mcp.Tool{
Name: "list_guardrails",
Description: "List all agent guardrails, optionally filtered by tag or severity.",
}, toolSet.Skills.ListGuardrails)
// Project Skills & Guardrails
addTool(server, &mcp.Tool{
Name: "add_project_skill",
Description: "Link an agent skill to a project.",
}, toolSet.Skills.AddProjectSkill)
addTool(server, &mcp.Tool{
Name: "remove_project_skill",
Description: "Unlink an agent skill from a project.",
}, toolSet.Skills.RemoveProjectSkill)
addTool(server, &mcp.Tool{
Name: "list_project_skills",
Description: "List all skills linked to a project. Call this at the start of a project session to load existing agent behaviour instructions before generating new ones.",
}, toolSet.Skills.ListProjectSkills)
addTool(server, &mcp.Tool{
Name: "add_project_guardrail",
Description: "Link an agent guardrail to a project.",
}, toolSet.Skills.AddProjectGuardrail)
addTool(server, &mcp.Tool{
Name: "remove_project_guardrail",
Description: "Unlink an agent guardrail from a project.",
}, toolSet.Skills.RemoveProjectGuardrail)
addTool(server, &mcp.Tool{
Name: "list_project_guardrails",
Description: "List all guardrails linked to a project. Call this at the start of a project session to load existing agent constraints before generating new ones.",
}, toolSet.Skills.ListProjectGuardrails)
return mcp.NewStreamableHTTPHandler(func(*http.Request) *mcp.Server {
return server
}, &mcp.StreamableHTTPOptions{