new-boost-module

Create new Harbor Boost modules — the Python plugins that run inside Harbor's LLM proxy. Use this skill whenever the user wants to build a Boost module, write a custom module for Harbor Boost, add a new feature to the Boost proxy pipeline, or create any kind of middleware that transforms, augments, or intercepts LLM chat completions in Harbor. Also triggers when the user mentions "boost module", "boost plugin", "custom module for boost", or wants to add prompt engineering, reasoning chains, or output transforms to Harbor's proxy layer.

2,773 stars
byav

Best use case

new-boost-module is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create new Harbor Boost modules — the Python plugins that run inside Harbor's LLM proxy. Use this skill whenever the user wants to build a Boost module, write a custom module for Harbor Boost, add a new feature to the Boost proxy pipeline, or create any kind of middleware that transforms, augments, or intercepts LLM chat completions in Harbor. Also triggers when the user mentions "boost module", "boost plugin", "custom module for boost", or wants to add prompt engineering, reasoning chains, or output transforms to Harbor's proxy layer.

Teams using new-boost-module should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/new-boost-module/SKILL.md --create-dirs "https://raw.githubusercontent.com/av/harbor/main/.agents/skills/new-boost-module/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/new-boost-module/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How new-boost-module Compares

Feature / Agentnew-boost-moduleStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create new Harbor Boost modules — the Python plugins that run inside Harbor's LLM proxy. Use this skill whenever the user wants to build a Boost module, write a custom module for Harbor Boost, add a new feature to the Boost proxy pipeline, or create any kind of middleware that transforms, augments, or intercepts LLM chat completions in Harbor. Also triggers when the user mentions "boost module", "boost plugin", "custom module for boost", or wants to add prompt engineering, reasoning chains, or output transforms to Harbor's proxy layer.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Creating Harbor Boost Modules

Harbor Boost is an optimizing LLM proxy with an OpenAI-compatible API. Modules are Python
files that hook into the completion pipeline — they can rewrite prompts, inject system messages,
chain multiple LLM calls, stream artifacts, or replace the completion entirely.

A module is activated by prefixing a model name with the module's `ID_PREFIX`. For example,
a module with `ID_PREFIX = "mymod"` is invoked via model `mymod-llama3.1`.

## Before You Write Code

1. Read the Custom Modules guide: `docs/5.2.1.-Harbor-Boost-Custom-Modules.md`
2. Scan existing modules in `services/boost/src/modules/` to find similar functionality
   you can reuse or learn from. There are 17+ built-in modules covering reasoning chains,
   prompt rewriting, structured output, artifacts, and more.
3. Read the Built-in Modules reference: `docs/5.2.3-Harbor-Boost-Modules.md`

Understanding the available primitives (`chat`, `llm`, `config`, `selection`, `log`) saves
you from reinventing patterns that already exist.

## Module Structure

Every module is a single `.py` file with two required exports:

```python
ID_PREFIX = 'my_module'

async def apply(chat: 'Chat', llm: 'LLM'):
    # Module logic here
    pass
```

### Required Exports

| Export | Type | Purpose |
|--------|------|---------|
| `ID_PREFIX` | `str` | Unique identifier. Becomes the model prefix (e.g., `mymod-llama3.1`). Use lowercase, short, memorable names. |
| `apply` | `async def(chat, llm)` | Entry point called for every matching completion request. |

### Recommended Exports

| Export | Type | Purpose |
|--------|------|---------|
| `DOCS` | `str` | Markdown documentation shown in the Boost modules reference. Include a description, parameters, and usage examples. |
| `logger` | Logger | Created via `log.setup_logger(ID_PREFIX)` for consistent, filterable logging. |

## Core Primitives

### `chat` — The Conversation

`Chat` is a linked list of `ChatNode` objects. The `tail` is the most recent message.

```python
chat.tail.content      # last message text
chat.text()            # full conversation as plain text
chat.history()         # list of dicts from tail upward
chat.user("...")       # append a user message
chat.assistant("...")  # append an assistant message

# Insert a system message before the first message
chat.tail.ancestor().add_parent(
    ch.ChatNode(role="system", content="You are helpful.")
)

# Create a fresh chat for a side-conversation
side = ch.Chat.from_conversation([
    {"role": "user", "content": "Summarize this."}
])
```

### `llm` — The Downstream Model

`llm` talks to the actual LLM backend configured in Boost.

**Output to the client (streamed in real time):**
```python
await llm.emit_message("text")           # raw text chunk
await llm.emit_status("Working...")       # status indicator
await llm.emit_artifact("<html>...</html>")  # Open WebUI artifact
```

**Internal completions (not streamed, returned to you):**
```python
result = await llm.chat_completion(prompt="...", resolve=True)
result = await llm.chat_completion(messages=[...], resolve=True)
result = await llm.chat_completion(chat=some_chat, resolve=True)
# With structured output
result = await llm.chat_completion(prompt="...", schema=MyModel, resolve=True)
```

**Streamed completions (sent to client AND returned):**
```python
text = await llm.stream_chat_completion(prompt="...")
text = await llm.stream_chat_completion(messages=[...])
```

**Final completion (always reaches the client, even with intermediate output disabled):**
```python
await llm.stream_final_completion()                    # from current chat
await llm.stream_final_completion(prompt="Custom prompt")
```

**Boost parameters** — clients can pass `@boost_*` params in the request body:
```python
llm.boost_params  # dict of params without the @boost_ prefix
```

### `config` — Service Configuration

For configurable modules, define config entries in `services/boost/src/config.py` using
the same pattern as existing modules. Config keys follow the `HARBOR_BOOST_<MODULE>_<PARAM>`
convention and are exposed via `harbor boost <module> <param>` CLI.

