From f4cf9a9a83bf475a4b1d06105371c05e5c26692c Mon Sep 17 00:00:00 2001 From: nicosampler Date: Wed, 3 Jun 2026 17:45:00 -0300 Subject: [PATCH 1/7] docs: standardize documentation distribution --- AGENTS.md | 187 +++++++++++++++++++++- CLAUDE.md | 160 +----------------- architecture.md | 11 +- canton-barebones/wallet-service/AGENTS.md | 28 ++++ canton-barebones/wallet-service/CLAUDE.md | 3 + canton-connect-kit/AGENTS.md | 33 ++++ canton-connect-kit/CLAUDE.md | 3 + canton-connect-kit/README.md | 15 +- canton-connect-kit/architecture.md | 92 +++++++++++ carpincho-wallet/AGENTS.md | 58 ++++++- carpincho-wallet/CLAUDE.md | 65 +------- carpincho-wallet/architecture.md | 2 +- dapp/README.md | 2 + dapp/daml/README.md | 6 +- dapp/e2e/AGENTS.md | 27 ++++ dapp/e2e/CLAUDE.md | 3 + dapp/e2e/README.md | 19 +-- dapp/frontend/README.md | 3 + 18 files changed, 454 insertions(+), 263 deletions(-) create mode 100644 canton-barebones/wallet-service/AGENTS.md create mode 100644 canton-barebones/wallet-service/CLAUDE.md create mode 100644 canton-connect-kit/AGENTS.md create mode 100644 canton-connect-kit/CLAUDE.md create mode 100644 canton-connect-kit/architecture.md create mode 100644 dapp/e2e/AGENTS.md create mode 100644 dapp/e2e/CLAUDE.md diff --git a/AGENTS.md b/AGENTS.md index 7f0d014b..e496e30a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,5 +1,186 @@ -# Agent Configuration +# Agent Configuration — Canton dApp Booster -This project's agent configuration lives in [`CLAUDE.md`](./CLAUDE.md). +This file is the canonical monorepo-wide agent configuration. `CLAUDE.md` +files are compatibility shims that point here or to a sibling `AGENTS.md`. +Each subproject can layer its own `AGENTS.md` for stack-specific deltas: -Claude Code reads `CLAUDE.md` natively. If your agent reads `AGENTS.md` (Cursor, Windsurf, etc.), load rules from `CLAUDE.md` -- it is the single source of truth for this project's conventions, stack, and working rules. +- [`carpincho-wallet/AGENTS.md`](carpincho-wallet/AGENTS.md) — CIP-0103 wallet (Vite + React + Biome) +- [`canton-connect-kit/AGENTS.md`](canton-connect-kit/AGENTS.md) — wagmi-style React hooks for Canton dApps +- [`canton-barebones/wallet-service/AGENTS.md`](canton-barebones/wallet-service/AGENTS.md) — wallet-service bridge rules +- [`dapp/e2e/AGENTS.md`](dapp/e2e/AGENTS.md) — Playwright black-box integration test rules +- `canton-barebones/`, `dapp/daml/`, `dapp/frontend/` — see each subproject's `README.md` + +For the system shape (data flow, components, ports), see [`architecture.md`](architecture.md). + +--- + +## Documentation Distribution + +Use one reader per doc type, layered by scope: + +| File | Reader / question | Distribution rule | +|------|-------------------|-------------------| +| `README.md` | Human: what is this and how do I run it? | Every independently buildable, runnable, publishable, or testable unit gets one. Subproject READMEs cover only that unit and link to the root README for shared setup. | +| `AGENTS.md` | Agent: what local rules change how I edit here? | Root always. Subproject only when local conventions differ from root enough that an agent editing only that directory would get it wrong. Deltas only; link upward for repo-wide rules. | +| `CLAUDE.md` | Claude compatibility loader | Three-line shim beside every `AGENTS.md`, pointing to the sibling `AGENTS.md`. It is never canonical. | +| `architecture.md` | Human or agent: what are the structural seams and internal subsystems? | Root always for cross-component seams. Subproject only when internals outgrow the README: three or more interacting subsystems, non-trivial control flow, or named abstractions. | + +Current distribution: + +| Scope | README | AGENTS | CLAUDE | architecture | Decision | +|-------|--------|--------|--------|--------------|----------| +| root | yes | yes | shim | yes | Canonical repo rules and cross-component seams. | +| `carpincho-wallet/` | yes | yes | shim | yes | Complex wallet internals: vault, provider, extension, WalletConnect, theme, session. | +| `canton-connect-kit/` | yes | yes | shim | yes | Public hook API, connector abstractions, provider event wiring. | +| `canton-barebones/wallet-service/` | yes | yes | shim | no | Local bridge rules are useful; README API boundary is enough architecture for now. | +| `dapp/e2e/` | yes | yes | shim | no | Independent Playwright package with strict black-box testing conventions. | +| `dapp/frontend/` | yes | no | no | no | Small dApp UI; root rules and README are enough. | +| `dapp/daml/` | yes | no | no | no | Single DAML package. | +| `canton-barebones/` | yes | no | no | no | Docker/Bash local participant wrapper. | + +Subproject docs must not restate root rules. They should describe only their local delta and link upward. + +## Stack & Conventions (monorepo) + +| Category | Technology | Notes | +|----------|-----------|-------| +| Languages | TypeScript, DAML, Bash | TypeScript across the JS subprojects; DAML in `dapp/daml/`; Bash for canton-barebones scripts | +| Package manager | npm | One `package-lock.json` per Node subproject; root `package.json` orchestrates via `npm --prefix ` | +| Node | 24 | Pinned via root `.nvmrc`; inherits to every Node subproject | +| Container runtime | Docker | Used by `canton-barebones/` for the local participant + Postgres | +| Commit linting | commitlint + husky | Enforced via root `.husky/commit-msg` | +| Lint / format | Biome | One root `biome.json` and a single root `@biomejs/biome`; per-project specifics live in `overrides`. No per-subproject Biome install or config | +| Pre-commit | lint-staged | Root `.lintstagedrc.mjs` runs root Biome (`biome check --write`) across `carpincho-wallet/`, `canton-connect-kit/`, `dapp/frontend/`, and `dapp/e2e/` | +| Pre-push | tsc | Root `.husky/pre-push` runs `tsc --noEmit` per Node subproject | + +## Subprojects + +| Path | Purpose | Stack | Port | +|------|---------|-------|------| +| [`canton-barebones/`](canton-barebones/) | Local Canton participant + Postgres via docker-compose; deploy + health + token scripts | Docker, Bash, Node scripts | 3013/3014/3015/3016/3017/3018 | +| [`dapp/daml/`](dapp/daml/) | `quickstart-counter` DAML model | DAML | n/a (DAR artifact) | +| [`canton-barebones/wallet-service/`](canton-barebones/wallet-service/) | JSON-RPC bridge between the wallet and the Canton participant. Started by `npm run canton:up`. Self-mints its Canton JWT. | Node + Express + TypeScript | 3010 | +| [`carpincho-wallet/`](carpincho-wallet/) | CIP-0103 wallet — vault, signing, WalletConnect, Chrome extension | Vite 6 + React 18 + Tailwind v4 + Biome | 3011 | +| [`dapp/frontend/`](dapp/frontend/) | dApp UI | Vite + React + Biome | 3012 | +| [`dapp/e2e/`](dapp/e2e/) | dApp integration tests | Playwright + TypeScript | n/a | +| [`canton-connect-kit/`](canton-connect-kit/) | wagmi-style React hooks for connecting Canton dApps to CIP-0103 wallets | TypeScript + React 18 + Biome | n/a (library) | + +## Code Style + +- All source code in English regardless of conversation language. +- TypeScript preferred over JavaScript across Node subprojects. +- **No semicolons** in TypeScript / JavaScript across the repo. +- Lint and formatting are centralized in the root `biome.json`. Add project-specific rules under `overrides` keyed by path; do not create per-subproject Biome configs. + +## Working Rules + +- Use **npm** only (never pnpm or yarn). +- Install / run inside a subproject either by `cd ` or by using `npm --prefix run