Skip to content
Skills Library
AI & agents · Building & coding

moebius-extensions

/moebius-extensions

Write a Pi extension (TypeScript that runs inside the Pi process of a Moebius run) and give it to an agent. Use it when the person wants something a rule, a column script or a plugin cannot do - a new tool or command for the model, logging every tool call, changing what the agent sees - or names a Pi extension.

Repository
Moebius ↗
Licence
Apache-2.0
Last repository change
13.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Write a Pi extension (TypeScript that runs inside the Pi process of a Moebius run) and give it to an agent. Use it when the person wants something a rule, a column script or a plugin cannot do - a new tool or command for the model, logging every tool call, changing what the agent sees - or names a Pi extension.

Original author description

Write a Pi extension (TypeScript that runs inside the Pi process of a Moebius run) and give it to an agent. Use it when the person wants something a rule, a column script or a plugin cannot do - a new tool or command for the model, logging every tool call, changing what the agent sees - or names a Pi extension.

How it works

  1. Look for a package first
  2. Where it goes
  3. The extension API
  4. Example
  5. Try it
  6. What can go wrong
  7. Details
Original SKILL.md headings · 98 lines, 749 words
SKILL.md preview
---
name: moebius-extensions
description: Write a Pi extension (TypeScript that runs inside the Pi process of a Moebius run) and give it to an agent. Use it when the person wants something a rule, a column script or a plugin cannot do - a new tool or command for the model, logging every tool call, changing what the agent sees - or names a Pi extension.
---

# Pi extensions

Goal: one small TypeScript file that does what was asked, loaded only by the agents that should have it, with the
Moebius bridge still last.

## Look for a package first

More than 5,000 packages in the pi.dev catalog already give Pi extensions and skills. Before writing one, search it for
the task and show the person what fits:

- `"$MOEBIUS" ext search <words> --type extension` (or `skill`) lists the packages with their downloads;
  `"$MOEBIUS" ext info npm:<name>` shows what one has, its dependencies and its install scripts, which Moebius never runs.
- `"$MOEBIUS" ext add npm:<name> --agent <agent>` proposes installing it and giving the agent its extensions and skills
  as `pkg:<name>`. The package is fetched and checked against the registry's integrity, vendored into `packages/<name>/`
  of the harness configuration repository and offered as a change in the inbox with its source, version, integrity and
  files. You can propose; you cannot merge it, because an extension is code that runs in every Pi process of the agents
  that name it. Tell the person the change is waiting and what the package does.
- `"$MOEBIUS" ext list` shows what is installed, `"$MOEBIUS" ext update` proposes newer versions with their changelog, and
  `"$MOEBIUS" ext remove <name>` proposes removing one.

Name a package's extensions in an agent as `pkg:<name>` or one of them as `pkg:<name>/<path>`; never copy a package's files
into `extensions/` by hand, and never use `pi install`: a run starts with `--no-extensions` and fetches nothing.

## Where it goes

- In a chat in the harness configuration repository (the usual way): write `extensions/<name>.ts` and add its path to
  `extensions` in `agents/<agent>.toml`. The person merges the change; the agent's next run loads it. To name it from
  outside such a chat: `"$MOEBIUS" agent show <agent> --json`, then `"$MOEBIUS" agent save <agent> ... --extension
  extensions/<name>.ts` with every setting it had (see the `moebius-configure` skill).
- A server without a harness configuration repository: the path goes in `agents.<agent>.extensions` of `moebius.toml`
  (`"$MOEBIUS" settings set`), relative to the file's directory, and needs a restart.

Moebius starts Pi with `--no-extensions`, then `--extension` for each path of the agent in order, then the bridge. The
bridge checks every tool call and result against the rules after your handlers ran, so it sees what they changed;
nothing an extension does gets past it. Never try to load an extension after it or to turn it off.

## The extension API

A file exports a default function that takes the Pi API. `import type` needs nothing installed; Pi runs TypeScript as it
is. The parts used most:

