mate AGENTS.md

Project instructions for antiv/mate, a multi-agent system that manages agents and their tools. They describe the required Python style, virtual-environment use, architecture, and server setup.

In plain words
What is it for?
Use them when adding or modifying agents, managers, tools, database models, callbacks, or the authentication and agent-development servers.
Why use it?
They give coding agents consistent rules for changing the project and help prevent misplaced logic, incorrect initialization, or commands run with the wrong dependencies.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/antiv/mate/agents-md
Clone the repo
git clone --depth 1 https://github.com/antiv/mate

Made for: Codex, OpenCode.

Per session 1,440 This file is loaded in full into every session.
When invoked 1,440 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01440 $0.01440
Opus 5 $0.00720 $0.00720
Sonnet 5 $0.00288 $0.00288
Haiku 4.5 $0.00144 $0.00144

Measured 2d ago against content hash fae037564731, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mate AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MATE (Multi-Agent Tree Engine) System Instructions

Code Style

  • Use Python 3.8+ for all new files
  • Follow PEP 8 style guidelines with 4-space indentation
  • Use type hints for function parameters and return types
  • Prefer descriptive variable names over comments
  • Use f-strings for string formatting
  • Import statements should be grouped: stdlib, third-party, local imports

Development Environment

  • ALWAYS activate the virtual environment before running any Python commands
  • Use source .venv/bin/activate before running Python scripts, tests, or imports
  • This ensures correct package versions and dependencies are used
  • All Python commands should be run within the activated virtual environment

Architecture

  • Follow the Agent-Manager-Tool Factory pattern
  • Keep database models in shared/utils/models.py
  • Keep agent business logic separate from database operations
  • Use the AgentManager for all agent initialization and hierarchy management
  • Tools should be created through the ToolFactory system
  • All agents must include token usage tracking callbacks

Server Architecture

  • Auth Server: Always runs on port 8000 (auth_server.py)
  • ADK Server: Always runs on port 8001 (adk_main.py)
  • All requests go through auth server - no direct access to ADK server
  • Auth server acts as a proxy to ADK server for all API requests
  • Authentication is required for all requests (admin:mate by default)
  • A2A (Agent-to-Agent) protocol requests are proxied through auth server

Database

  • Use SQLAlchemy ORM for all database operations
  • Support PostgreSQL (production), MySQL, and SQLite (development)
  • Database sessions should be properly closed in finally blocks
  • Use the DatabaseClient for connection management
  • Agent configurations are stored in agents_config table
  • Token usage is logged in token_usage_logs table
  • Create migrations for each DB changes. Migrations are in shared/sql/migrations/. Each DB type have separated folder: postgresql, sqlite, mysql
  • Database updates should go through the migration system, not through a separate script.
  • Do not run any DB update. Prepare migrations. Migrations will be run on server run.

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 125 lines · 1,440 tokens per session scan A fae037564731

Subscribe to this mod's changes

mate AGENTS.md is an instructions file published in the GitHub repository antiv/mate (88 stars, last pushed 3d ago), licensed Apache-2.0. It adds 1,440 tokens to every session, about $0.0072 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.