linea-monorepo / postman
AGENTS.md126 starsChanged 3 months agoApache-2.0View on GitHub
Inherits all rules from root AGENTS.md. Only overrides and additions below. TypeScript backend service that facilitates cross-chain message delivery between L1 (Ethereum) and L2 (Linea). Monitors MessageSent events, checks message anchoring readiness, and auto-claims messages with configurable retry/gas-bumping logic. Built with Viem for blockchain interactions, TypeORM + PostgreSQL for persistence, Express for metrics/health API, and Zod for configuration validation.
- Reads credentials
We split this AGENTS.md into the rules it gives an agent
3 rules. About 1 is common, 0 are distinctive, and 2 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 110
Test files: /__tests__/*.test.ts pattern
- Common: line 124
Never log private keys, signer secrets, or database passwords
- Very specific: line 132
Run pnpm -F @lfdt-lineth/postman run lint before proposing TypeScript changes
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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.
Files
AGENTS.md — postman
Inherits all rules from root AGENTS.md. Only overrides and additions below.
Package Overview
TypeScript backend service that facilitates cross-chain message delivery between L1 (Ethereum) and L2 (Linea). Monitors MessageSent events, checks message anchoring readiness, and auto-claims messages with configurable retry/gas-bumping logic. Built with Viem for blockchain interactions, TypeORM + PostgreSQL for persistence, Express for metrics/health API, and Zod for configuration validation.
How to Run
# Build dependency projects first
NATIVE_LIBS_RELEASE_TAG=blob-libs-v1.2.0 pnpm run -F linea-native-libs build && \
pnpm run -F linea-shared-utils build && \
pnpm run -F "./ts-libs/sdk/*" build
# Build the postman
pnpm -F @lfdt-lineth/postman run build
# Run locally (requires local stack + PostgreSQL)
pnpm exec ts-node src/main.ts
# Run as part of full stack
make start-env-with-tracing-v2Test
# Unit tests
pnpm -F @lfdt-lineth/postman run testLint
pnpm -F @lfdt-lineth/postman run lint
pnpm -F @lfdt-lineth/postman run lint:fixTypeScript-Specific Conventions
- Build tool: tsc (
tsconfig.build.json) - Runtime: Node.js (entry point:
src/main.ts, production:dist/src/main.js) - Blockchain library: Viem
- ORM: TypeORM 0.3 with PostgreSQL
- Configuration: Zod schema validation (
src/application/postman/app/config/schema.ts) - Logging: Winston via
@lfdt-lineth/shared-utils - Metrics: Prometheus via
prom-client
Directory Structure
postman/
├── src/
│ ├── main.ts Entry point
│ ├── application/postman/app/ Application layer
│ │ ├── PostmanApp.ts Lifecycle orchestrator (start/stop)
│ │ ├── PostmanContainer.ts Dependency wiring / service builder
│ │ ├── L1ToL2App.ts L1→L2 message processing pipeline
│ │ ├── L2ToL1App.ts L2→L1 message processing pipeline
│ │ └── config/ Env loading, Zod schemas, defaults
│ ├── core/ Domain interfaces and types
│ │ ├── clients/blockchain/ Blockchain client interfaces
│ │ ├── services/ Service interfaces (signing, retries, nonce)
│ │ ├── persistence/ Repository interfaces
│ │ ├── metrics/ Metrics interfaces
│ │ ├── enums/ Direction, MessageStatus, etc.
│ │ ├── errors/ Error types
│ │ ├── constants/ Default values
│ │ └── types/ Shared types (hex, log, receipt)
│ ├── infrastructure/ Implementations
│ │ ├── blockchain/viem/ Viem-based blockchain clients
│ │ │ ├── clients/ LinethRollup, L2MessageService clients
│ │ │ ├── providers/ Viem/Linea providers
│ │ │ ├── gas/ Gas estimation (Ethereum + Linea)
│ │ │ ├── signers/ Private key + Web3Signer support
│ │ │ └── mappers/ Viem type mappers
│ │ ├── persistence/ TypeORM entities, repos, migrations
│ │ ├── metrics/ Prometheus metrics updaters
│ │ └── api/ Express API (metrics, health)
│ ├── services/ Business logic processors and pollers
│ │ ├── processors/ Event processing, claiming, anchoring
│ │ └── pollers/ Interval-based polling
│ └── utils/testing/ Test helpers, fixtures, mocks
├── scripts/ CLI scripts (send messages for testing)
└── Dockerfile Multi-stage production Docker imageKey Dependencies
| Dependency | Purpose |
viem | Blockchain interactions (public/wallet clients, ABI encoding) |
@lfdt-lineth/sdk-core | Core SDK types and utilities |
@lfdt-lineth/sdk-viem | Viem-based SDK integration |
@lfdt-lineth/native-libs | Native library bindings (blob compressor) |
@lfdt-lineth/shared-utils | Shared utilities (logging, metrics, server) |
typeorm | PostgreSQL ORM with migrations |
zod | Configuration schema validation |
filtrex | Calldata filter expression parsing |
winston | Structured logging |
prom-client | Prometheus metrics |
Testing
- Framework: Jest 30.4.2 with ts-jest preset
- Uses
jest-mock-extendedfor mock generation --forceExitand--detectOpenHandlesflags enabled- Test files:
**/__tests__/*.test.tspattern
Database Migrations
Migrations live in src/infrastructure/persistence/migrations/. Create new ones with:
MIGRATION_NAME=<NAME> pnpm run migration:createMigrations are written manually — TypeORM CLI auto-generation is not used due to incompatibility.
Postman-Specific Safety Rules
- Never log private keys, signer secrets, or database passwords
- Signer configuration supports
private-key,web3signer, andaws-kmstypes — test all three paths when modifying signer logic. Theaws-kmsadapter requires an asyncinit()(performed insidecreateSignerClient), socreateSignerClientisasyncand must be awaited. - Nonce management is critical for transaction ordering — changes to
NonceManagerrequire careful review - Gas bumping (
MAX_BUMPS_PER_CYCLE,MAX_RETRY_CYCLES) affects transaction cost — validate defaults incore/constants/common.ts - Database migration files are append-only — never modify existing migrations
Agent Rules (Overrides)
- Run
pnpm -F @lfdt-lineth/postman run lintbefore proposing TypeScript changes - Configuration changes must be reflected in both
config/schema.ts(Zod) andconfig/envLoader.ts - New environment variables must be added to
.env.samplewith sensible defaults - Changes to blockchain client interfaces (
core/clients/) affect both L1→L2 and L2→L1 paths — test both directions - TypeORM entity changes may require a new migration — check
infrastructure/persistence/entities/
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 28,693 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 repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- contracts/AGENTS.mdAGENTS.md
- coordinator/AGENTS.mdAGENTS.md
- e2e/AGENTS.mdAGENTS.md
- maru/AGENTS.mdAGENTS.md
- prover/AGENTS.mdAGENTS.md
- prover-ray/AGENTS.mdAGENTS.md
- tracer/AGENTS.mdAGENTS.md
- transaction-exclusion-api/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/documentation.mdcCursor rule
- .cursor/rules/security-logging-guidelines/EXAMPLES.mdCursor rule
- .cursor/rules/security-logging-guidelines/RULES.mdCursor rule
- .cursor/rules/smart-contract-guidelines/RULE.mdCursor rule
- .cursor/rules/versioning-guidelines/EXAMPLES.mdCursor rule
- .cursor/rules/versioning-guidelines/RULES.mdCursor rule
- developing-smart-contractsSkill
- linea-dependency-maintenanceSkill
- squash-bugbotSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

