atlasclaw
AGENTS.md89 starsChanged 7 months agoApache-2.0View on GitHub
Coding guidelines for AI assistants working on the AtlasClaw enterprise agent framework. Concrete provider packages do not live in this repository. AtlasClaw core loads them through providers_root, typically from a sibling providers repository. Before making any feature changes, bug fixes, or architectural decisions, consult these canonical documents: All development work MUST be consistent with these documents. If a proposed change conflicts with documented patterns, update the documentation as part of the same change. Imports: - Use from __future__ import annotations…
- Installs packages
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,736 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 repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
31 rules. About 0 are common, 13 are distinctive, and 18 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 57
Before making any feature changes, bug fixes, or architectural decisions, consult these canonical documents:
- Very specific: line 81
Use from __future__ import annotations at the top for forward references
- Very specific: line 84
Use absolute imports: from app.atlasclaw.core.deps import SkillDeps
- Distinctive: line 94
Use double quotes for strings unless single quotes avoid escaping
- Distinctive: line 97
Use type hints on all function parameters and return values
- Very specific: line 98
Use Optional[T] instead of T | None (Python 3.10+ union syntax okay but Optional preferred)
- Very specific: line 99
Use dataclasses for data containers: @dataclass
- Very specific: line 100
Prefer enums for string constants: class EventType(str, Enum)
- Very specific: line 109
Use specific exception types, not bare except:
- Very specific: line 112
Use asyncio.Event for cancellation signals
- Distinctive: line 117
Use Google-style or reStructuredText format
- Distinctive: line 121
All I/O-bound operations must be async
- Very specific: line 122
Use asyncio.Event for coordination
- Very specific: line 129
Test classes: Test<PascalCase> (e.g., TestStreamEvent)
- Very specific: line 130
Test methods: test_<description> (e.g., test_create_lifecycle_start)
- Very specific: line 131
Use fixtures in conftest.py for shared resources
- Very specific: line 138
Use @pytest.mark.asyncio for async tests
- Very specific: line 141
Use scope="session" for expensive resources
- Very specific: line 142
Use scope="function" (default) for isolated tests
- Distinctive: line 149
No semicolons preferred (but be consistent with existing code)
- Very specific: line 188
Environment variables: Use ${VAR_NAME} format in config
- Distinctive: line 192
Thin core, rich providers: Keep platform logic in providers, reusable logic in core
- Distinctive: line 193
Pydantic models: Use for all data validation and serialization
- Distinctive: line 195
Strict permissions: Never bypass RBAC, inherit user access rights
- Distinctive: line 196
Async-first: All I/O operations are async
- Very specific: line 200
When implementing features, see openspec/AGENTS.md for spec-driven development:
- Distinctive: line 201
Create proposals for new features, breaking changes, or architectural changes
- Very specific: line 202
Use openspec-cn CLI for spec management
- Distinctive: line 203
Follow three-phase workflow: Create → Implement → Archive
- Very specific: line 207
Use Conventional Commits: feat, fix, docs, refactor, test, chore.
- Distinctive: line 208
Commit message should be concrete and precise, covering the changes.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 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 - AtlasClaw Coding Guidelines
Coding guidelines for AI assistants working on the AtlasClaw enterprise agent framework.
Concrete provider packages do not live in this repository. AtlasClaw core loads
them through providers_root, typically from a sibling providers repository.
Build / Test / Lint Commands
Backend (Python)
# Run the service
uvicorn app.atlasclaw.main:app --reload --host 0.0.0.0 --port 8000
# Run all tests
pytest tests/atlasclaw -q
# Run a single test file
pytest tests/atlasclaw/test_agent.py -v
# Run a single test class
pytest tests/atlasclaw/test_agent.py::TestStreamEvent -v
# Run a single test method
pytest tests/atlasclaw/test_agent.py::TestStreamEvent::test_create_lifecycle_start -v
# Run tests with specific markers
pytest -m "not slow" # Skip slow tests
pytest -m llm # Run LLM integration tests (needs API key)
pytest -m e2e # Run end-to-end tests
# Run with coverage
pytest --cov=app.atlasclaw --cov-report=term-missingFrontend (JavaScript)
cd app/frontend
# Install dependencies
npm install
# Build for production
npm run build
# Build for development (with sourcemap)
npm run build:dev
# Run tests
npm testRequired Reading
Before making any feature changes, bug fixes, or architectural decisions, consult these canonical documents:
| Document | Content | Path |
| Architecture | Design philosophy, system architecture, bootstrap sequence, request lifecycle, security model, extension points | docs/architecture.md |
| Module Details | Per-module API surface, class/method/enum reference, configuration options, dependencies | docs/module-details.md |
| Development Spec | Code style, architecture patterns, error handling, security, testing, extension development, deployment & operations, review checklist | docs/development-spec.md |
All development work MUST be consistent with these documents. If a proposed change conflicts with documented patterns, update the documentation as part of the same change.
Additional References
| Document | Content |
| Provider Guide | Core-side provider contract and external loading model |
| Skill Guide | Creating executable, markdown, and hybrid skills |
| Channel Guide | Channel handler implementation and integration |
| Guide | End-user/developer usage guide |
Code Style Guidelines
Python
Imports:
- Use
from __future__ import annotationsat the top for forward references - Standard library imports first, third-party second, local third
- Group imports with a blank line between groups
- Use absolute imports:
from app.atlasclaw.core.deps import SkillDeps
Formatting:
- UTF-8 encoding: Include
# -*- coding: utf-8 -*-header in Python files - Copyright headers: Do not blindly copy an old copyright year from another file. For newly created files, use the year the file is first added. When moving or splitting existing code, keep the original copyright year only if it reflects the copied code's provenance.
- 4 spaces for indentation
- Line length: ~100 characters (be reasonable)
- Use double quotes for strings unless single quotes avoid escaping
Types:
- Use type hints on all function parameters and return values
- Use
Optional[T]instead ofT | None(Python 3.10+ union syntax okay but Optional preferred) - Use dataclasses for data containers:
@dataclass - Prefer enums for string constants:
class EventType(str, Enum)
Naming Conventions:
snake_casefor functions, variables, modulesPascalCasefor classes, exceptionsSCREAMING_SNAKE_CASEfor constants- Private methods/attributes prefixed with
_
Error Handling:
- Use specific exception types, not bare
except: - Include error context in exception messages
- Return result objects for expected failures:
SendResult(success=False, error="timeout") - Use
asyncio.Eventfor cancellation signals
Documentation:
- Docstrings use triple quotes on separate lines
- Include docstrings for all public classes and methods
- Use Google-style or reStructuredText format
- Comments in both English and Chinese acceptable
Async Patterns:
- All I/O-bound operations must be async
- Use
asyncio.Eventfor coordination - Properly await coroutines in tests with
@pytest.mark.asyncio
Testing
Test Structure:
- Test files:
test_<module>.py - Test classes:
Test<PascalCase>(e.g.,TestStreamEvent) - Test methods:
test_<description>(e.g.,test_create_lifecycle_start) - Use fixtures in
conftest.pyfor shared resources
Test Markers:
@pytest.mark.slow- Tests taking > 1 second@pytest.mark.integration- Integration tests@pytest.mark.e2e- End-to-end tests (requires services)@pytest.mark.llm- Tests requiring LLM API calls- Use
@pytest.mark.asynciofor async tests
Test Fixtures:
- Use
scope="session"for expensive resources - Use
scope="function"(default) for isolated tests - Clean up in fixture teardown or use
yield
JavaScript (Frontend)
Style:
- ES modules:
"type": "module"in package.json - No semicolons preferred (but be consistent with existing code)
- 2 spaces for indentation
- Single quotes for strings
Testing:
- Uses Jest with jsdom environment
- Tests in
tests/frontend/**/*.test.js
Project Structure
AtlasClaw-Core/
├── app/atlasclaw/ # Main application code
│ ├── agent/ # Agent engine, streaming, routing
│ ├── api/ # REST, WebSocket, SSE endpoints
│ ├── auth/ # Authentication, authorization
│ ├── channels/ # Channel adapters (WebSocket, SSE, REST)
│ ├── core/ # Config, dependencies, provider registry, provider loading
│ ├── memory/ # Memory manager and retrieval
│ ├── session/ # Session management
│ ├── skills/ # Skill loading and registry
│ └── tools/ # Built-in tools
├── tests/ # Test suite
│ ├── atlasclaw/ # Python tests
│ └── frontend/ # JavaScript tests
├── app/frontend/ # Frontend application
├── docs/ # Documentation
└── openspec/ # Specification-driven development
└── AGENTS.md # OpenSpec workflow guideConcrete providers are external packages loaded through providers_root. This
repository owns the runtime, contracts, and loading behavior, not provider
implementations.
Configuration
- Backend config:
atlasclaw.json(in project root) - Test config:
tests/atlasclaw.test.json - Environment variables: Use
${VAR_NAME}format in config
Architecture Patterns
- Thin core, rich providers: Keep platform logic in providers, reusable logic in core
- Pydantic models: Use for all data validation and serialization
- Dependency injection:
SkillDepspassed throughRunContext - Strict permissions: Never bypass RBAC, inherit user access rights
- Async-first: All I/O operations are async
OpenSpec Workflow
When implementing features, see openspec/AGENTS.md for spec-driven development:
- Create proposals for new features, breaking changes, or architectural changes
- Use
openspec-cnCLI for spec management - Follow three-phase workflow: Create → Implement → Archive
Commit and PR Messages
Use Conventional Commits: feat, fix, docs, refactor, test, chore.
Commit message should be concrete and precise, covering the changes.
Format:
<type>(<scope>): <summary>
Example:
docs(config): align webhook env var examples
PR titles must use the same Conventional Commit type format. Do not include AI assistant or AI tool names in PR titles.
Keep this file updated as the project evolves.
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.

