Skip to main content

making-thinkrail-extensions

Use when the user asks you to make, change, rebuild, switch off or remove a ThinkRail extension — agent tools with their own chat cards, settings or skills, added to ThinkRail as a package — or asks why one they made did not load. You write it to a local folder, build it with @thinkrail/extension-sdk and install it yourself by editing extensions.json. Not for plain pi packages, MCP servers, or ThinkRail's own built-in extensions.

v1.0.1New

Unsigned, install at your own risk

Unverified

This skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install thinkrail-making-thinkrail-extensions
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/thinkrail-making-thinkrail-extensions/SKILL.md

Setup guide →
0Save

Instructions

Making ThinkRail extensions

A ThinkRail extension is an npm-style package with a thinkrail manifest. Its server half gives the
agent tools (pi registerTool), boolean settings, interactive tools and skills; its web half draws a
card in chat for a tool call. Either half may be missing: a web-only extension can give cards to tools
that come from elsewhere (a pi package, an MCP server). It cannot add panels, commands, menus,
non-boolean settings or translations — say so instead of faking them.

The user asked you to write it and install it: do both, without asking for a confirmation click.

Is it an extension at all?

  • Only agent tools or skills, no card wanted → a plain pi package also works (Settings → Extensions & skills →
    Install package). Make an extension when they want a card, a setting with a toggle, or ask for one.
  • Wrapping an external service that already has an MCP server → configure the MCP server instead (the
    managing-mcp-servers skill). An MCP server is not an extension.
  • Changing ThinkRail's own code or its built-in extensions → ordinary repository work, not this skill.

Steps

1. Find the host and check the tools

node --version   # needs >= 22.19
npm --version
node <this skill's directory>/scripts/extensions.mjs where

where prints the data dir ($THINKRAIL_DATA_DIR, which ThinkRail gives every agent shell; otherwise
~/.thinkrail), the paths of extensions.json and status.json, api — the extension API this
ThinkRail loads (for example "1.0") — and hostReported, when the host last wrote its status. If both
are null, ThinkRail is older than this skill or not running: use "1.0" and verify in Settings →
Extensions.

2. Check that the SDK can be installed

npm view "@thinkrail/extension-sdk@~<api>.0" version

A version printed → go on. A network error → tell the user npm is unreachable. An E404 or no output →
the SDK is not on npm yet (it is published with the first ThinkRail release that supports extensions)
or not for this API:

  • the user has pointed you at a ThinkRail source checkout → pack the SDK there
    (reference/troubleshooting.md § SDK from a checkout) and go on;
  • otherwise stop before writing files and tell the user: "Making extensions needs the
    @thinkrail/extension-sdk package, which isn't published on npm yet for this version of ThinkRail.
    Once it is, ask me again — or, if you have a ThinkRail source checkout, tell me where it is and I'll
    build the SDK from it."

3. Choose the folder and names

  • Folder: ~/thinkrail-extensions/<slug>/ unless the user names one. Never inside the current
    workspace, a chat folder or the data dir: ThinkRail deletes worktrees and owns
    <data dir>/extensions/, and the folder is the user's source code.
  • Package name thinkrail-ext-<slug> (lowercase, npm rules). It is the extension's identity — the key
    of its on/off switch and settings — so do not rename it later.
  • Style prefix: the slug's letters only (word-count → wordcount), lowercase a–z.
  • Tool names: snake_case, specific to the extension (dice_roll, not roll). A name that a built-in
    tool or an earlier extension already registers stays theirs, so never reuse a name from your own tool
    list (read, bash, edit, write, …).

4. Write the package

<folder>/
  package.json        the manifest
  .npmrc              omit=peer
  server/index.ts     server half (TypeScript, loaded as source)
  web/index.tsx       web half entry (bundled by the build)
  dist/web.js         written by the build
  dist/web.css        written by the build

Start from the complete, working example in reference/example.md and change it. Details:
reference/server-half.md and reference/web-half.md. Leave out a half you do not need, together
with its manifest keys (no web half → no web, styles, scripts.build).

