Skip to content

docs(prompts): tell Prime Claude when the KB beats a dictionary - #208

Merged
ddehilster merged 1 commit into
VisualText:mainfrom
ddehilster:docs/prime-claude-kb-not-dict
Aug 23, 2026
Merged

docs(prompts): tell Prime Claude when the KB beats a dictionary#208
ddehilster merged 1 commit into
VisualText:mainfrom
ddehilster:docs/prime-claude-kb-not-dict

Conversation

@ddehilster

Copy link
Copy Markdown
Member

A session reached for a .dict twice 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 .dict into kb/user tags 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 like s= goes further still and changes tokenization: dicttok builds a typed node for those words, so plain _xALPHA rules 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/.kbb pair into kb/user/ — that bullet describes the dictionary mechanism, so the qualification belongs next to it. The desc line picks up the new convention.

Prompt text only — no engine, analyzer, or library files touched.

🤖 Generated with Claude Code

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>
@ddehilster
ddehilster merged commit 4d4cbd1 into VisualText:mainAug 23, 2026
1 check passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ddehilster