agentleFS
agentteamhqagentteamhq/agentteam-email/AGENTS.md

agentteam-email

AGENTS.md60 starsChanged 5 months agoMITView on GitHub

Agents must keep AGENTS.md limited to durable workflows and read or update the owning documentation before changing documented behavior. Agents must not edit any AGENTS.md file without explicit current-task approval for that specific file. README.md is the public product and project presentation surface; agents must not use it for architecture requirements, security rules, runtime contracts, release procedures, validation workflows, or operational runbooks. Before work involving authentication, authorization, Better Auth, credentials, encryption, sessions, cookies, API keys, tokens, JWT, OAuth, JWKS, secret…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

11 rules. About 1 is common, 9 are distinctive, and 1 is very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Common:

    Before work involving authentication, authorization, Better Auth, credentials, encryption, sessions, cookies, API keys, tokens, JWT, OAuth, …

    line 15
  2. Distinctive:

    Before changing existing product concepts, architecture boundaries, route surfaces, authentication terms, integration terms, account/domain …

    line 22
  3. Distinctive:

    When ARCHITECTURE.md points to a package or directory AGENTS.md as the owning rule surface, agents must read that file before changing …

    line 27
  4. Distinctive:

    Before proposing or changing any code, configuration, documentation, task, Compose file, chart, test, or runtime wiring that connects one …

    line 31
  5. Distinctive:

    When fixing a bug, test failure, CI failure, or broken workflow, agents must restore the intended system contract at the layer that owns it.

    line 51
  6. Distinctive:

    Every path written into a repository file must be relative to the repository root.

    line 66
  7. Distinctive:

    When the repository root is unclear, agents must run git rev-parse --show-toplevel to identify it, verify the target path is inside that …

    line 73
  8. Distinctive:

    Before adding or changing containerized workflows, agents must follow SETUP.md instructions.

    line 131
  9. Very specific:

    DO NOT EDIT .pnpmfile.cjs WITHOUT EXPLICIT CURRENT-TASK APPROVAL.

    line 167
  10. Distinctive:

    Do not redact or drop fields because they are caller-controlled, provider-controlled, auth-related, token-shaped, long, unfamiliar, or …

    line 217
  11. Distinctive:

    Every production-reachable user-visible screen state must be represented in Storybook.

    line 238

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Agent Requirements

Documentation

Agents must keep AGENTS.md limited to durable workflows and read or update the owning documentation before changing documented behavior.

Agents must not edit any AGENTS.md file without explicit current-task approval for that specific file.

README.md is the public product and project presentation surface; agents must not use it for architecture requirements, security rules, runtime contracts, release procedures, validation workflows, or operational runbooks.

Before work involving authentication, authorization, Better Auth, credentials, encryption, sessions, cookies, API keys, tokens, JWT, OAuth, JWKS, secret storage, security-sensitive routes, or anything that could be security related, agents must stop, read SECURITY.md, and follow it.

Architecture And Integration Boundaries

Before changing existing product concepts, architecture boundaries, route surfaces, authentication terms, integration terms, account/domain ownership, or settings semantics, agents must read ARCHITECTURE.md and preserve the vocabulary and ownership model defined there.

When ARCHITECTURE.md points to a package or directory AGENTS.md as the owning rule surface, agents must read that file before changing behavior in that scope.

Before proposing or changing any code, configuration, documentation, task, Compose file, chart, test, or runtime wiring that connects one service to another, agents must read ARCHITECTURE.md and the owning service architecture documentation.

This applies to service-to-service integration, network or listener binding, hostnames, ports, Compose or Kubernetes routing, RPC clients, SMTP relay paths, OAuth callbacks, webhooks, provider boundaries, and any other connection between services. Connection-specific changes include adding, removing, or changing URLs, base URLs, listen addresses, network aliases, target services, protocols, ports, client factories, callback paths, relay paths, health checks, credential boundaries, or provider endpoints. Agents must identify the documented contract, the current runtime evidence, and the specific mismatch before editing. Agents must not infer connectivity changes from a local symptom, temporary dev topology, or current broken code alone. If observed behavior matches the documented contract, agents must not change wiring and must continue validation at the next failing boundary.

Fixes And Failures

When fixing a bug, test failure, CI failure, or broken workflow, agents must restore the intended system contract at the layer that owns it. Agents must not infer the contract from the error message or current broken code alone; they must investigate the relevant requirements and architecture first. If the intended contract is unclear, agents must ask before editing. Agents must not use workarounds or weakened paths unless explicitly requested. Agents must verify through the canonical workflow that proves the contract.

Open Source Boundary

This repository is open source. Repository files must not contain secrets, private operational context, private hostnames, private repository names, credentials, tokens, absolute paths, or paths that resolve outside the repository root.

Every path written into a repository file must be relative to the repository root.

Agents must not write developer-machine, worktree-specific, temporary-checkout, or local-clone paths into repository files. Do not include the output of git rev-parse --show-toplevel in committed content.

When the repository root is unclear, agents must run git rev-parse --show-toplevel to identify it, verify the target path is inside that root, and write only the repository-root-relative path.

Standards And Structured Formats

Standard, protocol, common-format, and syntax-governed functionality must use purpose-built structured APIs from well-supported canonical packages.

This applies to all repository code and workflows, including application code, tests, scripts, probes, diagnostics, harnesses, generators, containers, and tooling.

