Skip to content

Comments

feat(skills): add skills management#423

Merged
mudler merged 13 commits intomainfrom
feat/skills-management
Feb 21, 2026
Merged

feat(skills): add skills management#423
mudler merged 13 commits intomainfrom
feat/skills-management

Conversation

@mudler
Copy link
Owner

@mudler mudler commented Feb 21, 2026

This pull request introduces built-in Skills management to LocalAGI, enabling agents to use reusable skills that can be managed, imported, exported, and synced via git from the Web UI. The changes add support for skills as a first-class feature, update documentation and configuration, and allow agents to receive skills context and tools when enabled. Additionally, the Go version is updated to 1.26, and several dependencies are upgraded.

Skills Management Integration

  • Added built-in Skills management to LocalAGI, including Web UI support for creating, editing, importing/exporting, and syncing skills from git; agents can now enable skills per agent and receive skills context and tools via MCP. [1] [2] [3] [4] [5] [6]
  • Introduced SkillsProvider interface and integrated skills prompt and MCP session injection into agent startup logic in core/state/pool.go, allowing agents to use skills when enabled. [1] [2] [3] [4] [5] [6] [7]
  • Added agent configuration options for skills: enable_skills (checkbox), skills_prompt (textarea), and corresponding metadata in core/state/config.go. [1] [2] [3]
  • Provided support for mounting a host directory for skills in Docker Compose and clarified skills directory usage in documentation. [1] [2]

MCP Session Handling

  • Added support for pre-connected MCP client sessions (e.g., in-process skills MCP) via WithMCPSession option and integrated them in agent initialization and cleanup logic. [1] [2] [3] [4]

Dependency and Platform Updates

  • Updated Go version to 1.26 and upgraded dependencies, including github.com/modelcontextprotocol/go-sdk to v1.2.0 and other indirect dependencies for skills and git integration. [1] [2] [3] [4] [5]
  • Updated Dockerfile to use Go 1.26-alpine for builds.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Copilot AI review requested due to automatic review settings February 21, 2026 15:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces first-class Skills support: a backend skills service + REST API, React UI pages to manage skills and Git-synced skill repositories, and agent-level integration to expose skills via dynamic prompts and an in-process MCP session.

Changes:

  • Add a skills service (services/skills) that manages a state-dir-backed skills store and exposes an in-process MCP session + dynamic prompt.
  • Add Web UI skills management (list/search/create/edit/import/export, resources, git repo management) and wire new API endpoints.
  • Extend agent/pool configuration to support per-agent “Enable Skills”, injecting the skills prompt and MCP tools when enabled.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
webui/skills_handlers.go Adds the Skills + Git repo REST API handlers used by the React UI.
webui/routes.go Registers the new Skills and Git repo API routes.
webui/react-ui/src/utils/config.js Adds endpoint definitions for skills and git repos.
webui/react-ui/src/utils/api.js Adds skillsApi client wrapper for the new endpoints.
webui/react-ui/src/router.jsx Adds routes for Skills list and Skill editor pages.
webui/react-ui/src/pages/Skills.jsx Implements the Skills management page and Git repo UI.
webui/react-ui/src/pages/SkillEdit.jsx Implements create/edit form for a skill.
webui/react-ui/src/App.jsx Adds “Skills” to the sidebar navigation.
webui/options.go Allows wiring a SkillsService into the webui App config.
services/skills/service.go Implements skills dir manager caching + shared in-process MCP session creation.
services/skills/prompt.go Implements a dynamic prompt block that renders available skills as XML.
core/state/pool.go Adds optional skills provider integration to inject prompt/MCP session when enabled.
core/state/config.go Adds enable_skills to agent config + metadata for the UI.
core/agent/options.go Adds WithMCPSession option for attaching pre-connected MCP sessions.
core/agent/mcp.go Registers extra MCP sessions’ tools; avoids closing shared sessions.
main.go Instantiates the skills service and passes it into pool + webui.
README.md Documents built-in Skills and how to use/mount them.
docker-compose.yaml Notes optional host mount for /pool/skills.
Dockerfile.webui Updates Go builder image version used for building the webui binary.
go.mod / go.sum Bumps/introduces dependencies (skillserver, MCP sdk, go-x libs, etc.).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +197 to +203
frontmatter := fmt.Sprintf("---\nname: %s\ndescription: %s\n", req.Name, req.Description)
if req.License != "" {
frontmatter += fmt.Sprintf("license: %s\n", req.License)
}
if req.Compatibility != "" {
frontmatter += fmt.Sprintf("compatibility: %s\n", req.Compatibility)
}
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frontmatter is constructed via string formatting with unescaped user input (name/description/license/compatibility/metadata). Newlines, colons, quotes, etc. can produce invalid YAML (or unintended structure), breaking skill parsing. Consider using a YAML encoder and/or quoting/sanitizing values.

Copilot uses AI. Check for mistakes.
Comment on lines 230 to 234
func (a *Agent) closeMCPServers() {
for _, s := range a.mcpSessions {
s.Close()
// Do not close shared sessions (e.g. in-process skills MCP) so other agents can keep using them
isExtra := false
for _, e := range a.options.extraMCPSessions {
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closeMCPServers closes sessions but never clears a.mcpSessions. Since initMCPActions appends new sessions each time, the slice can grow unbounded and may repeatedly attempt to close old sessions (and duplicate extra sessions). Consider resetting a.mcpSessions after closing (while preserving shared sessions if needed).

Copilot uses AI. Check for mistakes.
Comment on lines 44 to 47
defer s.mu.Unlock()
s.manager = nil
s.mcpSrv = nil
s.session = nil
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InvalidateManager drops references to the cached MCP session/server but doesn’t close the existing session (and may leave the in-process server goroutine running). This can leak resources and keep using stale managers; consider explicitly closing the prior session and stopping the server before nil’ing them out.

Suggested change
defer s.mu.Unlock()
s.manager = nil
s.mcpSrv = nil
s.session = nil
// Capture current resources and clear cached references under lock
oldManager := s.manager
oldSrv := s.mcpSrv
oldSession := s.session
s.manager = nil
s.mcpSrv = nil
s.session = nil
s.mu.Unlock()
// Close session if it supports Close
if oldSession != nil {
if closer, ok := any(oldSession).(interface{ Close() error }); ok {
_ = closer.Close()
}
}
// Stop/close server if it supports Close
if oldSrv != nil {
if closer, ok := any(oldSrv).(interface{ Close() error }); ok {
_ = closer.Close()
}
}
// Close manager if it supports Close
if oldManager != nil {
if closer, ok := any(oldManager).(interface{ Close() error }); ok {
_ = closer.Close()
}
}

Copilot uses AI. Check for mistakes.
mudler and others added 12 commits February 21, 2026 19:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler force-pushed the feat/skills-management branch from a4fa485 to 3174b84 Compare February 21, 2026 21:16
@mudler mudler merged commit bc567ef into main Feb 21, 2026
2 checks passed
@mudler mudler deleted the feat/skills-management branch February 21, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant