Sezione 18 di 25
Lavorare con gli agenti di coding
Indice
SLAT è nato in un team in cui gran parte del codice è scritta da agenti di coding. Gli agenti seguono una struttura in modo affidabile quando è scritta, breve e verificata da macchine. Tre cose fanno la differenza.
- Una struttura fissa è una mappa gratuita. Un agente a cui si chiede di "aggiungere un filtro alle trascrizioni" apre
core/transcript/eapp/transcript/senza cercare. Il tempo che un agente passa a cercare è tempo in cui sbaglia. - Un check batte una frase nel prompt. "Non emettere eventi da core" scritto in un prompt viene rispettato quasi sempre. Un check rosso viene rispettato sempre. La regola si scrive prima come check, e come riga di prompt solo quando non si può verificare.
- Le ricette sono prompt. La sezione 17 è scritta di proposito come passi numerati: si incolla la ricetta nel task, e l'agente produce i file nei posti attesi e nell'ordine atteso.
Gli agenti cambiano anche il modo in cui si compila un workspace. Più agenti in più copie di lavoro sono più build a freddo delle stesse dipendenze nello stesso momento, cioè il portatile bloccato della sezione 19.2. La sezione 22.5 mostra come ogni copia di lavoro parte calda senza condividere una cartella target/ con un'altra, e la sezione 22.4 come ognuno esegue solo i test che la propria modifica può toccare.
Una sezione da copiare nella guida per chi contribuisce al repository (AGENTS.md, CLAUDE.md o equivalente):
## Backend layout: SLAT 1.3
The backend follows SLAT (Slice · Layer · Actor · Tier), version 1.3.
Reference: https://monoone.dev/blog/slat/
- Tiers: app → core → store/drivers → kit. Only `app` depends on tauri.
- A feature is one slice: `crates/<product>-core/src/<slice>/` and `src-tauri/src/<slice>/`.
- Files in a slice: mod.rs, model.rs, logic.rs, store.rs, service.rs, actor/ (only if needed).
- A Tauri command has at most 10 lines and calls one function of its slice.
- Background state belongs to an actor: Msg → update (pure) → Effect.
- Operating-system code only in `drivers/src/platform/`.
- If the product has plugins: a base slice never imports a plugin slice
(SLAT section 23).
- Before adding code, find its place with the decision tree (SLAT section 17.8,
https://monoone.dev/blog/slat/recipes/).
- Checks in `checks/slat-*.sh` enforce this. Do not edit a check to make it pass;
report it instead.
- Before pushing, run the tests the change affects (SLAT section 22.4), then the checks.
- Every working copy has its own `target/`. Never point two copies at one
folder (SLAT section 22.5).