Thoughtware

Libraries

Reusable cognitive unit and Skill packages carry contracts, evidence, ownership, and limitations.

10 min read

Cover for Libraries

Copy-paste a prompt into Slack and three teams diverge within a month. Each copy "works" locally. No substitution rule can prove two templates make the same judgment. Improvement of one copy improves one demo, not the organisation. The pattern is familiar to anyone who has watched AI features ship without architecture: a "best prompt" shared in a channel becomes four forks within a quarter, nobody can say which version production uses, and the organisation has shared prose rather than shared judgment.

Helpful context: Cognition as material states the category claim. Cognitive capability should be encapsulated explains why callers depend on contracts rather than templates. What is a cognitive unit and what is a skill define what gets packaged. This page is the canonical library definition, read it before any autonomy essay.

Why libraries exist

Software teams learned decades ago that code reuse without packages produces chaos. Nobody shares implementation by emailing source files. Artifacts have identity, semantic versioning, and test evidence. Callers import the interface. Maintainers improve the implementation behind it. Cognition deserves the same discipline, arguably with more urgency, because model outputs feel authoritative even when unmeasured. A library of cognition is how organisational learning concentrates instead of dispersing into prompt forks.

Without a library, every product line reinvents the same judgments. AskTargetedQuestion becomes twelve paragraphs of "only ask when it matters" scattered across agents. AssessMealPracticality becomes a Notion doc that three services copied differently. Evaluation history splits. Substitution becomes impossible. Autonomy collapses into longer system prompts because meta-agents cannot search what was never published. With a library, a settled judgment travels once, carrying contract, suite, owner, and semantic versioning, and every consumer inherits the same measured behaviour. Improvement in one package improves every caller who respects substitution rules. That is the supply-chain logic libraries encode.

What travels with a package

Callers need more than availability. They need to know what was measured, on what distribution, and what the package must not be asked to do. A library entry carries several artifacts that move together: the contract (name, decision or capability, inputs, outputs, abstain and refer branches), evaluation evidence (suite results bound to identity), an operational profile (cost, latency, purity, known failure modes), ownership (who improves, who approves release), and limitations (terrain and authority ceilings).

Travels with the cognitive unit or SkillWhy
ContractName, decision or capability, inputs, outputs, abstain/refer
Evaluation evidenceSuite results bound to identity
Operational profileCost, latency, purity, known failure modes
OwnershipWho improves it, who approves release
LimitationsTerrain and authority ceilings

If any of these is missing, the result is a template dump, not a library entry. Teams discover this when they try to substitute v2 for v1 and find no comparable suite, or when an agent invokes a package that "worked in demo" but never passed regression on the distribution production actually sees. The table summarises what the organisation should require before calling anything "published."

Where packages live in the Meal Companion

Placement answers questions of scope: what may be shared across products, what stays agent-private until promotion, and what belongs in a specialised inventory like a judge library. In the Weekly Meal Companion, InterpretWeek, ComposeWeek, and CritiquePlan are agent-private, owned by agent strategy until deliberately promoted. GenerateCandidates, AssessMealPracticality, and RecommendMealSubstitution belong in the meal-planning domain library because two product lines sharing the same domain model should not fork busy-evening logic. AskTargetedQuestion belongs in the organisational library because question discipline is leadership policy, not meal-domain trivia. Judge-library entries like JudgeWeeklyVariety, JudgeWeekdayPracticality, and JudgeHouseholdFit carry evaluation-shaped contracts with grader suites, reusable across workflows.

PlacementExamplesWhat placement means
Agent-privateInterpretWeek, ComposeWeek, CritiquePlanTactics owned by agent strategy until deliberately promoted
Meal-planning domain libraryGenerateCandidates, AssessMealPracticality, RecommendMealSubstitutionShared judgments across product lines that share the domain model
Organisational libraryAskTargetedQuestionOrg-wide policy packaged once, materiality thresholds, question discipline
Judge libraryJudgeWeeklyVariety, JudgeWeekdayPracticality, JudgeHouseholdFit, JudgeLocalRepairQualityEvaluation-shaped judgments with grader suites, reusable across workflows

