Agent skill

Host Pattern

by nukeop in nukeop/nuclear

A skill your agent uses when adding a new domain to Nuclear's plugin system, or implementing a host.

AGPL-3.0Auto-check passed

Install Host Pattern

skills CLI
$ npx skills add nukeop/nuclear --skill host-pattern -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nukeop/nuclear host-pattern --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nukeop/nuclear.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/host-pattern .claude/skills/host-pattern && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
host-pattern
GitHub stars
19k
Token cost
~1.3k tokens
SKILL.md length
264 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
AGPL-3.0

At a glance

A skill your agent uses when adding a new domain to Nuclear's plugin system, or implementing a host.

  • Works in 3 steps: Host type - the contract (SDK, no… → API class - what plugins actually call… → Host implementation - bridges the API to…
  • Adding a new domain to Nuclears plugin system
  • SKILL.md covers Files to create/modify, API class pattern, Connecting to NuclearAPI and Host implementation, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Host Pattern is an agent skill from nukeop/nuclear. Use when adding a new domain to Nuclear's plugin system, or implementing a host. Covers the host pattern (how player functionality is exposed to plugins), the host interface and API class structure, how hosts are implemented in the player, error handling conventions, and what files to create and modify. Trigger phrases include "add a domain", "new domain", "host implementation", "host pattern", "createPluginAPI".

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with Model Context Protocol. The repository describes itself as: Streaming music player that finds free music for you. The licence is AGPL-3.0.

When your agent uses it

  • Adding a new domain to Nuclears plugin system
  • Implementing a host
  • Phrases include add a domain
  • Host implementation

Example prompts

  • “add a domain”
  • “new domain”
  • “host implementation”
  • “/host-pattern”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Host type - the contract (SDK, no implementation)
  2. API class - what plugins actually call (SDK, wraps the host)
  3. Host implementation - bridges the API to player internals (player)

What it can do on your machine

Read from SKILL.md and the folder at commit 27904e9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Host Pattern loads about 1.3k tokens when it runs. Until then it costs about 107 tokens; SKILL.md has 264 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~107
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nukeop/nuclear at commit 27904e9, republished under its AGPL-3.0 licence (© nukeop). 264 words, ~1,327 tokens.

Download SKILL.mdSave it as .claude/skills/host-pattern/SKILL.md (or your agent's skills folder).
name
host-pattern
description
Use when adding a new domain to Nuclear's plugin system, or implementing a host. Covers the host pattern (how player functionality is exposed to plugins), the host interface and API class structure, how hosts are implemented in the player, error handling conventions, and what files to create and modify. Trigger phrases include "add a domain", "new domain", "host implementation", "host pattern", "createPluginAPI".

Host pattern

Every feature area follows the same three-layer structure:

  1. Host type - the contract (SDK, no implementation)
  2. API class - what plugins actually call (SDK, wraps the host)
  3. Host implementation - bridges the API to player internals (player)

Plugins call methods on an API class (e.g. api.Queue.addToQueue()), which holds a reference to the host and delegates to it. Plugins never touch a host directly.

Files to create/modify

SDK (packages/plugin-sdk/)
ActionFileWhat
Createsrc/types/yourDomain.tsYourDomainHost interface + related types
Createsrc/api/yourDomain.tsYourDomainAPI class
Modifysrc/api/index.tsAdd yourDomainHost option + YourDomain field to NuclearAPI
Modifysrc/index.tsExport types and API class
Player (packages/player/)
ActionFileWhat
Createsrc/services/yourDomainHost.tsHost implementation + singleton export
Modifysrc/services/plugins/createPluginAPI.tsPass singleton to NuclearPluginAPI
Modifysrc/services/logger.tsAdd domain to LOG_SCOPES (needed for reportError)

If the domain needs shared model types: create packages/model/src/yourDomain.ts and re-export from packages/model/src/index.ts.

API class pattern

Every API class follows this structure.

typescript
// packages/plugin-sdk/src/api/yourDomain.ts
export class YourDomainAPI {
  #host?: YourDomainHost;

  constructor(host?: YourDomainHost) {
    this.#host = host;
  }

  #withHost<T>(fn: (host: YourDomainHost) => T): T {
    const host = this.#host;
    if (!host) {
      throw new Error('YourDomain host not available');
    }
    return fn(host);
  }

  yourMethod(arg: SomeType) {
    return this.#withHost((host) => host.yourMethod(arg));
  }
}

Reference: packages/plugin-sdk/src/api/queue.ts, packages/plugin-sdk/src/api/dashboard.ts

Connecting to NuclearAPI

typescript
// packages/plugin-sdk/src/api/index.ts
import type { YourDomainHost } from '../types/yourDomain';
import { YourDomainAPI } from './yourDomain';

// Add to class:
readonly YourDomain: YourDomainAPI;

// Add to constructor opts type:
yourDomainHost?: YourDomainHost;

// Add to constructor body:
this.YourDomain = new YourDomainAPI(opts?.yourDomainHost);
typescript
// packages/player/src/services/plugins/createPluginAPI.ts
import { yourDomainHost } from '../../services/yourDomainHost';
// Add to NuclearPluginAPI constructor call:
yourDomainHost,

Host implementation

Hosts bridge the SDK contract to whatever backs the domain. Most commonly a Zustand store:

typescript
// packages/player/src/services/yourDomainHost.ts
import type { YourDomainHost } from '@nuclearplayer/plugin-sdk';
import { useYourDomainStore } from '../stores/yourDomainStore';

export const createYourDomainHost = (): YourDomainHost => ({
  yourMethod: (arg) => useYourDomainStore.getState().doThing(arg),
  getState: () => useYourDomainStore.getState().value,
});

export const yourDomainHost = createYourDomainHost();

A host can also have access to the provider registry (metadata, streaming, dashboard), resolving which registered provider to call. Two patterns:

Single provider (user picks one in Sources):

typescript
const getProvider = (providerId?: string) =>
  providersHost.get<YourProvider>(
    providerId ?? providersHost.getActive('yourkind'), 'yourkind',
  );

export const createYourDomainHost = (): YourDomainHost => ({
  async fetch(query, providerId?) {
    const provider = getProvider(providerId);
    if (!provider) throw new Error('No provider available');
    return provider.fetch(query);
  },
});

Fan-out (aggregate across all providers - dashboard):

typescript
export const createYourDomainHost = (): YourDomainHost => ({
  async fetchAll() {
    const providers = providersHost.list('yourkind') as YourProvider[];
    const results = await Promise.allSettled(providers.map(async (provider) => {
      const items = await provider.fetch();
      return { providerId: provider.id, providerName: provider.name, items };
    }));
    return results.filter(isFulfilled).map((r) => r.value);
  },
});

Reference: packages/player/src/services/metadataHost.ts (single), packages/player/src/services/dashboardHost.ts (fan-out)

Error handling

  • Store-backed hosts: let errors propagate naturally.
  • Provider-backed, single provider (metadata, streaming): throw errors so the user sees failures.
  • Provider-backed, fan-out (dashboard): catch per-provider so one failure doesn't block others. Log via reportError, return partial results.
  • MissingCapabilityError: always a plugin bug. Single-provider domains throw it; fan-out domains log it and skip the offending provider.

© nukeop, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/host-pattern of nukeop/nuclear.

Open the folder on GitHubat commit 27904e9

Compare with similar skills

Host Pattern next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Host Pattern compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Host Pattern this skillnukeop/nuclear19k—~1.3kAutomated safety check: PassAGPL-3.0
Zodjasonjgardner/blockbench-mcp-plugin4883 repos~1.4kAutomated safety check: PassGPL-3.0
Logging Observabilitygetsentry/toolkit917—~2.6kAutomated safety check: PassCustom licence
fp-go Logging PatternsIBM/fp-go2k—~3.7kAutomated safety check: PassApache-2.0
Agent Tool Builderomer-metin/skills-for-antigravity162—~705Automated safety check: PassApache-2.0
AWS Lambda Durable Functionsawslabs/agent-plugins912—~2.3kAutomated safety check: PassApache-2.0

Similar skills

  • Zod

    jasonjgardner/blockbench-mcp-plugin

    Zod schema validation best practices for type safety, parsing, and error handling.

    488 GitHub starsUsed in 3 repos~1.4k tokens
    DevelopmentAuto-check passed
  • Logging Observability

    getsentry/toolkit

    Official

    Review code for correct logging and error handling patterns.

    917 GitHub stars~2.6k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Official

    Adds logging to fp-go functional pipelines with Tap operators, entry and exit logs and error context, so that logging never changes the value or error flowing through.

    2k GitHub stars~3.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Agent Tool Builder

    omer-metin/skills-for-antigravity

    Tools are how AI agents interact with the world. An agent skill from omer-metin/skills-for-antigravity.

    162 GitHub stars~705 tokensUpdated 8 mo ago
    AI & LLM EngineeringAuto-check passed
  • AWS Lambda Durable Functions

    awslabs/agent-plugins

    Official

    Build resilient, long-running, multi-step applications with AWS Lambda durable functions with automatic state persistence, retry logic, and orchestration for long-running executions.

    912 GitHub stars~2.3k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Agent Tool Builder

    davila7/claude-code-templates

    Tools are how AI agents interact with the world. An agent skill from davila7/claude-code-templates.

    32k GitHub starsUsed in 2 repos~417 tokens
    DatabasesAuto-check passed

More from nukeop/nuclear

  • Making Demo Videos

    nukeop/nuclear

    A skill your agent uses when making a demo, tutorial, or feature video of Nuclear.

    19k GitHub stars~892 tokensUpdated yesterday
    Auto-check passed
  • Creating Components

    nukeop/nuclear

    A skill your agent uses when creating new UI components in packages/ui.

    19k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Writing Docs

    nukeop/nuclear

    A skill your agent uses when writing or editing documentation in packages/docs.

    19k GitHub stars~907 tokensUpdated yesterday
    Auto-check passed
  • Writing Plugins

    nukeop/nuclear

    A skill your agent uses when writing, scaffolding, or modifying Nuclear plugins.

    19k GitHub stars~825 tokensUpdated yesterday
    Auto-check passed

Questions about Host Pattern

What does Host Pattern do?

A skill your agent uses when adding a new domain to Nuclear's plugin system, or implementing a host. Host Pattern is an agent skill from nukeop/nuclear. Use when adding a new domain to Nuclear's plugin system, or implementing a host.

When should I use Host Pattern?

Host Pattern fits situations like: adding a new domain to Nuclears plugin system; implementing a host; phrases include add a domain; host implementation.

How do I install Host Pattern in Claude Code?

Run `npx skills add nukeop/nuclear --skill host-pattern -a claude-code`. Or copy the skill folder (.agents/skills/host-pattern in nukeop/nuclear) into .claude/skills/host-pattern in your project. Claude Code loads it when a task matches its description.

How do I install Host Pattern in Codex?

Run `npx skills add nukeop/nuclear --skill host-pattern -a codex`. Or copy the skill folder (.agents/skills/host-pattern in nukeop/nuclear) into .agents/skills/host-pattern in your project. Codex loads it when a task matches its description.

Can I use Host Pattern in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nukeop/nuclear --skill host-pattern -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/host-pattern, .gemini/skills/host-pattern, .github/skills/host-pattern and .opencode/skills/host-pattern in your project.

What does Host Pattern need to run?

SKILL.md names no scripts, command-line tools or credentials: Host Pattern is instructions for the agent only.

Does Host Pattern access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Host Pattern safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Host Pattern use?

Host Pattern is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Host Pattern use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Host Pattern?

Skills that share tags, products or a category with Host Pattern: Zod (jasonjgardner/blockbench-mcp-plugin, 488 stars), Logging Observability (getsentry/toolkit, 917 stars), fp-go Logging Patterns (IBM/fp-go, 2k stars) and Agent Tool Builder (omer-metin/skills-for-antigravity, 162 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Host Pattern?

nukeop (a GitHub user) maintains it in nukeop/nuclear, which has 18,611 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.

Source: nukeop/nuclear on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.