# Agent rules for design-brain

1. **Never promote a candidate.** Files in `inbox/` are `status: candidate` until Fabio
   moves them to `decisions/`. You may create, edit, merge, or rescope candidates. You
   may not set `status: confirmed`.
2. **Edit decisions, not skills.** `skills/` and `exports/` are generated by
   `scripts/compile-skills.ts`. Never hand-edit them. After any change to
   `decisions/` or `patterns/`, run `bun run compile`.
3. **Rule, then value.** A decision states the reusable rule. Concrete values (a hex,
   a font, a padding) go under `## Examples`, never in the rule itself unless the value
   *is* the rule (a client brand color).
4. **Evidence is mandatory.** Every candidate lists at least one source: a transcript
   quote (verbatim, original language, with project + date), a DDR path, an audit
   finding id, or a repo file path. No evidence, no candidate.
5. **Scope honestly.** Client repos (see `sources.yaml`) yield `client:<slug>` or
   `universal` only. Never mark a client value as `personal`.
6. **English rules, verbatim quotes.** Write rules in English. Keep pt-BR directives
   exactly as typed, typos included. Add unknown pt-BR nouns to `glossary.md`.
7. **Dedupe before adding.** Search `inbox/` and `decisions/` for the same rule first.
   Add an occurrence and evidence line to the existing file instead of a new file.
8. **Rejections are decisions.** "não", "definitivamente não", "not rounded" become
   `stance: never` or `avoid` candidates with the same care as approvals.
9. Templates: `templates/DB-000-template.md`, `templates/pattern-template.md`.
   Validate with `bun run check` before finishing.
10. **This repo also has a Forge record** in `design/` (brief, glossary, questions,
    todos, `design/decisions/DDR-###`). DDRs are decisions *about design-brain itself*;
    `decisions/DB-###` are the cross-project design rules it compiles. Use the `ddr`
    skill for the former, `bun run promote` for the latter. Run `forge doctor` after
    touching `design/`.
11. **Imports** from `inbox/_imports/*.md` (external-extract output) convert into candidates
    in the DB-c-500..599 range, with evidence prefixed by the project slug. From client
    projects only `scope: universal` survives; project-specific rules are discarded, not
    scoped. Read `inbox/_imports/README.md`.
12. **Titles are two lines.** A title is one sentence of at most 80 characters that names the
    rule; every qualifier, example, and mechanism goes in `## Rule`. `bun run check` rejects
    longer titles.
13. **Bodies read in short paragraphs.** Rule opens with one sentence, then at most two
    paragraphs of one idea each, five rows max (~300 characters). Three or more cases become a
    list. Why is one or two paragraphs. Detail moves to Examples or Exceptions; nothing is
    deleted. `check` warns on long paragraphs.
14. **Conflicts are declared, then resolved.** When two rules disagree while both apply, tag
    `conflicts_with: [id]` and write a one-line `resolution:` saying which wins and when. Two
    confirmed rules that conflict without a resolution block `compile`.
