{"owner":"foxcpp","repo":"maddy","hasSkills":true,"totalSkillsCount":1,"totalTokensCount":861,"categories":["root-instruction"],"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# AGENTS.md — Maddy Mail Server\n\n## Architecture\n\nMaddy is a composable all-in-one mail server (MTA/MX/IMAP) written in Go. The core abstraction is the **module system**: every functional component (auth, storage, checks, targets, endpoints) implements `module.Module` from `framework/module/module.go` and registers itself via `module.Register(name, factory)` in an `init()` function.\n\n- **`framework/`** — Stable, reusable packages (config parsing, module interfaces, address handling, error types, logging). Interfaces live here to avoid circular imports.\n- **`internal/`** — All module implementations. Subdirectories map to module roles: `endpoint/` (protocol listeners), `target/` (delivery destinations), `auth/`, `check/` (message inspectors), `modify/` (header modifiers), `storage/`, `table/` (string→string lookups).\n- **`maddy.go`** — Side-effect imports that pull all `internal/` modules into the binary, plus the `Run`/`moduleConfigure`/`RegisterModules` startup sequence.\n- **`cmd/maddy/main.go`** — Thin entrypoint; imports root package for module registration, then calls `maddycli.Run()`.\n\nModules are wired together at runtime via `maddy.conf` configuration. Top-level blocks are lazily initialized through `module.Registry`. The **message pipeline** (`internal/msgpipeline/`) routes messages from endpoints through checks, modifiers, and to delivery targets based on sender/recipient matching rules.\n\n## Build & Test\n\n```sh\n# Build (produces ./build/maddy by default):\n./build.sh build\n\n# Build with specific tags (e.g. for Docker):\n./build.sh --tags \"docker\" build\n\n# Unit tests (standard Go):\ngo test ./...\n\n# Integration tests\ncd tests && ./run.sh\n```\n\nThe build embeds version via `-ldflags -X github.com/foxcpp/maddy.Version=...`. A C compiler is needed for SQLite support (`mattn/go-sqlite3`).\n\n## Adding a New Module\n\n1. Create a package under the appropriate `internal/` subdirectory (e.g. `internal/check/mycheck/`).\n2. Implement `module.Module` plus the relevant role interface (`module.Check`, `module.DeliveryTarget`, `module.PlainAuth`, `module.Table`, etc.) from `framework/module/`.\n3. Register in `init()`: `module.Register(\"check.mycheck\", NewMyCheck)`. Use naming convention: `check.`, `target.`, `auth.`, `table.`, `modify.` prefixes.\n4. Add a blank import `_ \"github.com/foxcpp/maddy/internal/check/mycheck\"` in `maddy.go`.\n5. For checks: use the skeleton at `internal/check/skeleton.go` or `check.RegisterStatelessCheck` (see `internal/check/dns/` for a stateless example).\n\n## Error Handling\n\nUse `framework/exterrors` — not bare `fmt.Errorf`. Errors crossing module boundaries must carry:\n- SMTP status info via `exterrors.SMTPError{Code, EnhancedCode, Message, CheckName/TargetName}`\n- Temporary flag via `exterrors.WithTemporary`\n- Module name field\n\nKeep SMTP error messages generic (no server config details). Use `exterrors.WithFields` for unexpected errors. See `HACKING.md` for full guidelines.\n\n## Key Conventions\n\n- **No shared state between messages** — check/modifier code runs in parallel across messages.\n- **Panic recovery** — any goroutine you spawn must recover panics to avoid crashing the server.\n- **Address normalization** — domain parts must be U-labels with NFC normalization and case-folding. Use `framework/address.CleanDomain`.\n- **Configuration parsing** — modules receive config via `config.Map` in their `Configure` method. See `framework/config/` and existing modules for the pattern.\n- **Logging** — use `framework/log.Logger`, not `log` stdlib. Per-delivery loggers via `target.DeliveryLogger(...)`.\n\n"},"files":{"AGENTS.md":"# AGENTS.md — Maddy Mail Server\n\n## Architecture\n\nMaddy is a composable all-in-one mail server (MTA/MX/IMAP) written in Go. The core abstraction is the **module system**: every functional component (auth, storage, checks, targets, endpoints) implements `module.Module` from `framework/module/module.go` and registers itself via `module.Register(name, factory)` in an `init()` function.\n\n- **`framework/`** — Stable, reusable packages (config parsing, module interfaces, address handling, error types, logging). Interfaces live here to avoid circular imports.\n- **`internal/`** — All module implementations. Subdirectories map to module roles: `endpoint/` (protocol listeners), `target/` (delivery destinations), `auth/`, `check/` (message inspectors), `modify/` (header modifiers), `storage/`, `table/` (string→string lookups).\n- **`maddy.go`** — Side-effect imports that pull all `internal/` modules into the binary, plus the `Run`/`moduleConfigure`/`RegisterModules` startup sequence.\n- **`cmd/maddy/main.go`** — Thin entrypoint; imports root package for module registration, then calls `maddycli.Run()`.\n\nModules are wired together at runtime via `maddy.conf` configuration. Top-level blocks are lazily initialized through `module.Registry`. The **message pipeline** (`internal/msgpipeline/`) routes messages from endpoints through checks, modifiers, and to delivery targets based on sender/recipient matching rules.\n\n## Build & Test\n\n```sh\n# Build (produces ./build/maddy by default):\n./build.sh build\n\n# Build with specific tags (e.g. for Docker):\n./build.sh --tags \"docker\" build\n\n# Unit tests (standard Go):\ngo test ./...\n\n# Integration tests\ncd tests && ./run.sh\n```\n\nThe build embeds version via `-ldflags -X github.com/foxcpp/maddy.Version=...`. A C compiler is needed for SQLite support (`mattn/go-sqlite3`).\n\n## Adding a New Module\n\n1. Create a package under the appropriate `internal/` subdirectory (e.g. `internal/check/mycheck/`).\n2. Implement `module.Module` plus the relevant role interface (`module.Check`, `module.DeliveryTarget`, `module.PlainAuth`, `module.Table`, etc.) from `framework/module/`.\n3. Register in `init()`: `module.Register(\"check.mycheck\", NewMyCheck)`. Use naming convention: `check.`, `target.`, `auth.`, `table.`, `modify.` prefixes.\n4. Add a blank import `_ \"github.com/foxcpp/maddy/internal/check/mycheck\"` in `maddy.go`.\n5. For checks: use the skeleton at `internal/check/skeleton.go` or `check.RegisterStatelessCheck` (see `internal/check/dns/` for a stateless example).\n\n## Error Handling\n\nUse `framework/exterrors` — not bare `fmt.Errorf`. Errors crossing module boundaries must carry:\n- SMTP status info via `exterrors.SMTPError{Code, EnhancedCode, Message, CheckName/TargetName}`\n- Temporary flag via `exterrors.WithTemporary`\n- Module name field\n\nKeep SMTP error messages generic (no server config details). Use `exterrors.WithFields` for unexpected errors. See `HACKING.md` for full guidelines.\n\n## Key Conventions\n\n- **No shared state between messages** — check/modifier code runs in parallel across messages.\n- **Panic recovery** — any goroutine you spawn must recover panics to avoid crashing the server.\n- **Address normalization** — domain parts must be U-labels with NFC normalization and case-folding. Use `framework/address.CleanDomain`.\n- **Configuration parsing** — modules receive config via `config.Map` in their `Configure` method. See `framework/config/` and existing modules for the pattern.\n- **Logging** — use `framework/log.Logger`, not `log` stdlib. Per-delivery loggers via `target.DeliveryLogger(...)`.\n\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/foxcpp/maddy/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"# AGENTS.md — Maddy Mail Server\n\n## Architecture\n\nMaddy is a composable all-in-one mail server (MTA/MX/IMAP) written in Go. The core abstraction is the **module system**: every functional component (auth, storage, checks, targets, endpoints) implements `module.Module` from `framework/module/module.go` and registers itself via `module.Register(name, factory)` in an `init()` function.\n\n- **`framework/`** — Stable, reusable packages (config parsing, module interfaces, address handling, error types, logging). Interfaces live here to avoid circular imports.\n- **`internal/`** — All module implementations. Subdirectories map to module roles: `endpoint/` (protocol listeners), `target/` (delivery destinations), `auth/`, `check/` (message inspectors), `modify/` (header modifiers), `storage/`, `table/` (string→string lookups).\n- **`maddy.go`** — Side-effect imports that pull all `internal/` modules into the binary, plus the `Run`/`moduleConfigure`/`RegisterModules` startup sequence.\n- **`cmd/maddy/main.go`** — Thin entrypoint; imports root package for module registration, then calls `maddycli.Run()`.\n\nModules are wired together at runtime via `maddy.conf` configuration. Top-level blocks are lazily initialized through `module.Registry`. The **message pipeline** (`internal/msgpipeline/`) routes messages from endpoints through checks, modifiers, and to delivery targets based on sender/recipient matching rules.\n\n## Build & Test\n\n```sh\n# Build (produces ./build/maddy by default):\n./build.sh build\n\n# Build with specific tags (e.g. for Docker):\n./build.sh --tags \"docker\" build\n\n# Unit tests (standard Go):\ngo test ./...\n\n# Integration tests\ncd tests && ./run.sh\n```\n\nThe build embeds version via `-ldflags -X github.com/foxcpp/maddy.Version=...`. A C compiler is needed for SQLite support (`mattn/go-sqlite3`).\n\n## Adding a New Module\n\n1. Create a package under the appropriate `internal/` subdirectory (e.g. `internal/check/mycheck/`).\n2. Implement `module.Module` plus the relevant role interface (`module.Check`, `module.DeliveryTarget`, `module.PlainAuth`, `module.Table`, etc.) from `framework/module/`.\n3. Register in `init()`: `module.Register(\"check.mycheck\", NewMyCheck)`. Use naming convention: `check.`, `target.`, `auth.`, `table.`, `modify.` prefixes.\n4. Add a blank import `_ \"github.com/foxcpp/maddy/internal/check/mycheck\"` in `maddy.go`.\n5. For checks: use the skeleton at `internal/check/skeleton.go` or `check.RegisterStatelessCheck` (see `internal/check/dns/` for a stateless example).\n\n## Error Handling\n\nUse `framework/exterrors` — not bare `fmt.Errorf`. Errors crossing module boundaries must carry:\n- SMTP status info via `exterrors.SMTPError{Code, EnhancedCode, Message, CheckName/TargetName}`\n- Temporary flag via `exterrors.WithTemporary`\n- Module name field\n\nKeep SMTP error messages generic (no server config details). Use `exterrors.WithFields` for unexpected errors. See `HACKING.md` for full guidelines.\n\n## Key Conventions\n\n- **No shared state between messages** — check/modifier code runs in parallel across messages.\n- **Panic recovery** — any goroutine you spawn must recover panics to avoid crashing the server.\n- **Address normalization** — domain parts must be U-labels with NFC normalization and case-folding. Use `framework/address.CleanDomain`.\n- **Configuration parsing** — modules receive config via `config.Map` in their `Configure` method. See `framework/config/` and existing modules for the pattern.\n- **Logging** — use `framework/log.Logger`, not `log` stdlib. Per-delivery loggers via `target.DeliveryLogger(...)`.\n\n","isInternal":false,"tokens":861,"sizeBytes":3599}],"systemPromptSnippet":"<yakaai_skills repo=\"foxcpp/maddy\">\n<!-- File: AGENTS.md (Tokens: ~861 | Category: root-instruction) -->\n# AGENTS.md — Maddy Mail Server\n\n## Architecture\n\nMaddy is a composable all-in-one mail server (MTA/MX/IMAP) written in Go. The core abstraction is the **module system**: every functional component (auth, storage, checks, targets, endpoints) implements `module.Module` from `framework/module/module.go` and registers itself via `module.Register(name, factory)` in an `init()` function.\n\n- **`framework/`** — Stable, reusable packages (config parsing, module interfaces, address handling, error types, logging). Interfaces live here to avoid circular imports.\n- **`internal/`** — All module implementations. Subdirectories map to module roles: `endpoint/` (protocol listeners), `target/` (delivery destinations), `auth/`, `check/` (message inspectors), `modify/` (header modifiers), `storage/`, `table/` (string→string lookups).\n- **`maddy.go`** — Side-effect imports that pull all `internal/` modules into the binary, plus the `Run`/`moduleConfigure`/`RegisterModules` startup sequence.\n- **`cmd/maddy/main.go`** — Thin entrypoint; imports root package for module registration, then calls `maddycli.Run()`.\n\nModules are wired together at runtime via `maddy.conf` configuration. Top-level blocks are lazily initialized through `module.Registry`. The **message pipeline** (`internal/msgpipeline/`) routes messages from endpoints through checks, modifiers, and to delivery targets based on sender/recipient matching rules.\n\n## Build & Test\n\n```sh\n# Build (produces ./build/maddy by default):\n./build.sh build\n\n# Build with specific tags (e.g. for Docker):\n./build.sh --tags \"docker\" build\n\n# Unit tests (standard Go):\ngo test ./...\n\n# Integration tests\ncd tests && ./run.sh\n```\n\nThe build embeds version via `-ldflags -X github.com/foxcpp/maddy.Version=...`. A C compiler is needed for SQLite support (`mattn/go-sqlite3`).\n\n## Adding a New Module\n\n1. Create a package under the appropriate `internal/` subdirectory (e.g. `internal/check/mycheck/`).\n2. Implement `module.Module` plus the relevant role interface (`module.Check`, `module.DeliveryTarget`, `module.PlainAuth`, `module.Table`, etc.) from `framework/module/`.\n3. Register in `init()`: `module.Register(\"check.mycheck\", NewMyCheck)`. Use naming convention: `check.`, `target.`, `auth.`, `table.`, `modify.` prefixes.\n4. Add a blank import `_ \"github.com/foxcpp/maddy/internal/check/mycheck\"` in `maddy.go`.\n5. For checks: use the skeleton at `internal/check/skeleton.go` or `check.RegisterStatelessCheck` (see `internal/check/dns/` for a stateless example).\n\n## Error Handling\n\nUse `framework/exterrors` — not bare `fmt.Errorf`. Errors crossing module boundaries must carry:\n- SMTP status info via `exterrors.SMTPError{Code, EnhancedCode, Message, CheckName/TargetName}`\n- Temporary flag via `exterrors.WithTemporary`\n- Module name field\n\nKeep SMTP error messages generic (no server config details). Use `exterrors.WithFields` for unexpected errors. See `HACKING.md` for full guidelines.\n\n## Key Conventions\n\n- **No shared state between messages** — check/modifier code runs in parallel across messages.\n- **Panic recovery** — any goroutine you spawn must recover panics to avoid crashing the server.\n- **Address normalization** — domain parts must be U-labels with NFC normalization and case-folding. Use `framework/address.CleanDomain`.\n- **Configuration parsing** — modules receive config via `config.Map` in their `Configure` method. See `framework/config/` and existing modules for the pattern.\n- **Logging** — use `framework/log.Logger`, not `log` stdlib. Per-delivery loggers via `target.DeliveryLogger(...)`.\n</yakaai_skills>"}