nexusos
AGENTS.md19 starsChanged 4 months agoApache-2.0View on GitHub
This file defines the operating contract for AI coding agents working on NexusOS. Read it before inspecting tasks, editing code, or changing documentation. NexusOS is a local-first knowledge operating system for AI agents. The v0.1 release must provide a small, deterministic, well-tested memory contract over files the user owns. The repository is shipping stable v0.1.0. The planned core v0.1 feature scope shipped through the alpha/RC train. Preserve the frozen v0.1 contracts and route new product scope to the next release…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
18 rules. About 1 is common, 16 are distinctive, and 1 is very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 4
Read it before inspecting tasks, editing code, or changing documentation.
- Distinctive: line 25
Never reference, import, inspect, or depend on private Nexus projects or personal knowledge stores.
- Common: line 27
Never hardcode personal names, paths, domains, credentials, or workspace content.
- Distinctive: line 72
read-only local inspection API and UI
- Distinctive: line 74
Not in the v0.1 release scope:
- Distinctive: line 82
Do not create placeholder commands, empty interfaces, speculative configuration keys, or documentation that implies these features work.
- Very specific: line 87
Every release change must map to a task ID in ROADMAP.md, such as A3-04 or RC-03.
- Distinctive: line 92
Read the roadmap task, dependencies, acceptance criteria, and verification gate.
- Distinctive: line 101
Add or update tests for every behavior change and regression fix.
- Distinctive: line 102
Keep the change scoped to one roadmap task unless dependencies make a combined change unavoidable.
- Distinctive: line 104
Do not silently defer an acceptance criterion.
- Distinctive: line 105
Update documentation and changelog entries in the same change when behavior or public contracts move.
- Distinctive: line 110
Run the required verification commands.
- Distinctive: line 113
Never report “done” based only on code generation or passing a narrow test subset.
- Distinctive: line 134
Use synthetic data only. Tests must not depend on personal files, network access, local agent state, or machine-specific paths.
- Distinctive: line 147
Do not weaken an existing assertion merely to make a change pass.
- Distinctive: line 189
When these files disagree with implementation, inspect the code and tests, correct the contract deliberately, and update every affected …
- Distinctive: line 202
Do not call an alpha “stable,” claim “full coverage” without a measured policy, or mark a release complete because feature checkboxes are …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.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
AGENTS.md
This file defines the operating contract for AI coding agents working on NexusOS. Read it before inspecting tasks, editing code, or changing documentation.
Mission
NexusOS is a local-first knowledge operating system for AI agents. The v0.1 release must provide a small, deterministic, well-tested memory contract over files the user owns.
The repository is shipping stable v0.1.0. The planned core v0.1 feature scope
shipped through the alpha/RC train. Preserve the frozen v0.1 contracts and route
new product scope to the next release train.
The executable release plan lives in ROADMAP.md.
Isolation rules
These are non-negotiable:
- Work only inside the NexusOS project directory.
- Namespace all product state under CLI
nexusos, packagenexusos, environment variablesNEXUSOS_*, and workspace state.nexusos/. - Never reference, import, inspect, or depend on private Nexus projects or personal knowledge stores.
- Never hardcode personal names, paths, domains, credentials, or workspace content.
- Tests must use synthetic fixtures and temporary directories.
- Source documents are immutable unless a future, explicitly approved write system is implemented. v0.1 has no source-mutation feature.
- Derived state must remain disposable and rebuildable from source files.
Architecture boundary
core (errors, models, path safety, configuration)
↓
workspace (initialization, identity, templates)
↓
indexing (discovery, parsing, graph, schema, migrations, database, lock, kernel)
↓
services (doctor, index, status, search, navigation, lint, serve, demo)
↓
cli (Typer and Rich adapters)
mcp (top-level adapter beside cli, importing services only)Rules:
coremust not import Typer, Rich, MCP, CLI, or service modules.workspacemay depend oncore, never on CLI or MCP.indexingmay depend oncoreandworkspace, never on CLI or MCP.servicesowns reusable application behavior.cliformats command input and output around services.mcpis a top layer. It imports services, not indexing internals or CLI code.- CLI and MCP behavior should share service contracts rather than duplicate logic.
See docs/architecture.md for the maintained architecture reference.
Current release boundary
Implemented in v0.1.0-alpha.2:
- workspace initialization, doctor, and configuration display
- path boundaries, deny paths, nested-workspace checks, and safe state writes
- Markdown and text discovery, parsing, deterministic chunking, and wiki-link graphing
- SQLite schema and migrations, FTS5, transactional persistence, and writer locking
- index, status, search, browse, read, recent, links, context, lint, serve, MCP, and demo
- MCP tools over stdio and Streamable HTTP
- read-only local inspection API and UI
Not in the v0.1 release scope:
- embeddings or vector databases
- web, PDF, or service ingestion connectors
- source mutation through CLI, HTTP, or MCP
- cloud hosting, OAuth, sync, teams, or multi-user authorization
- operational dashboards beyond the bundled local inspection UI
Do not create placeholder commands, empty interfaces, speculative configuration keys, or documentation that implies these features work.
Roadmap task protocol
Every release change must map to a task ID in ROADMAP.md, such as A3-04
or RC-03.
Before editing:
- Read the roadmap task, dependencies, acceptance criteria, and verification gate.
- Inspect the implementation and existing tests that define current behavior.
- State the smallest coherent change required to complete the task.
- Identify affected public contracts: CLI, configuration, JSON, MCP, docs, packaging, migrations, or exit codes.
During implementation:
- Preserve dependency direction and source immutability.
- Add or update tests for every behavior change and regression fix.
- Keep the change scoped to one roadmap task unless dependencies make a combined change unavoidable.
- Do not silently defer an acceptance criterion. Record the deferral and reason.
- Update documentation and changelog entries in the same change when behavior or public contracts move.
Before reporting completion:
- Run the required verification commands.
- Confirm all task acceptance criteria with concrete evidence.
- Report files changed, tests added, commands run, and any unresolved limitation.
- Never report “done” based only on code generation or passing a narrow test subset.
Coding standards
- Python 3.11+
from __future__ import annotationssrc/package layout- Pydantic v2 models
- Typer and Rich only in adapter layers
- Ruff for linting and formatting
- mypy strict mode
- pytest for unit, integration, regression, and security tests
- maximum line length: 100
- dependencies locked through
uv.lock
Favor explicit typed models and narrow service interfaces. Avoid hidden global state, implicit network access, non-deterministic retrieval behavior, and broad exception swallowing.
Testing contract
Use synthetic data only. Tests must not depend on personal files, network access, local agent state, or machine-specific paths.
Behavior changes should be tested at the lowest useful level and at the public boundary when appropriate:
- unit tests for pure logic and validation
- integration tests for service and CLI flows
- regression tests for reported defects
- security tests for filesystem boundaries, source immutability, server exposure, and unsafe input handling
- packaging smoke tests for installed artifacts during release work
Do not weaken an existing assertion merely to make a change pass. Explain and document intentional contract changes.
Required verification
The default repository gate is:
uv sync
uv run ruff check .
uv run ruff format --check .
uv run mypy src
uv run pytest -q --cov=nexusos
uv run nexusos versionThe --cov=nexusos flag enforces the A3-03 aggregate coverage gate: fail_under = 80
in [tool.coverage.report] (measured baseline 84–85%, 2026-08-03). CI additionally
enforces targeted floors for security-critical modules (core/path_safety.py,
indexing/lock.py, services/serve_service.py, mcp/) and uploads the coverage
report as a per-leg artifact. Claims of "full test suite passing" must refer to the
measured suite and its measured coverage, never to an unmeasured literal 100%.
Roadmap tasks may require additional commands, platform matrices, clean-environment installs, MCP client tests, package builds, or release checks. Run those in addition to the default gate.
Documentation contract
The following files describe public behavior and must remain aligned:
README.md: user-facing overview, quick start, supported behavior, current statusROADMAP.md: release tasks, dependencies, acceptance criteria, and gatesCHANGELOG.md: shipped and unreleased user-visible changesSECURITY.md: supported security boundary and vulnerability reportingCONTRIBUTING.md: contributor workflow and pull-request evidencedocs/architecture.md: dependency direction and invariantsdocs/configuration.md: valid keys, environment variables, defaults, precedencedocs/mcp.md: transports, tools, schemas, and safety boundarydocs/linting.md: lint modes, checks, severities, and exit codesdocs/releasing.md: build, validation, versioning, and publication procedure
When these files disagree with implementation, inspect the code and tests, correct the contract deliberately, and update every affected document.
Release language
Use precise terms:
- core-scope complete: planned v0.1 product capabilities are implemented
- release hardening: defects, contracts, packaging, platforms, docs, and security are being validated
- release candidate: intended stable artifact under real-world validation
- stable: published artifact and public contracts have passed all roadmap gates
Do not call an alpha “stable,” claim “full coverage” without a measured policy, or mark a release complete because feature checkboxes are full.
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.

