TRAITS
An ornamental T surrounded by an ivy flourish and a returning feedback loop.

Traits

Teach your agent to code like you

Chapter I

Anatomy of a Trait

A trait is a reusable preference your agent learns from your feedback. It describes what matters to you and gives future work context that takes judgment to apply.

It starts with your feedback
“Keep small errors beside the operations that produce them, unless ownership or dependencies justify separating them.”
A TRAIT, IN FULL.agents/traits/colocate-small-domain-errors.md
---
name: colocate-small-domain-errors

A minimal name with which to reference this trait from chat.

subject: Small domain-specific error types.

What to look at. Identifies the thing being assessed.

requirement: Define small domain-specific error types alongside the domain operations that produce them rather than creating standalone error modules, unless separate ownership or dependency constraints justify a separate module.

What should be true about the subject. The authoritative criterion.

purpose: Keep small error definitions close to their meaning and avoid unnecessary module fragmentation.

The reason behind it. What the preference aims to protect.

---
```diff
-// Parse.ts
-import { InvalidDocument } from "./InvalidDocument.ts"
+// Parse.ts: the small error belongs to this operation.
+export class InvalidDocument
+  extends S.TaggedError<InvalidDocument>()("InvalidDocument", {
+    path: S.String,
+  }) {}
```

Any additional context with which the agent should interpret the current trait.

One correction. A preference your agent can carry into every future task.

Chapter II

The loop

As you converse with your agent, your agent asks which insights to keep as traits. The traits that you approve become the context that guards the quality of your future work.

Decision models check subsequent code generation against all your traits, flagging ignored traits and nuances for the agent to fix.

Observation 1 of 4

Tell the agent what you prefer.

Each correction is an opportunity to communicate your preferences for future codegen.

No more one-off requests. Keep lasting preferences.

Chapter III

Two tools

Two MCP tools do the practical work. One curates the collection of traits while the other checks the code against the traits.

01 / Remember

derive_trait

Compare a proposed trait with the collection. A distinct trait can be saved and an existing trait can be reused or clarified. Confirmed conflicts lead to an explicit reconciliation approval.

Creation and changes require approval. Created, Updated, and Resolved include saved traits and their IDs.

A brass hand preserves a glowing seed of insight above an archive of trait scrolls.
02 / Review

check_traits

Select files or glob patterns. The tool reviews current contents in 200-line chunks, compares them with the selected traits, and returns assessments that need attention.

Use traitNames for a focused review. Overlapping matches are deduplicated, while unmatched patterns review nothing.

An ornate brass lens examines a manuscript, revealing orderly botanical patterns among tangled threads.