How to Parse and Use Claude Skills with Go: A Deep Dive into LLM Tool Integration
This article explains the concept of Claude Skills, walks through a Go library that parses skill packages, demonstrates a CLI inspector, shows how to run skills with Deepseek‑v3 via an OpenAI‑compatible API, and outlines future security enhancements.
Claude Skills Overview
Claude introduces Skills as modular folders that contain a SKILL.md manifest, scripts, references and assets. An application loads a Skill only when the current user request matches the Skill, which reduces runtime overhead and enables portable, composable functionality. Skills can embed executable code (e.g., Bash or Python) that is more reliable than pure token‑based generation.
Parsing Skill Packages with goskills
A Skill package is a zip that expands to a directory such as .claude/skills/xxx. The Go library github.com/smallnest/goskills performs the following steps:
Read SKILL.md and extract the YAML front‑matter into a SkillMeta struct.
Capture the remaining markdown description.
Discover resource sub‑directories scripts/, references/ and assets/.
Installation: go get github.com/smallnest/goskills Example usage:
package main
import (
"fmt"
"log"
"github.com/smallnest/goskills"
)
func main() {
// Path to the skill directory you want to parse
skillDirectory := "./examples/skills/artifacts-builder"
skillPackage, err := goskills.ParseSkillPackage(skillDirectory)
if err != nil {
log.Fatalf("Failed to parse skill package: %v", err)
}
fmt.Printf("Successfully Parsed Skill: %s
", skillPackage.Meta.Name)
// ... further processing
}The resulting SkillPackage can be passed to any OpenAI‑compatible LLM for execution.
Inspector CLI
The library also provides a command‑line inspector (inspired by raw391-ai/skill-cli) with the following sub‑commands: list – list all Skills in a directory. parse – show a Skill overview (metadata only). detail – display full Skill information. files – enumerate the files belonging to a Skill. search – search within a Skill.
Build the CLI: go build -o goskills-cli ./cmd/skill-cli Typical usage:
./goskills-cli list ./examples/skills ./goskills-cli parse ./examples/skills/artifacts-builderThese commands demonstrate how the goskills library can be leveraged programmatically.
Deepseek Integration via goskills-runner
The repository also ships a runner CLI that shows how to invoke a Skill through any OpenAI‑compatible API (e.g., Deepseek‑v3).
Build the runner: go build -o goskills-runner ./cmd/skill-runner Set the API key and execute a request:
export OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
./goskills-runner run --model deepseek-v3 \
--api-base https://qianfan.baidubce.com/v2 \
"create an algorithm that generates abstract art"The runner follows a three‑step strategy:
Skill discovery – enumerate all valid Skills in the configured path.
Skill selection – ask the LLM to pick the most appropriate Skill for the user prompt.
Skill execution – invoke the selected Skill, allowing tool calls defined in the Skill (e.g., shell, python, web search).
Key implementation snippets (error handling omitted for brevity):
// --- STEP 1: SKILL DISCOVERY ---
fmt.Println("🔎 Discovering available skills...")
availableSkills, err := discoverSkills(skillsPath)
if err != nil { return fmt.Errorf("failed to discover skills: %w", err) }
if len(availableSkills) == 0 { return errors.New("no valid skills found") }
fmt.Printf("✅ Found %d skills.
", len(availableSkills))
// --- STEP 2: SKILL SELECTION ---
fmt.Println("🧠 Asking LLM to select the best skill...")
selectedSkillName, err := selectSkill(ctx, client, userPrompt, availableSkills)
if err != nil { return fmt.Errorf("failed during skill selection: %w", err) }
selectedSkill, ok := availableSkills[selectedSkillName]
if !ok { fmt.Printf("⚠️ LLM selected a non‑existent skill '%s'. Aborting.
", selectedSkillName); return nil }
fmt.Printf("✅ LLM selected skill: %s
", selectedSkillName)
// --- STEP 3: SKILL EXECUTION (with Tool Calling) ---
fmt.Println("🚀 Executing skill (with potential tool calls)...")
err = executeSkillWithTools(ctx, client, userPrompt, selectedSkill)
if err != nil { return fmt.Errorf("failed during skill execution: %w", err) }The current demo does not include sandboxing, security checks, or advanced error handling; these are planned for future work.
Tool Set
To enable script execution, the library provides the following tools (each exposed as a Go plugin that can be called from a Skill):
file_tool – basic file operations (read, write, list).
knowledge_tool – query a wiki‑style knowledge base.
python_tool – run a Python script and capture stdout.
shell_tool – execute Bash commands.
web_search_tool – perform DuckDuckGo web searches.
The tool collection is intended to grow as more use cases emerge.
References
Claude Skills blog: https://www.claude.com/blog/skills
Official Skill user guide: https://support.claude.com/en/articles/12580051-teach-claude-your-way-of-working-using-skills
Help center article: https://support.claude.com/en/articles/12512176-what-are-skills
API documentation: https://docs.claude.com/en/api/skills-guide
Claude Code Skills docs: https://docs.claude.com/en/docs/claude-code/skills
Anthropic Skills repository: https://github.com/anthropics/skills
Community skill collections: https://github.com/travisvn/awesome-claude-skills, https://github.com/ComposioHQ/awesome-claude-skills, https://github.com/BehiSecc/awesome-claude-skills, https://github.com/K-Dense-AI/claude-scientific-skills
Deep dive analysis: https://leehanchung.github.io/blogs/2025/10/26/claude-skills-deep-dive/
Skill‑CLI reference implementation: https://github.com/raw391-ai/skill-cli
Go library source: https://github.com/smallnest/goskills
BirdNest Tech Talk
Author of the rpcx microservice framework, original book author, and chair of Baidu's Go CMC committee.
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.
