Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# AGENTS.md — NullClaw Chat UI Engineering Protocol

Default working protocol for coding agents in this repository. Scope: entire repository.

## 1) Project Snapshot

The chat surface for NullClaw: a SvelteKit app served two ways — as a web app
(vite dev/build) and as a dynamically-mounted UI module (`npm run build:module`
→ `module.js`, consumed by NullHub's module loader). TypeScript + Svelte 5.

Transport contract: WebSocket to the NullClaw gateway's `channels.web` endpoint
(default `ws://127.0.0.1:32123/ws`), end-to-end encryption (X25519 + ChaCha20-Poly1305),
PIN/token pairing. The protocol lives in `src/lib/protocol/` and the session
controller in `src/lib/session/` — treat these as the compatibility surface.

## 2) Engineering Principles

- The gateway wire protocol is a compatibility contract: changes must be
backward-compatible or explicitly versioned, and tested against a running
`nullclaw gateway`.
- No secrets in the repo. Keep tokens and keys out of logs; persisted browser
auth must respect its TTL and be cleared on rejection.
- Deterministic tests: `npm test` (vitest) must pass; no network in unit tests.

## 3) Validation

```bash
npm install # node 20+, npm 10+
npm test # vitest — required before every commit
npm run check # svelte-check — required before every commit
npm run build # app build must succeed
npm run build:module # module.js must build (NullHub consumption)
```

## 4) Contribution flow

See [CONTRIBUTING.md](CONTRIBUTING.md).
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributing to NullClaw Chat UI

1. **Read [AGENTS.md](AGENTS.md)** first — the gateway wire protocol is a
compatibility contract and the validation gates live there.
2. One concern per PR. No drive-by refactors.
3. Before every commit: `npm test`, `npm run check`, `npm run build`,
`npm run build:module` — all must pass.
4. Every PR runs CI. Keep it green.
5. Bug fixes must include a regression test citing the issue number.
Loading