The LinX platform now supports a flexible, Claude Code-style dynamic skill system that allows users to create executable skills with actual Python code, not just metadata.
Added new fields to the skills table:
skill_type: Type of skill (python_function, api_wrapper, database_query, etc.)code: Python code for function skills (with @tool decorator)config: YAML/JSON configuration for API/DB skillsis_active: Whether the skill is currently activeis_system: Whether it's a built-in system skillexecution_count: Number of times the skill has been executedlast_executed_at: Timestamp of last executionaverage_execution_time: Average execution time in secondscreated_by: User who created the skill (for custom skills)updated_at: Last update timestamp
Files Created:
backend/skill_library/skill_types.py- Skill type enumsbackend/skill_library/templates.py- Pre-built skill templatesdocs/backend/dynamic-skill-system.md- Complete architecture documentationdocs/backend/skill-system-summary.md- This file
Database Migration:
backend/alembic/versions/13be0d1967af_add_dynamic_skill_fields.py- Migration applied ✅
Updated Files:
backend/database/models.py- Enhanced Skill model.kiro/specs/digital-workforce-platform/tasks.md- Added Phase 2.7 tasks
Five ready-to-use templates are now available:
- Web Search - Search the internet using Tavily API
- HTTP API Call - Make requests to external APIs
- Data Analysis - Analyze data using pandas
- File Reader - Read file contents
- Calculator - Perform mathematical calculations
- Skill Execution Engine - Implement the actual code execution with sandboxing
- API Updates - Add endpoints for:
GET /skills/templates- List templatesPOST /skills/from-template- Create from templatePOST /skills/{id}/test- Test skill executionPOST /skills/{id}/activate- Activate skillPOST /skills/{id}/deactivate- Deactivate skill
- Code Editor - Replace rigid form with Monaco editor
- Template Selector - Visual template browser
- Skill Tester - Test skills before deployment
- Enhanced UI - Show skill type, stats, and code preview
- Agent Integration - Load skills as LangChain tools dynamically
- Hot Reloading - Update skills without restarting agents
- Permission System - Check permissions before execution
Skills are now defined by actual Python code:
from langchain_core.tools import tool
@tool
def my_skill(param: str) -> str:
"""Skill description.
Args:
param: Parameter description
Returns:
Result description
"""
# Implementation
return resultThe execution engine will:
- Parse the Python code
- Extract the
@tooldecorated function - Create a LangChain Tool instance
- Execute in a sandboxed environment
- Track execution stats
- All code runs in isolated sandboxes (gVisor/Firecracker/Docker)
- Static analysis before execution
- Resource limits (CPU, memory, time)
- Permission checks
- Audit logging
- Flexibility - Users can create any type of skill
- LangChain Native - Direct integration with LangChain tools
- Type-Safe - Python type hints provide validation
- Testable - Built-in testing before deployment
- Observable - Execution stats and monitoring
- Secure - Sandboxed execution with resource limits
POST /api/v1/skills/from-template?template_id=web_search&name=my_searchPOST /api/v1/skills
{
"name": "custom_skill",
"description": "My custom skill",
"skill_type": "python_function",
"code": "from langchain_core.tools import tool\n\n@tool\ndef custom_skill(input: str) -> str:\n return f'Processed: {input}'",
"interface_definition": {
"inputs": {"input": "string"},
"outputs": {"result": "string"},
"required_inputs": ["input"]
},
"dependencies": [],
"version": "1.0.0"
}POST /api/v1/skills/{skill_id}/test
{
"inputs": {
"query": "test search"
}
}- Design Document:
docs/backend/dynamic-skill-system.md - Tasks:
.kiro/specs/digital-workforce-platform/tasks.md(Phase 2.7) - LangChain Tools: https://python.langchain.com/docs/modules/agents/tools/
- Reference Implementation:
examples-of-reference/langchain-demo/app.py
- ✅ Database schema updated
- ✅ Skill types defined
- ✅ Templates created
- ✅ Documentation written
- ⏳ Execution engine (next)
- ⏳ API endpoints (next)
- ⏳ Frontend UI (next)
- ⏳ Agent integration (next)