- `pi.on("tool_call", async (event) => ...)`: `event.toolName`, `event.input`, `event.toolCallId`. Return nothing to let
  the call run, or `{ block: true, reason: "..." }` to stop it (a rule is better for forbidding).
- `pi.on("tool_result", async (event) => ...)`: `toolName`, `toolCallId`, `content`, `isError`.
- `pi.registerTool({ name, label, description, parameters, execute })`: a tool the model can call; `parameters` is a
  TypeBox schema (`Type` from `@earendil-works/pi-ai`), `execute(id, params, signal, onUpdate, ctx)` returns
  `{ content: [{ type: "text", text }], details }`.
- `pi.registerCommand(name, { description, handler })`: a `/` command.
- Other events cover input, the agent's start and end, the model request and sessions.

Standard output is Pi's channel to Moebius: never write to it. Use `console.error`, which lands in the run's
`stderr.log`.

## Example

`extensions/log-tool-calls.ts`, which logs every call and result and changes nothing:

```ts
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";

export default function (pi: ExtensionAPI) {
	pi.on("tool_call", async (event) => {
		console.error(`tool_call ${event.toolName} ${event.toolCallId} ${JSON.stringify(event.input)}`);
		return undefined;
	});
	pi.on("tool_result", async (event) => {
		console.error(`tool_result ${event.toolName} ${event.toolCallId} error=${event.isError}`);
		return undefined;
	});
}
```

## Try it

After the change is merged, start a chat with the agent that uses a tool and read its events and log:

```sh
"$MOEBIUS" chat start "List the files in this directory." --agent Coder
"$MOEBIUS" api GET /v1/runs/<id>/events
```

The log is `<data_dir>/runs/<id>/stderr.log` (`data_dir` is in `"$MOEBIUS" settings`). Say what you could not try
before the merge.

## What can go wrong

- Nothing happens: the change is not merged, the agent does not name the file, or (with `moebius.toml`) the server was
  not restarted.
- Events of kind `unparsed`: the extension wrote to standard output.
- Every call is slow: a handler awaits something slow.
- A refusal that starts `Moebius refused this call:` came from the bridge and a rule, not from your handler.

## Details

In the `moebius` skill: `guide/extensions.md`, `reference/bridge-protocol.md` and
`reference/harness-configuration.md`. Pi-Bolt's own `docs/extensions.md` has every event and method.

Versions

The database has no other skills named moebius-extensions.

Database snapshot: 13.11.2026 · package version db69092b16d5 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100moebius-configure
    Change how a Moebius server is set up - an agent (model, instructions, skills, MCP servers, extensions), the rules, a column's script in one repository, a setting of moebius.toml, a skill or an MCP server. Use it whenever the person asks to add, change or remove any of these, or…
  • 95moebius
    Operate and build on Moebius, the orchestration layer that drives coding agents from a repository's issues to changes ready to merge. This is the reference library - the guide and the exact references of every command, route, card field, script function and configuration key.…
  • 100migrating-gemini-extensions
    Convert a Gemini CLI extension into a Claude Code plugin, preserving functionality and backwards compatibility. Use when the user wants to migrate/port a Gemini extension to Claude Code, convert gemini-extension.json to plugin.json, adapt GEMINI.md context or Gemini tools/hooks,…
  • 100authoring-claude-extensions
    Decides which Claude Code extension a need calls for — skill, subagent, hook, or plugin — and then writes it. Use when building or changing any of those four, when Claude should do something automatically or every time, when a workflow keeps getting pasted into chat, or when a…
  • 100godot-moebius-rendering
    Transform editable 3D game projects toward a coherent Moebius-inspired style through global art-direction profiles, category-aware organic model rebuilding, separated color and ink rendering, and contextual scene composition. Use for whole-scene restyling, mechanical…
  • 91extensions
    Report which extensions the connected NeatContext context expects, and whether this machine provides them. Use when the user asks what a context can reach, why an extension tool is missing, or how to connect one here.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.