[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M723DFPMG9520YQ86NGW492G":3,"skill-same:01M723DFPMG9520YQ86NGW492G":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M723DFPMG9520YQ86NGW492G","configure-memory-and-skills",null,"Wire multi-turn memory + the runtime skill catalog. Use when the agent needs context across turns (chatbots, multi-step research), or when you want token-savvy DB-backed skills (Skills.md importer \u002F in-runtime generator) the planner can search and inject.","hurtener\u002FHarbor","hurtener","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F117486687?v=4","01M723BZXGKZDHCZ9JHRV24W4D","Santi Benvenuto","01M723BZY77XR795N9PK1BS4GX",6,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhurtener\u002FHarbor\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Fconfigure-memory-and-skills\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\nname: configure-memory-and-skills\ndescription: \"Wire multi-turn memory + the runtime skill catalog. Use when the agent needs context across turns (chatbots, multi-step research), or when you want token-savvy DB-backed skills (Skills.md importer \u002F in-runtime generator) the planner can search and inject.\"\nlicense: Apache-2.0\nmetadata:\n  framework: harbor\n  surface: memory\n  verbs: \"skill import, skill rm\"\n---\n\n# Configure memory + runtime skills\n\nTwo subsystems that look similar but solve different problems:\n\n- **Memory** — multi-turn context within a session. Lets the agent remember what it said three turns ago without re-reading the whole event log every step.\n- **Runtime skills** — token-savvy, DB-backed playbooks the planner can search by name and inject into a prompt mid-reasoning. Distinct from \"operator skills\" (the docs\u002Fskills\u002F directory you're reading) — runtime skills are mechanism inside the planner, not docs for humans.\n\nBoth subsystems share a key contract: **identity-scoped by (tenant, user, session)** — the same multi-isolation triple that gates everything else in Harbor. No cross-session leakage. Ever.\n\n## 1. Memory — strategies + drivers\n\nMemory has two axes you tune independently:\n\n- **Strategy** (`memory.strategy`) — how the planner uses memory each turn.\n- **Driver** (`memory.driver`) — the administrative memory adapter. Durability\n  comes from the shared `state.driver`, not from a separate memory transcript.\n\n### Strategies\n\n| Strategy           | When to use                                                                 |\n|--------------------|------------------------------------------------------------------------------|\n| `none`            | Explicit stateless opt-out. Each run starts cold.                           |\n| `rolling_summary` (default) | Cumulative short-term session context with 20 recent detailed turns. |\n\n`rolling_summary` preserves the conversation arc while compacting model input.\nBy default the summariser uses the run's model through the governed Bifrost\nclient. For local inference, `memory.summarizer.model` selects a separately\nprofiled model. For externally routed runs, use the independently authorized\n`memory.summarizer.provider_route` selector described in\n[the configuration reference](..\u002F..\u002FCONFIG.md#memorysummarizerprovider_route).\nIt reuses the same resolver and verified run identity; it cannot repurpose a\nsigned grant or silently fall back after revocation. Model routing remains\nrestart-required even when the working-input budget is edited through Protocol.\n\n`memory.summarizer.max_tokens` separately configures the completion allowance\nfor each compaction call, including provider reasoning. Omitted\u002Fzero preserves\nthe 2048-token default; for example, set `8192` for a deployment that needs more\nroom to finish a summary. The matching environment override is\n`HARBOR_MEMORY_SUMMARIZER_MAX_TOKENS`; both are restart-required. This does not\nchange the working-input target or driving model's output limit. Routed model\ncapacity and governance still apply, and incomplete output never replaces a\ncheckpoint. Valid summaries are not additionally capped at 16 KiB; subsequent\nrequests still pass configured byte and token admission. See\n[the reference](..\u002F..\u002FCONFIG.md#memorysummarizermax_tokens).\n\n`memory.summarizer.max_calls` sets the maintenance-call allowance per compaction\n(zero\u002Fomitted: `16`). YAML or `HARBOR_MEMORY_SUMMARIZER_MAX_CALLS` changes require\na restart. Raise it only when more chronological chunks are needed; exhaustion\npreserves the previous checkpoint, and increasing the allowance can increase\ntime and spend. There is no separate session-wide reference\u002Fevidence count cap,\nand `recent_turns` has no fixed maximum of 32. Existing execution tranches,\nconfigured request admission, identity, expiry and erasure still apply. See\n[the call allowance reference](..\u002F..\u002FCONFIG.md#memorysummarizermax_calls), including\nreceipt-consumer compatibility when using more than sixteen calls.\n\nThe removed `truncation` strategy is rejected rather than silently dropping\nunsummarized context when a window fills.\n\nMaintenance requests are bounded by the summariser model's input allowance,\nwith each step sent as its own part. An exchange too large for one part is\nsummarised from a clipped preview whose exact text stays reachable by\nartifact reference. If maintenance fails, the run keeps its previous\ncheckpoint and continues; when the request no longer fits, the oldest\nobservations are reduced to previews with references until it does. A\ncompleted turn without a new checkpoint keeps its unsummarised history, and the\nnext turn compacts before its first decision.\n\n### Persistence\n\n| State driver | When to use                                                              |\n|------------|----------------------------------------------------------------------------|\n| `inmem`    | Dev. Memory dies on `harbor dev` restart.                                  |\n| `sqlite`   | Single-node production. Survives restarts. Default for self-hosted agents. |\n| `postgres` | Multi-replica production. Use behind a load balancer.                      |\n\n### Example: chat agent with rolling summary on SQLite\n\n```yaml\nmemory:\n  driver: inmem              # shares the durable StateStore below\n  strategy: rolling_summary\n  recent_turns: 20\n  budget_tokens: 8000          # working-input compaction target, not output tokens\nstate:\n  driver: sqlite\n  dsn: \u002Ftmp\u002Fharbor-validation\u002Fmy-agent-state.sqlite   # outside the project dir (WAL trap)\n```\n\n`budget_tokens` is the soft working-input target for the complete assembled\nrequest. With `rolling_summary`, zero derives that target from the effective\nmodel's input capacity and output reservation. It is independent of completion\nlimits; fresh tool results cannot be silently truncated to satisfy it. A positive\nvalue also enables within-run compaction for stateless agents. The removed\n`planner.token_budget` is rejected with migration guidance.\n\nOn served runtimes advertising `agent_config_memory_v1`, an admin can override\nthis same target per agent through the versioned `agent_config.set_revision`\npayload: `{\"memory\":{\"budget_tokens\":64000}}`. This is an example value, not a\nframework default. Read the current revision, preserve its writable sibling\nsections, and supply its `expected_content_hash` to avoid overwriting concurrent\nedits. Omit `memory` to inherit YAML again; present zero requests automatic\nsizing. Changes apply to the next run, never a running one. The runtime must\nalready have its compactor configured; this edit cannot enable an unwired LLM.\n\nIn PR #779, `rolling_summary` now selects the cumulative execution-context path\nfor both served and embedded root runs. Set `recent_turns: 20` (zero also selects\ntwenty); this bounds detail, not how far back checkpoint meaning reaches.\nThe separate `sessions.retained_context_turns` and SDK activation option are\nremoved. Persistence uses the configured StateStore and session lifetime.\nOmitted YAML settings and `config.Defaults()` now enable that memory behavior;\nset `memory.strategy: none` explicitly to disable it. Compaction can incur\ngoverned model calls. The pair-summary engine and its recovery loop are removed;\nadmin inspection and mutation use the same owner as execution. See the\n[implementation tracker](..\u002F..\u002Fnotes\u002Fportable-context-tracker.md).\n\nAdministrative `Put` accepts conversational notes only; execution receipts and\ntheir provenance come from the runtime journal. Heavy `memory.get` values return\nreferences resolved through bounded `artifacts.get`, without storing a second\ncopy. These references cannot be presigned and stop resolving when their source\nis deleted, expired or replaced. Refresh `memory.list` for the current projection;\nuse `memory.delete`, not artifact deletion, to remove a memory source.\n\n### Removed semantic-memory retrieval\n\nRemove `memory.retrieval`, `memory.retrieval_top_k`,\n`memory.retrieval_min_score` and their `HARBOR_MEMORY_RETRIEVAL*` environment\noverrides. They now fail validation. Cumulative session memory uses checkpoints\nand recent execution evidence; it does not maintain a separate embedding index.\nExternal long-term memory can still arrive through caller memory or ordinary\ncapability tools. Semantic skill retrieval remains available.\n\n### Caller-supplied external memory (D-364)\n\nA Protocol client supplies the fixed `caller_supplied` entry by sending\n`caller_memory` on a `start` request (see\n[`use-the-harbor-protocol`](..\u002Fuse-the-harbor-protocol\u002FSKILL.md)).\nThat content remains separate from runtime-owned conversation context and\ncannot replace it. Native semantic recall no longer produces `recalled_turns`.\n\nWhat this means for you as the operator:\n\n- **You do not enable it.** There is no config key. It is on the Protocol surface for every caller with a valid identity, and it is bounded at 32 KiB per request at the edge, refused before any task is created. Your runtime advertises `caller_memory` in `runtime.info.capabilities`, so a client can tell whether it is supported before relying on it.\n- **That 32 KiB is a resource bound, not a security boundary — do not budget your threat model against it.** It bounds caller-memory admission before dispatch; it does not authorize the content or replace assembled-request budgeting. It tells you nothing about how much content a caller can put in front of the model — the same caller can send more through the uncapped `query`, which lands in the *unframed* conversation position, and through `agent_config.session.set_user_prompt`, which needs no admin scope, takes a 1 MiB body, and lands *inside* the system prompt. What contains a caller's payload is the tier it lands in, never its size.\n- **A caller can only reach that ONE prompt position.** It never touches the trusted base prompt (that is `system_prompt_override`, a different and strictly more powerful knob) and it never writes the conversation-memory tier, which is a claim about the session's stored turns only the runtime makes.\n- **You can see it happening.** Every admitting run emits `memory.caller_block_admitted` with `bytes` \u002F `tier` \u002F `key` — a size, never content — so an audit trail shows caller-asserted memory entering a run without becoming a copy of it. In a trace, the external tier carries `{\"caller_supplied\":{…}}`, distinct from runtime-owned conversation memory.\n- **It is stored redacted, like its siblings.** The payload is persisted on the task record (and so to disk), and it goes through the audit redactor on the way in — the same one the run's `query` and description take. The redactor walks the decoded JSON, so structure survives and only secret-shaped keys (`api_key` \u002F `password` \u002F `secret` \u002F `token` \u002F `cookie` \u002F `authorization`) and inline `Bearer …` \u002F `Basic …` values become `***`. The redacted form is what the prompt sees too, which is already true of `query`.\n- **The framing is the mitigation, and neither it nor the redactor is a sanitiser.** The tier's five-line anti-injection preamble tells the MODEL not to obey the content; it does nothing about what the bytes contain. The audit redactor is a PATTERN redactor: it does not detect PII, does not detect a credential that reads as ordinary prose, and cannot make hostile text safe. A caller that pipes unredacted third-party content through `caller_memory` still has a data-leakage path no prompt wrapper and no pattern redactor closes.\n- **Nothing meters admission volume.** Token spend is metered at the LLM edge by the governance layer, so the cost is governed — but a caller may send 32 KiB on every `start` and no per-tenant accounting of admission itself exists yet.\n\n### Identity scoping\n\nEvery memory write\u002Fread is keyed by `(tenant_id, user_id, session_id)`. The planner cannot read user A's memory from user B's session — the SQL `WHERE` clause filters before the rows reach the planner. This is enforced at the driver level, not at the planner; even a buggy planner cannot leak cross-session.\n\n## 2. Runtime skills — DB-backed playbooks the planner searches\n\nRuntime skills are typed, token-savvy reusable patterns the planner can ask for by name mid-reasoning. What a run sees is an **effective composition**, not one flat table: the identity-scoped **base\u002Fuser\u002Fsession** rungs plus **one operator tier** applied LAST, so operator-authored content deterministically wins a name collision against caller content.\n\nThe operator tier is itself a strict merge of TWO operator-managed sources:\n\n- **Active revision packs** — the selected agent's durable `agent_packs` section of its active agent-config revision (protocol-managed and versioned; the `agent_config.agent_packs.*` verbs author it).\n- **HA-66 boot packs** — the node-local `skills.boot_agent_packs` config-declared baseline, loaded eagerly and immutably before readiness (see below).\n\nThe merge is strict, never last-write-wins: the same canonical name with the same canonical semantic content hash dedupes to ONE item marked `source=both` (migration-safe — moving an unchanged body between the durable revision and the boot config must not split the composed view); the same name with a differing hash **fails loud**; and the unique combined tier holds at most **256** items. Run snapshots and the composition preview report per-item `boot|revision|both` provenance plus the deterministic `boot_pack_set_hash` (and combined\u002Frevision set hashes), so you can verify exactly what the resolved agent composes.\n\nSkills enter the catalog through these producers:\n\n- **Skills.md importer** — you write a Skills.md file (one skill per file: YAML frontmatter + a `## Steps` body) and ingest it with `harbor skill import \u003Cpath>`.\n- **In-runtime generator** — the planner itself can author a new skill at runtime (e.g. \"this kind of question seems common — let me save the steps as a skill\") and persist it via the `skill_propose` built-in (opt-in; see below).\n- **Caller-authorized import (HA-61)** — the two-phase `import_validate` \u002F `import_commit` Protocol flow installs a reviewed personal-skill package (see below).\n- **Draft-only authoring (HA-62)** — `skill_create_draft` writes a reviewable draft artifact only, never an installed skill (see below).\n\n### Example: a Skills.md file\n\nOne skill per file. Two body forms are accepted.\n\n- **Sectioned (Harbor) form.** Prose, then `## Steps` (at least one dash list item) and the optional `## Preconditions` \u002F `## Failure modes` sections.\n- **Free-form (Agent Skills) form.** Any other body with instruction prose — arbitrary level-2 headings, numbered lists, code blocks, no `## Steps` — is kept verbatim as the skill's instructions in its description, which `skill_get` returns to the model. Any trailing run of canonical sections is still parsed as sections, and a single step \"Follow the instructions in this skill's description.\" is supplied when none is declared.\n\nThe frontmatter `description:` is the human-visible explanation of what the skill does (shown in listings and import reviews); it comes first in the skill's description, followed by the body prose. The frontmatter `trigger:` is the planner-visible match cue: when it is absent, it is derived from `description` (whitespace collapsed to one line), and a file with neither is refused. The Agent Skills keys `license`, `compatibility`, `allowed-tools` and `metadata` are accepted as advisory and are not stored: `allowed-tools` never grants a tool.\n\nListings and import reviews show only the first prose paragraph, capped at 500 runes; the joined instruction body stays available through `skill_get`. Without a frontmatter description, the first body prose paragraph supplies the summary (leading Markdown headings are skipped). A multi-paragraph frontmatter description is also summarized by its first paragraph: canonical packages retain the joined text, not the original frontmatter boundary.\n\n```markdown\n---\nname: triage-incident\ntitle: Triage an incident\ndescription: Classifies a support ticket into bug, feature or question and recommends the next action.\ntrigger: when a support ticket needs classification\ntags: [support, triage]\n---\n## Steps\n\n- Read the user's report.\n- Match against known categories.\n- If \"bug\", pull the last 5 PRs that touched the area.\n```\n\nThe same skill in the free-form Agent Skills form, packaged with a `references\u002F` file in a zip:\n\n```markdown\n---\nname: triage-incident\ndescription: Classifies a support ticket and recommends the next action. Use when a support ticket needs classification.\nlicense: Apache-2.0\n---\n# Triage an incident\n\n## Instructions\n\n1. Read the user's report.\n2. Match it against the categories in [the guide](references\u002Fcategories.md).\n3. If it is a bug, pull the last 5 PRs that touched the area.\n```\n\nBundled files are support files and must use the support MIME allowlist: Markdown, plain text, JSON, XML, SVG, common images, PDF and fonts, plus a text class for common script, source, data and template files (`.py`, `.sh`, `.js`, `.ts`, `.sql`, `.yaml`, `.csv`, `.html`, `.j2`, and similar). Text-class files must be UTF-8 without NUL bytes (empty files are fine); they are recorded as `text\u002Fplain; charset=utf-8`, stored as data, and never executed by Harbor. Common extension-less text files (`LICENSE`, `NOTICE`, `Makefile`, `Dockerfile`, and similar) are matched by exact name, `.xsd` \u002F `.xsl` \u002F `.xslt` files are XML, and macOS `__MACOSX\u002F` and `.DS_Store` entries are skipped. Zips from `zip -r` or Finder work: empty directory entries are skipped, and one top-level folder wrapping the whole skill (`my-skill\u002FSKILL.md`) is stripped. Binary executables, archives and other extension-less files are refused.\n\n### Import \u002F remove with the CLI\n\n```console\n$ harbor skill import .\u002Fskills\u002Ftriage-incident.skill.md\nimported \"triage-incident\" (scope=project, steps=3, attachments=0)\nstore: driver=localdb dsn=\u002Ftmp\u002Fharbor-validation\u002Fmy-agent-skills.sqlite\n\n$ harbor skill rm triage-incident\nremoved \"triage-incident\"\nstore: driver=localdb dsn=\u002Ftmp\u002Fharbor-validation\u002Fmy-agent-skills.sqlite\n```\n\nBehaviour you can rely on:\n\n- The verbs resolve the store from `harbor.yaml`'s `skills:` block — the **same store `harbor dev` serves** — and print the resolved `driver=… dsn=…` so you can see exactly where the skill landed. Pass `--config \u003Cpath>` for a non-default config.\n- Skills are identity-scoped (`(tenant, user, session)`). The verbs default to the `harbor dev` triple (`dev`\u002F`dev`\u002F`dev`); use `--tenant` \u002F `--user` \u002F `--session` for anything else.\n- A duplicate name is **rejected with exit 1** (\"pass --overwrite to replace, or `harbor skill rm \u003Cname>` first\"); `--overwrite` replaces it. An invalid file (missing frontmatter, empty `trigger:`, no steps) exits 1 with the validator's reason. `rm` of a missing name exits 1.\n- The global `--json` flag switches both verbs to a machine-readable result (`{\"result\":\"imported\",\"driver\":…,\"dsn\":…,\"report\":{…}}`).\n- Inline attachments (`![alt](relative\u002Fpath)`) resolve relative to the file's own directory and upload to the configured artifact store; paths escaping that directory are rejected.\n\nGo-level: the verbs are thin callers over `importer.ImportAndStore` — a headless embedder calls the same function (see `docs\u002Frecipes\u002Fuse-memory-and-skills-from-go.md`).\n\nOnce the skills are in the catalog, the planner sees them at reasoning time two ways: a bounded per-turn `\u003Cskills_context>` browse window (the skills directory — see below) and on-demand retrieval via the `skill_search` \u002F `skill_get` meta-tools — token-savvy because full skill bodies only enter the prompt when the LLM actually pulls them.\n\n### Caller-authorized reviewed import (HA-61) — `import_validate` \u002F `import_commit`\n\nFor a caller (a Protocol client, not an operator with a shell), installing a personal skill is a two-phase, reviewed proposal flow — never an immediate upsert:\n\n- **`agent_config.user.skills.import_validate`** — the caller uploads a bounded complete skill package (zip carrying exactly one root-level `SKILL.md`, or a single Markdown document) as a caller-owned artifact via `artifacts.put`, then calls validate with that artifact ref plus the effective agent. The runtime runs the ONE production importer\u002Fvalidator and returns the closed normalized review, hashes, and warnings together with a **stateless opaque proposal token**. Validate performs **ZERO writes** of any kind: no SkillStore body\u002Fpackage write, no agent-config membership write, no proposal-ledger write — the review rides entirely inside the sealed token (24h window, refreshable by re-validating).\n- **`agent_config.user.skills.import_commit`** — the caller echoes the token plus the reviewed `PackageHash`, expected config hash, canonical name, and explicit replace consent. The runtime authenticates and strictly decodes the sealed claims, re-derives identity and signed effective-agent reach, rechecks lifecycle \u002F policy \u002F ceilings \u002F expected config hash, forces `ScopeUser` + caller ownership server-side, and atomically materializes the approved package plus membership in ONE conditional write. Response-loss retry is idempotent; competing commits have one winner.\n\nAuthority model to rely on: identity comes from the VERIFIED context (no selectable tenant\u002Fuser\u002Fsession\u002Fscope — the request carries no authority fields), signed session-reach and agent-reach gates run before any artifact lookup or persistence, and the package frontmatter is CLOSED (authority-bearing fields are rejected by the importer). `required_tools` \u002F `required_namespaces` \u002F `required_tags` are **applicability metadata, never grants**: a requirement outside the run-visible capability snapshot is a WARNING (the injection-time filter scrubs it), and the policy snapshot is sealed into the token so a policy change between validate and commit is a typed revocation refusal. A boot-owned canonical name is read-only to this flow too, even at equal hash (see HA-66 below).\n\n### Personal skill export\n\n`agent_config.user.skills.export` (`POST \u002Fv1\u002Fagent_config\u002Fuser\u002Fskills\u002Fexport`)\naccepts `identity`, `agent_id`, and the canonical personal skill `name`. Like\n`user.skills.list`, it requires the verified caller and signed reach to an\nactive Agent, without an admin or `agent_config:user` scope. It exports only\nthat caller's durable user-scope package installed through reviewed import;\na same-name shared, foreign, or legacy upsert-only skill is never a fallback.\n\nThe response carries `artifact` (the normal `ArtifactRef`), `package_hash`,\n`name`, `size_bytes`, and `protocol_version`. Retrieve its bytes through\n`artifacts.get` or `artifacts.get_ref`. The ZIP has root `SKILL.md` and all\npackage support files and can enter the normal reviewed import flow. A\npackage installed from a single Markdown document exports in the same form. The\npackage hash identifies package content; the artifact SHA256 identifies the\nZIP bytes. Export writes only the caller-owned artifact, with no skill,\nmembership, or revision change. Missing installed packages, including legacy upsert-only rows, return\n`not_found`.\n\n### Draft-only authoring (HA-62) — `skill_create_draft`\n\n`skill_create_draft` is an ordinary runtime tool that turns a bounded authoring intent (plus optional revision feedback) into ONE validated, caller-scoped, resource-free `SKILL.md` **draft artifact** — `installed: false`, `state: draft`. It is deliberately non-authoritative: it writes exactly one immutable artifact under the invocation's verified run identity and has **zero mutation authority** — no skill-store upsert, no membership\u002Frevision write, no operator-pack proposal\u002Fpublication, no capability registration, no tool exposure, no approval\u002FOAuth path. Identity comes exclusively from the run context; the closed argument shape (intent + optional feedback) rejects any owner\u002Fscope\u002Fidentity\u002Fpersistence\u002Fpublication\u002Fgrant field.\n\nIt is **disabled by default**: the tool is a known built-in in the registry's `KnownNames()` and an operator enables it by listing it in `tools.built_in`, exactly like every other built-in — the recommended\u002Fdefault configs simply do not list it. The assembly supplies the composed LLM client; explicitly listing the tool on a runtime without a usable LLM fails the boot loud. Once enabled it is opt-in per agent through the ordinary tool policy, with the same policy \u002F approval \u002F governance \u002F rate-and-cost \u002F deadline \u002F cancellation \u002F redaction \u002F audit wrappers as every other ordinary tool. Installing the draft is a SEPARATE explicit caller action through the HA-61 validate\u002Fcommit flow — creating the draft never installs or enables a skill. The result may warn that declared `required_tools` are metadata only and never grant capability.\n\n### Yaml config\n\n```yaml\nskills:\n  driver: localdb                  # localdb (default, SQLite) | postgres (durable\u002Fshared)\n  dsn: \u002Ftmp\u002Fharbor-validation\u002Fmy-agent-skills.sqlite    # WAL trap caveat applies\n  # Postgres variant — durable\u002Fshared storage for multi-instance\n  # deployments (every replica sees the same skills catalog):\n  #   driver: postgres\n  #   dsn: postgres:\u002F\u002Fharbor:${HARBOR_SKILLS_PG_PASSWORD}@db:5432\u002Fharbor?sslmode=require\n  #   migration_mode: apply # direct endpoint; switch to verify with pooled dsn after apply\n  # retrieval: semantic            # optional — skill_search ranks by embedding\n  #                                # similarity instead of the FTS5\u002Fregex\u002Fexact\n  #                                # ladder (requires the embeddings: block; the\n  #                                # capability filter, redaction, and budgeter\n  #                                # apply unchanged on top)\n  directory:                       # optional — shapes the per-turn \u003Cskills_context> block\n    pinned: [triage-incident]      # always listed first, in this order\n    max_entries: 10                # 0\u002Funset → planner.skills_context_max (default 5)\n    selection: pinned_then_recent  # the one wired value (pinned_then_top is rejected: not yet wired)\n  # boot_agent_packs:              # optional (HA-66) — node-local operator baseline\n  #   - tenant_id: acme            # exact, case-sensitive tenant key\n  #     agent_id: harbor-dev-agent # must equal the resolved boot\u002Fdefault agent\n  #     directory: \u002Fetc\u002Fharbor\u002Fskills   # config-file-relative, never CWD\n  #     include: [workbench-foundation] # package directories, one SKILL.md each\n\ntools:\n  built_in:\n    - skill_search    # the LLM discovers runtime skills by capability text\n    - skill_get       # the LLM pulls the full bodies of named skills\n    - skill_list      # the LLM enumerates the catalog (paged, summary-only)\n    # - skill_propose      # OPT-IN: lets the LLM author + persist new skills\n    # - skill_create_draft # OPT-IN (HA-62): drafts ONE immutable caller-scoped\n    #                      # SKILL.md artifact; needs the assembly's composed\n    #                      # LLM client (boot fails loud without one)\n```\n\n**Store drivers.** Skills ship at two-driver parity (the memory triple has no skills equivalent):\n\n| Driver     | Use when                                                                 |\n| ---------- | ------------------------------------------------------------------------ |\n| `localdb`  | Default. CGo-free SQLite, a per-instance file. Single-node \u002F embedded.    |\n| `postgres` | Durable, shared Postgres for multi-instance deployments — every replica sees the same skills catalog. Same conflict policy, identity scoping, and FTS → regex → exact ranking ladder as `localdb` (the full-text tier rides a `tsvector` + GIN index). |\n\nSwitching backends is a `driver:` + `dsn:` change — the CLI verbs, meta-tools, directory, and semantic mode all behave identically (proven by the shared conformance suite). Identity scoping (`(tenant, user, session)` in the SQL `WHERE`) is enforced at the driver on both.\n\nFor Postgres, empty\u002F`apply` runs forward migrations under a session advisory lock and therefore needs a direct\u002Fsession-capable endpoint. A transaction-pooled steady-state deployment first completes that apply separately, then switches BOTH the DSN to the pooler and `migration_mode` to `verify`. Verify mode proves the subsystem's namespaced `harbor_schema_migrations` and `harbor_store_identity` rows plus required physical schema; a state ledger or `state_records` table never satisfies memory. It refuses startup if identity, checksums, schema, or any embedded version is missing and never creates or repairs schema through the pool. During a staged v1.29.1 rollout, use `harbor postgres cutover --mode inspect` and the non-destructive `--mode copy --freeze-ack` procedure from the PostgreSQL cutover recipe before switching one runtime to a unified DSN.\n\n### Node-local boot agent packs (HA-66) — `skills.boot_agent_packs`\n\nAn operator may declare a **node-local, resource-free operator skill baseline** for the resolved boot\u002Fdefault agent in boot config (the `boot_agent_packs:` block above). Behaviour you can rely on:\n\n- **Loaded eagerly, immutably, before readiness.** The strict loader reads every declared package directory through the ONE production importer\u002Fvalidator at boot — before the runtime is ready or any listener binds — and fails the boot LOUD on any malformed, unresolvable, or un-importable entry. The frozen set is fixed for the process lifetime (restart-only; never hot-reloaded).\n- **Zero persistence, zero admin verbs.** The loader performs **no SkillStore writes, no ArtifactStore writes, no AgentConfig revisions, no lifecycle materialization, and no admin pack verbs** — it is a pure eager filesystem read + parse + validate. It never creates agents or widens reach. `EnsureBootAgentLifecycle` is a separate mechanism and MAY write a revision.\n- **Node-local, never converged.** Each node reloads its own files at boot. The durable Postgres `${SKILLS_DSN}` store persists agent revisions and personal state but NEVER the boot packs — a file change on one node never converges the others, and boot packs are never shared through the store.\n- **One combined operator tier.** Boot entries merge with the agent's active durable revision-pack items into ONE strict operator tier (see the §2 intro): same canonical name + same semantic hash dedupes as `source=both`; differing hash fails loud; at most 256 unique combined items; the tier applies LAST over base\u002Fuser\u002Fsession skills. Every declared tenant-agent active revision is pre-read before readiness, so a conflict surfaces at boot, not at first run.\n- **Boot\u002Frevision provenance + `boot_pack_set_hash`.** The run snapshot and the read-only composition preview (`agent_config.composition.preview`) report per-item `boot|revision|both` provenance alongside the deterministic `boot_pack_set_hash` (a node-local digest over the normalized boot entries, distinct from per-package hashes, stable across restarts for an unchanged config) — so you can verify exactly what the resolved agent composes.\n- **Boot-owned names are read-only.** `upsert`, every proposal-commit path, and rollback\u002Factivation refuse a boot-declared canonical name with a typed error, even at equal hash — the NAME is boot-owned, not the bytes. Removal is the narrow exception: it may delete a real legacy active-revision shadow at that name, while a boot-only removal is a typed read-only refusal, never false success.\n- **Config removal affects new runtime\u002Fnew runs only.** Removing a `boot_agent_packs` declaration removes the boot contribution on the NEXT deployment\u002Frun; already-captured in-flight snapshots retain their bytes and hash, and an independently persisted durable revision remains revision-only (no tombstone, no erasure). A name with both contributions absent stays non-oracularly unavailable.\n- **Headless `RunOnce` against a boot-pack agent is unsupported and fails loud** — it never silently runs without the packs. Production `harbor serve` and the devstack resolve the SAME loader path.\n\n### Organization skill publications (HA-68 \u002F D-430)\n\nOrganization publications are a Protocol-managed, same-runtime source for\nreviewed skill revisions. They are not another `skills:` YAML block and they\ndo not turn the ordinary identity-scoped catalog into a tenant-wide search.\nConfigure the existing skills store and StateStore first; the publication\ndomain uses that StateStore's conditional-save and idempotency contract.\n\nThe verified organization administrator path is:\n\n1. `skills.publications.publish` creates the first immutable,\n   content-addressed revision.\n2. `skills.publications.list` and `.get` inspect bounded metadata only.\n3. `skills.publications.publish_successor` advances an exact generation\u002Fhash\n   compare-and-set; `skills.publications.retire` closes the revision lifecycle.\n\nThe caller path is available only after the request's verified identity and\nsigned effective-agent reach are checked:\n`skills.publications.available`, `.install`, `.update`, `.remove`, and\n`.references.list`. A reference pins the exact publication\u002Frevision id,\ngeneration, content hash, lifecycle state, and runtime\u002Fdeployment id for the\ndurable tenant\u002Fuser\u002Fagent state. List results, references, and receipts never\ncontain the body. Only the authorized runtime resolver returns a body, and it\nfails closed on a retired, stale, foreign-runtime, wrong-hash, or unreachable\nreference.\n\nPeople can also propose their own personal skills for organization review\n(D-508): `skills.publications.candidates.submit` freezes a snapshot of the\ncaller's skill, admins list and read the pending candidates, then `accept` one\nas a new publication or a successor revision (through the same publication\nstore, so every invariant above applies) or `reject` it with a note. A skill\nwith support files cannot become a publication yet and is refused at\nsubmission. `skills.publications.read` shows any caller the body of an active\npublication before they install it.\n\nDo not copy a publication into each user's skill triple, use a shared service\nidentity, or treat `ScopeTenant`\u002F`ScopeGlobal` as an implemented publication\nvisibility shortcut. Do not place publication bodies in logs, events, audit\npayloads, metadata, or model-visible discovery. At this checkpoint the\npublication domain, persistence contract, and canonical wire registration are\nlanded; do not claim an end-to-end route until the Protocol transport and\nruntime-composition consumer are present and their focused integration tests\npass. See [Phase 250](..\u002F..\u002Fplans\u002Fphase-250-same-runtime-skill-publications.md)\nand D-430.\n\n### LLM-side discovery via meta-tools\n\nThe React planner runs on native provider tool-calling: the LLM doesn't ask \"what skills do I have?\" in prose — it calls the `skill_search` built-in when it needs one. The meta-tools are the rich skills handlers (capability filter + redaction + token budgeter) over the SAME store your `harbor skill import` populated — one source of truth, identity-scoping carries through:\n\n- `skill_search(query, limit?)` — ranked candidates, capability-filtered to the tools this run can actually see (a skill requiring a tool the run isn't granted never surfaces).\n- `skill_get(names[], max_tokens?)` — full bodies, budget-fit through a tiered ladder (full → drop optional sections → cap steps at 3); an impossibly small budget errs loudly rather than silently truncating.\n- `skill_list(scope?, task_type?, tags?, limit?, offset?)` — paged enumeration, summary-only.\n- `skill_propose({skill, persist})` — the in-runtime generator. **Deliberately opt-in** (list it in `tools.built_in` only when you want the LLM persisting skills): persisted skills are stamped `Origin=generated`, can never overwrite an imported pack skill, and every persist emits a mandatory redacted `skill.proposed` audit event. This is the STRUCTURED generator; the natural-language draft path is the separate HA-62 `skill_create_draft` tool above.\n\n### The per-turn skills directory (`\u003Cskills_context>`)\n\nIndependent of the meta-tools, every planner turn carries a compact `\u003Cskills_context>` block produced by the **skills directory**: a bounded, stable, pinned-then-recent browse window over the catalog (name \u002F title \u002F trigger \u002F task type \u002F pinned flag — never full bodies). The block tells the LLM *what exists*; pulling content is `skill_get`'s job. Tune it with the `skills.directory` yaml block above — `pinned` guarantees your flagship skills are always visible, `max_entries` caps the budget, and the stable ordering keeps the prompt prefix KV-cache-friendly. Capability filtering applies to the directory too: pinning never bypasses it.\n\n### Session-personal skill cutover — operator-only, deny writes until verified\n\nPhase 233a moves agent-owned session-personal skill bodies to durable records.\nThe rollout is intentionally **not** automatic: the default is read-only\n`dual_read`. Existing eligible legacy session skills remain readable, but every\nsession-personal mutation is refused with `session_skill_cutover_pending`\n(HTTP 409) until the tenant completes its declared migration. Do not retry that\nerror by writing a legacy shared-skill row.\n\nOnly declare a tenant after all older writers for that tenant have drained.\nThe declaration is static and takes effect on restart; it neither discovers\ntenants\u002Fwriters nor makes writes safe merely because its flag is set. It needs\nthe normal configured SkillStore and a durable StateStore in production:\n\n```yaml\nstate:\n  driver: sqlite\n  dsn: \u002Fvar\u002Flib\u002Fharbor\u002Fstate.sqlite\n\nskills:\n  driver: localdb\n  dsn: \u002Fvar\u002Flib\u002Fharbor\u002Fskills.sqlite\n  session_personal_cutover:\n    tenants:\n      - tenant_id: tenant-acme\n        epoch: 2026-08-cutover-01\n        roster_digest: sha256-... # an operator-attested label, never a secret\n        legacy_writers_drained: false\n```\n\n`tenant_id` is case-sensitive. The list is capped at 256 declarations, and its\nidentifiers\u002Fepoch\u002Fdigest are bounded printable-ASCII tokens; bad or duplicate\nentries fail boot. Start with `legacy_writers_drained: false`. After draining\nall older writers and attesting the roster, change it to `true` and restart.\nHarbor resumes its bounded checkpointed migration and performs a fresh\nverification pass. It alone writes durable `state_only`; until then, mutation\nrefusal is expected and protects the authoritative legacy view.\n\n### Skill vs tool — when to pick which\n\n- **Tool** — there's code to run, an API to call, a typed input\u002Foutput. Build a [tool](..\u002Fadd-an-in-process-tool\u002FSKILL.md).\n- **Skill** — there's a *reasoning pattern* the planner should follow (a recipe, a checklist, a domain heuristic). Build a skill.\n- **Both** — many real agents do both. A `triage-incident` skill whose step 4 says \"call the `ticket.find_related_prs` tool\" reaches into both subsystems.\n\n## 3. Operator-skill vs runtime-skill — the naming clarification\n\n`docs\u002Fskills\u002F` (what you're reading right now) holds **operator playbooks** — markdown docs for humans building agents. They are NOT loaded into the planner at runtime; they're adoption material.\n\n`internal\u002Fskills\u002F` (RFC §6.7) holds the **runtime skill subsystem** — the identity-scoped catalog (localdb\u002Fpostgres), the Skills.md importer, the in-runtime generator, the HA-61 reviewed import flow, the HA-62 draft tool, the HA-66 boot baseline loader, and the planner's mid-reasoning skill lookup path.\n\nThe two are unrelated. The glossary entry pins this distinction (`docs\u002Fglossary.md` → \"skill (operator)\" vs \"skill (runtime)\"). Don't conflate them.\n\n## Common failure modes\n\n- **Memory exceeds the working-input target mid-conversation.** Check `memory.budget_tokens` and the effective model profile. Fresh results remain protected; lowering the target is not permission to discard evidence. Compaction cost and savings depend on actual input and provider usage, not a fixed per-turn estimate.\n- **Compaction reports an incomplete summary with `finish_reason: length`.** Inspect provider usage and `memory.summarizer.max_tokens`, including reasoning tokens. Increase the deployment's allowance within the selected model's capacity and restart; do not accept truncated summaries or blindly replay external actions after a failed turn.\n- **Compaction fails while the recent-turn window is full.** An interrupted or cancelled run with fully settled dispatches can record its terminal state while preserving unsummarized overflow. The next run must compact that tail before successful rollover. Existing abandoned journals require explicit authorized recovery; an unknown external outcome remains refused. No tool is replayed and recovery does not renew the source lifetime.\n- **`harbor dev` reboots in a loop after enabling memory.** Your `memory.dsn` is inside the project directory and the SQLite WAL trap fires. Move the DSN to `\u002Ftmp\u002Fharbor-validation\u002F\u003Cproject>-memory.sqlite` or `~\u002F.harbor\u002F\u003Cproject>-memory.sqlite`.\n- **`harbor skill import` fails with \"skill name already exists\".** The catalog rejects duplicate names by default. Re-import with `--overwrite`, remove the old entry first (`harbor skill rm \u003Cname>`), or rename the skill in the file.\n- **The planner doesn't pick a skill I imported.** Either the skill's `trigger:` doesn't pattern-match the user's input (write more concrete trigger language), the run can't see a tool the skill requires (`required_tools` is capability-filtered — default-deny), or `planner.max_steps` is too low to reach the skill-search turn. Pin it (`skills.directory.pinned`) to guarantee it's at least visible in every `\u003Cskills_context>` block.\n- **A session-personal skill update returns `session_skill_cutover_pending`.** This is the production-safe default while the tenant is unlisted, undrained, or still being freshly verified. Do not write through to a legacy shared body. Drain old writers, attest the exact roster, set the declaration true, restart, and wait for Harbor to reach `state_only`.\n- **A boot pack and a revision pack collide at the same name with different content.** That is the strict operator-tier conflict: same canonical name, differing semantic hash — the boot fails loud (pre-read at readiness) and every later run refuses too. It is never a silent overwrite. Align the bodies (or the names), then restart; the boot baseline and the durable revision must agree on the canonical content hash to compose as `source=both`.\n- **A mutation on a boot-owned name returns a typed read-only refusal.** Boot-declared names are read-only to `upsert`, every proposal-commit path, and rollback\u002Factivation — even at equal hash (the NAME is boot-owned, not the bytes). Removal is the one narrow exception: it may delete an ACTUAL legacy durable revision shadow at that name, while a boot-only name (owned by the baseline, absent from the durable revision) still returns the typed read-only refusal and is never removed. Change the boot config (or the revision's name), then restart; do not try to write through.\n- **Cross-session memory leakage suspected.** It can't happen — the SQL filter is at the driver. If you see it, file a bug with the SQL trace from `telemetry.log_level: debug` — a leak would be a P0 security issue.\n\n## See also\n\n- [`define-the-agent-yaml`](..\u002Fdefine-the-agent-yaml\u002FSKILL.md) — the `memory:` and `skills:` blocks in context.\n- [`add-an-in-process-tool`](..\u002Fadd-an-in-process-tool\u002FSKILL.md) — when a skill becomes \"actually run code\".\n- [`observe-with-the-console`](..\u002Fobserve-with-the-console\u002FSKILL.md) — the Memory tab + the Skills tab show what the planner saw on each turn.\n- [`docs\u002Frecipes\u002Fembed-and-retrieve.md`](..\u002F..\u002Frecipes\u002Fembed-and-retrieve.md) — the embedding client à la carte + both semantic-retrieval opt-ins from Go.\n- RFC §6.7 — the runtime skill subsystem design.\n- RFC §6.6 — the memory subsystem design.\n","# Configure memory + runtime skills\n\nTwo subsystems that look similar but solve different problems:\n\n- **Memory** — multi-turn context within a session. Lets the agent remember what it said three turns ago without re-reading the whole event log every step.\n- **Runtime skills** — token-savvy, DB-backed playbooks the planner can search by name and inject into a prompt mid-reasoning. Distinct from \"operator skills\" (the docs\u002Fskills\u002F directory you're reading) — runtime skills are mechanism inside the planner, not docs for humans.\n\nBoth subsystems share a key contract: **identity-scoped by (tenant, user, session)** — the same multi-isolation triple that gates everything else in Harbor. No cross-session leakage. Ever.\n\n## 1. Memory — strategies + drivers\n\nMemory has two axes you tune independently:\n\n- **Strategy** (`memory.strategy`) — how the planner uses memory each turn.\n- **Driver** (`memory.driver`) — the administrative memory adapter. Durability\n  comes from the shared `state.driver`, not from a separate memory transcript.\n\n### Strategies\n\n| Strategy           | When to use                                                                 |\n|--------------------|------------------------------------------------------------------------------|\n| `none`            | Explicit stateless opt-out. Each run starts cold.                           |\n| `rolling_summary` (default) | Cumulative short-term session context with 20 recent detailed turns. |\n\n`rolling_summary` preserves the conversation arc while compacting model input.\nBy default the summariser uses the run's model through the governed Bifrost\nclient. For local inference, `memory.summarizer.model` selects a separately\nprofiled model. For externally routed runs, use the independently authorized\n`memory.summarizer.provider_route` selector described in\n[the configuration reference](..\u002F..\u002FCONFIG.md#memorysummarizerprovider_route).\nIt reuses the same resolver and verified run identity; it cannot repurpose a\nsigned grant or silently fall back after revocation. Model routing remains\nrestart-required even when the working-input budget is edited through Protocol.\n\n`memory.summarizer.max_tokens` separately configures the completion allowance\nfor each compaction call, including provider reasoning. Omitted\u002Fzero preserves\nthe 2048-token default; for example, set `8192` for a deployment that needs more\nroom to finish a summary. The matching environment override is\n`HARBOR_MEMORY_SUMMARIZER_MAX_TOKENS`; both are restart-required. This does not\nchange the working-input target or driving model's output limit. Routed model\ncapacity and governance still apply, and incomplete output never replaces a\ncheckpoint. Valid summaries are not additionally capped at 16 KiB; subsequent\nrequests still pass configured byte and token admission. See\n[the reference](..\u002F..\u002FCONFIG.md#memorysummarizermax_tokens).\n\n`memory.summarizer.max_calls` sets the maintenance-call allowance per compaction\n(zero\u002Fomitted: `16`). YAML or `HARBOR_MEMORY_SUMMARIZER_MAX_CALLS` changes require\na restart. Raise it only when more chronological chunks are needed; exhaustion\npreserves the previous checkpoint, and increasing the allowance can increase\ntime and spend. There is no separate session-wide reference\u002Fevidence count cap,\nand `recent_turns` has no fixed maximum of 32. Existing execution tranches,\nconfigured request admission, identity, expiry and erasure still apply. See\n[the call allowance reference](..\u002F..\u002FCONFIG.md#memorysummarizermax_calls), including\nreceipt-consumer compatibility when using more than sixteen calls.\n\nThe removed `truncation` strategy is rejected rather than silently dropping\nunsummarized context when a window fills.\n\nMaintenance requests are bounded by the summariser model's input allowance,\nwith each step sent as its own part. An exchange too large for one part is\nsummarised from a clipped preview whose exact text stays reachable by\nartifact reference. If maintenance fails, the run keeps its previous\ncheckpoint and continues; when the request no longer fits, the oldest\nobservations are reduced to previews with references until it does. A\ncompleted turn without a new checkpoint keeps its unsummarised history, and the\nnext turn compacts before its first decision.\n\n### Persistence\n\n| State driver | When to use                                                              |\n|------------|----------------------------------------------------------------------------|\n| `inmem`    | Dev. Memory dies on `harbor dev` restart.                                  |\n| `sqlite`   | Single-node production. Survives restarts. Default for self-hosted agents. |\n| `postgres` | Multi-replica production. Use behind a load balancer.                      |\n\n### Example: chat agent with rolling summary on SQLite\n\n```yaml\nmemory:\n  driver: inmem              # shares the durable StateStore below\n  strategy: rolling_summary\n  recent_turns: 20\n  budget_tokens: 8000          # working-input compaction target, not output tokens\nstate:\n  driver: sqlite\n  dsn: \u002Ftmp\u002Fharbor-validation\u002Fmy-agent-state.sqlite   # outside the project dir (WAL trap)\n```\n\n`budget_tokens` is the soft working-input target for the complete assembled\nrequest. With `rolling_summary`, zero derives that target from the effective\nmodel's input capacity and output reservation. It is independent of completion\nlimits; fresh tool results cannot be silently truncated to satisfy it. A positive\nvalue also enables within-run compaction for stateless agents. The removed\n`planner.token_budget` is rejected with migration guidance.\n\nOn served runtimes advertising `agent_config_memory_v1`, an admin can override\nthis same target per agent through the versioned `agent_config.set_revision`\npayload: `{\"memory\":{\"budget_tokens\":64000}}`. This is an example value, not a\nframework default. Read the current revision, preserve its writable sibling\nsections, and supply its `expected_content_hash` to avoid overwriting concurrent\nedits. Omit `memory` to inherit YAML again; present zero requests automatic\nsizing. Changes apply to the next run, never a running one. The runtime must\nalready have its compactor configured; this edit cannot enable an unwired LLM.\n\nIn PR #779, `rolling_summary` now selects the cumulative execution-context path\nfor both served and embedded root runs. Set `recent_turns: 20` (zero also selects\ntwenty); this bounds detail, not how far back checkpoint meaning reaches.\nThe separate `sessions.retained_context_turns` and SDK activation option are\nremoved. Persistence uses the configured StateStore and session lifetime.\nOmitted YAML settings and `config.Defaults()` now enable that memory behavior;\nset `memory.strategy: none` explicitly to disable it. Compaction can incur\ngoverned model calls. The pair-summary engine and its recovery loop are removed;\nadmin inspection and mutation use the same owner as execution. See the\n[implementation tracker](..\u002F..\u002Fnotes\u002Fportable-context-tracker.md).\n\nAdministrative `Put` accepts conversational notes only; execution receipts and\ntheir provenance come from the runtime journal. Heavy `memory.get` values return\nreferences resolved through bounded `artifacts.get`, without storing a second\ncopy. These references cannot be presigned and stop resolving when their source\nis deleted, expired or replaced. Refresh `memory.list` for the current projection;\nuse `memory.delete`, not artifact deletion, to remove a memory source.\n\n### Removed semantic-memory retrieval\n\nRemove `memory.retrieval`, `memory.retrieval_top_k`,\n`memory.retrieval_min_score` and their `HARBOR_MEMORY_RETRIEVAL*` environment\noverrides. They now fail validation. Cumulative session memory uses checkpoints\nand recent execution evidence; it does not maintain a separate embedding index.\nExternal long-term memory can still arrive through caller memory or ordinary\ncapability tools. Semantic skill retrieval remains available.\n\n### Caller-supplied external memory (D-364)\n\nA Protocol client supplies the fixed `caller_supplied` entry by sending\n`caller_memory` on a `start` request (see\n[`use-the-harbor-protocol`](..\u002Fuse-the-harbor-protocol\u002FSKILL.md)).\nThat content remains separate from runtime-owned conversation context and\ncannot replace it. Native semantic recall no longer produces `recalled_turns`.\n\nWhat this means for you as the operator:\n\n- **You do not enable it.** There is no config key. It is on the Protocol surface for every caller with a valid identity, and it is bounded at 32 KiB per request at the edge, refused before any task is created. Your runtime advertises `caller_memory` in `runtime.info.capabilities`, so a client can tell whether it is supported before relying on it.\n- **That 32 KiB is a resource bound, not a security boundary — do not budget your threat model against it.** It bounds caller-memory admission before dispatch; it does not authorize the content or replace assembled-request budgeting. It tells you nothing about how much content a caller can put in front of the model — the same caller can send more through the uncapped `query`, which lands in the *unframed* conversation position, and through `agent_config.session.set_user_prompt`, which needs no admin scope, takes a 1 MiB body, and lands *inside* the system prompt. What contains a caller's payload is the tier it lands in, never its size.\n- **A caller can only reach that ONE prompt position.** It never touches the trusted base prompt (that is `system_prompt_override`, a different and strictly more powerful knob) and it never writes the conversation-memory tier, which is a claim about the session's stored turns only the runtime makes.\n- **You can see it happening.** Every admitting run emits `memory.caller_block_admitted` with `bytes` \u002F `tier` \u002F `key` — a size, never content — so an audit trail shows caller-asserted memory entering a run without becoming a copy of it. In a trace, the external tier carries `{\"caller_supplied\":{…}}`, distinct from runtime-owned conversation memory.\n- **It is stored redacted, like its siblings.** The payload is persisted on the task record (and so to disk), and it goes through the audit redactor on the way in — the same one the run's `query` and description take. The redactor walks the decoded JSON, so structure survives and only secret-shaped keys (`api_key` \u002F `password` \u002F `secret` \u002F `token` \u002F `cookie` \u002F `authorization`) and inline `Bearer …` \u002F `Basic …` values become `***`. The redacted form is what the prompt sees too, which is already true of `query`.\n- **The framing is the mitigation, and neither it nor the redactor is a sanitiser.** The tier's five-line anti-injection preamble tells the MODEL not to obey the content; it does nothing about what the bytes contain. The audit redactor is a PATTERN redactor: it does not detect PII, does not detect a credential that reads as ordinary prose, and cannot make hostile text safe. A caller that pipes unredacted third-party content through `caller_memory` still has a data-leakage path no prompt wrapper and no pattern redactor closes.\n- **Nothing meters admission volume.** Token spend is metered at the LLM edge by the governance layer, so the cost is governed — but a caller may send 32 KiB on every `start` and no per-tenant accounting of admission itself exists yet.\n\n### Identity scoping\n\nEvery memory write\u002Fread is keyed by `(tenant_id, user_id, session_id)`. The planner cannot read user A's memory from user B's session — the SQL `WHERE` clause filters before the rows reach the planner. This is enforced at the driver level, not at the planner; even a buggy planner cannot leak cross-session.\n\n## 2. Runtime skills — DB-backed playbooks the planner searches\n\nRuntime skills are typed, token-savvy reusable patterns the planner can ask for by name mid-reasoning. What a run sees is an **effective composition**, not one flat table: the identity-scoped **base\u002Fuser\u002Fsession** rungs plus **one operator tier** applied LAST, so operator-authored content deterministically wins a name collision against caller content.\n\nThe operator tier is itself a strict merge of TWO operator-managed sources:\n\n- **Active revision packs** — the selected agent's durable `agent_packs` section of its active agent-config revision (protocol-managed and versioned; the `agent_config.agent_packs.*` verbs author it).\n- **HA-66 boot packs** — the node-local `skills.boot_agent_packs` config-declared baseline, loaded eagerly and immutably before readiness (see below).\n\nThe merge is strict, never last-write-wins: the same canonical name with the same canonical semantic content hash dedupes to ONE item marked `source=both` (migration-safe — moving an unchanged body between the durable revision and the boot config must not split the composed view); the same name with a differing hash **fails loud**; and the unique combined tier holds at most **256** items. Run snapshots and the composition preview report per-item `boot|revision|both` provenance plus the deterministic `boot_pack_set_hash` (and combined\u002Frevision set hashes), so you can verify exactly what the resolved agent composes.\n\nSkills enter the catalog through these producers:\n\n- **Skills.md importer** — you write a Skills.md file (one skill per file: YAML frontmatter + a `## Steps` body) and ingest it with `harbor skill import \u003Cpath>`.\n- **In-runtime generator** — the planner itself can author a new skill at runtime (e.g. \"this kind of question seems common — let me save the steps as a skill\") and persist it via the `skill_propose` built-in (opt-in; see below).\n- **Caller-authorized import (HA-61)** — the two-phase `import_validate` \u002F `import_commit` Protocol flow installs a reviewed personal-skill package (see below).\n- **Draft-only authoring (HA-62)** — `skill_create_draft` writes a reviewable draft artifact only, never an installed skill (see below).\n\n### Example: a Skills.md file\n\nOne skill per file. Two body forms are accepted.\n\n- **Sectioned (Harbor) form.** Prose, then `## Steps` (at least one dash list item) and the optional `## Preconditions` \u002F `## Failure modes` sections.\n- **Free-form (Agent Skills) form.** Any other body with instruction prose — arbitrary level-2 headings, numbered lists, code blocks, no `## Steps` — is kept verbatim as the skill's instructions in its description, which `skill_get` returns to the model. Any trailing run of canonical sections is still parsed as sections, and a single step \"Follow the instructions in this skill's description.\" is supplied when none is declared.\n\nThe frontmatter `description:` is the human-visible explanation of what the skill does (shown in listings and import reviews); it comes first in the skill's description, followed by the body prose. The frontmatter `trigger:` is the planner-visible match cue: when it is absent, it is derived from `description` (whitespace collapsed to one line), and a file with neither is refused. The Agent Skills keys `license`, `compatibility`, `allowed-tools` and `metadata` are accepted as advisory and are not stored: `allowed-tools` never grants a tool.\n\nListings and import reviews show only the first prose paragraph, capped at 500 runes; the joined instruction body stays available through `skill_get`. Without a frontmatter description, the first body prose paragraph supplies the summary (leading Markdown headings are skipped). A multi-paragraph frontmatter description is also summarized by its first paragraph: canonical packages retain the joined text, not the original frontmatter boundary.\n\n```markdown\n---\nname: triage-incident\ntitle: Triage an incident\ndescription: Classifies a support ticket into bug, feature or question and recommends the next action.\ntrigger: when a support ticket needs classification\ntags: [support, triage]\n---\n## Steps\n\n- Read the user's report.\n- Match against known categories.\n- If \"bug\", pull the last 5 PRs that touched the area.\n```\n\nThe same skill in the free-form Agent Skills form, packaged with a `references\u002F` file in a zip:\n\n```markdown\n---\nname: triage-incident\ndescription: Classifies a support ticket and recommends the next action. Use when a support ticket needs classification.\nlicense: Apache-2.0\n---\n# Triage an incident\n\n## Instructions\n\n1. Read the user's report.\n2. Match it against the categories in [the guide](references\u002Fcategories.md).\n3. If it is a bug, pull the last 5 PRs that touched the area.\n```\n\nBundled files are support files and must use the support MIME allowlist: Markdown, plain text, JSON, XML, SVG, common images, PDF and fonts, plus a text class for common script, source, data and template files (`.py`, `.sh`, `.js`, `.ts`, `.sql`, `.yaml`, `.csv`, `.html`, `.j2`, and similar). Text-class files must be UTF-8 without NUL bytes (empty files are fine); they are recorded as `text\u002Fplain; charset=utf-8`, stored as data, and never executed by Harbor. Common extension-less text files (`LICENSE`, `NOTICE`, `Makefile`, `Dockerfile`, and similar) are matched by exact name, `.xsd` \u002F `.xsl` \u002F `.xslt` files are XML, and macOS `__MACOSX\u002F` and `.DS_Store` entries are skipped. Zips from `zip -r` or Finder work: empty directory entries are skipped, and one top-level folder wrapping the whole skill (`my-skill\u002FSKILL.md`) is stripped. Binary executables, archives and other extension-less files are refused.\n\n### Import \u002F remove with the CLI\n\n```console\n$ harbor skill import .\u002Fskills\u002Ftriage-incident.skill.md\nimported \"triage-incident\" (scope=project, steps=3, attachments=0)\nstore: driver=localdb dsn=\u002Ftmp\u002Fharbor-validation\u002Fmy-agent-skills.sqlite\n\n$ harbor skill rm triage-incident\nremoved \"triage-incident\"\nstore: driver=localdb dsn=\u002Ftmp\u002Fharbor-validation\u002Fmy-agent-skills.sqlite\n```\n\nBehaviour you can rely on:\n\n- The verbs resolve the store from `harbor.yaml`'s `skills:` block — the **same store `harbor dev` serves** — and print the resolved `driver=… dsn=…` so you can see exactly where the skill landed. Pass `--config \u003Cpath>` for a non-default config.\n- Skills are identity-scoped (`(tenant, user, session)`). The verbs default to the `harbor dev` triple (`dev`\u002F`dev`\u002F`dev`); use `--tenant` \u002F `--user` \u002F `--session` for anything else.\n- A duplicate name is **rejected with exit 1** (\"pass --overwrite to replace, or `harbor skill rm \u003Cname>` first\"); `--overwrite` replaces it. An invalid file (missing frontmatter, empty `trigger:`, no steps) exits 1 with the validator's reason. `rm` of a missing name exits 1.\n- The global `--json` flag switches both verbs to a machine-readable result (`{\"result\":\"imported\",\"driver\":…,\"dsn\":…,\"report\":{…}}`).\n- Inline attachments (`![alt](relative\u002Fpath)`) resolve relative to the file's own directory and upload to the configured artifact store; paths escaping that directory are rejected.\n\nGo-level: the verbs are thin callers over `importer.ImportAndStore` — a headless embedder calls the same function (see `docs\u002Frecipes\u002Fuse-memory-and-skills-from-go.md`).\n\nOnce the skills are in the catalog, the planner sees them at reasoning time two ways: a bounded per-turn `\u003Cskills_context>` browse window (the skills directory — see below) and on-demand retrieval via the `skill_search` \u002F `skill_get` meta-tools — token-savvy because full skill bodies only enter the prompt when the LLM actually pulls them.\n\n### Caller-authorized reviewed import (HA-61) — `import_validate` \u002F `import_commit`\n\nFor a caller (a Protocol client, not an operator with a shell), installing a personal skill is a two-phase, reviewed proposal flow — never an immediate upsert:\n\n- **`agent_config.user.skills.import_validate`** — the caller uploads a bounded complete skill package (zip carrying exactly one root-level `SKILL.md`, or a single Markdown document) as a caller-owned artifact via `artifacts.put`, then calls validate with that artifact ref plus the effective agent. The runtime runs the ONE production importer\u002Fvalidator and returns the closed normalized review, hashes, and warnings together with a **stateless opaque proposal token**. Validate performs **ZERO writes** of any kind: no SkillStore body\u002Fpackage write, no agent-config membership write, no proposal-ledger write — the review rides entirely inside the sealed token (24h window, refreshable by re-validating).\n- **`agent_config.user.skills.import_commit`** — the caller echoes the token plus the reviewed `PackageHash`, expected config hash, canonical name, and explicit replace consent. The runtime authenticates and strictly decodes the sealed claims, re-derives identity and signed effective-agent reach, rechecks lifecycle \u002F policy \u002F ceilings \u002F expected config hash, forces `ScopeUser` + caller ownership server-side, and atomically materializes the approved package plus membership in ONE conditional write. Response-loss retry is idempotent; competing commits have one winner.\n\nAuthority model to rely on: identity comes from the VERIFIED context (no selectable tenant\u002Fuser\u002Fsession\u002Fscope — the request carries no authority fields), signed session-reach and agent-reach gates run before any artifact lookup or persistence, and the package frontmatter is CLOSED (authority-bearing fields are rejected by the importer). `required_tools` \u002F `required_namespaces` \u002F `required_tags` are **applicability metadata, never grants**: a requirement outside the run-visible capability snapshot is a WARNING (the injection-time filter scrubs it), and the policy snapshot is sealed into the token so a policy change between validate and commit is a typed revocation refusal. A boot-owned canonical name is read-only to this flow too, even at equal hash (see HA-66 below).\n\n### Personal skill export\n\n`agent_config.user.skills.export` (`POST \u002Fv1\u002Fagent_config\u002Fuser\u002Fskills\u002Fexport`)\naccepts `identity`, `agent_id`, and the canonical personal skill `name`. Like\n`user.skills.list`, it requires the verified caller and signed reach to an\nactive Agent, without an admin or `agent_config:user` scope. It exports only\nthat caller's durable user-scope package installed through reviewed import;\na same-name shared, foreign, or legacy upsert-only skill is never a fallback.\n\nThe response carries `artifact` (the normal `ArtifactRef`), `package_hash`,\n`name`, `size_bytes`, and `protocol_version`. Retrieve its bytes through\n`artifacts.get` or `artifacts.get_ref`. The ZIP has root `SKILL.md` and all\npackage support files and can enter the normal reviewed import flow. A\npackage installed from a single Markdown document exports in the same form. The\npackage hash identifies package content; the artifact SHA256 identifies the\nZIP bytes. Export writes only the caller-owned artifact, with no skill,\nmembership, or revision change. Missing installed packages, including legacy upsert-only rows, return\n`not_found`.\n\n### Draft-only authoring (HA-62) — `skill_create_draft`\n\n`skill_create_draft` is an ordinary runtime tool that turns a bounded authoring intent (plus optional revision feedback) into ONE validated, caller-scoped, resource-free `SKILL.md` **draft artifact** — `installed: false`, `state: draft`. It is deliberately non-authoritative: it writes exactly one immutable artifact under the invocation's verified run identity and has **zero mutation authority** — no skill-store upsert, no membership\u002Frevision write, no operator-pack proposal\u002Fpublication, no capability registration, no tool exposure, no approval\u002FOAuth path. Identity comes exclusively from the run context; the closed argument shape (intent + optional feedback) rejects any owner\u002Fscope\u002Fidentity\u002Fpersistence\u002Fpublication\u002Fgrant field.\n\nIt is **disabled by default**: the tool is a known built-in in the registry's `KnownNames()` and an operator enables it by listing it in `tools.built_in`, exactly like every other built-in — the recommended\u002Fdefault configs simply do not list it. The assembly supplies the composed LLM client; explicitly listing the tool on a runtime without a usable LLM fails the boot loud. Once enabled it is opt-in per agent through the ordinary tool policy, with the same policy \u002F approval \u002F governance \u002F rate-and-cost \u002F deadline \u002F cancellation \u002F redaction \u002F audit wrappers as every other ordinary tool. Installing the draft is a SEPARATE explicit caller action through the HA-61 validate\u002Fcommit flow — creating the draft never installs or enables a skill. The result may warn that declared `required_tools` are metadata only and never grant capability.\n\n### Yaml config\n\n```yaml\nskills:\n  driver: localdb                  # localdb (default, SQLite) | postgres (durable\u002Fshared)\n  dsn: \u002Ftmp\u002Fharbor-validation\u002Fmy-agent-skills.sqlite    # WAL trap caveat applies\n  # Postgres variant — durable\u002Fshared storage for multi-instance\n  # deployments (every replica sees the same skills catalog):\n  #   driver: postgres\n  #   dsn: postgres:\u002F\u002Fharbor:${HARBOR_SKILLS_PG_PASSWORD}@db:5432\u002Fharbor?sslmode=require\n  #   migration_mode: apply # direct endpoint; switch to verify with pooled dsn after apply\n  # retrieval: semantic            # optional — skill_search ranks by embedding\n  #                                # similarity instead of the FTS5\u002Fregex\u002Fexact\n  #                                # ladder (requires the embeddings: block; the\n  #                                # capability filter, redaction, and budgeter\n  #                                # apply unchanged on top)\n  directory:                       # optional — shapes the per-turn \u003Cskills_context> block\n    pinned: [triage-incident]      # always listed first, in this order\n    max_entries: 10                # 0\u002Funset → planner.skills_context_max (default 5)\n    selection: pinned_then_recent  # the one wired value (pinned_then_top is rejected: not yet wired)\n  # boot_agent_packs:              # optional (HA-66) — node-local operator baseline\n  #   - tenant_id: acme            # exact, case-sensitive tenant key\n  #     agent_id: harbor-dev-agent # must equal the resolved boot\u002Fdefault agent\n  #     directory: \u002Fetc\u002Fharbor\u002Fskills   # config-file-relative, never CWD\n  #     include: [workbench-foundation] # package directories, one SKILL.md each\n\ntools:\n  built_in:\n    - skill_search    # the LLM discovers runtime skills by capability text\n    - skill_get       # the LLM pulls the full bodies of named skills\n    - skill_list      # the LLM enumerates the catalog (paged, summary-only)\n    # - skill_propose      # OPT-IN: lets the LLM author + persist new skills\n    # - skill_create_draft # OPT-IN (HA-62): drafts ONE immutable caller-scoped\n    #                      # SKILL.md artifact; needs the assembly's composed\n    #                      # LLM client (boot fails loud without one)\n```\n\n**Store drivers.** Skills ship at two-driver parity (the memory triple has no skills equivalent):\n\n| Driver     | Use when                                                                 |\n| ---------- | ------------------------------------------------------------------------ |\n| `localdb`  | Default. CGo-free SQLite, a per-instance file. Single-node \u002F embedded.    |\n| `postgres` | Durable, shared Postgres for multi-instance deployments — every replica sees the same skills catalog. Same conflict policy, identity scoping, and FTS → regex → exact ranking ladder as `localdb` (the full-text tier rides a `tsvector` + GIN index). |\n\nSwitching backends is a `driver:` + `dsn:` change — the CLI verbs, meta-tools, directory, and semantic mode all behave identically (proven by the shared conformance suite). Identity scoping (`(tenant, user, session)` in the SQL `WHERE`) is enforced at the driver on both.\n\nFor Postgres, empty\u002F`apply` runs forward migrations under a session advisory lock and therefore needs a direct\u002Fsession-capable endpoint. A transaction-pooled steady-state deployment first completes that apply separately, then switches BOTH the DSN to the pooler and `migration_mode` to `verify`. Verify mode proves the subsystem's namespaced `harbor_schema_migrations` and `harbor_store_identity` rows plus required physical schema; a state ledger or `state_records` table never satisfies memory. It refuses startup if identity, checksums, schema, or any embedded version is missing and never creates or repairs schema through the pool. During a staged v1.29.1 rollout, use `harbor postgres cutover --mode inspect` and the non-destructive `--mode copy --freeze-ack` procedure from the PostgreSQL cutover recipe before switching one runtime to a unified DSN.\n\n### Node-local boot agent packs (HA-66) — `skills.boot_agent_packs`\n\nAn operator may declare a **node-local, resource-free operator skill baseline** for the resolved boot\u002Fdefault agent in boot config (the `boot_agent_packs:` block above). Behaviour you can rely on:\n\n- **Loaded eagerly, immutably, before readiness.** The strict loader reads every declared package directory through the ONE production importer\u002Fvalidator at boot — before the runtime is ready or any listener binds — and fails the boot LOUD on any malformed, unresolvable, or un-importable entry. The frozen set is fixed for the process lifetime (restart-only; never hot-reloaded).\n- **Zero persistence, zero admin verbs.** The loader performs **no SkillStore writes, no ArtifactStore writes, no AgentConfig revisions, no lifecycle materialization, and no admin pack verbs** — it is a pure eager filesystem read + parse + validate. It never creates agents or widens reach. `EnsureBootAgentLifecycle` is a separate mechanism and MAY write a revision.\n- **Node-local, never converged.** Each node reloads its own files at boot. The durable Postgres `${SKILLS_DSN}` store persists agent revisions and personal state but NEVER the boot packs — a file change on one node never converges the others, and boot packs are never shared through the store.\n- **One combined operator tier.** Boot entries merge with the agent's active durable revision-pack items into ONE strict operator tier (see the §2 intro): same canonical name + same semantic hash dedupes as `source=both`; differing hash fails loud; at most 256 unique combined items; the tier applies LAST over base\u002Fuser\u002Fsession skills. Every declared tenant-agent active revision is pre-read before readiness, so a conflict surfaces at boot, not at first run.\n- **Boot\u002Frevision provenance + `boot_pack_set_hash`.** The run snapshot and the read-only composition preview (`agent_config.composition.preview`) report per-item `boot|revision|both` provenance alongside the deterministic `boot_pack_set_hash` (a node-local digest over the normalized boot entries, distinct from per-package hashes, stable across restarts for an unchanged config) — so you can verify exactly what the resolved agent composes.\n- **Boot-owned names are read-only.** `upsert`, every proposal-commit path, and rollback\u002Factivation refuse a boot-declared canonical name with a typed error, even at equal hash — the NAME is boot-owned, not the bytes. Removal is the narrow exception: it may delete a real legacy active-revision shadow at that name, while a boot-only removal is a typed read-only refusal, never false success.\n- **Config removal affects new runtime\u002Fnew runs only.** Removing a `boot_agent_packs` declaration removes the boot contribution on the NEXT deployment\u002Frun; already-captured in-flight snapshots retain their bytes and hash, and an independently persisted durable revision remains revision-only (no tombstone, no erasure). A name with both contributions absent stays non-oracularly unavailable.\n- **Headless `RunOnce` against a boot-pack agent is unsupported and fails loud** — it never silently runs without the packs. Production `harbor serve` and the devstack resolve the SAME loader path.\n\n### Organization skill publications (HA-68 \u002F D-430)\n\nOrganization publications are a Protocol-managed, same-runtime source for\nreviewed skill revisions. They are not another `skills:` YAML block and they\ndo not turn the ordinary identity-scoped catalog into a tenant-wide search.\nConfigure the existing skills store and StateStore first; the publication\ndomain uses that StateStore's conditional-save and idempotency contract.\n\nThe verified organization administrator path is:\n\n1. `skills.publications.publish` creates the first immutable,\n   content-addressed revision.\n2. `skills.publications.list` and `.get` inspect bounded metadata only.\n3. `skills.publications.publish_successor` advances an exact generation\u002Fhash\n   compare-and-set; `skills.publications.retire` closes the revision lifecycle.\n\nThe caller path is available only after the request's verified identity and\nsigned effective-agent reach are checked:\n`skills.publications.available`, `.install`, `.update`, `.remove`, and\n`.references.list`. A reference pins the exact publication\u002Frevision id,\ngeneration, content hash, lifecycle state, and runtime\u002Fdeployment id for the\ndurable tenant\u002Fuser\u002Fagent state. List results, references, and receipts never\ncontain the body. Only the authorized runtime resolver returns a body, and it\nfails closed on a retired, stale, foreign-runtime, wrong-hash, or unreachable\nreference.\n\nPeople can also propose their own personal skills for organization review\n(D-508): `skills.publications.candidates.submit` freezes a snapshot of the\ncaller's skill, admins list and read the pending candidates, then `accept` one\nas a new publication or a successor revision (through the same publication\nstore, so every invariant above applies) or `reject` it with a note. A skill\nwith support files cannot become a publication yet and is refused at\nsubmission. `skills.publications.read` shows any caller the body of an active\npublication before they install it.\n\nDo not copy a publication into each user's skill triple, use a shared service\nidentity, or treat `ScopeTenant`\u002F`ScopeGlobal` as an implemented publication\nvisibility shortcut. Do not place publication bodies in logs, events, audit\npayloads, metadata, or model-visible discovery. At this checkpoint the\npublication domain, persistence contract, and canonical wire registration are\nlanded; do not claim an end-to-end route until the Protocol transport and\nruntime-composition consumer are present and their focused integration tests\npass. See [Phase 250](..\u002F..\u002Fplans\u002Fphase-250-same-runtime-skill-publications.md)\nand D-430.\n\n### LLM-side discovery via meta-tools\n\nThe React planner runs on native provider tool-calling: the LLM doesn't ask \"what skills do I have?\" in prose — it calls the `skill_search` built-in when it needs one. The meta-tools are the rich skills handlers (capability filter + redaction + token budgeter) over the SAME store your `harbor skill import` populated — one source of truth, identity-scoping carries through:\n\n- `skill_search(query, limit?)` — ranked candidates, capability-filtered to the tools this run can actually see (a skill requiring a tool the run isn't granted never surfaces).\n- `skill_get(names[], max_tokens?)` — full bodies, budget-fit through a tiered ladder (full → drop optional sections → cap steps at 3); an impossibly small budget errs loudly rather than silently truncating.\n- `skill_list(scope?, task_type?, tags?, limit?, offset?)` — paged enumeration, summary-only.\n- `skill_propose({skill, persist})` — the in-runtime generator. **Deliberately opt-in** (list it in `tools.built_in` only when you want the LLM persisting skills): persisted skills are stamped `Origin=generated`, can never overwrite an imported pack skill, and every persist emits a mandatory redacted `skill.proposed` audit event. This is the STRUCTURED generator; the natural-language draft path is the separate HA-62 `skill_create_draft` tool above.\n\n### The per-turn skills directory (`\u003Cskills_context>`)\n\nIndependent of the meta-tools, every planner turn carries a compact `\u003Cskills_context>` block produced by the **skills directory**: a bounded, stable, pinned-then-recent browse window over the catalog (name \u002F title \u002F trigger \u002F task type \u002F pinned flag — never full bodies). The block tells the LLM *what exists*; pulling content is `skill_get`'s job. Tune it with the `skills.directory` yaml block above — `pinned` guarantees your flagship skills are always visible, `max_entries` caps the budget, and the stable ordering keeps the prompt prefix KV-cache-friendly. Capability filtering applies to the directory too: pinning never bypasses it.\n\n### Session-personal skill cutover — operator-only, deny writes until verified\n\nPhase 233a moves agent-owned session-personal skill bodies to durable records.\nThe rollout is intentionally **not** automatic: the default is read-only\n`dual_read`. Existing eligible legacy session skills remain readable, but every\nsession-personal mutation is refused with `session_skill_cutover_pending`\n(HTTP 409) until the tenant completes its declared migration. Do not retry that\nerror by writing a legacy shared-skill row.\n\nOnly declare a tenant after all older writers for that tenant have drained.\nThe declaration is static and takes effect on restart; it neither discovers\ntenants\u002Fwriters nor makes writes safe merely because its flag is set. It needs\nthe normal configured SkillStore and a durable StateStore in production:\n\n```yaml\nstate:\n  driver: sqlite\n  dsn: \u002Fvar\u002Flib\u002Fharbor\u002Fstate.sqlite\n\nskills:\n  driver: localdb\n  dsn: \u002Fvar\u002Flib\u002Fharbor\u002Fskills.sqlite\n  session_personal_cutover:\n    tenants:\n      - tenant_id: tenant-acme\n        epoch: 2026-08-cutover-01\n        roster_digest: sha256-... # an operator-attested label, never a secret\n        legacy_writers_drained: false\n```\n\n`tenant_id` is case-sensitive. The list is capped at 256 declarations, and its\nidentifiers\u002Fepoch\u002Fdigest are bounded printable-ASCII tokens; bad or duplicate\nentries fail boot. Start with `legacy_writers_drained: false`. After draining\nall older writers and attesting the roster, change it to `true` and restart.\nHarbor resumes its bounded checkpointed migration and performs a fresh\nverification pass. It alone writes durable `state_only`; until then, mutation\nrefusal is expected and protects the authoritative legacy view.\n\n### Skill vs tool — when to pick which\n\n- **Tool** — there's code to run, an API to call, a typed input\u002Foutput. Build a [tool](..\u002Fadd-an-in-process-tool\u002FSKILL.md).\n- **Skill** — there's a *reasoning pattern* the planner should follow (a recipe, a checklist, a domain heuristic). Build a skill.\n- **Both** — many real agents do both. A `triage-incident` skill whose step 4 says \"call the `ticket.find_related_prs` tool\" reaches into both subsystems.\n\n## 3. Operator-skill vs runtime-skill — the naming clarification\n\n`docs\u002Fskills\u002F` (what you're reading right now) holds **operator playbooks** — markdown docs for humans building agents. They are NOT loaded into the planner at runtime; they're adoption material.\n\n`internal\u002Fskills\u002F` (RFC §6.7) holds the **runtime skill subsystem** — the identity-scoped catalog (localdb\u002Fpostgres), the Skills.md importer, the in-runtime generator, the HA-61 reviewed import flow, the HA-62 draft tool, the HA-66 boot baseline loader, and the planner's mid-reasoning skill lookup path.\n\nThe two are unrelated. The glossary entry pins this distinction (`docs\u002Fglossary.md` → \"skill (operator)\" vs \"skill (runtime)\"). Don't conflate them.\n\n## Common failure modes\n\n- **Memory exceeds the working-input target mid-conversation.** Check `memory.budget_tokens` and the effective model profile. Fresh results remain protected; lowering the target is not permission to discard evidence. Compaction cost and savings depend on actual input and provider usage, not a fixed per-turn estimate.\n- **Compaction reports an incomplete summary with `finish_reason: length`.** Inspect provider usage and `memory.summarizer.max_tokens`, including reasoning tokens. Increase the deployment's allowance within the selected model's capacity and restart; do not accept truncated summaries or blindly replay external actions after a failed turn.\n- **Compaction fails while the recent-turn window is full.** An interrupted or cancelled run with fully settled dispatches can record its terminal state while preserving unsummarized overflow. The next run must compact that tail before successful rollover. Existing abandoned journals require explicit authorized recovery; an unknown external outcome remains refused. No tool is replayed and recovery does not renew the source lifetime.\n- **`harbor dev` reboots in a loop after enabling memory.** Your `memory.dsn` is inside the project directory and the SQLite WAL trap fires. Move the DSN to `\u002Ftmp\u002Fharbor-validation\u002F\u003Cproject>-memory.sqlite` or `~\u002F.harbor\u002F\u003Cproject>-memory.sqlite`.\n- **`harbor skill import` fails with \"skill name already exists\".** The catalog rejects duplicate names by default. Re-import with `--overwrite`, remove the old entry first (`harbor skill rm \u003Cname>`), or rename the skill in the file.\n- **The planner doesn't pick a skill I imported.** Either the skill's `trigger:` doesn't pattern-match the user's input (write more concrete trigger language), the run can't see a tool the skill requires (`required_tools` is capability-filtered — default-deny), or `planner.max_steps` is too low to reach the skill-search turn. Pin it (`skills.directory.pinned`) to guarantee it's at least visible in every `\u003Cskills_context>` block.\n- **A session-personal skill update returns `session_skill_cutover_pending`.** This is the production-safe default while the tenant is unlisted, undrained, or still being freshly verified. Do not write through to a legacy shared body. Drain old writers, attest the exact roster, set the declaration true, restart, and wait for Harbor to reach `state_only`.\n- **A boot pack and a revision pack collide at the same name with different content.** That is the strict operator-tier conflict: same canonical name, differing semantic hash — the boot fails loud (pre-read at readiness) and every later run refuses too. It is never a silent overwrite. Align the bodies (or the names), then restart; the boot baseline and the durable revision must agree on the canonical content hash to compose as `source=both`.\n- **A mutation on a boot-owned name returns a typed read-only refusal.** Boot-declared names are read-only to `upsert`, every proposal-commit path, and rollback\u002Factivation — even at equal hash (the NAME is boot-owned, not the bytes). Removal is the one narrow exception: it may delete an ACTUAL legacy durable revision shadow at that name, while a boot-only name (owned by the baseline, absent from the durable revision) still returns the typed read-only refusal and is never removed. Change the boot config (or the revision's name), then restart; do not try to write through.\n- **Cross-session memory leakage suspected.** It can't happen — the SQL filter is at the driver. If you see it, file a bug with the SQL trace from `telemetry.log_level: debug` — a leak would be a P0 security issue.\n\n## See also\n\n- [`define-the-agent-yaml`](..\u002Fdefine-the-agent-yaml\u002FSKILL.md) — the `memory:` and `skills:` blocks in context.\n- [`add-an-in-process-tool`](..\u002Fadd-an-in-process-tool\u002FSKILL.md) — when a skill becomes \"actually run code\".\n- [`observe-with-the-console`](..\u002Fobserve-with-the-console\u002FSKILL.md) — the Memory tab + the Skills tab show what the planner saw on each turn.\n- [`docs\u002Frecipes\u002Fembed-and-retrieve.md`](..\u002F..\u002Frecipes\u002Fembed-and-retrieve.md) — the embedding client à la carte + both semantic-retrieval opt-ins from Go.\n- RFC §6.7 — the runtime skill subsystem design.\n- RFC §6.6 — the memory subsystem design.\n",{"name":5,"license":15,"metadata":24,"description":7},{"verbs":25,"surface":26,"framework":27},"skill import, skill rm","memory","harbor","main","d5e4bebc2516f8ae118156a73921760e3089c169","docs\u002Fskills\u002Fconfigure-memory-and-skills",1,"https:\u002F\u002Fgithub.com\u002Fhurtener\u002FHarbor","https:\u002F\u002Fgithub.com\u002Fhurtener","2026-11-15 04:22:13",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add hurtener\u002FHarbor --skill configure-memory-and-skills",{"tool":41,"command":42},"bunx","bunx skills add hurtener\u002FHarbor --skill configure-memory-and-skills",{"tool":44,"command":45},"pnpm","pnpm dlx skills add hurtener\u002FHarbor --skill configure-memory-and-skills","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhurtener\u002FHarbor\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Fconfigure-memory-and-skills\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M723EVVMQQH8MFVBKTYMTW22","wire-the-llm-provider","Pick a real LLM provider and wire it through Bifrost — OpenRouter \u002F Anthropic \u002F OpenAI \u002F Azure \u002F NVIDIA NIM \u002F OpenAI-compatible endpoints. Use when configuring the `llm:` block beyond the scaffold default, swapping models, setting model_profiles, or using the dev-only mock escape hatch.","https:\u002F\u002Fgithub.com\u002Fhurtener\u002FHarbor\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Fwire-the-llm-provider\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M723ESCAV3DX4FSWHB9QRXDT","validate-and-package","Run `harbor validate` + `make preflight` + the per-phase smoke gates before shipping an agent. Use when packaging an agent for a non-dev environment — production deploy, share with a teammate, hand off to CI, or ship a release tag.","https:\u002F\u002Fgithub.com\u002Fhurtener\u002FHarbor\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Fvalidate-and-package\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M723E99VBZ6D9XCG10RPJMM1","scaffold-a-harbor-agent","Scaffold a new Harbor agent project with `harbor init` + `harbor scaffold`. Use when starting a fresh agent from zero — drops a tiered, commented `harbor.yaml`, the companion AGENTS.md \u002F CLAUDE.md \u002F README.md, and materialises the Go project so `harbor dev` boots a working runtime in under five minutes.","https:\u002F\u002Fgithub.com\u002Fhurtener\u002FHarbor\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Fscaffold-a-harbor-agent\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M723E52YP0JSH9R22APN4T5M","run-the-dev-loop","Use `harbor dev` + `harbor console` to run an agent locally with the Console attached. Use when iterating on a Harbor project — single-process or multi-process attach posture, the `HARBOR_DEV_TOKEN` handshake, hot reload on yaml changes, and which posture to pick when.","https:\u002F\u002Fgithub.com\u002Fhurtener\u002FHarbor\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Frun-the-dev-loop\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M723E1M9CF4V7ZMHAMA3GY2Y","observe-with-the-console","Tour the Console's observability pages — Overview, Live Runtime, Observability, Sessions, Tasks, Agents, Tools, Events, Background Jobs, Playground, Flows, Memory, MCP Connections, Artifacts, Settings. Use when debugging an agent's behavior, hunting a regression, or building intuition for what the runtime is actually doing under the hood.","https:\u002F\u002Fgithub.com\u002Fhurtener\u002FHarbor\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Fobserve-with-the-console\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M723DXYEMV4VWKM7A65BHR5E","drive-the-playground","Use the Console's Playground page to chat against your agent, attach files (images \u002F PDFs \u002F audio), and steer or queue input during a run. Use when validating the agent end-to-end interactively, the foreground\u002Fbackground task posture, image-vs-PDF MIME dispatch, and the playground's steering UI.","https:\u002F\u002Fgithub.com\u002Fhurtener\u002FHarbor\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Fdrive-the-playground\u002FSKILL.md",[],[]]