### `selection` — Message Selection

For modules that operate on specific messages rather than the whole chat, use the selection
module. It provides strategy-based filtering (`all`, `first`, `last`, `match`, etc.) — see
`klmbr`, `eli5`, or `rcn` modules for usage patterns.

## Writing Good DOCS

The `DOCS` string is the user-facing documentation. It should include:

1. A brief description of what the module does and why it's useful
2. Parameter descriptions if the module is configurable
3. Usage examples showing `harbor boost` CLI commands and/or standalone Docker usage

Format example:
```python
DOCS = """
Explains complex questions simply before answering them, improving accuracy
on nuanced prompts.

**Parameters**

- `strat` - message selection strategy. Default: `match`
- `strat_params` - selection filter. Default: matches last user message

```bash
harbor boost modules add eli5
harbor boost eli5 strat match
harbor boost eli5 strat_params role=user,index=-1
```

**Standalone**

```bash
docker run \\
  -e "HARBOR_BOOST_MODULES=eli5" \\
  -e "HARBOR_BOOST_OPENAI_URLS=http://172.17.0.1:11434/v1" \\
  -p 34131:8000 \\
  ghcr.io/av/harbor-boost:latest
```
"""
```

## Common Patterns

**Prompt injection** — add context before the final completion:
```python
async def apply(chat, llm):
    chat.tail.add_parent(ch.ChatNode(role="system", content="Extra context"))
    await llm.stream_final_completion()
```

**Multi-step reasoning** — chain internal completions, then produce a final answer:
```python
async def apply(chat, llm):
    await llm.emit_status("Analyzing...")
    analysis = await llm.chat_completion(prompt="Analyze: {q}", q=chat.tail.content, resolve=True)
    await llm.stream_final_completion(prompt="Given analysis:\n{analysis}\n\nAnswer: {q}",
                                       analysis=analysis, q=chat.tail.content)
```

**Pass-through with side effects** — do something extra while preserving normal behavior:
```python
async def apply(chat, llm):
    logger.info(f"Processing: {chat.tail.content[:50]}")
    await llm.stream_final_completion()
```

## Checklist

Before considering the module done:

- [ ] `ID_PREFIX` is unique, lowercase, and concise
- [ ] `DOCS` export explains functionality, parameters, and includes usage examples
- [ ] `logger = log.setup_logger(ID_PREFIX)` is defined
- [ ] `async def apply(chat, llm)` is the entry point
- [ ] Module file is placed in `services/boost/src/modules/` (built-in) or `boost/src/custom_modules/` (custom)
- [ ] If configurable, config entries added to `services/boost/src/config.py`
- [ ] Documentation in `docs/5.2.3-Harbor-Boost-Modules.md` is updated

Related Skills

run-llms

2773
from av/harbor

Comprehensive guide for setting up and running local LLMs using Harbor. Use when user wants to run LLMs locally, set up or troubleshoot Ollama, Open WebUI, llama.cpp, vLLM, SearXNG, Open Terminal, or similar local AI services. Covers full setup from Docker prerequisites through running models, per-service configuration, VRAM optimization, GPU troubleshooting, web search integration, code execution, profiles, tunnels, and advanced features. Includes decision trees for autonomous agent workflows and step-by-step troubleshooting playbooks.

```skill

2773
from av/harbor

---

skill-creator

2773
from av/harbor

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

release

2773
from av/harbor

Perform Harbor release procedures — version bumping, codegen, committing, pushing, and drafting GitHub releases. Use this skill when the user wants to release a new version of Harbor, bump the version number, create a release on GitHub, run the release codegen pipeline, or anything related to shipping a new Harbor version. Triggers on phrases like "release Harbor", "bump version", "new release", "ship a new version", or "prepare a release".

new-service

2773
from av/harbor

Add a new service to Harbor — scaffold the compose config, environment variables, metadata, documentation, and cross-service integrations. Use this skill whenever the user wants to add a new service to Harbor, integrate a new tool/app/model server, create a compose configuration for a new project, or onboard any software into the Harbor ecosystem. Triggers on phrases like "add X to Harbor", "new service", "integrate Y", "onboard Z", "create a service for", or when the user provides a GitHub repo link and expects it to become a Harbor service. Even if the user just says a project name and implies they want it in Harbor, this skill applies.

Enterprise Submodule Setup

38786
from novuhq/novu

Use this skill when making changes to the enterprise submodule (`.source/`) or enterprise packages (`enterprise/packages/*`), or when the enterprise submodule needs to be initialized/updated.

terraform-module-library

31392
from sickn33/antigravity-awesome-skills

Production-ready Terraform module patterns for AWS, Azure, and GCP infrastructure.

terraform-aws-modules

31392
from sickn33/antigravity-awesome-skills

Terraform module creation for AWS — reusable modules, state management, and HCL best practices. Use when building or reviewing Terraform AWS infrastructure.

odoo-module-developer

31392
from sickn33/antigravity-awesome-skills

Expert guide for creating custom Odoo modules. Covers __manifest__.py, model inheritance, ORM patterns, and module structure best practices.

update-avm-modules-in-bicep

28865
from github/awesome-copilot

Update Azure Verified Modules (AVM) to latest versions in Bicep files.

boost-prompt

28865
from github/awesome-copilot

Interactive prompt refinement workflow: interrogates scope, deliverables, constraints; copies final markdown to clipboard; never writes code. Requires the Joyride extension.

performing-hardware-security-module-integration

4032
from mukul975/Anthropic-Cybersecurity-Skills

Integrate Hardware Security Modules (HSMs) using PKCS#11 interface for cryptographic key management, signing operations, and secure key storage with python-pkcs11, AWS CloudHSM, and YubiHSM2.