---
title: Why weft is built this way
description: 'The design rationale behind weft: how the modules fit together, the rules its tests pin, the decision records, the agent loop from first principles, how it compares to other frameworks, the patterns built on it, how the repository enforces its guarantees, and the roadmap.'
url: https://weftgo.dev/docs/explanation/
type: concept
sources:
  - weft/AGENTS.md:1-18, 656-750
  - weft/docs/adr/
  - weft/docs/agent-loop-deep-dive.md
---

# Why weft is built this way

These pages explain why weft is shaped the way it is: a small loop with two seams and one tap, tool errors as data, approval as a run boundary, and everything else in layers above the loop. They explain; the [guides](https://weftgo.dev/docs/guides/) apply and the [reference](https://weftgo.dev/docs/reference/) lists. Read them in any order.

1. [How weft is put together](https://weftgo.dev/docs/explanation/architecture/): two modules, the generated facade, the layers and their import rule, and how a run reaches Studio.
2. [Design principles: the rules weft keeps](https://weftgo.dev/docs/explanation/design-principles/): the 13 loop rules and 5 thread rules, each with the failure it prevents and the test or gate that pins it.
3. [Architecture decision records](https://weftgo.dev/docs/explanation/decisions/): every ADR, its decision in a sentence, and its status at v0.20.2.
4. [The agent loop, from first principles](https://weftgo.dev/docs/explanation/agent-loop/): the forty-line loop, one run function by function, and the eleven questions a loop must answer.
5. [How weft compares to other agent frameworks](https://weftgo.dev/docs/explanation/comparison/): design choices side by side, from those frameworks' own documentation.
6. [Agent patterns and where they attach in weft](https://weftgo.dev/docs/explanation/patterns/): workflows, context, tool design, safety, protocols, durability and evaluation on weft's pieces.
7. [How the weft repository is organised and checked](https://weftgo.dev/docs/explanation/repository/): the layout, the `make` targets and the CI gates behind the guarantees.
8. [Roadmap](https://weftgo.dev/docs/explanation/roadmap/): what v0.20.2 ships and where the planned work is listed.

[`AGENTS.md`](https://github.com/weftgo/weft/blob/v0.20.2/AGENTS.md) holds the whole API on one screen and the rules in their original words; [pkg.go.dev](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2) has the signatures.

## See also

- [weft concepts](https://weftgo.dev/docs/concepts/)
- [What is weft?](https://weftgo.dev/docs/get-started/what-is-weft/)
- [Glossary](https://weftgo.dev/docs/reference/glossary/)
