Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
docs: add repository operating rules
davoodmehraban89 committed
Oct 5, 2026 at 11:38 UTC
7f34489f66f5d9ec72a2a0dfa301dbb6d0d6db65
1 file changed
+39
AGENTS.md
new
+39
@@ -0,0 +1,39 @@
1
+# TreasuryFlow Repository Operating Rules
2
+
3
+## Product class
4
+TreasuryFlow handles high-risk financial workflows. Correctness, traceability and safe failure take precedence over convenience.
5
+
6
+## Source of truth
7
+1. `docs/specs/PHASE_1_FOUNDATION_SPEC.md` for current foundation invariants.
8
+2. `docs/ROADMAP.md` for phase boundaries.
9
+3. ADRs under `docs/adr/` for architectural decisions.
10
+4. Tests for executable behavior.
11
+
12
+## Engineering rules
13
+- TypeScript strict mode; avoid `any` at financial/domain boundaries.
14
+- Money is integer IRR at the domain/storage boundary; never floating-point money.
15
+- State transitions are explicit domain operations; UI may not write arbitrary status values.
16
+- Authorization is enforced server-side for every sensitive action.
17
+- No bank submission without an idempotency identity.
18
+- No automatic retry after ambiguous bank outcome.
19
+- No secret, credential, token or private banking material in Git, logs, fixtures or screenshots.
20
+- Migrations are versioned and reviewed.
21
+- External integrations sit behind typed adapters and contract tests.
22
+- Iran-specific bank limits/cutoffs/capabilities are configuration with effective dates.
23
+
24
+## Delivery rules
25
+- Work on a feature/foundation branch; use PR review before merging to `main` once CI exists.
26
+- Use TDD for domain rules and bug fixes.
27
+- Every completed phase updates project state/handoff documentation.
28
+- Do not claim production readiness from mocks or simulated bank responses.
29
+- Live-bank activation, public production release, destructive data actions and sensitive access changes require explicit release authorization.
30
+
31
+## Required checks before merge
32
+- format/lint
33
+- typecheck
34
+- unit/integration tests
35
+- build
36
+- security-relevant negative tests for changed financial behavior
37
+
38
+## Documentation language
39
+Code identifiers and technical contracts are English. User-facing product copy is Persian-first. Architectural documents may be English or Persian but must use stable domain terms.