Building an AI Knowledge Management System with Claude Skills & Dynamic Routing
This article explains how to design and implement a knowledge‑management and intelligent‑assistant system called Krawl using Claude Skills, covering the three‑layer skill architecture, progressive disclosure, dynamic routing, lazy loading, meta‑tool integration, and concrete Python examples for video summarisation and knowledge queries.
Over the past two years the author, while running an AI startup, also worked as a content creator and found the manual process of collecting, transcribing, and organising video content extremely inefficient. The typical workflow involved bookmarking, screenshotting, and later trying to retrieve the information, which often resulted in lost context and no usable text.
To solve this, the author and an intern wrapped the repetitive steps into a Claude Skill , eventually evolving the idea into a full Krawl system —a knowledge‑management and intelligent‑question‑answer platform that leverages Claude Skills for deep AI‑tool integration.
Understanding Claude Skills
Anthropic defines Agent Skills as modular capabilities that extend Claude’s functionality. Each skill packages instructions, metadata, and optional resources (scripts, templates). When a scenario matches a skill’s description, Claude automatically invokes it.
Skills consist of three core components, forming three context layers from abstract to concrete:
Metadata – name, description, tags.
Instructions – the concrete prompt that drives the skill.
Resources – files, scripts, or other assets needed for execution.
Claude Skills follow the principle of Progressive Disclosure : information is loaded in stages rather than dumping the entire skill into the context window at once.
Layer 1: Metadata (always loaded)
Lets Claude know which skills are available.
Supports intent matching and skill triggering.
Consumes minimal context because it contains no execution logic.
---
name: douyin-summary
description: Douyin video summarisation skill. Fetches transcript via Coze API and returns a concise summary.
---Layer 2: Core Instructions (loaded on demand)
When a user request matches a skill description, Claude reads the full SKILL.md file from the filesystem and injects it into the current conversation.
# Douyin video summarisation skill
## Workflow
1. **Detect Douyin link**
2. **Run script** `scripts/fetch_douyin.py` to obtain transcript
3. **Summarise** the text
4. **Return** a friendly outputLayer 3: Code & Resources (lazy‑loaded)
Complex skills may include multiple files, forming a self‑contained knowledge base. By loading metadata → instructions → code/resources, a skill can be fully recognised, triggered, and executed.
Claude Skills Installation & Usage
Two ways to add skills in Claude Code:
Official skill marketplace (recommended)
/plugin marketplace add anthropics/skills
/plugin list
/plugin install document-skills@anthropic-agent-skillsManual custom skill creation
Create a folder under ~/.claude/skills/, e.g., douyin-summary.
Add a SKILL.md describing the skill.
Optionally place helper scripts (e.g., Python files) in the folder.
mkdir -p ~/.claude/skills/douyin-summary ---
name: douyin-summary
description: Douyin video summarisation assistant.
---
# Douyin video summarisation assistant
## Workflow
1. Detect Douyin link
2. Run scripts/fetch_douyin.py
3. Extract key points
4. Output concise summaryBuilding Krawl with Skills
Krawl turns Claude from a passive chatbot into an active assistant that can invoke tools to complete tasks. It does this through a skill‑extension mechanism and a dynamic router combined with lazy loading to keep startup fast and avoid context pollution.
Core Components
Metadata (always loaded) – tells Claude which skills exist.
Instructions (trigger‑time load) – the prompt that defines how to perform the skill.
Resources & Code (on‑demand) – actual Python modules that implement the tool functions.
Dynamic Router & Lazy Loading
At startup, SkillManager scans the skills/ directory, reading only the front‑matter of each skill.md to build a lightweight registry:
@dataclass
class SkillInfo:
"""Skill information container – core is lazy load"""
name: str
description: str
is_loaded: bool = False
content: str = ""
tools: List[Dict[str, Any]] = field(default_factory=list)
handlers: Dict[str, ToolHandler] = field(default_factory=dict)
module_path: str = ""The manager performs a "lightweight scan" that reads only the front‑matter, keeping memory usage minimal.
class SkillManager:
def scan_skills(self) -> None:
"""Lightweight scan: only read directory structure and front‑matter"""
for item in self._skills_dir.iterdir():
if not item.is_dir() or item.name.startswith("_"):
continue
description = self._read_frontmatter_description(item / "skill.md")
self._skills[item.name] = SkillInfo(name=item.name, description=description)When the LLM decides a skill is needed, it calls the meta‑tool load_skill, which triggers activate_skill to read the full skill.md and dynamically import the corresponding execute.py module.
def activate_skill(self, skill_name: str) -> Tuple[bool, str, List[Dict[str, Any]]]:
skill = self._skills.get(skill_name)
if skill.is_loaded:
return True, skill.content, skill.tools
md_path = self._skills_dir / skill_name / "skill.md"
skill.content = md_path.read_text(encoding="utf-8")
module_name = f"app.skills.{skill_name}.execute"
module = importlib.import_module(module_name)
skill.tools = getattr(module, "TOOLS", [])
skill.handlers = getattr(module, "HANDLERS", {})
skill.is_loaded = True
for name, handler in skill.handlers.items():
self._active_handlers[name] = handler
return True, skill.content, skill.toolsThe meta‑tool returns the loaded manual and newly available tool names so the LLM can continue its reasoning.
async def _handle_load_skill(self, args: Dict[str, Any], context: Dict[str, Any]) -> Dict[str, Any]:
skill_name = args.get("skill_name")
success, content, tools = self.activate_skill(skill_name)
if success:
tool_names = [t["name"] for t in tools]
return {"ok": True, "message": f"Skill '{skill_name}' loaded.", "manual": content, "new_tools": tool_names}
return {"ok": False, "error": content}Example Skill: link_ingest
This skill extracts content from a URL, saves it to the knowledge base, and registers a tool save_link_knowledge:
# app/skills/link_ingest/execute.py
TOOLS = [{
"name": "save_link_knowledge",
"description": "Save link content to knowledge base",
"parameters": {
"type": "object",
"properties": {"url": {"type": "string"}, "category": {"type": "string"}},
"required": ["url"]
}
}]
async def save_link_knowledge(args: Dict[str, Any], context: Dict[str, Any]) -> Dict[str, Any]:
url = args.get("url")
# ... business logic to fetch video, extract subtitles, store ...
return {"ok": True, "id": 123}
HANDLERS = {"save_link_knowledge": save_link_knowledge}Example Skill: knowledge_query
Provides a tool for searching the personal knowledge base:
TOOLS = [{
"name": "search_knowledge",
"description": "Search personal knowledge base for relevant saved content.",
"parameters": {
"type": "object",
"properties": {
"query": {"type": "string"},
"queries": {"type": "array", "items": {"type": "string"}},
"top_k": {"type": "integer", "default": 3}
},
"required": []
}
}]
async def search_knowledge(args: Dict[str, Any], context: Dict[str, Any]) -> Dict[str, Any]:
return {"ok": True, "content": "..."}
HANDLERS = {"search_knowledge": search_knowledge}Best Practices & Lessons Learned
Start with a small, focused skill that solves a concrete problem.
Maintain a balanced granularity: a skill should do one thing but not be so tiny that management becomes a nightmare.
Group skills by business domain; each skill corresponds to a complete user story.
Implement clear error‑handling and logging for each skill.
Version‑manage skills to allow rollback.
Through the Krawl project the author demonstrates that the Skills paradigm turns Claude into an autonomous assistant capable of invoking tools, performing complex workflows, and sharing capabilities across teams.
Sohu Tech Products
A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