Placement is not a ranking of importance. InterpretWeek is agent-private not because interpretation is trivial but because the Meal Planning Agent owns how this run's request becomes structured week state, and that strategy may still change while domain judgments stabilise. Judge-library placement deserves emphasis. JudgeWeekdayPracticality is not the same artifact as AssessMealPracticality even when both touch schedules. The assessor cognitive unit decides fit for one candidate on one evening. The judge cognitive unit scores plan quality against a labelled distribution for evaluation and release gates. Different contracts, different suites, different substitution semantics, often different inventory shelves.

Library package
ContractSuite evidenceOperational profileOwnerLimitations

Substitution and autonomy both depend on packaging, not folder depth.

Library versus dump

A dump accumulates templates. A library supports substitution rules: identical contracts, measured replacements, fast paths behind the same interface. Domain libraries hold shared judgments. Agent-private cognitive units stay behind agent boundaries until promoted on purpose.

The distinction matters for platform economics. Dump culture optimises for demo velocity: copy, tweak, ship. Library culture optimises for compound improvement: publish, measure, substitute, propagate. A dump makes every team feel productive on day one. A library makes the organisation productive on year two, when the tenth product line imports GenerateCandidates instead of rewriting candidate production for the tenth time.

Autonomy depends on search. Meta-agents and composing agents need searchable sealed cognitive units and Skills, because without them composition collapses into longer prompts. The library unlocks autonomy when evaluated parts exist as inventory. This page defines what "inventory" means. Later notes in this track cover packages, not prompts, sealed and searchable discovery, and runtime inspectability before invocation.

How libraries connect to encapsulation

Encapsulation hides implementation. Libraries publish the encapsulated edge. A cognitive unit in a domain library exposes contract and evidence. Callers do not read prompt wording. Maintainers version identity when the decision changes and swap implementation when the contract is stable and suites pass.

That separation is what lets the Meal Planning Agent improve strategy without forking domain judgments, and lets platform teams improve AssessMealPracticality without redeploying every agent. Without libraries, encapsulation stays local to one service. With libraries, encapsulation becomes organisational infrastructure.

Common mistakes

The most common mistake is calling a Notion page a library. Shared templates without contracts, suites, or owners are dumps with good intentions. A close second is publishing before placement is decided, promoting a judgment to the organisational library too early freezes policy that should stay domain-local. Mixing judge and assessor shelves is another frequent error: evaluation artifacts and production decision cognitive units need distinct contracts even when names sound similar. Skipping limitations in catalog browse invites wrong-package selection, the failure mode runtime inspectability addresses.

What this looks like in practice

The originating sentence triggers work that can live in libraries:

Plan dinners for four people this week. Tuesday and Thursday are busy. Use the spinach before Wednesday and avoid meals we ate last week.

GenerateCandidates and AssessMealPracticality come from the meal-planning domain library, reusable, substitutable, searchable. AskTargetedQuestion comes from the organisational library when authority or information is missing. JudgeWeekdayPracticality may score a plan candidate during evaluation or release review from the judge library. Agent-private ComposeWeek orchestrates without re-deciding what domain cognitive units already own.

When the platform publishes AssessMealPracticality v2.1 with improved busy-evening calibration, callers on v2.0 contract-compatible interfaces substitute after suite gates, not after someone diffs Slack threads.

A library is a set of judgments that can travel safely beyond their original location.

The cognitive unit · Ch. 11

Portfolio observability

Library health is portfolio observability for cognition. Tracking duplicate cognitive units under different names, semantic versioning drift between products, substitution failures after promotion, and conduct regression on shared packages reveals where the library is working and where it is becoming a graveyard of templates with version numbers. Observability means catalog metadata, suite status, and owner contact travel with every package entry agents can search.

Before calling an entry published, the organisation confirms contract text, judgment or capability sentence, suite results bound to identity, operational profile with cost and latency, owner contact, limitations including terrain and authority ceilings, and substitution policy pointer. Missing any item means the entry is a candidate, not a package. Candidates belong in inventory spreadsheets until that checklist passes.

What to do next

The practical starting point is to inventory judgments that already repeat in multiple prompts, because those are candidates for a first publish. Placement decisions (agent-private, domain, organisational, judge) come before semantic versioning talk, because where a package lives determines who owns it and who consumes it. Every published entry needs contract, suite, owner, and limitations before it earns the label. Catalog metadata enables agents to search without reading templates, a concern sealed, evaluated, and searchable develops.

Read packages, not prompts for the supply-chain discipline that separates assets from dumps, and substitution rules for safe upgrades behind fixed contracts.

Read next: Packages, not prompts.