clickhouse/nerve/nerve-dev

Claude Code and agent skill by clickhouse/nerve

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Nerve backend (Python) and frontend (React/TS) development and code contribution. Use when writing Python code for Nerve, fixing bugs, adding features, reviewing Nerve PRs, building the frontend, running tests, or working with the Nerve codebase. Triggers on "nerve code", "nerve PR", "fix nerve", "nerve feature", "nerve test", "build nerve UI", "nerve migration", "nerve lint".

Install

npx vskill@latest install clickhouse/nerve/nerve-dev

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as clickhouse/nerve/nerve-dev.

Nerve Development Skill

Changing your own config (skills, cron, settings), not the app code? Use
the nerve-workspace skill instead — that covers the workspace, and which of a
pull request or a direct edit applies to this instance. This skill is for
developing the Nerve application codebase.

Repository

  • Upstream: https://github.com/ClickHouse/nerve (git@github.com:ClickHouse/nerve.git)
  • Issues & PRs: https://github.com/ClickHouse/nerve/pulls

All changes go through PRs — never push directly to main. The repo is public; see the security section before every commit.

Getting Started (Contributors)

Prerequisites: Python 3.13+ (pyproject.toml pins requires-python = ">=3.13"), uv, Node.js 22.12+, git, gh.

bash
# 1. Fork on GitHub, then clone your fork
git clone git@github.com:<your-username>/nerve.git
cd nerve
# 2. Add upstream remote
git remote add upstream git@github.com:ClickHouse/nerve.git
# 3. Python environment — same resolution as CI (fails if uv.lock is stale)
uv sync --locked --extra test
source .venv/bin/activate
# 4. Frontend
cd web && npm ci --strict-peer-deps && cd ..
# 5. Verify
.venv/bin/pytest tests/ -v
cd web && npm run build && npm test && npm run lint && cd ..

Run the commands below from the repository root (wherever you cloned it).

Project Layout

