boost-modules skill
Create custom Python modules to intercept, transform, or augment LLM chat completions through an optimizing proxy.
- GitHub stars
- 28
- Files
- 2
- Last commit
- Nov 11, 2026
- License
- MIT
- Allowed tools
- —
What does the boost-modules skill do?
boost-modules creates custom Python modules to intercept, transform, or augment LLM chat completions through an optimizing proxy.
Summary generated from the skill's SKILL.md.
About the boost-modules skill
Developers building custom middleware for LLM proxies can use this skill to create Python modules that intercept and transform chat completions. It is designed for those working with Harbor Boost to implement specific behaviors like reasoning chains, prompt injection, or structured outputs. By defining a module with a specific ID_PREFIX, an agent can trigger custom logic that modifies how a model responds to a user.
When an agent loads this skill, it provides the tools to manipulate conversation history through a linked list of ChatNodes. Users can emit status indicators, stream text, or generate artifacts for compatible clients. The skill relies on the Harbor Boost environment, which can be deployed via Docker, to execute these Python files. It allows for complex workflows such as fetching URL content to augment a prompt or forcing a model to follow a specific persona through system message injection.
What an agent can do with it
- 1Augmenting prompts with web dataExtract URLs from a user message and fetch their content to include in the LLM prompt.
- 2Generating structured responsesEnsure the model output adheres to a specific Pydantic schema for reliable data parsing.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the boost-modules skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the boost-modules skill in Claude Code
~/.claude/skills/boost-modules/SKILL.md
$ npx degit av/skills/boost-modules ~/.claude/skills/boost-modulesInstall the boost-modules skill in Claude Code (project)
.claude/skills/boost-modules/SKILL.md
$ npx degit av/skills/boost-modules .claude/skills/boost-modulesInstall the boost-modules skill in Codex
~/.agents/skills/boost-modules/SKILL.md
$ npx degit av/skills/boost-modules ~/.agents/skills/boost-modulesInstall the boost-modules skill in Gemini CLI
~/.gemini/skills/boost-modules/SKILL.md
$ npx degit av/skills/boost-modules ~/.gemini/skills/boost-modulesInstall the boost-modules skill in Claude.ai
npx degit av/skills/boost-modules boost-modules && zip -r boost-modules.zip boost-modules # claude.ai → Customize → Skills → + → Create skill → Upload a skill → boost-modules.zip
SKILL.md
View on GitHubHarbor Boost Custom Modules
Boost modules are Python files that intercept chat completions and can transform, augment, or replace LLM responses.
Module Structure
ID_PREFIX = 'mymodule' # Models prefixed with this trigger the module
async def apply(chat, llm):
# chat: conversation history (linked list of ChatNodes)
# llm: interface to downstream LLM and output streaming
await llm.stream_final_completion()
Quick Reference
Output Methods
# Stream text to client
await llm.emit_message("Hello")
# Status indicator (formatted per HARBOR_BOOST_STATUS_STYLE)
await llm.emit_status("Processing...")
# Internal completion (not streamed to client)
result = await llm.chat_completion(prompt="Summarize: {text}", text=content, resolve=True)
# Streamed completion (visible to client)
await llm.stream_chat_completion(prompt="Explain {topic}", topic="quantum")
# Final completion (always streamed, even when intermediate output disabled)
await llm.stream_final_completion()
await llm.stream_final_completion(prompt="Reply to: {msg}", msg=chat.tail.content)
# Structured output
from pydantic import BaseModel, Field
class Response(BaseModel):
answer: str = Field(description="The answer")
result = await llm.chat_completion(prompt="...", schema=Response, resolve=True)
# Artifacts (for clients like Open WebUI)
await llm.emit_artifact("<h1>Interactive content</h1>")
Chat Manipulation
# Read conversation
chat.text() # Full conversation as string
chat.message # Last user message content
chat.tail # Last ChatNode
chat.tail.content # Content of last message
chat.tail.role # Role of last message
chat.history() # List of messages from tail
chat.plain() # List of ChatNodes from tail
# Add messages
chat.user("New user message")
chat.assistant("New assistant message")
chat.add_message(role="system", content="Custom instruction")
# Navigate/modify tree
chat.tail.parent # Parent node
chat.tail.parents() # All ancestors
chat.tail.ancestor() # Root node
chat.tail.add_child(ChatNode(role="user", content="..."))
chat.tail.add_parent(ChatNode(role="system", content="..."))
# Create new chat
import chat as ch
new_chat = ch.Chat.from_conversation([
{"role": "user", "content": "Hello"}
])
Request Parameters
Custom params prefixed with @boost_ in the request body:
# Request: {"model": "mymodule-gpt4", "@boost_mode": "verbose"}
async def apply(chat, llm):
mode = llm.boost_params.get("mode") # "verbose"
Standalone Docker Setup
docker run \
-e "HARBOR_BOOST_OPENAI_URLS=http://172.17.0.1:11434/v1" \
-e "HARBOR_BOOST_OPENAI_KEYS=sk-ollama" \
-e "HARBOR_BOOST_MODULES=mymodule" \
-e "HARBOR_BOOST_BASE_MODELS=true" \
-v /path/to/modules:/app/custom_modules \
-p 8000:8000 \
ghcr.io/av/harbor-boost:latest
Key environment variables:
HARBOR_BOOST_OPENAI_URLS/HARBOR_BOOST_OPENAI_KEYS: Semicolon-separated backend URLs and keys (index-matched)HARBOR_BOOST_MODULES: Semicolon-separated list of enabled modules (orall)HARBOR_BOOST_BASE_MODELS: Settrueto also serve unmodified modelsHARBOR_BOOST_API_KEY: Protect the boost API with a keyHARBOR_BOOST_INTERMEDIATE_OUTPUT: Show reasoning/status (default: true)
Example Modules
Echo (Minimal)
ID_PREFIX = 'echo'
async def apply(chat, llm):
await llm.emit_message(chat.message)
System Prompt Injection
import chat as ch
ID_PREFIX = 'pirate'
async def apply(chat, llm):
chat.tail.ancestor().add_child(
ch.ChatNode(role='system', content='Respond as a pirate.')
)
await llm.stream_final_completion()
Chain of Thought
ID_PREFIX = 'cot'
async def apply(chat, llm):
await llm.emit_status("Thinking...")
reasoning = await llm.chat_completion(
prompt="Think step by step about: {q}\nProvide reasoning only.",
q=chat.message,
resolve=True
)
await llm.emit_message(f"**Reasoning:**\n{reasoning}\n\n**Answer:**\n")
await llm.stream_final_completion(
prompt="Given this reasoning:\n{reasoning}\n\nProvide a final answer to: {q}",
reasoning=reasoning,
q=chat.message
)
URL Reader
import re
import requests
ID_PREFIX = "readurl"
url_regex = r"https?://[^\s]+"
async def apply(chat, llm):
urls = re.findall(url_regex, chat.message)
if not urls:
return await llm.stream_final_completion()
content = ""
for url in urls:
await llm.emit_status(f"Fetching {url}...")
content += requests.get(url).text[:5000]
await llm.stream_final_completion(
prompt="<content>\n{content}\n</content>\n\nUser request: {request}",
content=content,
request=chat.message
)
Development Workflow
- Create module file in mounted
custom_modules/directory - Restart container on first load (hot reload works after)
- Test via API:
curl http://localhost:8000/v1/models # Verify module appears curl -X POST http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model":"mymodule-llama3","messages":[{"role":"user","content":"test"}]}' - Check logs for debug output:
docker logs -f <container>
Debugging
import log
logger = log.setup_logger('mymodule')
async def apply(chat, llm):
logger.debug(f"Input: {chat.message}")
logger.info("Processing started")
Logs appear in container stdout. Set DEBUG log level for verbose output.
Files in this skill
2boost-modules skill questions
How do I install the boost-modules skill in Claude Code?
Run npx degit av/skills/boost-modules ~/.claude/skills/boost-modules. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the boost-modules skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How do I trigger a custom Boost module?
Modules are triggered by an ID_PREFIX defined in the Python file; models prefixed with this ID will activate the module.
Can I use structured outputs in my modules?
Yes, you can use Pydantic models with the chat_completion method to ensure structured responses.
How can I pass custom parameters to a module via an API request?
You can pass custom parameters by prefixing them with @boost_ in the request body.
How do I deploy Harbor Boost using Docker?
You can run the Harbor Boost image using docker run, configuring backend URLs, keys, and module paths through environment variables.