agentleFS
CloudChefCloudChef/atlasclaw/AGENTS.md

atlasclaw

AGENTS.md92 starsChanged 16 days 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 code style.

    Of the AGENTS.md files we read, the 35,337 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.

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
  1. Distinctive:

    Before making any feature changes, bug fixes, or architectural decisions, consult these canonical documents:

    line 57
  2. Very specific:

    Use from __future__ import annotations at the top for forward references

    line 81
  3. Very specific:

    Use absolute imports: from app.atlasclaw.core.deps import SkillDeps

    line 84
  4. Distinctive:

    Use double quotes for strings unless single quotes avoid escaping

    line 94
  5. Distinctive:

    Use type hints on all function parameters and return values

    line 97
  6. Very specific:

    Use Optional[T] instead of T | None (Python 3.10+ union syntax okay but Optional preferred)

    line 98
  7. Very specific:

    Use dataclasses for data containers: @dataclass

    line 99
  8. Very specific:

    Prefer enums for string constants: class EventType(str, Enum)

    line 100
  9. Very specific:

    Use specific exception types, not bare except:

    line 109
  10. Very specific:

    Use asyncio.Event for cancellation signals

    line 112
  11. Distinctive:

    Use Google-style or reStructuredText format

    line 117
  12. Distinctive:

    All I/O-bound operations must be async

    line 121
  13. Very specific:

    Use asyncio.Event for coordination

    line 122
  14. Very specific:

    Test classes: Test<PascalCase> (e.g., TestStreamEvent)

    line 129
  15. Very specific:

    Test methods: test_<description> (e.g., test_create_lifecycle_start)

    line 130
  16. Very specific:

    Use fixtures in conftest.py for shared resources

    line 131
  17. Very specific:

    Use @pytest.mark.asyncio for async tests

    line 138
  18. Very specific:

    Use scope="session" for expensive resources

    line 141
  19. Very specific:

    Use scope="function" (default) for isolated tests

    line 142
  20. Distinctive:

    No semicolons preferred (but be consistent with existing code)

    line 149
  21. Very specific:

    Environment variables: Use ${VAR_NAME} format in config

    line 188
  22. Distinctive:

    Thin core, rich providers: Keep platform logic in providers, reusable logic in core

    line 192
  23. Distinctive:

    Pydantic models: Use for all data validation and serialization

    line 193
  24. Distinctive:

    Strict permissions: Never bypass RBAC, inherit user access rights

    line 195
  25. Distinctive:

    Async-first: All I/O operations are async

    line 196
  26. Very specific:

    When implementing features, see openspec/AGENTS.md for spec-driven development:

    line 200
  27. Distinctive:

    Create proposals for new features, breaking changes, or architectural changes

    line 201
  28. Very specific:

    Use openspec-cn CLI for spec management

    line 202
  29. Distinctive:

    Follow three-phase workflow: Create → Implement → Archive

    line 203
  30. Very specific:

    Use Conventional Commits: feat, fix, docs, refactor, test, chore.

    line 207
  31. Distinctive:

    Commit message should be concrete and precise, covering the changes.

    line 208

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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-missing

Frontend (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 test

Required Reading

Before making any feature changes, bug fixes, or architectural decisions, consult these canonical documents:

DocumentContentPath
ArchitectureDesign philosophy, system architecture, bootstrap sequence, request lifecycle, security model, extension pointsdocs/architecture.md
Module DetailsPer-module API surface, class/method/enum reference, configuration options, dependenciesdocs/module-details.md
Development SpecCode style, architecture patterns, error handling, security, testing, extension development, deployment & operations, review checklistdocs/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

DocumentContent
Provider GuideCore-side provider contract and external loading model
Skill GuideCreating executable, markdown, and hybrid skills
Channel GuideChannel handler implementation and integration
GuideEnd-user/developer usage guide

Code Style Guidelines

Python

Imports:

  • Use from __future__ import annotations at 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 of T | 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_case for functions, variables, modules
  • PascalCase for classes, exceptions
  • SCREAMING_SNAKE_CASE for 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.Event for 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.Event for 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.py for 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.asyncio for 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 guide

Concrete 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: SkillDeps passed through RunContext
  • 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-cn CLI 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.