<repo>/
├── nerve/ # Python backend (FastAPI + agent backends)
│ ├── cli.py # Click CLI: init/start/stop/restart/status/logs/doctor/upgrade/reload/backup/
│ │ # restore/pair/sync/cron/migrate/migrate-openclaw/backfill-timestamps/setup-telegram
│ │ # + groups `config`, `codex`, `db`, `workflow`
│ ├── config.py # Config dataclasses + three-layer loader, ${VAR} interpolation
│ ├── config_validate.py # `nerve config validate` (also used by sync and config PRs)
│ ├── config_reload.py # hot reload (`nerve reload`, POST /api/config/reload)
│ ├── config_pr.py # propose_config_change — PR against the workspace repo
│ ├── config_repo.py # `nerve config init-repo` scaffold
│ ├── sync_service.py # git-backed workspace sync, lockdown clean-tree checks
│ ├── paths.py # ~/.nerve (NERVE_HOME) state-dir resolver — never hardcode ~/.nerve
│ ├── identity.py # Actor (human / system) attribution model
│ ├── setup_token.py # first-start claim token pairing.py — Telegram pairing codes
│ ├── bootstrap.py # `nerve init` wizard, CORE_CRONS, template installation
│ ├── workspace.py # workspace templates (MANIFEST), bundled skills
│ ├── backup.py # `nerve backup` / `nerve restore` bundles
│ ├── migrate.py # legacy config layout migration
│ ├── models_catalog.py # model picker discovery ollama.py, coerce.py, _env.py
│ ├── db/ # SQLite (aiosqlite): Database = base.py + domain mixins
│ │ ├── base.py # connection, pragmas, write lock, migrations, FTS health
│ │ ├── migrations/ # vNNN_*.py + runner.py (SCHEMA_VERSION = highest file number); fork/ = a fork's own track
│ │ └── sessions.py messages.py tasks.py task_statuses.py plans.py notifications.py
│ │ sources.py cron.py skills.py mcp.py audit.py accounts.py files.py usage.py
│ │ wakeups.py workflow_runs.py review_loops.py observations.py maintenance.py
│ ├── agent/ # engine.py, prompts.py, sessions.py, streaming.py, interactive.py,
│ │ │ # plan_service.py, cache_policy.py
│ │ ├── backends/ # AgentBackend protocol: claude.py (Claude Agent SDK), codex/ (app-server), events.py
│ │ └── tools/ # registry.py (ToolSpec/ToolContext/ToolResult), schemas.py, claude_sdk_adapter.py
│ │ └── handlers/ # one handler module per tool domain
│ ├── gateway/ # server.py (app factory, lifespan, WS, static), auth.py (JWT, require_auth), diff.py
│ │ └── routes/ # one module per API domain, assembled by register_all_routes()
│ ├── channels/ # web.py, telegram.py, slack*.py, router.py, access.py,
│ │ # observation.py, archives.py, stream_adapter.py, base.py
│ ├── sources/ # inbox sources: telegram, gmail, imap, github, github_events, github_repos,
│ │ # channel (observed chats), codex_threads/; runner.py, filters.py, registry.py
│ ├── cron/ # APScheduler service, jobs.py, gates.py, gate_plugins.py
│ ├── memory/ # files.py, memu_bridge.py (memU), loom.py (Loom), xmemory_bridge.py
│ ├── skills/ # SkillManager — filesystem skills + DB index
│ ├── tasks/ # task markdown files + manager
│ ├── notifications/ # NotificationService, silences, approval dispatch
│ ├── workflows/ # workflow runs (service.py) and review loops (review_loop.py)
│ ├── mcp_server/ # external MCP endpoint (/mcp/v1) + Codex loopback listener
│ ├── external_agents/ # Codex / Claude Code bootstrap, memory-bundle renderers, sync service
│ ├── observability/ # Langfuse tracing, usage rewrite
│ ├── proxy/ # CLIProxyAPI daemon (subscription auth, no API key)
│ ├── utils/ # aio.py, fs.py, time.py
│ └── templates/ # personal/, worker/ (+ MANIFEST), config/settings.yaml,
│ # config-repo/, skills/ (bundled: nerve-dev, nerve-workspace)
├── web/ # React + TypeScript + Vite frontend
│ ├── src/api/ # REST client, WebSocket client
│ ├── src/components/ # Auth, Chat, Cron, ExternalAgents, Files, Layout, Memory, Notifications, Sources, Tasks, ui
│ ├── src/pages/ # route pages (ChatPage, TasksPage, PlansPage, WorkflowRunsPage, ...)
│ ├── src/stores/ # Zustand stores; chatStore + handlers/ (WS dispatch) + helpers/
│ ├── src/hooks/ src/utils/ src/types/
│ ├── src/test/setup.ts # vitest setup (jsdom + Testing Library)
│ ├── e2e/ # Playwright UI snapshots: spec, baseline PNGs, snapshots.sh (Docker runner)
│ └── eslint.config.js, vite.config.ts, playwright.config.ts, package.json, package-lock.json
├── tests/ # pytest suite; conftest.py isolates NERVE_HOME per test
├── scripts/ # check_migration_numbers.py, check_codex_schema.py, codex_smoke.py, backtest_cache_ttl.py, ui_snapshot_server.py
├── docs/ # architecture, config, api, cron, memory, ... — update alongside code
├── .github/workflows/ # ci.yml (backend tests, migration check, frontend build + vitest, Node floor, UI snapshots), slack-live.yml
├── config.example.yaml # committed example; config.yaml and config.local.yaml are gitignored
├── install.sh
├── pyproject.toml, uv.lock # commit uv.lock together with pyproject.toml
└── README.md

Gateway Routes Architecture

Routes are split into domain modules under nerve/gateway/routes/: auth, accounts, setup, actors, sessions, tasks, plans, skills, mcp_servers, memory, diagnostics, cron, sources, notifications, files, external_agents, prompt_rewrite, models, codex, workflow_runs, review_loops, config. Each module:

  • defines its own router = APIRouter() with related endpoints,
  • imports get_deps() from _deps.py to reach the engine, DB, notification

service and external-agents sync service,

  • keeps its Pydantic request models co-located with the handlers.

