This file is the canonical English contributing guide. The docs site embeds it on docs.nexu.io โ Contributing. ็ฎไฝไธญๆไธบ็ฌ็ซ่ฏๆฌ๏ผไปๅบๅ
docs/zh/guide/contributing.md๏ผ็บฟไธ๏ผใ
Thank you for helping improve nexu. The sections below cover code, documentation, and how we review changes.
If you want a lower-friction entry point, we are actively looking for Good First Issue contributors. Start with the good-first-issue label or the Chinese first-PR guide.
- Code of conduct: follow
CODE_OF_CONDUCT.mdin all Issues, Discussions, and PRs. - Security: do not open public issues for vulnerabilities. See
SECURITY.mdfor how to report them; implementation notes live inspecs/SECURITY.md.
- Bug reports โ reproducible steps, version/OS, logs (redact secrets).
- Feature ideas โ open a Discussion or Issue so maintainers can align before large PRs.
- Code โ fixes and features that match the project scope.
- Docs โ fixes, translations, screenshots, and clarity improvements (English + Chinese when both exist).
- Search Issues and Discussions for duplicates.
- For non-trivial changes, open an Issue first (or comment on an existing one) to agree on direction.
- Fork the repo and work on a short-lived branch off
main.
- Git
- Node.js 24+ (LTS recommended; enforced via
package.jsonengines) - pnpm 10.26+ (repo pins
pnpm@10.26.0viapackageManager) - npm 11+ (required for repo-local OpenClaw runtime maintenance flows)
From the repository root (not only docs/):
git clone https://github.com/nexu-io/nexu.git
cd nexu
pnpm installpostinstall runs scripts (including OpenClaw runtime setup). The first install can take a while.
nexu/
โโโ apps/
โ โโโ web/ # React + Ant Design dashboard
โ โโโ desktop/ # Electron desktop shell
โ โโโ controller/ # Hono backend + OpenClaw orchestration
โโโ packages/shared/ # Shared Zod schemas
โโโ packages/slimclaw/ # Repo-local OpenClaw runtime contract + prepared runtime ownership
โโโ scripts/ # Dev/CI scripts (launchd, probes, e2e)
โโโ tests/ # Vitest test suites
โโโ docs/ # VitePress documentation site
โโโ specs/ # Design docs, product specs
Run from the repo root unless noted.
| Command | Purpose |
|---|---|
pnpm dev |
Dev stack (controller + web) with hot reload |
pnpm start |
Full desktop runtime (Electron + launchd services, macOS only) |
pnpm stop |
Stop desktop runtime (graceful SIGTERM โ SIGKILL fallback) |
pnpm status |
Show desktop runtime status |
pnpm dev:controller |
Controller only |
pnpm build |
Production build (all packages) |
pnpm typecheck |
TypeScript checks across the workspace |
pnpm lint |
Biome check only |
pnpm lint:fix |
Auto-fix where safe with Biome only |
pnpm format |
Format/write with Biome |
pnpm test |
Root Vitest suite (vitest run) |
pnpm check:esm-imports |
ESM specifier verification (also run in CI) |
pnpm dist:mac:unsigned |
Build unsigned macOS desktop app for local testing |
Some packages define their own scripts (for example pnpm --filter @nexu/web test:e2e for Playwright). Prefer the closest package.json to the code you change.
Note for desktop contributors:
pnpm startrequires macOS (uses launchd for process management). The test suite includes real launchd integration tests that only run on macOS โ they're automatically skipped on other platforms. If you're contributing to desktop code, test on macOS before submitting a PR.
- Biome is the source of truth for formatting and many lint rules (
biome.json). - Pre-commit:
pnpm prepareinstallsscripts/pre-commitinto.git/hookswhen possible; it runs Biome on staged*.ts,*.tsx,*.js,*.jsx,*.jsonfiles. - Alternative hook path:
git config core.hooksPath scripts(then use hooks underscripts/as documented inscripts/pre-commit).
Run before pushing:
pnpm lint
pnpm typecheck
pnpm testIf you touched production build paths:
pnpm build
pnpm check:esm-importsWe recommend Conventional Commits-style messages so history and changelogs stay readable:
feat: โฆโ new featurefix: โฆโ bug fixdocs: โฆโ documentation onlychore: โฆโ tooling, deps, no user-facing changerefactor: โฆโ behavior-preserving code change
Use the imperative mood (add, fix, not added / fixed). Split unrelated changes into separate commits when practical.
- Branch from
main: e.g.fix/login-validationorfeat/feishu-webhook. - Scope โ one logical change per PR; avoid drive-by reformats across the repo.
- Title โ clear, concise; match Conventional Commits if you can.
- Description โ what/why, how to test, screenshots or screen recordings for UI changes.
- Link issues โ use
Fixes #123orCloses #123when applicable. - Secrets โ never commit tokens, API keys, or personal credentials. Use env vars and local-only config.
Maintainers may squash or adjust commit messages on merge; keeping your branch rebased on main reduces friction.
- Code PRs โ
.github/workflows/ci.ymlrunstypecheck,pnpm lint,pnpm build, andpnpm check:esm-imports. Pushes that only change files underdocs/skip this workflow (paths-ignore). - Docs PRs โ
.github/workflows/docs-ci.ymlbuilds the docs site whendocs/orCONTRIBUTING.mdchanges.
Green CI is required before merge unless a maintainer says otherwise.
cd docs
pnpm install # first time only
pnpm devVitePress prints a local URL; use it to verify headings, links, and images.
- English narrative in this guide is maintained in
CONTRIBUTING.mdat the repo root and included into the English docs page; edit that file for English prose, unless you are only fixing VitePress-only wiring. - English pages under
docs/en/: other guides stay indocs/en/. - Chinese pages:
docs/zh/ - New sidebar entries: update
docs/.vitepress/config.ts - When you add or substantially change a guide, keep English and Chinese in sync when both locales exist.
We recommend the telesoho.vscode-markdown-paste-image extension.
Workspace default (see .vscode/settings.json):
{
"MarkdownPaste.path": "${workspaceFolder}/docs/public/assets"
}- Copy a screenshot to the clipboard.
- Open the target file under
docs/en/ordocs/zh/. - Run Markdown Paste or
Cmd+Option+V(macOS) /Ctrl+Alt+V(Windows/Linux).
Link images from the site root:
Use descriptive filenames and alt text.
- Both
enandzhupdated if the page exists in both languages -
pnpm devpreview looks correct - New assets load from
/assets/... - Sidebar updated when adding a new page
Reviewers care about correctness, security/privacy, maintainability, and user-facing clarity. Smaller PRs are reviewed faster.
Again: thank you for contributing โ questions are welcome in Discussions.