AI Skill Governance
Govern AI skill growth through intelligent merging — not blocking.
Prevent skill bloat in AI agents by automatically detecting and merging similar capabilities while preserving functionality.
Support
If this project is useful to you, consider supporting development:
Why AI Skill Governance?
Modern AI agents can accumulate dozens or hundreds of skills. This leads to:
- Context dilution
- Slower reasoning
- Conflicting behaviors
- Maintenance nightmare
AI Skill Governance solves this by intelligently merging similar skills instead of arbitrarily limiting them.
Before / After
A support agent accumulates 12 skills over a few iterations. Many overlap.
| Cluster | Before | After |
|---|---|---|
| Greetings | greet, welcome, say_hi, hello_user |
greet |
| Refunds | refund, return_payment, issue_refund |
refund |
| Lookups | find_order, search_orders, get_order_by_id |
find_order |
| One-offs | escalate, close_ticket |
escalate, close_ticket |
| Total | 12 skills · ~840 tool-list tokens* | 5 skills · ~350 tokens |
→ 58% fewer skills. ~58% smaller tool-list prompt. Same coverage, faster tool selection, fewer conflicting behaviors.
*Illustrative. Tool-list tokens depend on serialization format (OpenAI function-calling schema, Anthropic tool blocks, etc.). The skill-count reduction is deterministic; token savings scale roughly with it.
Installation
pip install ai-skill-governance
For faster fuzzy matching:
pip install "ai-skill-governance[fuzzy]"
Quick Start
from ai_skill_governance import SkillRegistry
registry = SkillRegistry(default_threshold=0.75)
@registry.register(description="Sends a warm greeting")
def greet(name: str):
return f"Hello, {name}!"
@registry.register(description="Welcomes the user warmly")
def welcome(name: str):
return f"Welcome, {name}!"
# Check for suggested merges
print(registry.suggest_merges())
# Perform merge (v0.1.1: includes signature compatibility check)
merged = registry.perform_merge("greet", "welcome")
print(merged)
# Persistence (new in v0.1.1)
registry.save("my_skills.json")
registry.load("my_skills.json")
Advanced Merging
The merger creates a smart combined function that:
- Preserves the primary behavior
- Augments with secondary skill when signatures match
- Intelligently combines string/dict results
- Maintains full traceability
CLI
# Show status
skill-gov status --threshold 0.8
# Analyze and suggest merges
skill-gov merge --threshold 0.75
# Auto-merge similar skills
skill-gov merge --auto
Configuration
default_threshold: Similarity cutoff (0.0–1.0). Default: 0.75merge_mode:"suggest"(default) or"auto"
v0.3.0 New Features
Skill Graph Visualization
from ai_skill_governance import SkillRegistry, SkillGraph
reg = SkillRegistry()
# ... register skills ...
graph = SkillGraph(reg)
print(graph.to_ascii()) # Simple text view
dot = graph.to_dot("skills.dot") # Graphviz format
data = graph.to_json("graph.json") # For web dashboards
Semantic Merging (Major Upgrade)
pip install "ai-skill-governance[semantic]"
from ai_skill_governance import SkillRegistry
reg = SkillRegistry()
suggestions = reg.suggest_merges(method="semantic") # Uses embeddings when available
LangChain Integration
from ai_skill_governance.integrations.langchain import LangChainSkillGovernor
governor = LangChainSkillGovernor()
# Use @governor.register_tool on your LangChain @tool functions
CrewAI Integration
from ai_skill_governance.integrations.crewai import CrewAISkillGovernor
PyPI Release Notes
This package is fully prepared for PyPI publication with:
- Modern
pyproject.toml - Proper metadata and classifiers
- Optional dependencies (
fuzzyfor rapidfuzz) - Comprehensive documentation
- MIT License
Contributing
We welcome contributions that improve merging intelligence, add new similarity methods, or enhance the governance dashboard.
License
MIT License — see LICENSE file.
Metadata
Release files for ai-skill-governance 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ai_skill_governance-0.3.0.tar.gz | 16.1 kB | Without provenance | Details for ai_skill_governance-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ai_skill_governance-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for ai_skill_governance-0.3.0-py3-none-any.whl |
Total release size: 32.5 kB
Release files / ai_skill_governance-0.3.0.tar.gz
| Download URL | ai_skill_governance-0.3.0.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62e20aab692eaf4c8457df0a184afa38fabefe7ab7722ca13c05981aecdcf0b7
|
|
BLAKE2b-256 checksum How to use checksums |
0f4cf75f6056cc508d5a8c916891a237156a508d1e7ee64d2ce7cfb01ffb78f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / ai_skill_governance-0.3.0-py3-none-any.whl
| Download URL | ai_skill_governance-0.3.0-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8cda1803984ec949affee4c2520dce170a66fa8c37db9e307d2f8eb87d857327
|
|
BLAKE2b-256 checksum How to use checksums |
32e2fbcbac373b0b93a534e26fe80cc4fe009d1be56476cf499211e41b14d81c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for ai-skill-governance 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.