c101452bb5
- Refactored and condensed numerous system prompts, agent instructions, and tool documentation files across packages. - Streamlined workflow rules, formatting constraints, and execution guidelines for improved clarity and brevity. - Updated discovery rules, recommendation criteria, and syntax standards in prompt templates.
725 B
725 B
description, condition, scope, interruptMode
| description | condition | scope | interruptMode |
|---|---|---|---|
| Prefer Record<K, V> for small static literals; use Set/Map for anything dynamic | \bnew\s+(Set|Map)\b | tool:edit(**/*.{ts,tsx}), tool:write(**/*.{ts,tsx}) | never |
Small, static string-keyed lookup tables: Record<K, V> / Record<K, true>.
Set / Map: dynamic/non-string keys; runtime insertion/deletion; .size, .clear(), stable insertion order, or iterator APIs.
// Static literal → Record
const LABEL_BY_KIND: Record<string, string> = {
text: "Text",
json: "JSON",
binary: "Binary",
};
// Dynamic membership → Set
const seen = new Set<string>();
for (const item of items) {
if (seen.has(item.id)) continue;
seen.add(item.id);
}