|
1 | 1 | ECA Agent Guide (AGENTS.md) |
2 | 2 |
|
3 | 3 | - Build (requires Clojure CLI + Babashka): |
4 | | - - All-in-one debug CLI (JVM, with nREPL): bb debug-cli |
5 | | - - Production CLI (JVM): bb prod-cli | Production JAR: bb prod-jar |
6 | | - - Native image (requires GRAALVM_HOME): bb native-cli |
7 | | -- Test (Kaocha via :test alias): |
8 | | - - Run all unit tests: bb test (equivalent: clojure -M:test) |
9 | | - - Run a single namespace: clojure -M:test --focus eca.main-test |
10 | | - - Run a single test var: clojure -M:test --focus eca.main-test/parse-opts-test |
11 | | - - Integration tests (needs ./eca or eca.exe present): bb integration-test |
| 4 | + - All-in-one debug CLI (JVM, nREPL): `bb debug-cli` |
| 5 | + - Production CLI (JVM): `bb prod-cli` | Production JAR: `bb prod-jar` |
| 6 | + - Native image (GraalVM, `GRAALVM_HOME` set): `bb native-cli` |
| 7 | +- Test (Kaocha via `:test` alias): |
| 8 | + - Run all unit tests: `bb test` (same as `clojure -M:test`) |
| 9 | + - Run a single test namespace: `clojure -M:test --focus eca.main-test` |
| 10 | + - Run a single test var: `clojure -M:test --focus eca.main-test/parse-opts-test` |
| 11 | + - Integration tests (requires built `./eca` or `eca.exe`): `bb integration-test` |
12 | 12 | - Lint/format: |
13 | | - - Lint: clj-kondo --lint src test dev integration-test |
14 | | - - Formatting is not enforced; follow idiomatic Clojure (use cljfmt if desired). |
15 | | -- Namespace and imports: |
16 | | - - One file per `ns`; set! *warn-on-reflection* true. |
17 | | - - Group requires: stdlib, third‑party, then eca.*; sort within groups. |
18 | | - - Prefer :as aliases; avoid :refer except in tests (clojure.test only what you use). |
19 | | -- Naming/types: |
20 | | - - kebab-case for fns/vars, snake/camel only for external data keys; namespaces `eca.<area>[.<subarea>]`. |
| 13 | + - Lint: `clj-kondo --lint src test dev integration-test` |
| 14 | + - Formatting not enforced; follow idiomatic Clojure (`cljfmt` optional). |
| 15 | +- Namespaces/imports: |
| 16 | + - One file per `ns`; always `(set! *warn-on-reflection* true)` near top. |
| 17 | + - Group `:require` as: Clojure stdlib, third‑party, then `eca.*`; sort within groups. |
| 18 | + - Prefer `:as` aliases; avoid `:refer` except in tests (`clojure.test` and what you use). |
| 19 | +- Naming/types/data: |
| 20 | + - kebab-case for fns/vars, `eca.<area>[.<subarea>]` for namespaces. |
| 21 | + - Use snake/camel case only when mirroring external data keys. |
21 | 22 | - Prefer immutable maps/vectors/sets; use namespaced keywords for domain data. |
22 | | - - Add type hints only to silence reflection where needed. |
23 | | -- Errors/logging: |
24 | | - - Use ex-info with data for exceptional paths; return {:result-code ...} maps from CLI flows. |
25 | | - - Never println for app logs; use eca.logger (levels: error/warn/info/debug). |
| 23 | + - Add type hints only to remove reflection where it shows up. |
| 24 | +- Errors/logging/flows: |
| 25 | + - Use `ex-info` with data for exceptional paths; return `{:result-code ...}` maps from CLI flows. |
| 26 | + - Never `println` for app logs; use `eca.logger/error|warn|info|debug` (stderr-based). |
26 | 27 | - Tests: |
27 | | - - Use clojure.test + matcher-combinators; keep tests deterministic; place helpers under test/eca/test_helper.clj. |
| 28 | + - Use `clojure.test` + `nubank/matcher-combinators`; keep tests deterministic. |
| 29 | + - Put shared test helpers under `test/eca/test_helper.clj`. |
0 commit comments