dodil/erp-platform

templates/brick-example/AGENTS.md

Instructions for agents working on this brick

This brick is built on erp-platform. Read its BRICKS.md before changing anything here — it holds the rules (ownership, use cases, data, identity, tests) and why each one exists.

Where a change goes

You are changing…It goes in
a business rule ("a sent quote cannot change")domain/ — and a test in tests/test_rules.py
who may do something, or which rows they seeapplication/ — the permission on the declaration, or _visible()
a new action for people and agentsa new @EXAMPLE.use_case in application/ — it becomes a route AND a tool
a column or tablesrc/brick_example/schema.sql (append; never drop or rename) and infrastructure/tables.py

Never add an HTTP route or an MCP tool by hand. Never import SQLAlchemy, FastAPI or MCP in domain/.

Before you commit

pytest -q --tb=short        # rules + both doors, no bucket needed

Add a test to tests/test_doors.py for any new use case: the outcome through the API and through MCP, and the 404 for another person's row.

Don't

  • Don't write to another brick's tables — call its seam.
  • Don't write an upsert or DELETE by hand — use the repository (DataK3's ON CONFLICT differs from Postgres).
  • Don't commit credentials or .env.