Skillware integrates with Anthropic Claude via the anthropic Python SDK. Catalog snippets and Haiku-oriented examples default to claude-haiku-4-5-20251001; override with ANTHROPIC_MODEL when needed. Sonnet or Opus IDs remain valid for heavier agent loops.
import os
from skillware.core.env import load_env_file
from skillware.core.loader import SkillLoader
import anthropic
load_env_file()
client = anthropic.Anthropic()
skill = SkillLoader.load_skill("finance/wallet_screening")
# Convert to Claude Format
claude_tool = SkillLoader.to_claude_tool(skill)
message = client.messages.create(
model=os.environ.get("ANTHROPIC_MODEL", "claude-haiku-4-5-20251001"),
max_tokens=1024,
system=skill['instructions'], # Directive
tools=[claude_tool], # Interface
messages=[
{"role": "user", "content": "Check wallet 0x123..."}
]
)Claude uses a specific JSON structure for tools:
{
"name": "my_function",
"description": "...",
"input_schema": { ... }
}Skillware's manifest.yaml uses standard JSON Schema for parameters.
SkillLoader.to_claude_tool() maps manifest['parameters'] directly to input_schema, wrapping it in the correct dictionary structure that the Anthropic API expects.
Claude excels at following complex instructions. Pass instructions.md (Directive) directly to the system parameter of messages.create() so the model knows when and how to invoke the skill—not to replace the host agent's persona.
Claude stops generating when it wants to call a tool. You must execute and reply.
if message.stop_reason == "tool_use":
tool_use = next(b for b in message.content if b.type == "tool_use")
# 1. Execute
print(f"Calling {tool_use.name}...")
result = my_skill.execute(tool_use.input)
# 2. Reply with Result
response = client.messages.create(
model=os.environ.get("ANTHROPIC_MODEL", "claude-haiku-4-5-20251001"),
max_tokens=1024,
system=skill['instructions'],
tools=[claude_tool],
messages=[
{"role": "user", "content": "..."},
{"role": "assistant", "content": message.content},
{
"role": "user",
"content": [
{
"type": "tool_result",
"tool_use_id": tool_use.id,
"content": str(result)
}
]
}
]
)Multi-turn loops: After tool results, call the model again without a new user message when the model may chain further tool calls. Only append a user turn when the skill returns needs_input and you need disambiguation from the end user.