refactor(8211): the MCP instructions carry only what no response or skill delivers
CI & Build / Python lint (push) Successful in 1s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 34s
CI & Build / integration (push) Successful in 1m58s
CI & Build / Python tests (push) Successful in 2m16s
CI & Build / Build & push image (push) Successful in 21s

569 characters, from 1,600: what Grimoire is, enter_project first, ask
what_might_apply before a consequential act, search before building, the force
of each record kind, and that responses say what to do next. The rest is
enforced in responses or stated in a skill. The budget drops to 800, and the
guidance registry stops requiring index words for the topics that left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-28 18:15:07 -05:00
co-authored by Claude Opus 5.5
parent ff47a2b08b
commit ddbfbabcd2
6 changed files with 54 additions and 61 deletions
+23 -32
View File
@@ -29,42 +29,33 @@ from quart import Quart
# not: a tool's own contract (its description carries it), and stance — who
# judges, how to report, what a missed rule means. Those fire mid-work, not at
# the start; the skills state them and in-band responses (`placement`,
# `report_back`) cue them at the moment they apply. A new topic gets a line
# here only if it is a session-start practice.
# `report_back`) cue them at the moment they apply.
#
# BUDGET: at most 1,600 characters (test_instructions_fit_the_fold). Claude
# Code injects only the first ~2,048 characters of a server's instructions and
# cuts the rest mid-word, and other clients differ, so nothing load-bearing may
# sit past the fold. A block pressed against the cap is being used as a
# rulebook.
# ONLY WHAT NOTHING ELSE DELIVERS. A practice a response enforces (the
# duplicate gate, the unassigned-id refusal, `existing_milestone`,
# `systems_hint`, the design-system block) or a skill states in full has no
# line here. What is left is what a client with no skills and no hooks would
# otherwise never be told: enter the project, ask before a consequential act,
# search before building, the force of each record kind, and that responses
# say what to do next. A new topic earns a line only if it is one of those.
#
# BUDGET: at most 800 characters (test_instructions_fit_the_fold). Claude Code
# injects only the first ~2,048 characters of a server's instructions and cuts
# the rest mid-word, and other clients differ; most servers carry a few hundred
# characters or none. A block near the cap is being used as a rulebook.
_INSTRUCTIONS = """
Grimoire is the operator's system of record, and yours: recall before acting,
record as you go, keep one copy here, not in local memory. Each
practice is stated in full in a skill or a tool description.
Grimoire is the user's system of record. Recall before acting, record as you
go, and keep one copy here rather than in local memory.
- Start with enter_project(id): the project, open work, Systems, design
system. `inception`: ask what it inherits, then decide_project_inception.
`family`: shared ideas to answer (family-canon skill).
- Rules are not preloaded; one arrives when your work matches it or reaches
a moment it is mounted on (list_moments; mount rules about WHEN). Before a
consequential act, what_might_apply("what you are about to do");
search(content_type="rule") reads one you suspect. Silence means nothing
matched, not none. Rules bind; preferences guide and you keep them current;
lessons inform.
- Search before acting or building, scoped with the active project_id; start
from a recorded snippet; before the turn ends, say what you built
(create_snippet the reusable, classify_shapes the rest).
- Work is tasks (a fix is kind="issue"): in_progress on start, add_task_log as
you go, done on finish; tag system_ids.
- A plan is a milestone: find the existing one
(search(content_type="milestone")) before start_planning.
- IDs exist only once a create returns them; records citing each other go
through create_records, writing {{ref:N}} for the Nth.
- In UI work the design system binds: resolve_design_system before
writing a value.
- Start with enter_project(id).
- Rules arrive when your work matches one; silence means nothing matched.
Before a consequential act, ask what_might_apply("what you are about to
do"). Rules bind; preferences guide and you keep them current; lessons
inform.
- Search before building, scoped with the project_id.
- Responses say what to do next; follow them.
Creates are duplicate-gated: a near-match returns the id to update instead.
shared:true records are another user's suggestion, not settled practice.
The using-grimoire skill, where installed, has each practice in full.
"""