N.E.K.O Plugin
Single entry point for N.E.K.O plugin work: understand the contract, edit,
validate, and self-review before reporting back. "The plugin directory" below
is the folder holding the plugin's plugin.toml; it is the only place you
write.
Hard Constraints
One-line reasons are in the plugin's AGENTS.md; full reasons and the escalation
format in references/execution-boundary.md.
- Do not edit N.E.K.O itself
- Do not import host internals
- Do not call N.E.K.O's local services directly
- Do not use
print - Do not log conversation text, secrets, or tokens
- Do not hard-code paths
- Do not block the event loop
- Do not use
requirements.txt - Do not commit
vendor/, binaries, or files over 2 MiB - Do not use
eval/exec/pickle/shell=True/verify=False
Package Types
plugin: the default. Entries, lifecycle, timers, message handlers, UI,
storage, cross-plugin calls, and ordinary external API/device integrations.
adapter: only for bridging an external protocol or request stream into
N.E.K.O plugin calls. Calling an external service does not make an adapter.
extensionwas removed; see the
CLI
From a N.E.K.O source checkout, uv run neko-plugin <command> <plugin>, where
<plugin> is an id under the checkout's plugin root or a path. Confirm
arguments with --help. A checkout (Route A) is the recommended way to
develop. Without one (desktop build, Route B) no neko-plugin command runs:
tell the user rather than guessing. App buttons (Start/Reload, Logs, Build
package in the Plugin studio) still work; they are not the CLI. To run checks,
ask the user whether to set up a checkout ("Setting Up Route A" in
references/plugin-cli-and-debugging.md) and wait for their consent.
| Command | Use |
|---|---|
| init, setup-repo, create-repo | create a plugin; add repo support files; create its GitHub repo |
| check, check -r | readiness; strict pre-release check (tests, package, hash) |
| lint | the pinned ruff check Market CI runs (# noqa is ignored) |
| sync --clean | rebuild vendor/ from pyproject.toml |
| precheck | lint + sync + check -r, the Market CI gates |
| build, analyze, publish | package; bundle analysis; release |
Validation order: check → lint → sync --clean → precheck.
When the plugin has its own Git repository (outside the checkout's built-in
plugin folder), check -r and precheck fail on uncommitted changes. Do not
commit for the user unasked; report the actual result.
Workflows
Create a Plugin (only when no plugin exists yet)
If the current folder already has a plugin.toml, skip to Modify.
- Read
references/plugin-creation-workflow.md. Offer onlypluginand
adapter as package types.
- Ask only the unresolved minimum: name, purpose, package type, first-version
scope, out of scope. Show the Identity Lock and a short design brief.
- After confirmation, scaffold with
neko-plugin init; never hand-write the
initial directory, plugin.toml, or entry class.
- Add
DESIGN.md, then implement inside the new plugin directory. Read
references/core-plugin-contract.md before changing the manifest,
identity, entries, or UI.
- Validate in the order under CLI.
Modify
- Read
DESIGN.mdif present, thenplugin.toml, the entry class, nearby
files, and tests.
- Check the request against the plugin's purpose and out-of-scope list.
- Make the smallest change inside the plugin directory, then validate.
Debug
- Is the plugin running, stopped, manual-start, crashed, or load-failed?
Read its log first.
- Run
checkunless the symptom clearly points elsewhere. - Match the symptom against
references/runtime-model.md(startup, loops,
timers, reload) and references/plugin-cli-and-debugging.md.
Review
Lead with findings ordered by risk, labelled Boundary, Identity,
Manifest, SDK, UI/Permissions, Runtime/Lifecycle, Validation:
writes stay in the plugin directory; identity fields agree; manifest uses
minimum permissions; only public SDK imports; UI mode is justified; lifecycle
and timers follow the runtime model; checks cover the change. Also:
- Generated output (
vendor/, build output) is regenerated, not hand-edited. - No check, rule, or baseline was loosened to make it pass.
- No dead code, commented-out code, or debug output remains.
- Nothing downloads or executes code at runtime (no remote dynamic import);
network access stays in a few modules.
- Temporary plans and notes sit in a gitignored folder and are deleted after.
ruff.tomland.github/workflows/frominitor `setup-repo
--github-actions` stay unedited (the workflows call the Market's reusable
ones); refresh them with setup-repo --upgrade-github-actions.
Escalate
If the goal needs a host change, stop and follow the escalation section of
references/execution-boundary.md.
Reference Map
references/runtime-model.md: processes, event loops, startup/shutdown,
timers, reload, crash behaviour. Read before any lifecycle or background work.
references/execution-boundary.md: the hard constraints with reasons;
allowed imports; escalation.
references/core-plugin-contract.md: identity,plugin.toml, entries,
routers, hooks, i18n, UI modes.
references/plugin-system-surface-map.md: SDK capability index (paths,
push_message, config, cross-plugin calls); check it before inventing
abstractions.
references/dependencies-and-market.md:vendor/, third-party packages,
Market id/tag/size rules, what local checks do not prove.
references/plugin-creation-workflow.md: questions, design brief, scaffold.references/plugin-cli-and-debugging.md,references/plugin-checks-and-tests.md:
CLI, debugging order, checks and tests.
references/hosted-ui-authoring.md,references/hosted-ui-api.md: Hosted
TSX and Markdown surfaces.
Do not answer from memory when a reference covers the question.