PKU harness
Build a plugin

Write a plugin with the AI

Ask the assistant in the app to write a PLUGIN.md plugin with you. It reads the language reference, validates the draft, tries read-only tools against the live service, and opens the usual review sheet, where you decide whether to install.

A plugin document is plain text, so the AI assistant in the app can write one with you. For example, you can ask for "a plugin for the gym booking site". The result is a PLUGIN.md folder that you review and then install, or discard.

You need only the app and a configured AI model. No computer is required, although you will want one later if you publish the plugin.

The assistant does this work through the tools of a built-in plugin called Plugins (id plugins). None of these tools can install anything without your confirmation.

The tools

The assistant uses five tools. The first four only read, and the last one opens a sheet for you.

plugins.reference (read) returns the whole plugin language on one page: the manifest, steps, expressions, the standard library, host abilities, limits and an example. The assistant reads it when it is about to write or edit a plugin. It is not part of every prompt, so it takes up no space in other conversations.

plugins.validate (read) checks a draft folder with the same loader the app uses. The draft is passed as { files: { "PLUGIN.md": "…", "tools/x.yaml": "…" } }. The tool returns { ok: true, id, version, tools, widgets, campus, network, abilities } when the draft is valid. Otherwise it returns { ok: false, issues }, and each issue names the file and step where the problem is.

plugins.tryTool (read) runs one read tool of a draft for real, without installing the draft. It sends live requests, uses your campus sessions for the services the draft declares, and gives the tool a throwaway store. Tools with the write, money or public effect can't be tried this way. The results are treated as untrusted data.

plugins.source (read) returns the files of an installed plugin document, so the assistant can explain, fix or copy it. Built-in TypeScript plugins have no document, so this tool doesn't work for them.

plugins.install (write) opens the app's review sheet for a link (a GitHub folder or a PLUGIN.md URL) or for a draft ({ files }). It only opens the sheet. You make the decision there.

The Plugins plugin asks before it runs write tools by default. Unless you have changed that mode, the assistant therefore also checks with you before it opens the sheet.

How a plugin is written

Describe what you want

Say what the plugin should do. If you know which page or API it should use, say that too. If it is a campus service, mention it: the plugin will call the service with your signed-in session and will never see your password.

The assistant drafts and validates

These tools are not offered when a chat starts: the assistant first loads the authoring tools of the plugins plugin with plugins.use. Then it reads plugins.reference, writes PLUGIN.md and the tool files. It calls plugins.validate after each change and keeps fixing the draft until no issues are left.

It tries the read tools

plugins.tryTool runs a read tool against the real service. You see actual results before anything is installed, which tells you whether the plugin really works.

You review and install

plugins.install opens the same review sheet you see for an install link. It shows whether the plugin is official or community; the campus services, websites and app features it can reach; and every tool with its effect. A draft written in chat counts as a community plugin. Nothing is installed until you tap Install.

Changing an installed plugin

To change an installed plugin document, ask the assistant to fix or extend it. It reads the files with plugins.source, edits them, validates the result, and opens the review sheet again with the new version.

If you paste a plugin link in the chat, the assistant opens the review sheet for it with plugins.install { link }.

Share what you made

The assistant's draft is an ordinary plugin folder. To share it, or to let it update from a link, put the folder in a public GitHub repository. The folder's URL becomes its install link (see Your first plugin). Before you publish, run the author CLI on a computer and add recorded tests.

Safety

  • The assistant never installs anything by itself. plugins.install only opens the review sheet.
  • plugins.tryTool runs only read tools, reaches only what the draft declares, and keeps nothing.
  • An installed draft follows the same rules as any community plugin. Its write, money and public tools ask first, and its results reach the AI as data, never as instructions.

The language itself is covered in Declarative plugins. Permissions explains how the permission modes work.

On this page