Adding an endpoint: add the handler to the matching domain module; nothing else to wire. Adding a domain: create routes/new_domain.py with a router = APIRouter(), then import it and include_router it in routes/__init__.py::register_all_routes() — inclusion is explicit, not by discovery. (accounts and setup are included only in local-accounts auth mode.)

Dependency and auth pattern:

python
from fastapi import APIRouter, Depends
from nerve.gateway.auth import require_auth
from nerve.gateway.routes._deps import get_deps
from nerve.identity import Actor
router = APIRouter(dependencies=[Depends(require_auth)])
@router.get("/api/example")
async def example():
deps = get_deps()
# deps.engine, deps.db, deps.notification_service, deps.external_agents_sync

Use actor: Actor = Depends(require_auth) on handlers that consume identity for attribution or account authority; otherwise gate the module through the router dependency. Routes that invoke agent tools go through the shared registry (_deps.get_tool_registry() / build_route_tool_context()), so the REST and MCP paths share one implementation.

Agent Tools

Every agent tool is a ToolSpec (name, description, JSON schema, async handler) — see nerve/agent/tools/registry.py. Agents call them as mcp__nerve__<name>.

Adding a tool: put the schema in nerve/agent/tools/schemas.py, the handler and its ToolSpec in nerve/agent/tools/handlers/<domain>.py, and append the spec to that module's *_SPECS list — handlers/__init__.py::build_default_registry() registers every list. Handlers read state only from the ToolContext they are handed and return a ToolResult. The same registry serves the in-process MCP server of Claude sessions, the Codex loopback listener and the external /mcp/v1 endpoint, and the system prompt lists every served tool automatically. Then document the tool in docs/ and, if users should know it, in the TOOLS.md templates under nerve/templates/.

Development Workflow

Order for every change:

  1. Branch — git checkout -b <username>/<feature-name> from up-to-date main
  2. Recall — memory_recall for past issues, conventions and preferences on the area
  3. Backend first — Python under nerve/; add or renumber a migration if the schema changes
  4. Frontend second — TypeScript/React under web/src/
  5. Tests — .venv/bin/pytest tests/ -v; cd web && npm test && npm run lint
  6. Build UI — cd web && npm run build (the server serves web/dist/); after a visible UI change, web/e2e/snapshots.sh --update-snapshots and commit the changed PNGs
  7. Docs — update the matching docs/*.md (and README tables) in the same change
  8. Commit — focused, scoped commits on the feature branch
  9. Review — launch a review subagent, act on its feedback, run the leak check below
  10. Push to fork — git push origin <username>/<feature-name>
  11. PR — open it against upstream main (https://github.com/ClickHouse/nerve)
PR Workflow
bash
# Keep main up to date
git fetch upstream
git checkout main
git merge upstream/main
# Create feature branch
git checkout -b <username>/<feature-name>
# ... make changes, test, build ...
# Push to your fork
git push origin <username>/<feature-name>
# Create PR via gh CLI
gh pr create --repo https://github.com/ClickHouse/nerve \
--title "Short description" \
--body "Details of the change"

PR conventions:

  • Keep PRs focused — one feature or fix per PR
  • Include test coverage for new functionality
  • Run the full backend suite, the frontend build and npm test before opening
  • CI runs: backend tests on Python 3.13 with uv sync --locked, the migration

number check, npm ci --strict-peer-deps && npm run build && npm test, an install + build on the Node floor (22.12.0), and the UI snapshot comparison (web/e2e/snapshots.sh). npm run lint is not in CI — run it yourself.

Build Commands

Backend
bash
# Install / resync exactly what uv.lock says (what CI does)
uv sync --locked --extra test
# Run all tests (~1 minute)
.venv/bin/pytest tests/ -v
# Run one file, one class, or a keyword selection
.venv/bin/pytest tests/test_sessions.py -v
.venv/bin/pytest tests/test_db.py::TestClassName -v
.venv/bin/pytest tests/ -k "task and not slack" -q

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
77
Repository forks
28
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/clickhouse/nerve/nerve-dev/badge)](https://verified-skill.com/skills/clickhouse/nerve/nerve-dev)

Something wrong with this skill or its page? Tell us.