The thinkrail manifest — the host rejects the extension unless:

  • name is a valid npm name and not a built-in's; the server descriptor's name is exactly it;
  • api is "major.minor" equal to api from step 1 (the SDK build accepts only its own API; the host
    refuses another major or a newer minor);
  • at least one of server / web; styles only together with web;
  • paths are relative, inside the package, no .., no backslash: server ends in .ts/.mts/.cts/
    .js/.mjs/.cjs, web in .js/.mjs, styles in .css;
  • title / image, if present, are non-empty strings;
  • @earendil-works/* and typebox are peerDependencies, never dependencies (ThinkRail provides
    its own; the build fails otherwise). Put @thinkrail/extension-sdk in devDependencies and use
    type-only SDK imports in the server half (export default { … } satisfies ServerExtension).

5. Build and check

cd <folder>
npm install --omit=peer            # SDK from a checkout: npm install --save-dev --omit=peer <tarball>
npm run build                      # = thinkrail-extension build --prefix <prefix>

--omit=peer keeps ThinkRail's own pi and typebox out of the folder (it provides them). A server-only
extension has no web build; its SDK types are only needed during development. For a web half, check
before installing that the build exited 0 and dist/web.js and dist/web.css exist. Build errors — an import of a package you forgot to install among them —
name the file and the rule (reference/web-half.md § Build errors). The build does not type-check,
and the host loads the server half by stripping types: type errors do not stop it, runtime errors do —
step 7 shows them.

6. Install

node <this skill's directory>/scripts/extensions.mjs add <folder>

It adds the absolute folder path to <data dir>/extensions.json (creating { "extensions": [] } if
missing, keeping every other entry and key, writing atomically; it refuses to touch a file that is not
valid JSON), waits for the host to read it and prints the extension's status entry. Without node,
edit the file the same way by hand: parse it, append the path, write a temporary file and rename it over —
never leave invalid JSON, because the host then ignores the whole file and refuses to rewrite it.

The host watches the file, loads the folder in place and lists it in Settings → Extensions & skills. Open chats
get the new tools when their current turn ends — your own chat included, so the tool is not callable
in this turn. Do not try to call it now.

7. Read the outcome

The printed entry comes from <data dir>/extensions/status.json, which the host rewrites after every
change: { api, updatedAt, fileError?, extensions: [{ source, name, version, state, error?, tools?, shadowed? }] }.

  • loaded and tools lists your tool names → done. A loaded server half with a tool missing from
    tools threw or skipped registerTool in its factory — fix it. A name in shadowed is one ThinkRail
    already owns: its own tool wins and yours never runs — rename it.
  • failed, incompatible, or a top-level fileError → reference/troubleshooting.md, fix, rebuild and
    run reload. Do not hand the user a broken extension.

8. Tell the user

  • what you installed (title, tools, card, settings) and the folder path;
  • that it runs code on their machine and in the app, like any installed extension;
  • that it is in Settings → Extensions & skills, where they can switch it off, change its settings or remove
    it;
  • that the tools reach a chat from its next turn;
  • to share it later, they can publish it to npm: https://thinkrail.ai/docs/build-an-extension/.

Change, switch off, remove

  • After editing: rebuild if the web half changed, then
    node <this skill's directory>/scripts/extensions.mjs reload <folder>. The host reloads a folder only
    when package.json or a manifest file (server entry, web, styles) changed; reload touches
    package.json, so edits to the entry and the TypeScript files it imports are picked up too. After
    changing a dependency or a plain-JavaScript file the entry imports, ask the user to restart ThinkRail:
    the host keeps its first copy of such a module. Open chats see it after their turn.
  • Switch off: the user's switch in Settings → Extensions & skills; there is no file for it. If a loaded
    extension's tools are missing, check whether it is switched off there.
  • Uninstall: node <this skill's directory>/scripts/extensions.mjs remove <folder> (or the
    Remove button). The folder stays — it is the user's; delete it only if they ask.
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
librarianResearch open-source libraries with evidence-backed answers and GitHub permalinks. Use when the user asks about library internals, needs implementation details with source code references, wants to understand why something was changed, or needs authoritative answers backed by actual code. Excels at navigating large open-source repos and providing citations to exact lines of code.2 installsasking-user-questionsUse when composing an ask_user_question round inside a workflow, or when a workflow skill names it at a question step. Shared norms for the tool — not a workflow, nothing to execute.2 installsstarting-a-new-projectUse when the workspace is empty, has no code, and the user brings a raw project idea. Normally reached via setting-up-a-project; not for an existing project.2 installswriting-workflow-skillsUse when adding a new workflow skill to pi-thinkrail-workflow, changing an existing workflow skill's role, trigger, handoff, or structure, or checking a workflow skill against the workflow system's rules. Not for authoring general-purpose skills outside this package.2 installswriting-specsUse when a workflow step drafts or revises a spec artifact — a goal-and-requirements, an architecture, or a module SPEC — or when a workflow skill names it at such a step. The shared quality bar for specs — not a workflow, nothing to execute.2 installsimporting-a-codebaseUse when asked to create the initial spec graph for an existing codebase that has source code but no specs. Normally reached via setting-up-a-project.2 installs

More from thinkrail

View source →

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.635 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.535 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.346 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.246 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.173 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions145 installs

Frequently asked questions about making-thinkrail-extensions

What does the making-thinkrail-extensions skill do?

Use when the user asks you to make, change, rebuild, switch off or remove a ThinkRail extension — agent tools with their own chat cards, settings or skills, added to ThinkRail as a package — or asks why one they made did not load. You write it to a local folder, build it with @thinkrail/extension-sdk and install it yourself by editing extensions.json. Not for plain pi packages, MCP servers, or ThinkRail's own built-in extensions. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the making-thinkrail-extensions skill?

Run `npx @skills-hub-ai/cli install thinkrail-making-thinkrail-extensions` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/thinkrail-making-thinkrail-extensions/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does making-thinkrail-extensions work with?

making-thinkrail-extensions runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the making-thinkrail-extensions skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use making-thinkrail-extensions after installing it?

In Claude Code, type `/thinkrail-making-thinkrail-extensions` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the making-thinkrail-extensions skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.