Before you write a single line of code, read AGENTS.MD in the project root. It's the developer bootstrap — architecture diagrams, source layout by line number, event flow, dedup behavior, session lifecycle, edge cases, and gotchas. It turns any coder (human or agent) into a productive MiniClaw UI developer in one read.
This document covers how to contribute. AGENTS.MD covers how the code works.
Every task — feature, bug fix, refactor — follows this workflow:
- Create a task doc →
docs/tasks/<kebab-case-name>.md- Goal, context, plan, related docs, start date
- Keep it updated → decisions, trade-offs, problems encountered
- Mark done → outcomes, completion date
- Update the index → add/update entry in
docs/tasks/index.md - Sync the docs → if you changed code, update the relevant
/docsfile in the same commit. The docs ARE the source of truth.
This is a zero-framework project. No React, no Vue, no Express. Just Node.js http module and vanilla DOM APIs. Keep it that way.
- ES6+ — use
constby default,letwhen reassigning, nevervar - Descriptive names —
getSessionDataPath()notgsp(),convertToFrontendEvent()notcvt() - Comment the why, not the what — the code says what; comments explain edge cases, workarounds, and intent
- Section headers —
miniclaw-ui.jsuses// === Section Name ===blocks; follow that pattern - Line length — no hard limit, but keep it readable. The file is already 1800+ lines; don't make it worse
- No new dependencies — the only runtime dep is
ws. Every dependency adds surface area; justify it hard
- Semantic HTML — use
<section>,<nav>,<article>where appropriate - CSS custom properties — the theme lives in 10 variables in
:root. Don't scatter hardcoded colors - Dark theme only — no light mode toggle, no media query detection. Dark is the design
- Responsive — sidebar collapses, modals adapt. Test at narrow widths
There is no test suite. Testing is manual.
# Start the server
node miniclaw-ui.js
# Hit the API
curl -u :miniclaw http://localhost:1234/api/status
curl -u :miniclaw http://localhost:1234/api/sessions
# Load the UI in a browser
# http://localhost:1234When testing:
- Exercise the full event pipeline — create a new session, send a chat message, watch tool calls stream in
- Test edge cases — empty sessions, rapid message sending, disconnect/reconnect, cleared events, deleted sessions
- Check both surfaces — the REST API and the browser WebSocket should agree on state
- File sharing — test with text files, markdown, and binary files under
$HOME
- Code matches the existing style (section comments, naming, patterns)
- New behavior has a matching doc update in
/docs - Task doc in
docs/tasks/is complete and linked fromdocs/tasks/index.md - Manual smoke test: start server, load UI, trigger affected flows
- No new dependencies added without explicit justification
- Edge cases from
AGENTS.MD§6 considered (dedup, session lifecycle, event conversion gotchas)
Include:
- Steps to reproduce — exact curl commands or UI clicks
- Expected behavior — what should happen
- Actual behavior — what actually happens (logs, screenshots, error messages)
- Environment — Node version, OS, Gateway status, any custom env vars (
PORT,MCPASS,GW_WSS)
- Server logs —
miniclaw-ui.jsprints to stdout - Browser console — the frontend logs connection state and event processing
- Session data —
data/session-{key}.jsonhas the raw event storage - Gateway status — is the Gateway running and reachable at
ws://127.0.0.1:18789?
- Describe what the feature does from the user's perspective
- Explain why it matters — what workflow does it enable or fix?
- Rough scope: frontend only? backend changes? new API endpoint? config change?
Thank you for contributing. Start with AGENTS.MD — it has everything you need.