Agents must not hand-roll behavior covered by this rule. If the required package is unavailable, agents must stop and request approval to add it or request an explicit exception.

Type Ownership

Agents must preserve strict types from their owning source instead of redefining or weakening them locally.

Code must import upstream package types, generated contract types, or exported workspace types from the owning package.

Authorization

Permissions must be modeled as strict backend-owned TypeScript/Zod contracts and enforced through CASL Ability.

Each protected domain object must have its own typed permission schema, CASL subject, ability builder, and helper surface when its authorization semantics differ.

Frontend labels, Storybook fixtures, OAuth scopes, and ad hoc booleans must not define or enforce permission semantics.

Generated Outputs

Generated outputs must not be manually edited. Agents must update the owning source, configuration, or inputs and rerun the process that generates them.

Definitions And Defaults

Definitions must have one owner.

Consumers must read, reference, derive from, or generate from the owning definition.

Required inputs must fail fast with clear errors when missing or invalid.

Defaults must live only in the owning configuration surface.

Build And Tasks

Agents must use SETUP.md for checkout setup, WT worktree identity, repo-managed tool installation, and validation command selection.

Before adding or changing containerized workflows, agents must follow SETUP.md instructions.

Node and frontend workflows must use Corepack-managed pnpm scripts from the relevant package.

Root mise.toml owns shared tool pins, repo-wide workflows, and broad aggregate tasks; scoped app, chart, docs, and test-container workflows are owned by the nearest relevant mise.toml and invoked with explicit monorepo task paths.

Root package.json owns workspace-wide Node workflows; app-specific and test-container-specific Node commands live in the owning package and are invoked through package filters or the owning mise task.

Canonical formatting, build, test, typecheck, lint, dependency, and runtime failures must be triaged through the failing workflow.

Direct tool invocations are allowed for debugging, diagnosis, or workflows that are not owned by a package script or mise task.

Database

Database schema changes must start in the owning schema package.

Migration or schema generation must be run only through the canonical package workflow and only when the current task authorizes generation.

Dependencies

Dependency changes must follow PEER-DEPS.md.

Installing a package requires current-task approval for that specific package.

The root pnpm-workspace.yaml owns workspace package boundaries, catalogs, peer rules, package-manager strictness, and minimum release age.

DO NOT EDIT .pnpmfile.cjs WITHOUT EXPLICIT CURRENT-TASK APPROVAL.

Dependency versions must be exact except where PEER-DEPS.md defines a peer or workspace protocol.

pnpm-lock.yaml and install artifacts must be maintained by normal pnpm install from the repo root.

Cross-package imports must use the referenced package's declared public exports.

Runtime And Environment

Shared code must receive environment-specific origins, ports, credentials, storage paths, providers, and debug behavior through explicit configuration.

Local database, mail, container, deploy, and service runtime workflows must use the repo-owned task or script that owns that lifecycle.

Testing

Tests must protect externally meaningful behavior, integration points, contractual service behavior, realistic failures, and regressions.

Regression fixes must start with a failing behavior-level reproduction and end with that reproduction passing.

End-to-end tests must exercise the real service boundary with repo-owned runtime configuration and controlled external-provider mocks.

Frontend changes must include visual validation for changed screens, components, and interactive workflows.

Logging

Runtime code must be diagnostically instrumented by default.

Agents must add or preserve safe structured logging when changing application behavior. Code paths that fail, branch on meaningful decisions, mutate durable state, cross process, service, or provider boundaries, enqueue or run work, or start up, report readiness, shut down, or affect user-visible outcomes must emit logs sufficient to diagnose what happened.

Absence of logging in changed runtime code must be intentional and limited to purely declarative, generated, type-only, or otherwise diagnostically empty code.

Application logs must be structured, safe to emit, and recorded at the boundary that owns the behavior or failure.

Logs must include stable correlation fields when available. Server-side logs must follow SECURITY.md: preserve diagnostic visibility first. Do not redact or drop fields because they are caller-controlled, provider-controlled, auth-related, token-shaped, long, unfamiliar, or otherwise ambiguous. If a value is ambiguous, log it. Omit or redact only specific values that the code context makes known to be actual credentials or secrets, and only when doing so does not make failures harder to understand.

Node runtime diagnostics must use the debug package with the existing package and domain namespace pattern. Node application diagnostics must not use ad hoc console logging. Non-Node runtime diagnostics must use the existing logging convention for that runtime.

Frontend

Frontend UI must use the repo's shadcn/ui primitives from the configured components/ui package path.

Frontend product icons must use @phosphor-icons/react.

New or substantially changed app screens, workflows, and reusable frontend components must include Storybook coverage for meaningful UI states.

Every production-reachable user-visible screen state must be represented in Storybook. Production frontend code must not render user-visible UI states, status messages, empty states, success states, error states, loading states, gated states, or workflow steps that are absent from the owning Storybook screen catalog.

Storybook screen stories and production routes must render the same route, page, controller, or canonical component contract. Storybook may mock loader, RPC, API, or service data at the boundary, but must pass that data into the same owner used by the app instead of recreating layout, component hierarchy, state transitions, or product behavior separately.

Product UI copy and fixtures must describe current product behavior with realistic data.

Screen components must keep route, auth, API, mutation, navigation, and global event wiring in the owning route or controller layer.

Exceptions

Exceptions to these rules must be explicitly approved by the human operator.

Approved exceptions must be documented in the relevant code or project documentation with the approval context.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.