Uh oh!
There was an error while loading. Please reload this page.
docs(prompts): tell Prime Claude when the KB beats a dictionary - #208
Merged
ddehilster merged 1 commit intoAug 23, 2026
Merged
Conversation
A session reaching for a .dict twice in one day to supply a fact that one rule needed. Loading a dictionary tags matching tokens in every pass for the whole run — a blast radius — and an attribute like s= goes further and changes tokenization, so plain _xALPHA rules stop matching those words. A knowledge base answers when asked, and that is what a single-rule fact wants. Adds the rule of thumb and the pattern that goes with it: match on shape, validate in code — the rule is permissive, the loop is strict. A pass picking US state codes matches a run of two-letter uppercase tokens separated by commas, then loops calling StateName() on each candidate; "multiple", "locations" and "in" each fail one of the three tests and drop out without the rule naming them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
A session reached for a
.dicttwice in one day to supply a fact that only one rule needed, and had to be shown otherwise both times. The primer never drew the distinction, so this adds it.A dictionary changes what every rule sees; a knowledge base answers when asked. Loading a
.dictintokb/usertags matching tokens in every pass for the whole run — a blast radius, and the right one when the analyzer is built on that vocabulary. An attribute likes=goes further still and changes tokenization: dicttok builds a typed node for those words, so plain_xALPHArules stop matching them. For a fact needed in one rule, the KB is the instrument.The pattern that goes with it: match on shape, validate in code — the rule is permissive, the loop is strict. A pass picking US state codes out of a list matches a run of two-letter uppercase tokens separated by commas, then loops calling a KB lookup (
StateName()) on each candidate: two characters, uppercase, and known to the knowledge base. "multiple", "locations" and "in" each fail at least one of those three tests and drop out on their own, without the rule having to name them.Placed in the "build on the libraries" rules of thumb, right after the bullet on wiring a
.dict/.kbbpair intokb/user/— that bullet describes the dictionary mechanism, so the qualification belongs next to it. Thedescline picks up the new convention.Prompt text only — no engine, analyzer, or library files touched.
🤖 Generated with Claude Code