neurodiveragents
CLAUDE.md2 starsChanged 2 months agoMITView on GitHub
This project uses the neurodiveragents fleet. When a task matches an agent domain, use the Task tool with the matching subagent_type. Pass full context in the prompt — subagents have no prior conversation history. Apply without being asked when the signal is clear:
- Reads credentials
In this repository16 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- ndv-adversarialSkill
- ndv-boundedSkill
- ndv-contextualSkill
- ndv-directSkill
- ndv-efficientSkill
- ndv-incrementalSkill
- ndv-map-firstSkill
- ndv-parallel-safeSkill
- ndv-perceptualSkill
- ndv-preciseSkill
- ndv-skepticalSkill
- ndv-structuralSkill
- ndv-temporalSkill
- ndv-total-perceptionSkill
- ndv-vigilantSkill
The file
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
Add logging or observability → apply ndv-telemetry
- Very specific: line 54
If still ambiguous: diagnose first with ndv-diagnose, then hand off
- Very specific: line 63
Use the Task tool with subagent_type: ndv-<specialist>
- Distinctive: line 69
All agents default to parallel execution for 4-8 independent files/items.
- Very specific: line 111
Run this before merging a release PR.
- Distinctive: line 125
Treat INCONCLUSIVE as "not checked", never as a pass.
- Very specific: line 194
Update routing in CLAUDE.md, agents/ndv-flow.md, bin/ndv.js (NDV_BLOCK + Copilot header), commands/opencode/ndv-help.md, …
- Very specific: line 196
Run npm run validate. The pre-commit hook and CI (Node 20, ubuntu-latest) run the same command.
- Very specific: line 197
If routing changed, run npm run eval:gate before the next release.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- ndv:start -->neurodiveragents
This project uses the neurodiveragents fleet. When a task matches an agent domain, use the Task tool with the matching subagent_type. Pass full context in the prompt — subagents have no prior conversation history.
Routing Table
| When the task involves... | Use agent |
| PRD, epic, multi-task workload, fleet orchestration | ndv-flow |
| Code review, PR, code smells, quality | ndv-review |
| Bug, stack trace, root cause unknown — investigate | ndv-diagnose |
| Root cause confirmed, fix known — implement it | ndv-build |
| Rename, extract, restructure, modernize syntax | ndv-refactor |
| Generate tests, improve coverage, ATDD, acceptance tests first, red tests before implementation | ndv-tester |
| Security vulnerabilities, OWASP, auth issues | ndv-secure |
| Slow code, N+1 queries, bundle size, latency | ndv-optimize |
| Add logging, metrics, traces, health checks | ndv-telemetry |
| Framework or library upgrade, version bump, breaking changes in a dependency, codemods, deprecated API removal | ndv-upgrade |
| System design, SOLID violations, architecture review | ndv-architect |
| Implement a spec with schemas, acceptance criteria, file targets, and architecture decided (behavioral specs additionally require scale simulation at N=1/N=10/N=100) | ndv-build |
| Scope creep, "while we're at it", PRD boundary review, overloaded tickets | ndv-scope |
| Estimate review, sprint plan calibration, roadmap sanity check | ndv-forecast |
| KPI audit, metrics review, coverage targets, DORA metrics, OKRs | ndv-signal |
| Technical docs, API docs, session notes | ndv-explain |
| UI structure, layout decisions, visual hierarchy, design judgment | ndv-design → then ndv-build |
| WCAG auditing, ARIA violations, contrast ratios, keyboard nav, screen reader compatibility, a11y, accessibility audit | ndv-accessibility |
| Codebase lookup, cross-file tracing, "where is X", "how does Y work", "does X exist", "find any reference to Z", feature flow summaries, pipeline investigation | ndv-research |
| No specialist match / no clear owner / tradeoffs / direct answer / command execution | ndv-honest |
Proactive Application
Apply without being asked when the signal is clear:
- Stack trace shared → apply
ndv-diagnose - PR or files to review → apply
ndv-review - "it's slow" or slow query → apply
ndv-optimize - "clean this up" or rename → apply
ndv-refactor - Code with no tests → suggest
ndv-tester - Story has schemas + criteria + file targets + architecture settled → apply
ndv-build - Add logging or observability → apply
ndv-telemetry - Version bump or "upgrade to vN" → apply
ndv-upgrade - UI code, components, or design decisions → apply
ndv-design - UI code with interactive elements, form inputs, or color usage → apply
ndv-accessibility - Accessibility remediation work: classify as
a11y-onlyvsa11y+visual-risk; route implementation tondv-build, and for visual-risking changes hand off tondv-designbefore implementation - "where is", "how does", "trace this", "what files", "show me" about existing code → apply
ndv-research
Conflict Resolution (use highest-priority match)
- Stack trace / exception / failing test / "debug" language →
ndv-diagnose(even if the code is auth/payment) - Explicit vulnerability/audit/exploit language →
ndv-secure - Explicit performance/latency/slow language →
ndv-optimize - If still ambiguous: diagnose first with
ndv-diagnose, then hand off ndv-honesthandles anything — it is a pure communication layer, not a router.- Layout/structure changes without a spec →
ndv-designfirst.ndv-buildexecutes specs, not decisions — but a human instruction that fully specifies the outcome is the spec. "Centre the row, two lines" is a decision already made; routing it through design re-opens a closed question. Route to design when the decision is open, not when the change is merely visual.
Example: "500 error + NullPointerException stack trace in login endpoint" → ndv-diagnose
Example: "Should we switch to pnpm?" → ndv-honest
How to Apply
- Use the Task tool with
subagent_type: ndv-<specialist> - Pass full context in the prompt (task description, relevant files, error messages, goals) — subagents have no prior conversation history
- For parallel work: spawn multiple Task calls in a single message
Parallelism Default
All agents default to parallel execution for 4-8 independent files/items.
<!-- ndv:end -->Stack
- Runtime: Node.js ≥ 18, ESM (
"type": "module") - Test runner:
node --test(built-in, no Jest/Vitest) - Dependencies:
@clack/prompts,picocolors— no build step for the fleet itself - CSS build: Tailwind CLI (
npm run css:build) — only needed for the website, not the fleet
Key directories
| Path | What lives here |
agents/ | Agent model files (source of truth) |
humans/ | Human-readable character profiles |
bin/ndv.js | CLI installer — ndv install, ndv list, ndv install-skills |
test/ | Test suite (14 files — see below) |
docs/ | Authoring guide, ADRs, manifesto |
skills/ | Cognitive module skills |
commands/ | Slash commands (OpenCode) |
Validation
npm run validateThat is the whole merge gate, and the pre-commit hook and CI (.github/workflows/validate.yml) run exactly that command. It runs the full test suite (npm test, 14 files) and then the CSS staleness check. Authoring-guide checks are scoped to the agents changed on the branch: scripts/validate.sh compares against origin/main, or you can set CHANGED_AGENTS="ndv-foo,ndv-bar" yourself.
Narrower commands for iterating:
npm run validate:agents # the 6 static agent/fixture checks — fast, no installs
npm run test:install # install simulation only
npm run css:check # CSS staleness onlyRouting eval gate (local, before every release)
Run this before merging a release PR. It calls models, costs tokens, and is not part of validate:
npm run eval:gateIt re-scores each model recorded in test/fixtures/routing-baseline.json against test/fixtures/routing-cases.json:
| Verdict | Meaning | Exit code |
| PASS | Canonical accuracy is at or above the baseline floor, and escalation is at or below the baseline ceiling | 0 |
| DEGRADED | Either limit is broken; the output names the new misses and escalations | 1 |
| INCONCLUSIVE | The model provider returned errors (quota, rate limit), or the fixture changed after the baseline was recorded | 2 |
Treat INCONCLUSIVE as "not checked", never as a pass.
Recording a baseline:
npm run eval:baseline # 3 runs each: Opus 5, Sonnet 5, Haiku 4.5
npm run eval:baseline -- --models glm-5.3-flash # add a model (Ollama, needs OLLAMA_API_KEY)- The floor is the worst result across the baseline runs. Misses are asked again (
--retries 2, majority vote), so one unlucky answer doesn't fail a release. - Editing the fixture makes the baseline stale.
validatethen fails until you re-runeval:baselineand commit the new baseline file. - Models are reached through
scripts/eval-providers/:claude.sh(default for Claude models) runs the Claude CLI from an empty temp directory with no tools, no MCP servers, and a minimal system prompt. WithANTHROPIC_API_KEYset it also adds--bare, which skips hooks, plugins and your personalCLAUDE.md. Without it, your user-levelCLAUDE.mdstill loads into every scoring call.anthropic.mjscalls the Messages API directly: the clean-room number. Select it with--provider anthropic. Key fromNDV_ANTHROPIC_API_KEYorANTHROPIC_API_KEY; base URL fromNDV_ANTHROPIC_BASE_URLto score through an Anthropic-compatible gateway. Some gateways resolve a bare alias such asclaude-opus-5to a different snapshot than Anthropic does;NDV_ANTHROPIC_MODEL_ALIASES=label=served-id,...maps the label to the id the gateway must receive, so the row measures the model its label names. Rate limits are retried with backoff; through a gateway pass--concurrency 2, since the default 4 trips a per-minute quota.ollama.mjscalls Ollama's cloud API whenOLLAMA_API_KEYis set, or a local Ollama server otherwise.
- Each baseline row records its provider, and
eval:gatescores through the same one. Recording with--provider anthropicand gating through the CLI would compare two transports, not two releases. - Keys and gateway settings live in
.envat the repo root, gitignored..env.exampleis the contract; copy it and fill it in. The eval scripts load it when present and shell variables take precedence. Never put a key or a gateway URL in a tracked file.
The eval measures the routing text that ships. The ndv:start/ndv:end block at the top of this file must be byte-identical to NDV_BLOCK in bin/ndv.js, and validate enforces that. Change the routing table in both places together, or the eval scores a table users never receive.
Ground truth: 56 cases covering all 19 agents, at least half of them conflict or residual cases. Each case has a basis:
canonical(50): forced by ananchor, a verbatim phrase on a routing line that names the expected agent.scripts/routing-context.mjssupplies the same text to the validator and to the model. A canonical miss means the routing table needs fixing, or the model can't follow it.judgment(6, capped at 25%): the fixture author's own reading, with thecontested alternative named. A judgment miss means review the case first.
To score a single model ad hoc, without the gate: NDV_EVAL_CMD='<command that reads stdin>' npm run eval:routing (supports --tag, --limit, --retries, --out).
Behavior eval (local, before a release that changes agent text)
The routing eval proves a task reaches the right agent. The behavior eval checks that the agent does the job once it's there. It also calls models, costs tokens, and is not part of validate:
npm run eval:behavior # one run, Sonnet 5 via claude.sh
npm run eval:behavior -- --agent ndv-secure --kind lane # narrow it while iterating
npm run eval:behavior:baseline # record floors: 3 runs each, same models as the routing gate
npm run eval:behavior:gate # PASS / DEGRADED / INCONCLUSIVE, same exit codes as eval:gate
npm run eval:behavior:compare -- --agent ndv-x --record # agent file vs a plain model on the same casesEach case in test/fixtures/behavior-cases.json runs with the agent's own model file as the system prompt, and has one of three kinds:
finds: a defect planted inside the agent's domain. Pass means the output names it.lane: a defect planted outside the domain. Pass means the output hands it to the agent named in the case, which must be one the agent's Out of Scope declares.brief: a Flow brief with one Brief Contract field missing. Pass meansBRIEF_REJECTED. Only Tier 1 and Tier 2 agents get one.
Scoring is deterministic: every check is a pattern on the output (scripts/behavior-checks.mjs, shared with the static test), with no model judge, so any score can be argued with line by line from the saved report (--out). The gate fails on a run below the baseline floor, and names each case that passed in every baseline run and now fails. Editing the fixture makes the baseline stale, and validate fails until it is re-recorded. Providers read the agent prompt from NDV_EVAL_SYSTEM_FILE; without it they keep the routing instruction.
Every new agent must beat the plain model. --compare runs each case twice: once with the agent file, once with a control prompt that knows the agent's lane, the routing table, the handoff format and BRIEF_REJECTED, but not the neurotype, primordial rule or domain protocols. The verdict per agent is EARNS (more checks passed than the control, and no fewer finds), NO GAIN or WORSE. --record writes it to test/fixtures/agent-evidence.json, pinned to the agent file and its cases. validate fails for any agent added after the original 18 without current EARNS evidence on at least two models (authoring guide, step 7).
Test files
| File | What it tests |
test/validate-schema.test.js | Structural schema for agent/human files — format contracts; runs unconditionally, no CHANGED_AGENTS dependency |
test/validate-authoring.test.js | Authoring-guide compliance; scoped to CHANGED_AGENTS env var when set, else describe blocks register but produce no tests |
test/validate-contracts.test.js | Architectural contract tests (ADR-008 Domain Contracts, O(n) behavioral spec regression); runs unconditionally |
test/validate-coherence.test.js | Semantic coherence across agent sections — handoff targets, Mandatory Pipeline, Brief Contract all resolve to real slugs; no agent instructs reacting to elapsed wall-clock time, asking the user what to do next, or sizing work in calendar units; static, no LLM calls |
test/validate-routing.test.js | Integrity of the behavioral routing fixture — every expect resolves, every agent is covered, the case mix stays hard enough to discriminate, canonical anchors exist in the routing text, and the committed eval baseline was recorded against this exact fixture; static, no LLM calls |
test/validate-flow-protocol.test.js | Structural gates on the orchestration protocol in ndv-flow.md — routing-table coverage, sentinel token consistency, handoff emit/parse grammar agreement, ledger status vocabulary, bounded BRIEF_REJECTED retry, router parity with every CLAUDE.md routing table (agent coverage + a declared signal list), and shipped-text parity (CLAUDE.md's ndv block byte-identical to NDV_BLOCK; Copilot header has the same routing rows); static, no LLM calls |
test/validate-behavior.test.js | Integrity of the behavioral output fixture — every case names a real agent and kind, every check compiles through the scorer's own helper, every agent but ndv-honest has a finds case, every agent with handoffs has a lane case whose target its Out of Scope declares, Tier 1/2 agents have a brief case, and a committed behavior baseline matches the fixture; static, no LLM calls |
test/install.test.js | bin/ndv.js install commands — simulates claude/opencode/cursor installs in a temp dir |
test/install-router-skills.test.js | Acceptance tests for router-skill auto-install behavior in bin/ndv.js (claude auto-install, opencode skip, cursor/copilot no skills dir) |
test/transform-skill.test.js | Adversarial unit tests for transformAgentToSkill() purity, determinism, boundary, and degradation behavior |
test/transform-opencode.test.js | Unit tests for transformForOpenCode() — the ndv-flow path-hint injection is gated on the exact bare filename, fails closed, and always injects the literal <name> placeholder |
test/entry-guard.test.js | Regression test for the entry-point symlink guard — invoking bin/ndv.js via a symlink still runs the command dispatcher |
Adding or changing an agent
- Edit
agents/ndv-[name].md(model file — source of truth) - Update routing in
CLAUDE.md,agents/ndv-flow.md,bin/ndv.js(NDV_BLOCK + Copilot header),commands/opencode/ndv-help.md,humans/ndv-agents.md. The ndv block inCLAUDE.mdandNDV_BLOCKmust stay byte-identical. - Edit
humans/ndv-[name].human.md(human file — written after model file is stable) - Run
npm run validate. The pre-commit hook and CI (Node 20, ubuntu-latest) run the same command. - If routing changed, run
npm run eval:gatebefore the next release. - For a new agent, or an edit to one added after the original 18: re-run
npm run eval:behavior:compare -- --agent ndv-[name] --recordon two models. It must sayEARNSon both.
Pre-commit hook
Husky runs npm run validate on every commit. Fix failures before committing — do not skip the hook.
Running from a git worktree: husky's generated .husky/_ directory is untracked, so the hook doesn't fire there. Run npm run validate by hand before pushing.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

