[GH-ISSUE #7827] [Feature]: Professor Mari - move authoring how-tos out of the permanent prompt into built-in skills #4312

Closed
opened 2026-10-21 06:14:43 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @ylli-selmani on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7827

Originally assigned to: @ylli-selmani on GitHub.

What problem does this solve?

Professor Mari's permanent prompt carries every how-to guide inline, on every turn. Measured on staging (51e6cace8):

Block Where Chars
MARI_SYSTEM_PROMPT workspace-agent.service.ts 37,941
workspaceCommandKnowledgePrompt() same file 22,456

That is ~60k chars (~15k tokens) before any history. About 23k chars of it (~38%) is procedure, not policy:

Topic Chars
Lorebook authoring guide 6,636
Decision authoring (MARI_DECISION_AUTHORING_PROMPT) 6,399
Interactive onboarding (character.onboarding.*) 2,377
Diagnose / fix-a-bad-reply procedure 2,055
Personal Extension drafts + browser UI 2,494
Preset create + section editing 1,349
Theme/CSS hooks, Home widgets 1,926

Two consequences:

  1. Clutter. Every guide is paid for on every turn, even when the request has nothing to do with onboarding, presets, or extensions.
  2. Compression into paragraphs. Because each guide is permanent, it is written as one dense paragraph with no worked examples, no validation-error → fix table, and no read-back verification step. Interactive onboarding is the current example: its permanent line is ~2.4k chars of prose, and Mari still often ends up reading character.onboarding.* implementation code to get a write right, because the paragraph cannot carry the procedure.

Proposed solution

Use the skill mechanism that already exists (app_data skill.list / skill.get, index-and-fetch, bodies up to 200k chars) and add a built-in, shipped skill source. This is the narrow variant of #7375/#7376: no new tool, no prompt restructure, no user-editable built-ins.

  • Content lives in packages/server/src/assets/mari-skills/*.md. That directory is already copied to dist/assets by packages/server/scripts/build.mjs, so dev (tsx) and packaged builds resolve it the same way. Frontmatter carries name + a trigger-style description.
  • list() merges built-ins with the user's DATA_DIR skills. skills.json is never touched by a built-in, so an app update replaces shipped text cleanly and a user cannot silently fork it. Ids are namespaced builtin-*; a name collision is reported in diagnostics rather than shadowing.
  • MariWorkspaceSkillSummary gains origin: "builtin" | "user". Built-ins are always on and read-only (badge in the Skills panel; edit/delete/toggle hidden; PUT/DELETE reject built-in ids).
  • Rendering: built-ins sort first (the index cap cannot drop them), marked [BUILT-IN], never inlined, and the block tells her to skill.get a matching skill before acting, plus that a skill is a procedure and never permission.
  • The permanent prompt keeps the rules, the action names and a router line per skill. Policy stays permanent: read-only intent, approval/apply/change card, understoodRequest, raw-DB delete danger, memory-save policy, the command-family list, voice. Procedure moves: field-by-field authoring, exact argument shapes, validation errors and fixes, read-back steps, worked examples.
  • Docs stay user-facing. A skill links docs_read docs/... for deeper field semantics instead of duplicating them.

First slice (the proof): interactive onboarding. Line ~911 shrinks to a router line, and builtin-onboarding.md carries the template/question model, conditional syntax, the character-question rule (its {{name}} must live in a card field), the validation errors and their fixes, a worked example, and a read-back verify step.

Follow-ups, each a small PR: lorebook authoring, preset authoring, Personal Extensions + browser UI, decision authoring, repair/diagnosis, themes + Home widgets.

Proof plan: a regression for the built-in loader/merge/read-only/index ordering, a permanent-prompt char budget so the text cannot creep back, and a contract regression pinning that the onboarding skill documents every key and rule character.onboarding.update accepts.

Alternatives considered

  • Point her at the user docs instead. docs_read already works, but the docs are written for users (audience, tone, no command recipes), and there is no "this is the procedure you must follow" contract. Skills reference docs instead of replacing them.
  • Seed built-ins into DATA_DIR on first run (the pattern in Gunterlie's #7822 example skill). Right for a feature demo, wrong for product behavior: updates would not propagate and users could silently fork shipped procedure.
  • Embed the text as TS constants (the #7376 shape). Avoids asset copying, but reviewable markdown beats escaped template literals.
  • #7376 as shipped: 16 skills as a TS constant, a new skill tool, <tool_inventory>/<pacing> blocks replacing existing prompt sections, and user-editable built-ins with "Restore Default". Closed as not-planned; this proposal keeps the existing tool and prompt structure and starts with one skill.

Additional context

  • #7375 / #7376 (closed not-planned) — the earlier built-in skill library; the maintainer note was to start with design agreement before code, which this issue is.
  • #7312 — app_data skill.list / skill.get (index-and-fetch) already on staging.
  • Gunterlie's #7822 seeds a disabled example user skill; unrelated to shipped procedure, and this change does not touch that path.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @ylli-selmani on GitHub (Oct 19, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7827 Originally assigned to: @ylli-selmani on GitHub. ## What problem does this solve? Professor Mari's permanent prompt carries every how-to guide inline, on every turn. Measured on `staging` (`51e6cace8`): | Block | Where | Chars | | --- | --- | --- | | `MARI_SYSTEM_PROMPT` | `workspace-agent.service.ts` | 37,941 | | `workspaceCommandKnowledgePrompt()` | same file | 22,456 | That is ~60k chars (~15k tokens) before any history. About 23k chars of it (~38%) is *procedure*, not policy: | Topic | Chars | | --- | --- | | Lorebook authoring guide | 6,636 | | Decision authoring (`MARI_DECISION_AUTHORING_PROMPT`) | 6,399 | | Interactive onboarding (`character.onboarding.*`) | 2,377 | | Diagnose / fix-a-bad-reply procedure | 2,055 | | Personal Extension drafts + browser UI | 2,494 | | Preset create + section editing | 1,349 | | Theme/CSS hooks, Home widgets | 1,926 | Two consequences: 1. **Clutter.** Every guide is paid for on every turn, even when the request has nothing to do with onboarding, presets, or extensions. 2. **Compression into paragraphs.** Because each guide is permanent, it is written as one dense paragraph with no worked examples, no validation-error → fix table, and no read-back verification step. Interactive onboarding is the current example: its permanent line is ~2.4k chars of prose, and Mari still often ends up reading `character.onboarding.*` implementation code to get a write right, because the paragraph cannot carry the procedure. ## Proposed solution Use the skill mechanism that already exists (`app_data skill.list` / `skill.get`, index-and-fetch, bodies up to 200k chars) and add a **built-in, shipped** skill source. This is the narrow variant of #7375/#7376: no new tool, no prompt restructure, no user-editable built-ins. - **Content lives in `packages/server/src/assets/mari-skills/*.md`.** That directory is already copied to `dist/assets` by `packages/server/scripts/build.mjs`, so dev (`tsx`) and packaged builds resolve it the same way. Frontmatter carries `name` + a trigger-style `description`. - **`list()` merges built-ins with the user's DATA_DIR skills.** `skills.json` is never touched by a built-in, so an app update replaces shipped text cleanly and a user cannot silently fork it. Ids are namespaced `builtin-*`; a name collision is reported in `diagnostics` rather than shadowing. - **`MariWorkspaceSkillSummary` gains `origin: "builtin" | "user"`.** Built-ins are always on and read-only (badge in the Skills panel; edit/delete/toggle hidden; `PUT`/`DELETE` reject built-in ids). - **Rendering:** built-ins sort first (the index cap cannot drop them), marked `[BUILT-IN]`, never inlined, and the block tells her to `skill.get` a matching skill *before* acting, plus that a skill is a procedure and never permission. - **The permanent prompt keeps the rules, the action names and a router line per skill.** Policy stays permanent: read-only intent, approval/`apply`/change card, `understoodRequest`, raw-DB delete danger, memory-save policy, the command-family list, voice. Procedure moves: field-by-field authoring, exact argument shapes, validation errors and fixes, read-back steps, worked examples. - **Docs stay user-facing.** A skill links `docs_read docs/...` for deeper field semantics instead of duplicating them. First slice (the proof): **interactive onboarding**. Line ~911 shrinks to a router line, and `builtin-onboarding.md` carries the template/question model, conditional syntax, the character-question rule (its `{{name}}` must live in a card field), the validation errors and their fixes, a worked example, and a read-back verify step. Follow-ups, each a small PR: lorebook authoring, preset authoring, Personal Extensions + browser UI, decision authoring, repair/diagnosis, themes + Home widgets. Proof plan: a regression for the built-in loader/merge/read-only/index ordering, a permanent-prompt char budget so the text cannot creep back, and a contract regression pinning that the onboarding skill documents every key and rule `character.onboarding.update` accepts. ## Alternatives considered - **Point her at the user docs instead.** `docs_read` already works, but the docs are written for users (audience, tone, no command recipes), and there is no "this is the procedure you must follow" contract. Skills reference docs instead of replacing them. - **Seed built-ins into `DATA_DIR` on first run** (the pattern in Gunterlie's #7822 example skill). Right for a feature *demo*, wrong for product behavior: updates would not propagate and users could silently fork shipped procedure. - **Embed the text as TS constants** (the #7376 shape). Avoids asset copying, but reviewable markdown beats escaped template literals. - **#7376 as shipped:** 16 skills as a TS constant, a new `skill` tool, `<tool_inventory>`/`<pacing>` blocks replacing existing prompt sections, and user-editable built-ins with "Restore Default". Closed as not-planned; this proposal keeps the existing tool and prompt structure and starts with one skill. ## Additional context - #7375 / #7376 (closed not-planned) — the earlier built-in skill library; the maintainer note was to start with design agreement before code, which this issue is. - #7312 — `app_data skill.list` / `skill.get` (index-and-fetch) already on `staging`. - Gunterlie's #7822 seeds a disabled *example* user skill; unrelated to shipped procedure, and this change does not touch that path. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:14:43 +07:00
Author
Owner

@ylli-selmani commented on GitHub (Oct 19, 2026):

always with these trigger happy agents, and filing issues.

<!-- gh-comment-id:6269872087 --> @ylli-selmani commented on GitHub (Oct 19, 2026): always with these trigger happy agents, and filing issues.
Author
Owner

@Gunterlie commented on GitHub (Oct 19, 2026):

Nono, let's try that. But I suggest doing/merging that after the next stable Update of ME. So we have time to experiment <3

<!-- gh-comment-id:6270277778 --> @Gunterlie commented on GitHub (Oct 19, 2026): Nono, let's try that. But I suggest doing/merging that after the next stable Update of ME. So we have time to experiment <3
Author
Owner

@ylli-selmani commented on GitHub (Oct 19, 2026):

@Gunterlie that's what i was planning to do, but my agent (dsh this time) was very, very trigger happy, lol. such a diligent worker, it even made a draft pr, after i told it to do no pr's today.

<!-- gh-comment-id:6270388014 --> @ylli-selmani commented on GitHub (Oct 19, 2026): @Gunterlie that's what i was planning to do, but my agent (dsh this time) was very, very trigger happy, lol. such a diligent worker, it even made a draft pr, after i told it to do no pr's today.
bsakaguchi 2026-10-22 04:05:41 +07:00
  • reopened this issue
  • added the
    in-pr
    label
Author
Owner

@ylli-selmani commented on GitHub (Oct 20, 2026):

reopening this now, after stable released - also, I'm doing this one

<!-- gh-comment-id:6299598688 --> @ylli-selmani commented on GitHub (Oct 20, 2026): reopening this now, after stable released - also, I'm doing this one
bsakaguchi 2026-10-24 04:03:16 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4312
No description provided.