docs(plugin): trim keboola-expert prompt to ~47.8 KB - #634
Merged
Conversation
The agent prompt sat at 61999 B against what was then a 62000 B PROMPT_BYTE_BUDGET -- 1 byte free, so the next command group that genuinely needed a tool-matrix row could not get one. v0.88.0 has since raised the cap to 70000 B, and the comment introducing that bump says the quiet part out loud: "It is NOT a licence to grow the file... Trim before you add." This is that trim. The budget is a real runtime cost -- the prompt loads into every subagent invocation -- so headroom should come from removing duplication, not from the ceiling. The bloat was not the version tags: ~95 (since vX.Y.Z) notes are only ~1 KB in total. It was section 2, the tool selection matrix, at 32 KB -- 52% of the file -- because its cells had grown into a second manual. The 37 files in skills/kbagent/references/ already carry that prose; semantic-layer- workflow.md even opens with a "When to use what" table in the same intent-to-command shape, making the 11 semantic-layer rows (7.3 KB) near verbatim duplication. - section 2: 32044 -> 21092 B. Cells now carry the decision only (command, outcome-changing flags, the NEVER list) and point at the matching *-workflow.md for the rationale. The semantic-layer block collapses from 11 rows to 2 (read, and "any write: export first, then read the workflow"). - section 3: 14768 -> 10978 B. Entries whose prose duplicated gotchas.md are back to one-line triggers, per the section's own stated design rule. - Retired version tags whose floor no longer bites. Kept every gate where an older version is silently wrong: 0.54.0 plaintext #-secrets, 0.66.1 dormant cron, 0.86.0 Azure cipher, 0.87.0 data-app workspace flag. - Dropped the hand-copied session_unsupported_features list, which the surrounding text already tells the agent not to reconstruct from memory -- auth login --json ships it. Kept the dev-portal and flow list/detail carve-outs so the agent does not pre-emptively refuse working commands. Rule 6 is reworded in the same pass. It used to say every command carries its own since-tag and to treat those as the authoritative floor; under that wording a stripped tag would silently read as "safe on any version". It now states that a tag marks a floor that still bites, that its absence is not a promise, and that a No such command error is a failed version gate. The 0.88.0 verification guidance added to the BigQuery repartition row in #629 is preserved through the rebase: table-detail --json -> .definition.timePartitioning / .clustering, because create-table only echoes the layout you requested. Nothing moved into gotchas.md -- every trimmed block was already documented there or in a topical workflow file, so no reference file changed. The freed headroom immediately absorbs the two features that had to skip this file: config clone (#587) and config state-get/state-set (#593) now have matrix rows instead of living only in gotchas.md. 47830 B against the 70000 B budget, 22170 free. PROMPT_BYTE_BUDGET itself is untouched by this PR. All 41 tests in tests/test_agent_prompt.py pass.
padak
force-pushed
the
claude/magical-kare-ef115c
branch
from
August 21, 2026 22:17
ff8a8e5 to
479f6a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
plugins/kbagent/agents/keboola-expert.mdsat at 61 999 B against what was then a 62 000 BPROMPT_BYTE_BUDGET— 1 byte free. The next command group that genuinely needed a tool-matrix row could not get one. Two changes already shipped without touching the file for exactly this reason: #587 (config clone) and #593 (config state-get/state-set) both put their knowledge ingotchas.mdinstead. That workaround only works because adding to an existing command group needs no new matrix row; it does not extend to a new group.Where the bloat actually was
Not the version tags. All ~95
(since vX.Y.Z)notes together are only ~1 KB.§2 had grown into a second manual. The 37 files in
skills/kbagent/references/(677 KB) already carry that prose —semantic-layer-workflow.mdeven opens with a "When to use what" table in the same intent→command shape, which made the 11 semantic-layer matrix rows (7.3 KB) near-verbatim duplication.What changed
*-workflow.mdfor the rationale. The semantic-layer block collapses 11 rows → 2 (read; and "any write:exportfirst, then read the workflow"). Its three sharp gotchas stay in §3.gotchas.mdare back to one-line triggers, which is the section's own stated design rule.#-secrets, 0.66.1 dormant cron, 0.86.0 Azure cipher + POST/PATCH no-retry, 0.87.0 data-app workspace flag.session_unsupported_featureslist — the surrounding text already tells the agent not to reconstruct it from memory (auth login --jsonships it), so an inline hand-copy was both contradictory and a drift risk.config clone(config new: cloning a config by hand silently drops sibling keys like runtime (parallelism) — no clone command, examples show only parameters #587) andconfig state-get/state-set(config: no CLI path to write configuration state (PUT .../state unused);config update --set 'state...'silently no-ops #593) now have proper matrix rows instead of living only ingotchas.md.The one thing worth reviewing carefully
Rule 6 is reworded in the same pass, and this is load-bearing. It used to say:
Strip tags under that wording and an untagged command silently reads as "safe on any version". Rule 6 and both section preambles now state that a tag marks a floor that still bites, that its absence is not a promise, and that a
No such command/ unknown-option error is a failed version gate rather than a reason to improvise (§5 already had that branch).Two carve-outs were deliberately kept after an initial over-trim:
dev-portalis not onsession_unsupported_features(own identity, no project token) andflow list/flow detailare plain Storage — without them the agent could pre-emptively refuse commands that work.Rebase note (#629)
#629 landed on
mainwhile this was open and amended the BigQuery repartition row. That guidance is preserved in the resolved row: verify a repartition withstorage table-detail --json→.definition.timePartitioning/.clustering(0.88.0+), becausecreate-tableonly echoes the layout you requested and so proves nothing. The conflict was that one 9-row block; both sides' value is folded in.Result
61 960 → 47 830 B — 22 170 bytes free of the 70 000 budget.
PROMPT_BYTE_BUDGETis not modified by this PR.Only one file changed. Nothing was moved into
gotchas.md— every trimmed block was already documented there or in a topical workflow file, verified per block before cutting.Verification
tests/test_skill_frontmatter.pyalso passes (45 total). Markdown table integrity checked programmatically after the conflict resolution — every §2 row has exactly 4 columns. No CLI command was added, removed or renamed, so the other convention #17 drift surfaces (SKILL.md,commands-reference.md,context.py,CLAUDE.md) need no update, and no version bump means no changelog entry.