Skip to content

[Feature Request] Add Skill Extension Framework Support to Spring AI #5293

@zhanglinpeng-semir

Description

@zhanglinpeng-semir

I have searched existing GitHub issues and confirmed this feature has not been previously requested.


Expected Behavior

Spring AI should provide a built-in Skill Extension Framework that enables developers to:

  1. Define reusable AI skills as self-contained, modular components that can be composed into larger AI applications
  2. Register skills dynamically at runtime with support for both eager and lazy loading strategies
  3. Manage skill lifecycle including initialization, configuration, and resource management
  4. Integrate skills with AI models seamlessly through a standardized tool/capability interface
  5. Discover and catalog skills with metadata support for documentation and versioning

Code Example:

// Define a Skill
@Skill(
    name = "weather",
    description = "Provides weather information for cities",
    source = "example"
)
public class WeatherSkill {
    @SkillInit
    public static WeatherSkill create() {
        return new WeatherSkill();
    }

    @SkillContent
    public String content() {
        return "# Weather Skill\nProvides weather information...";
    }

    @SkillTools
    public List<ToolCallback> tools() {
        return List.of(ToolCallbacks.from(this));
    }

    @Tool(description = "Get current weather for a city")
    public String getWeather(String city) {
        // Implementation
        return weatherData;
    }
}

// Register and use
SkillPoolManager poolManager = new DefaultSkillPoolManager();
ClassBasedSkillRegistrar registrar = ClassBasedSkillRegistrar.builder().build();
SkillDefinition definition = registrar.register(poolManager, WeatherSkill.class);

Current Behavior

Currently, Spring AI lacks a unified framework for defining and managing reusable skills. This makes it difficult to:

  • Create composable, self-contained AI capabilities
  • Share skills across different applications and teams
  • Manage skill versions and dependencies
  • Provide standardized metadata and documentation for skills
  • Integrate skills dynamically at runtime

Context

How this addresses real needs:

The Skill Extension Framework enables developers to build modular AI applications where business logic is encapsulated as reusable skills. This is particularly valuable for:

  • Enterprise applications: Composing complex AI workflows from well-tested skill components
  • Multi-tenant systems: Managing different skill sets per tenant or customer
  • Skill marketplace scenarios: Sharing and discovering skills across teams and organizations
  • Progressive AI enhancement: Adding new capabilities without modifying core application code

Current implementation:

We have successfully developed and open-sourced a production-ready Skill Extension Framework available at: https://github.com/semir-labs/spring-ai-skill-extension

The implementation includes:

  • ✅ Full skill lifecycle management with multiple loading strategies
  • ✅ Lazy and eager loading support for performance optimization
  • ✅ Comprehensive skill registration and discovery mechanism
  • ✅ Integration with Spring AI's tool/capability framework
  • ✅ Full test coverage (8 test classes covering all core functionality)
  • ✅ Complete adherence to Spring Framework coding standards (100% checkstyle compliant)
  • ✅ Thorough documentation and examples

Status:

We are ready to contribute this feature as a PR to the Spring AI project. The implementation is stable, tested, and follows all Spring Framework guidelines.


Related Resources


Proposed Solution

Integration of the Skill Extension Framework as a new module (spring-ai-skill) in the Spring AI project, providing:
Proposed Solution

Integration of the Skill Extension Framework as a new module (spring-ai-skill) in the Spring AI project, providing:

  1. Core skill abstraction and lifecycle management
  2. Multiple registration strategies (class-based, instance-based)
  3. Skill pool and kit management
  4. Full integration with Spring's dependency injection
  5. Comprehensive documentation and examples

We are committed to maintaining this feature and addressing any feedback or enhancements from the Spring AI team.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions