# Skills (https://docs.neuralisapp.com/package-system/skills)

A **skill** is a directory with a `SKILL.md` file — YAML frontmatter plus a
markdown body — and optional `scripts/`, `references/`, and `assets/` siblings.
The format is aligned with [agentskills.io](https://agentskills.io), and the
frontmatter parser is **whitelist-policy**: unknown fields are dropped
silently, so skills written for other agent platforms load unchanged.

```text
skills/
  deploy-checklist/
    SKILL.md
    scripts/
      verify.mjs
    references/
      runbook.md
```

The skill's scope is the whole directory, enumerated at discovery into the
contribution's `files[]` ([directory contract](https://docs.neuralisapp.com/package-system/directory-contract.md)).
A bare skill folder — `SKILL.md` plus `scripts/`, no `package.json` — loads as
a single-skill package whose root *is* the skill.

## Frontmatter [#frontmatter]

```markdown
---
name: deploy-checklist
description: One-line trigger sentence the model matches on to activate this skill.
disable-model-invocation: true
allowed-tools: [fs_list, fs_read]
credentials: [OPENAI_API_KEY]
maxSteps: 12
requiredFeatures: [platform.config]
---

# Title
Body. Use ${SKILL_DIR} / ${SKILL_URI} / ${SESSION_ID} / ${NEURALIS_API}.
Run scripts as `node "${SKILL_DIR}/scripts/verify.mjs"`.
```

Standard fields:

| Field | Meaning |
| --- | --- |
| `name` | Skill id (falls back to the folder name). |
| `description` | The always-visible routing contract in the per-agent package overview: the outcome, the natural request/failure trigger, and the decisive distinction from neighboring skills. The procedure stays in the activated body. A multi-line `>` or `\|` block, or a value continued on indented lines, is accepted and read as one line. |
| `allowed-tools` | Tool allowlist — a YAML list (`- name` lines may sit at the key's indent), one line of comma- or space-separated names, or those names in a `>`/`\|` block (Claude Code and agentskills.io forms all read); a trailing `# comment` is never a name. **Advisory on a skill**: recorded and displayed, but activation does not restrict the parent run's tools (the ecosystem treats it as an approval easement) — state intent, never rely on it as a control. On an [agent persona](https://docs.neuralisapp.com/package-system/agents.md) it is a ceiling. |
| `disable-model-invocation` | Marks the file manual-only. **On a `SKILL.md` it gates nothing** — recorded and displayed in the package overview and files catalog, but the skill stays listed and model-activatable. It is load-bearing only on `instruction` / `rule` files and on files that opt into the prompt with `activation.pinned` or `activation.target: "prompt-context"`, where a manual file is not injected. |
| `arguments` | Declared activation arguments: a list of `{ name, description?, required? }`. |
| `context` | `inline` (default — the body returns into the conversation) or `fork`. **Load-bearing:** a `fork` skill registers as an agent contribution, summonable as a delegate persona. |
| `model`, `agent`, `argument-hint`, `compatibility`, `license`, `user-invocable` | Recognized and carried as metadata for cross-platform compatibility. |

Neuralis extensions — all optional and additive:

| Field | Meaning |
| --- | --- |
| `credentials` | List of credential-store ids. Each id doubles as the env-var name projected into skill-script child processes. The model never sees resolved values. |
| `hooks` | Reserved for skill-scoped lifecycle hooks. The skill frontmatter parser does not accept the key yet, so declaring it changes nothing today. |
| `requiredFeatures` | Visibility gate — see below. This is the only frontmatter key that actually withholds a skill from a caller. |

**Accepted but inert.** `contextMode`, `agentType`, `preferredModel`, `maxSteps`
and `manualOnly` are parsed and carried as metadata, but no runtime reads them.
`contextMode` does **not** fork a skill — `context: fork` does. Use
`requiredFeatures` for a real gate, and set step ceilings on the agent.

Three authoring rules matter:

- **`requiredFeatures` must be a flat flow array** —
  `requiredFeatures: [platform.config]`. A nested `requires:` block with a
  `features:` child is read by nothing: the skill carries **no gate at all**,
  and nothing warns you.
- A skill that declares `context: fork` registers as an **agent** contribution
  (a delegate persona) instead of a skill — see
  [Agents](https://docs.neuralisapp.com/package-system/agents.md).
- **An explicit `activation:` block overrides everything else.** Discovery then
  reads `activation.target`, `activation.pinned` and `activation.invocation` and
  skips the `disable-model-invocation` inference. `activation.pinned: true` or
  `activation.target: "prompt-context"` pins the **whole skill body into every
  turn's system prompt** — every conversation's context grows by the skill's
  size, used or not. Leave the block off unless you mean it; `activation.target`
  has exactly two values, `prompt-context` and `workspace`.

## Activation flow [#activation-flow]

A skill activates through `execute action="skill"`, looked up by id, title or
frontmatter name, in five steps:

1. **Argument injection.** Declared `arguments` values are substituted.
2. **Credential resolution.** Each `credentials:` id resolves against the
   encrypted store with the caller's real scope, most-specific wins, cut at the
   caller's tier ceiling ([credentials](https://docs.neuralisapp.com/package-system/credentials.md#how-skills-receive-credentials));
   a tier above it reads as missing. Missing credentials are non-fatal: the body
   renders a `(missing: <id>)` sentinel and the structured result reports the
   id. Reserved connect-route ids (git / channel / MCP / workflow-signing) are
   never projected: they are reported missing, by name.
3. **Session ticket mint.** Every activation mints a per-stream session ticket
   (`NEURALIS_SESSION_TOKEN`, an opaque `nrs1.<requestId>.<secret>`) carrying
   the caller's real identity, which the skill's `neuralis request` calls use
   against the host API — no long-lived token, no synthetic skill identity, and
   a synthetic session cannot activate skills at all
   ([Sessions](https://docs.neuralisapp.com/package-system/sessions.md)).
4. **Placeholder substitution.** The body is rendered with
   `${SKILL_DIR}` (container path of the skill directory), `${SKILL_URI}`,
   `${SKILL_CONNECTOR}`, `${SKILL_NAME}`, `${SESSION_ID}`, `${NEURALIS_API}`
   (the host API base), and `${SKILL_CREDENTIALS_RESOLVED}` /
   `${SKILL_CREDENTIALS_MISSING}`. A placeholder whose coordinate is
   unavailable becomes a human-readable sentinel so the model picks another
   path. `${MISSING:<id>}` renders per-credential presence.
5. **Credential layer push.** Resolved secrets and env-projectable
   substitutions go onto the stream's active-skill stack for later shell calls.
   The layer pops on explicit deactivation (`args.deactivate: true`) or at
   stream end; re-activation replaces it idempotently.

The activation envelope carries a `[Skill directory: …]` line so imported
skills' relative `bash scripts/foo.sh` forms work (on a Windows device a bash
script needs Git for Windows) — the model passes
`cwd: "${SKILL_DIR}"` and the placeholder expands server-side. With several
skills active, a shell call can pass `skill: "<id>"` to bind that skill's
directory and `${SKILL_*}` substitutions; the default is the most recently
activated skill.

## How scripts run [#how-scripts-run]

There is no separate script runner: skill scripts run through the platform's
sandboxed shell, from the model's perspective simply
`node "${SKILL_DIR}/scripts/verify.mjs"`. The shell is bash on Linux, macOS
and the Docker app and PowerShell on a Windows device, so a script that must
run everywhere is written in Node (`.mjs`): `node` is present wherever the
`neuralis` CLI is. Each shell call gets:

- a freshly re-minted session ticket, so multi-turn skill scripts keep a live
  authenticated identity,
- of the platform's own secrets, **only** those **an** active skill declared in
  `credentials:` — the union of every skill its caller still has active in the
  conversation, never another participant's. The env sanitizer deny-lists
  secret-shaped names (`SECRET` / `TOKEN` / `PASSWORD` / `CREDENTIAL` /
  `API_KEY` families and more), known provider prefixes (`OPENAI_*`, `AWS_*`,
  `GITHUB_*`, …) and exact infrastructure keys, passing only the declared
  allowlist. A host variable matching no pattern still reaches the script, so
  secrets belong in the [credential store](https://docs.neuralisapp.com/package-system/credentials.md), not in
  ambient env vars,
- URI-policy enforcement on the working directory and path arguments, with the
  active skill directory readable for the duration of the activation (see
  [URI policies](https://docs.neuralisapp.com/package-system/uri-policies.md)).

The manifest's `runtime.skillScripts` key (`host` | `wasm-only` | `none`)
advertises script posture. It is a **declaration** — checked at load (an
untrusted package declaring anything but `none` fails) and shown as a tag in
the package overview; what stops a script is the shell's URI-policy gate and
the sandbox ([Manifest](https://docs.neuralisapp.com/package-system/manifest.md)).

`${SKILL_DIR}` is a sentinel only when the skill has no host-side directory — a
synced source whose connector exposes no container path. Installed packages and
`_packages/` drops both resolve a real directory.

## Visibility follows the caller [#visibility-follows-the-caller]

Skills inherit their package's enable state and the caller's role/feature
grants, deny-by-default. A skill whose `requiredFeatures` the caller lacks is
hidden entirely — not injected, not in the package overview or files catalog —
and activating it returns the same not-found as a skill that never existed.
Annotate a skill with the strongest route feature its scripts call; leave it
off for public skills — execution stays independently gated by route features,
shell URI policy and credentials.