src/— library code by NIP insrc/nipXX/(e.g.,src/nip46/). Shared types insrc/types/, utilities insrc/utils/. Export surfaces insrc/index.ts(update when adding modules). Followsrc/NIP_STANDARDIZATION.mdfor NIP changes.tests/— Jest tests mirrorsrc/by NIP (tests/nipXX/) plus focused tests liketests/utils/*.test.ts.examples/— runnable TypeScript examples by feature/NIP.dist/— compiled output; do not edit.scripts/— helper scripts (e.g.,scripts/promote-to-main.sh).
npm install— install dependencies.npm run build— clean and compile TypeScript todist/.npm test|npm run test:watch|npm run test:coverage— run Jest, watch mode, or coverage (reports incoverage/).npm run lint— ESLint (@typescript-eslint) over.tssources.npm run format— Prettier 3 forsrc/,tests/,examples/.npm run example(orexample:*) |npm start— run examples; default is the NIP‑07 example.npm run promote— maintainers: promotestaging→main.
- Language: TypeScript (strict). Prefer explicit types; avoid
any. - Formatting: Prettier, 2‑space indent; run
npm run formatbefore pushing. - Linting:
@typescript-eslint; intentionally unused vars prefixed with_. - Naming:
camelCasefor variables/functions;PascalCasefor types/classes. New NIP code goes undersrc/nipXX/and is exported viasrc/index.ts.
- Framework: Jest with
ts-jest, Node environment. - Naming:
*.test.tsor*.spec.ts; mirror thesrc/layout. - Coverage: keep or improve; use
npm run test:coverage. - Use test vectors and the ephemeral relay; never include real credentials.
- Commits: Conventional Commits (
feat:,fix:,refactor:,docs:,test:,chore:), imperative and concise. - Branches: create from
stagingusingfeature/<name>orfix/<name>; PRs targetstaging. - PR checklist: clear what/why, linked issues (e.g.,
#123), tests and examples updated if behavior changes. Runnpm run lint && npm test && npm run buildbefore opening.
- Do not commit private keys, secrets, or real credentials.
- Prefer
.envfiles ignored by Git; document required vars in examples or readme.
- This AGENTS.md applies repo‑wide. A deeper
AGENTS.mdoverrides within its folder subtree. Follow the structure and style above when adding files and exports.