Imported from velo-sh/velo (
AGENTS.md). Install upstream withnpx skills add velo-sh/velo. Copyright stays with the author.
AGENTS.md
Top-Level AI Agent Configuration for Velo
This file is the primary entry point for all AI agents working on this codebase.
π Universal Identity & Role Governance (Iron Rule)
[!IMPORTANT] ID-LOCK-GLOBAL: The following rules apply to ALL AI agents working on this project, regardless of their current role (Architect, Developer, QA, DevOps):
- β STRICT ROLE ADHERENCE: The agent MUST operate strictly within the scope of its active role.
- β NO UNAUTHORIZED ROLE SWITCH: The agent is strictly forbidden from switching to another role without explicit, human-approved modification of this section in
AGENTS.md.- β NO AUTO-TRANSITION: Any attempt to automatically, implicitly, or through self-referential edits switch roles is a CRITICAL GOVERNANCE VIOLATION.
- β NO ROLE APPLICATION: Agents are forbidden from applying for or requesting a role switch in the middle of a task unless the human user explicitly initiates the change.
- β NO SYSTEM PYTHON: Agents are strictly forbidden from using system Python or non-
uvmanaged environments.- β NO PLATFORM DRIFT: Agents must ensure binaries are compiled for and run on the correct platform. macOS binaries MUST NOT be run on Linux/Docker.
- π MANDATORY TASK ANCHOR: Every agent MUST copy the ID-LOCK-GLOBAL and ID-LOCK-ENV blocks into the top of their active
task.md(or equivalent task tracker) immediately upon mission start.This is the Iron Rule of Velo Governance. Agent identity, role boundaries, and environment purity are fixed and non-negotiable without explicit human override recorded in this file.
π‘οΈ Environment & Platform Governance (ID-LOCK-ENV)
[!IMPORTANT] ID-LOCK-ENV: The following environment rules are MANDATORY for all agents:
- UV-ONLY: Use ONLY
uvfor Python environment management. All commands must be run viauv runor within auv-synced.venv.- SENTINEL COMPLIANCE: Never bypass the Velo Sentinel (
VELO_STRICT_SSOT=1).- PLATFORM PURITY: Always verify
debug pre-flightbefore running tests in Docker. Blocked by Binary Platform Sentinel.
π― Project Overview
Velo is a high-performance Python runtime for the AI era, built with Rust.
| Aspect | Details |
|---|---|
| Language | Rust |
| Core Feature | Python startup acceleration via Zygote pre-warming |
| Performance | 18-23% faster warm starts for web frameworks |
| Current Version | v0.3.5 (Phase 3.5 Ecosystem Integration) |
π Essential Reading
Before making any changes, AI agents MUST read:
| Document | Purpose |
|---|---|
| README.md | Project overview and quick start |
| docs/STANDARDS.md | Naming conventions and directory structure |
| SOP-001: Master Lifecycle | CRITICAL: Architectural governance & reviews |
| SOP-002: Mission Protocol | CRITICAL: Forensic task methodology |
| docs/TEST_ARCHITECTURE.md | CRITICAL: Test environment isolation |
| docs/DEFINITION_OF_DONE.md | Quality gate standards |
β οΈ Critical Architecture Principles
The Kernel Engineer Mindset (TITANIUM Standard)
This is the foundational thinking pattern for all Velo development.
When designing or reviewing any system-level feature, every agent MUST think like a kernel engineer:
-
Assume the World is Hostile
- Every input is malicious until proven otherwise.
- Every external process will crash, hang, or misbehave.
- Every "normal flow" will eventually fail.
-
Never Trust "Normal Flows"
- "It works in the happy path" is not a defense.
- Design for the 3 AM incident, not the demo.
- If it can fail, it WILL failβplan the recovery.
-
The Three Questions of Death
- Who dies? (Process, thread, connection, memory segment)
- When do they die? (SIGKILL, OOM, container eviction, panic)
- Who cleans up the body? (Host? Kernel? Orphaned forever?)
-
Zero Undefined Behaviors
- Kernel-level design has only one standard: 0 undefined behaviors.
- Every failure path must be explicitly handled.
- "Let it crash" is NOT acceptable for shared resources.
-
Ownership and Lifecycle Authority
- Every resource has exactly ONE owner.
- The owner is responsible for cleanup, not the user.
- Never rely on "cooperative" cleanup from other processes.
This is not a technique. This is a way of thinking.
"99% correct + 1% wrong = system-level disaster."
Test Environment Isolation
CRITICAL: Velo's development environment and user project environments MUST be completely isolated.
Velo Repository (.venv) User Project (.venv)
βββββββββββββββββββββββ βββββββββββββββββββββββ
β pytest β β fastapi β
β ruff β β β uvicorn β
β ... dev deps β β ... user deps β
βββββββββββββββββββββββ βββββββββββββββββββββββ
See docs/TEST_ARCHITECTURE.md for full details.
No Hardcoding
- β Don't hardcode framework lists
- β Don't hardcode preload modules
- β
Use runtime analysis (
--profile) - β
Use user config (
pyproject.toml [tool.velo])
β οΈ Agent Pitfalls (Must Avoid)
As an AI Agent, please self-check the following high-frequency failure points before submitting code:
1. The /tmp Trap (Insecure Path Block)
- Symptom: Test fails with
LoaderError::InsecureLocation { path: "/tmp/..." }. - Mitigation: DO NOT use default
tempdir(). Usetempfile::Builderand specify a path within the project root (e.g.,tempfile::Builder::new().tempdir_in(std::env::current_dir()?)).
2. Formatting Failures (cargo fmt)
AI tools often bypass local formatting. This is the #1 cause of CI failures.
- Solution: Follow the rule in Critical Rules below.
- TIP: Run
scripts/setup-dev.shonce to install pre-commit hooks that automatically checkcargo fmtbefore each commit.
3. The language_server Crash (Dangerous Use of pkill -f)
- Symptom: The Antigravity IDE crashes unexpectedly after running a kill command.
- Root Cause: Using
pkill -f "substring"(e.g.,pkill -f "velo") matches the entire command line. The IDE's language server processes often include the project path in their arguments, causingpkill -fto accidentally terminate the IDE itself. - Correct Practices:
- β
Record PID at startup (Recommended):
./target/release/velo serve main:app & VELO_PID=$! # ... perform tasks ... kill "$VELO_PID" - β
Use Exact Pattern Matching:
# Match only the exact process name, not substrings in arguments pkill "^velo$"
- β
Record PID at startup (Recommended):
π§ Universal Work Methodology
Every AI agent follows this pattern:
PHASE 1: TOP VIEW
ββ State the goal in ONE sentence
ββ Define what "DONE" looks like
ββ List acceptance criteria as checkboxes
PHASE 2: EXECUTE
ββ Before each action: "Does this serve the goal?"
ββ After each step: Update checklist
ββ If drifting: STOP β Re-read goal β Realign
PHASE 3: VERIFY
ββ Check EVERY acceptance criterion: β
or β
ββ **PRIVACY AUDIT**: No absolute paths, user names, or secrets? β
ββ Compare result against original goal
PHASE 4: DELIVER
ββ Delivery summary: What was done
ββ Handover notes: What next session needs to know
π AI Role System
Available Roles
| Role | File | Primary Focus |
|---|---|---|
| ποΈ Architect | architect.md | System design, RFC |
| π» Developer | developer.md | Code quality, TDD |
| π§ͺ QA Engineer | qa-engineer.md | Testing, edge cases |
| π§ DevOps | devops-engineer.md | CI/CD, deployment |
How to Activate a Role
I am acting as the [ROLE NAME] as defined in AGENTS.md.
My primary focus is [FOCUS AREA].
I will review/implement with [ROLE]'s perspective.
π Key Directories
| Directory | Purpose |
|---|---|
src/ |
Rust source code |
src/cmd/ |
CLI command handlers |
src/serve/ |
Web server integration |
src/zygote/ |
Zygote pre-warming |
docs/ |
Documentation |
docs/rfcs/ |
RFC design documents |
docs/qa/ |
QA test matrices |
tests/qa/ |
Python QA tests |
scripts/ |
Build/test scripts |
β οΈ Critical Rules
DO NOT
- β Mix Velo's .venv with user project .venv
- β Hardcode framework/library lists
- β Skip
uv syncwhen testing user projects - β Commit without running pre-commit hooks
- β Use different lint/check flags than CI (causes silent failures)
- β NO DIRECT REBASE: Do not use
git rebaseto "beautify" logs. Aesthetic purity is not worth the risk of code loss. Use Squash Merge on the branch entry point (main/master) instead. Commit early and often locally; the squash merge will ensure a clean history on the shared trunk.
[!TIP] Run
scripts/setup-dev.shonce to install pre-commit hooks that automatically checkcargo fmtbefore each commit. This prevents most style-related CI failures.
MUST DO
- β Create isolated temp projects for integration tests
- β Use runtime analysis over hardcoding
- β
Run
cargo fmt && cargo clippy --all-targets --all-features -- -D warningsbefore commit - β Read TEST_ARCHITECTURE.md before writing tests
- β Zero Sensitive Information: No absolute local paths, usernames, or secrets in code or docs
- β Write ALL code and documentation in English only (no Chinese characters)
- β
Ensure local checks match CI (see
.github/workflows/ci.ymlfor exact commands) - β
USE UV SSOT: Always use
uv python findanduv sync. Ensure.venvis current and hermetic.
[!WARNING] CI Consistency: Pre-commit hooks in
.githooks/MUST use the same flags as CI. If you modify lint commands, update BOTH.githooks/pre-commitAND.github/workflows/ci.yml.
π Navigation
For governance rules and role transition policies, see Universal Identity & Role Governance above.
Agent Roles
The Trinity (QA Core)
Specialists (The Grand Council)
π Activated Skills (Slash Commands)
/start-mission: SOP-002 Mission Protocol/ask-council: SOP-001 Expert Review/audit-security: TITANIUM Security Scan
Architectural Standards (SOPs)
- SOP-001: Master Architecture Lifecycle
- SOP-002: Mission Protocol
- SOP-003: Knowledge Treasury
- SOP-004: Fallback Governance (H-Gov)
Project Standards
- STANDARDS.md - Naming conventions
- TEST_ARCHITECTURE.md - Test isolation
- DOCUMENTATION_GUIDELINES.md - Doc standards
- DEFINITION_OF_DONE.md - Quality gates
Technical Documentation
- RFCs - Design documents
- Zygote Guide - Zygote architecture
- QA Docs - Test matrices and reports
- Roadmap - 2026 roadmap
Last Updated: 2026-01-08