Physical-AI-Operating-System
AGENTS.md381 starsChanged 8 months agoApache-2.0View on GitHub
This file provides guidance to Codex and other coding agents when working in this repository. Treat CLAUDE.md as the upstream source of truth; this file is the Codex-compatible mirror of those project rules. This repo is developed across multiple AI-assisted environments. The following rules apply to all code changes: 1. Update docs on code change - When changing behavior, architecture, or APIs, update both the English and Vietnamese docs. Keep numbers, flows, endpoints, and states accurate with the code. Platform…
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- autonomous-ai/autonomous-osword for word, first seen Mar 30, 2026
Other versions1 project uses a version of this.
Word for word · 1
- autonomous-ai/autonomous-os★ 378100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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.
In this repository34 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/architecture.mdcCursor rule
- .cursor/rules/docs-on-code-change.mdcCursor rule
- .cursor/rules/multi-ide.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- agent-managementSkill
- audioSkill
- cameraSkill
- claude-buddySkill
- computer-useSkill
- connectorsSkill
- displaySkill
- emotionSkill
- environmentSkill
- face-enrollSkill
- faqSkill
- guardSkill
- habitSkill
- harness-useSkill
- input-branchingSkill
- led-controlSkill
- moodSkill
- musicSkill
- music-suggestionSkill
- sceneSkill
- sensingSkill
- sensing-trackSkill
- servo-controlSkill
- servo-trackingSkill
- skill-creatorSkill
- speaker-recognizerSkill
- user-emotion-detectionSkill
- voiceSkill
- wellbeingSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 0 are common, 10 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Update docs on code change: - When changing behavior, architecture, or APIs, update both the English and Vietnamese docs.
- Very specific: line 88
Verify with concrete evidence such as focused tests, builds, greps, bash -n, or compile checks.
- Distinctive: line 90
Do not "clean up" inherited drift such as unrelated gofmt churn, duplicate dependency metadata, or upstream-preserved style unless it is …
- Very specific: line 94
Do not auto-deploy to devices.
- Distinctive: line 101
Follow the active tool's completion contract.
- Very specific: line 105
Do not use shell sleep loops, repeated ps / pgrep / top, or repeated log/status reads to wait for a job that already has a completion …
- Distinctive: line 116
Avoid repeated zero/short-timeout checks.
- Distinctive: line 118
When an external job has no notification or native wait support, use a bounded watcher or read-only polling with backoff and an overall …
- Distinctive: line 120
Do not rerun the original operation just to obtain its status.
- Distinctive: line 130
When work can be split across independent, file-scoped tasks, use available parallelism instead of doing everything sequentially.
- Distinctive: line 151
Do not delegate when the overhead is larger than the work itself, especially for one or two quick edits in files already open.
- Very specific: line 158
Always ask the user before running any sshpass or ssh command to the Pi.
- Distinctive: line 159
Do not SSH automatically.
- Very specific: line 165
Before changing skills/harness-use, system/harness or the OS Harness UI/API, read the integration context and ownership and its Vietnamese …
- Very specific: line 185
All targets run from the repo root via the top-level Makefile.
- Distinctive: line 266
All HTTP endpoints return:
- Distinctive: line 296
Always wrap errors with useful context.
- Very specific: line 307
Always use context.Context for cancellation.
- Very specific: line 312
Use go-playground/validator for struct validation.
≈ “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 provides guidance to Codex and other coding agents when working in
this repository. Treat CLAUDE.md as the upstream source of truth; this file is
the Codex-compatible mirror of those project rules.
Multi-IDE Rules
This repo is developed across multiple AI-assisted environments. The following rules apply to all code changes:
Update docs on code change - When changing behavior, architecture, or APIs, update both the English and Vietnamese docs. Keep numbers, flows, endpoints, and states accurate with the code. Platform docs are in
docs/; lamp-specific docs are inrobots/lamp/docs/.Platform docs (
docs/+docs/vi/):Code area English doc Vietnamese doc os-server, API, startup docs/os-server.mddocs/vi/os-server_vi.mdSetup flow, provisioning docs/setup-flow.mddocs/vi/setup-flow_vi.mdWeb UI, configuration pages docs/web-ui.mddocs/vi/web-ui_vi.mdFlow Monitor (turn pipeline, JSONL, SSE) docs/flow-monitor.mddocs/vi/flow-monitor_vi.mdOverall structure docs/overview.mddocs/vi/overview_vi.mdMQTT, dispatch, publish docs/mqtt.mddocs/vi/mqtt_vi.mdOTA, bootstrap docs/bootstrap-ota.mddocs/vi/bootstrap-ota.mdSpeech emotion recognition (SER) docs/speech-emotion.mddocs/vi/speech-emotion_vi.mdRealtime voice agent (HAL realtime, Gemini Live / OpenAI Realtime, delegate)docs/realtime-voice.mddocs/vi/realtime-voice_vi.mdPerception service (cloud DL inference), load balancer, encryption, models docs/perception-service.mddocs/vi/perception-service_vi.mdHermes agent backend ( agent_runtime, runtimes/hermes)docs/agentic/hermes.mddocs/vi/agentic/hermes_vi.mdPicoClaw agent backend ( agent_runtime, runtimes/picoclaw, WebSocket)docs/agentic/picoclaw.mddocs/vi/agentic/picoclaw_vi.mdAdding/changing an agentic backend (AgentGateway contract, switch, install/presync, migration, skills, hooks, reset) docs/agentic/adding-agent-runtime.mddocs/vi/agentic/adding-agent-runtime_vi.mdSafety engine (SAFETY.md bounds, deterministic enforcement gate) docs/safety.mddocs/vi/safety_vi.mdDevice telemetry (adding a tracker, hal/telemetry,system/telemetry,/api/telemetry/event)docs/telemetry.mddocs/vi/telemetry_vi.mdVoice response metrics ( hal/telemetry,system/telemetry,/api/telemetry/event)docs/voice-metrics.mddocs/vi/voice-metrics_vi.mdLamp-specific docs (
robots/lamp/docs/+robots/lamp/docs/vi/):Code area English doc Vietnamese doc LED, effects, states, animations robots/lamp/docs/led-control.mdrobots/lamp/docs/vi/led-control_vi.mdSensing behavior, sound escalation, reactions robots/lamp/docs/sensing-behavior.mdrobots/lamp/docs/vi/sensing-behavior_vi.mdSensing threshold tuning robots/lamp/docs/sensing-tuning.mdrobots/lamp/docs/vi/sensing-tuning_vi.mdHabit tracking, pattern building, habit-aware nudge phrasing robots/lamp/docs/habit-tracking.mdrobots/lamp/docs/vi/habit-tracking_vi.mdVision tracking, object follow, servo track robots/lamp/docs/vision-tracking.mdrobots/lamp/docs/vi/vision-tracking_vi.mdPhysical controls (GPIO button, TTP223 touchpad, gestures, pet response) robots/lamp/docs/physical-controls.mdrobots/lamp/docs/vi/physical-controls_vi.mdAutonomous Buddy (Mac companion app) integrations/companions/autonomous-buddy/docs/autonomous-buddy.md,integrations/companions/autonomous-buddy/docs/autonomous-buddy-mvp.md,integrations/companions/autonomous-buddy/docs/release-signing.mdintegrations/companions/autonomous-buddy/docs/vi/autonomous-buddy_vi.md,integrations/companions/autonomous-buddy/docs/vi/autonomous-buddy-mvp_vi.md,integrations/companions/autonomous-buddy/docs/vi/release-signing_vi.mdSecurity test checklist robots/lamp/docs/security-test.md(no vi version) - Comments in English - Project standard.
- Code is the single source of truth - Docs reflect code, not the other way around.
- Do not commit binary artifacts - Version is injected via ldflags at build time.
- Web/TSX lint is a required quality gate - For every change under
system/web/, work freely on the implementation but finish with bothnpm run lintandnpm run buildfromsystem/web/. Do not hand off a change with ESLint warnings or errors, TypeScript errors, or a skipped validation command. Fix React Hook diagnostics by restructuring the code; do not silence them witheslint-disableunless the exception is narrowly scoped, documented in English with why it is safe, and has no practical compliant alternative. Report the exact commands run and any limitation. - Go validation must follow CI order - For Go changes, run from the repo
root, sequentially:
go build ./..., thengo vet ./..., thengo test ./.... Fix a failed stage before advancing to the next. The vet checks run implicitly bygo testare only a subset and do not replace the explicitgo vet ./...gate. For concurrency changes, also rungo test -raceon the affected packages. Complete these checks before reporting the change ready to commit or push; report exact commands and any failures or skipped checks. Device tests do not replace local gates.
See docs/DEV-MULTI-IDE.md for full conventions.
Working Style
- The user reviews and commits by hand. Do not create commits unless explicitly
asked. When asked:
git addthe exact files of that change (nevergit add -A), checkgit status --shortfor unrelated dirty or untracked files and leave them alone, then commit with a single-line message and nothing else in it — noCo-Authored-Bytrailer, no "Generated with" footer, no body. Commit only; do not push unless told to. - Work in small, reviewable chunks. When a task spans multiple concerns, split it by concern and verify each batch before moving to the next.
- Stay in scope. Flag unrelated issues instead of fixing them opportunistically.
- Verify with concrete evidence such as focused tests, builds, greps,
bash -n, or compile checks. Report what was and was not verified. - Do not "clean up" inherited drift such as unrelated gofmt churn, duplicate dependency metadata, or upstream-preserved style unless it is required for the task.
- Respond to the user in Vietnamese unless they request otherwise.
- Do not auto-deploy to devices. Default to repo changes plus local verification; any on-device SSH/SCP/restart step is opt-in and must be confirmed first.
Waiting for tools and background jobs
Avoid model turns that only ask whether a job has finished.
- Follow the active tool's completion contract. If it explicitly delivers the result automatically, do independent work or use its supported yield/wait mechanism. End a turn to await delivery only when the tool explicitly guarantees that it will resume the task; never assume a wakeup.
- Do not use shell
sleeploops, repeatedps/pgrep/top, or repeated log/status reads to wait for a job that already has a completion mechanism. Targeted process/log inspection is still appropriate to diagnose a failure or a suspected stall. - Retain the returned handle and use its matching continuation tool. In Codex,
an
exec_commandsession ID useswrite_stdin; a yieldedfunctions.execcell ID usesfunctions.wait. For agents/tasks, use the available native wait tool and preserve any returned cursor. These handles are not interchangeable, and receiving one does not mean the job succeeded. - For a long-running job, use a bounded wait suited to its expected duration (normally 30-60 seconds, within the active tool and communication limits). Avoid repeated zero/short-timeout checks; read only new output and report meaningful progress instead of narrating unchanged status.
- When an external job has no notification or native wait support, use a bounded watcher or read-only polling with backoff and an overall deadline. Do not rerun the original operation just to obtain its status.
- Inspect the final output and exit code or terminal status before claiming completion. A timeout, background handle, or quiet log is not success.
This governs coding-agent orchestration. It does not remove application/API polling, test synchronization, or service-readiness checks required by their own contracts.
Parallel Work / Subagents
When work can be split across independent, file-scoped tasks, use available
parallelism instead of doing everything sequentially. In Codex, prefer
multi_tool_use.parallel for independent local reads/checks, and use subagents
only when the tool is available and the overhead is justified.
Common cases in this repo:
- Repetitive edits across many files, such as rebranding strings across EN + VI docs: split by file or language, with exact rules and a verification grep.
- Long-running builds or cross-compile checks, such as
swift buildorGOOS=linux GOARCH=arm64 go build: run in parallel/background when possible and continue with independent work. - Repo-wide audits, such as stale paths after folder moves or broken cross-refs: use audit-only scope unless edits are explicitly part of the task.
- Independent English and Vietnamese doc updates after a code change: keep both sides consistent and verify matching numbers, endpoints, states, and flows.
Rules:
- Brief any delegated worker with goal, context, exact files/scope, verification step, and concise report format.
- Do not delegate when the overhead is larger than the work itself, especially for one or two quick edits in files already open.
- Trust but verify: spot-check actual diffs and run focused greps/tests before considering delegated work done.
Device Access Rules
- Always ask the user before running any
sshpassorsshcommand to the Pi. Do not SSH automatically. - Pi SSH:
ssh pi@<IP>(credentials stored in the team password manager; IP varies per session).
Harness integration context
Before changing skills/harness-use, system/harness or the OS Harness UI/API, read
the integration context and ownership and its
Vietnamese counterpart. Harness app/device support is
maintained by a separate team in autonomous-harness and
autonomous-harness-desktop. This repo owns the OS client and skill only; keep
implementation edits here. Verify cross-repository contract changes against the
Harness team's current code and coordinate them rather than inventing another
pairing flow, transport or credential. Buddy stays independent.
Project Overview
Autonomous is an open-source OS for physical AI agents. The Go backend
(system) provides device onboarding (WiFi, LLM provider, messaging
channel setup), OTA updates, and agent gateway integration. The brain is a
swappable agentic runtime (OpenClaw, Hermes, or any LLM + skills + memory).
Go module: go.autonomous.ai/os (rooted at repo root — covers system/ and runtimes/) | Go 1.24 | Target: Linux ARM64
Build & Development Commands
All targets run from the repo root via the top-level Makefile.
# Build Go services (cross-compiles to linux/arm64)
make os-build # Builds os-server binary
make os-build-bootstrap # Builds bootstrap-server binary
# Code generation (Google Wire DI)
make os-generate # Runs from repo root: GOFLAGS=-mod=mod go generate ./...
# Lint + tests (Go)
make os-lint # golangci-lint run (repo root, covers runtimes/)
make os-test # go test ./... (repo root, covers runtimes/)
# HAL (Python hardware runtime, hal)
make hal-dev # Install deps + run HAL locally
make hal-lint # Catch broken local imports + undefined names
make hal-test # Run HAL tests
# Web frontend (React/Vite/Tailwind in system/web)
make web-install # npm install
make web-dev # Vite dev server
make web-build # Production build to dist/
cd system/web && npm run lint # Required after every web/TSX change
cd system/web && npm run build # Required type-check + production buildGo version is injected at build time via ldflags. HAL/web versions live in
system/VERSION_OS_SERVER and hal/VERSION_HAL and are auto-bumped by the
make upload-* release targets — do not hand-edit for releases.
Architecture
Two Executables
system/cmd/os-server/main.go- Main HTTP API server (Gin). Handles device setup, network management, LED control, health checks, and agent gateway integration.system/cmd/bootstrap/main.go- OTA bootstrap worker. Periodically checks for and applies updates.
Dependency Injection
Uses Google Wire for compile-time DI. After changing provider signatures, run
make os-generate to regenerate wire_gen.go files.
Package Layout
Agentic runtimes - runtimes/ (repo root): swappable backends,
one folder per brain: runtimes/{openclaw,hermes,picoclaw,codex,claudecode}.
Selected by system/agent (AgentGateway factory).
Go backend - system/ (single Go module rooted at the repo root):
system/<domain>/- System managers, one folder per diagram chip (ambient, beclient, buddy, device, healthwatch, intent, monitor, network, skills, statusled, vision) plussystem/agent/(AgentGateway factory + migration).system/server/- HTTP layer: Gin router, handlers by domain (delivery/http/handler.goconvention);server/serializers/,server/config/.system/bootstrap/- OTA worker: metadata fetching, update execution, state persistence.system/domain/- Shared data structures.system/lib/- Shared libraries (mqtt, core/system, i18n, logger, hal HAL client, safego, ...).system/web/- React 19 + TypeScript + Vite + Tailwind CSS 4 SPA.
HAL - hal/ (Python hardware runtime, FastAPI on :5001):
drivers/- Hardware drivers by subsystem (rgb, motors, voice, sensing, display, gpio_button, ...).board/- Per-board profiles (pin maps, debounce).routes/- FastAPI route modules (servo, led, camera, audio, emotion, ...).
OS-level dirs (repo root): skills/ (agent skills), robots/ (per-device
declarations + docs; robots/contract/ device specs, robots/contract/cts/
compliance tests), scripts/imager/ (OrangePi image build), scripts/ (setup +
OTA upload), integrations/perception-service/, integrations/companions/.
API Response Format
All HTTP endpoints return:
{"status": 1, "data": {}, "message": null}on success, and:
{"status": 0, "data": null, "message": "error"}on failure.
Configuration
Config lives in config/config.json (path relative to the os-server working
dir) and is managed by system/server/config/config.go. It supports a
notification channel for config change propagation.
Coding Standards
Error Handling
if err != nil {
return fmt.Errorf("operation: %w", err)
}Always wrap errors with useful context.
Logging
log.Println("[component] message")
log.Printf("[component] formatted %v", value)Goroutines
Always use context.Context for cancellation. Background goroutines must
respect ctx.Done().
Validation
Use go-playground/validator for struct validation. Validate at the HTTP
handler level before passing data to services.
Naming (paths under system/)
- Handlers:
server/<domain>/delivery/http/handler.go - Services:
<domain>/service.go(system managers live atsystem/<domain>/, e.g.ambient/service.go) - Wire providers:
server/wire.go,bootstrap/wire.go - Domain types:
domain/<type>.go
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.

