agentleFS
vstorm-covstorm-co/agenticos/CLAUDE.md

agenticos

CLAUDE.md54 starsChanged 3 months agoApache-2.0View on GitHub

Project-wide decisions and pointers to task-specific guidance. Read relevant rules, skills and documentation as needed. Keep detailed procedures and incident history outside this file. Current user instructions and higher-priority session rules take precedence. A self-hosted, open-source, multi-tenant platform for a company's AI agents. An agent is a versioned spec. Users configure instructions, models, capabilities and budgets in the UI, publish a version and can export it as YAML. The same agent runs through web chat, the HTTP API and channel…

  • Reads credentials

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

17 rules. About 0 are common, 5 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use domain exceptions with message and details.

    line 30
  2. Very specific:

    Keep changes scoped. Avoid speculative abstractions, unused code and unrelated cleanup.

    line 32
  3. Distinctive:

    Test new behaviour and add regression tests for bugs.

    line 35
  4. Distinctive:

    Keep service and repository return types precise.

    line 60
  5. Very specific:

    Use datetime.now(UTC) and secrets.compare_digest() for API key comparisons.

    line 67
  6. Very specific:

    Read the relevant files under .claude/rules/.

    line 74
  7. Very specific:

    Before pushing, run make lint and the coverage gate for the side changed: make test and/or make test-frontend-cov.

    line 140
  8. Distinctive:

    Use the repository's pgvector-enabled PostgreSQL image.

    line 151
  9. Very specific:

    Check the interpreter actually used by uv run before relying on test results.

    line 155
  10. Very specific:

    Read docs/testing.md, .claude/rules/testing.md and the relevant testing skill for fixtures and patterns.

    line 159
  11. Very specific:

    When adding a platform module, keep [tool.coverage.run] include and the matching [[tool.ty.overrides]] include aligned, including order.

    line 165
  12. Distinctive:

    Update existing documentation in the same change when described behaviour changes.

    line 177
  13. Very specific:

    Read the project-docs skill for site structure, writing conventions, generated pages and build checks.

    line 182
  14. Distinctive:

    Never commit on main. Use a feature or fix branch, one PR per coherent change, squashed on merge.

    line 251
  15. Very specific:

    No AI attribution in commits or PR descriptions: no Co-Authored-By: Claude, Generated with Claude Code or equivalent footer.

    line 256
  16. Very specific:

    Use Conventional Commits: type(scope): summary, imperative, lower case after the colon, no trailing period, at most 72 characters.

    line 260
  17. Very specific:

    Add a body when the reason, verification or tradeoffs are not clear from the subject.

    line 265

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

CLAUDE.md — AgenticOS

Project-wide decisions and pointers to task-specific guidance. Read relevant rules, skills and documentation as needed. Keep detailed procedures and incident history outside this file. Current user instructions and higher-priority session rules take precedence.

What this is

A self-hosted, open-source, multi-tenant platform for a company's AI agents.

An agent is a versioned spec. Users configure instructions, models, capabilities and budgets in the UI, publish a version and can export it as YAML. The same agent runs through web chat, the HTTP API and channel integrations. Change an individual agent through its spec; change Python when implementing platform behaviour or capabilities. Tools reach models through the capability registry.

Stack: FastAPI, Pydantic v2, Pydantic AI, PostgreSQL with pgvector, Redis, Prefect, Next.js, React, bun, next-intl and MkDocs Material. Use versions from the repository manifests and lockfiles; Python is pinned in backend/.python-version.

The repository originated from the Full-Stack AI Agent Template. Platform and template-inherited subsystems have different coverage gates, described below.

Quality and scope

  • Type owned boundaries and nontrivial helpers. Do not use Any or suppressions to hide errors. Necessary suppressions need a specific explanation; route return annotations below are an explicit project convention.
  • Use domain exceptions with message and details. Do not swallow exceptions or mask bugs with fallbacks.
  • Keep changes scoped. Avoid speculative abstractions, unused code and unrelated cleanup. Comments explain non-obvious constraints; API contracts belong in docstrings. See .claude/rules/code-style.md.
  • Test new behaviour and add regression tests for bugs. Documentation-only changes need documentation checks, not artificial application tests.
  • Integrate new user-facing features with the existing product: onboarding for new pages and creation flows, and dashboard widgets for activity or state that belongs at a glance. Follow .claude/rules/frontend.md for registries, permissions, translations and anchors.

Hard boundaries

  • Routes call services; services coordinate repositories. Routes must not import or call repositories directly.
  • Repositories use db.flush() and db.refresh(), never db.commit(). Use DBSession: its scope="function" commits after the route returns and before the response is written. A bare Depends(get_db_session) has different timing. The agent run paths in AgentRunnerService._run and ChatAgentRunner.run explicitly commit before the model call and in terminal cleanup, and SessionService.detect_refresh_reuse commits the security response its caller is about to raise past. See docs/architecture.md#the-requests-transaction.
  • Dispatch background work needing rows written by the request with spawn_after_commit, so its own session can see those rows. See docs/architecture.md#dispatching-background-work-from-a-request.
  • Collection routes use require(...) gates. Per-resource routes for agents, skills and collections delegate to a service using resolve_access; a role gate must not reject access allowed by a resource grant. Follow permissions-rbac.
  • Route handlers return -> Any and declare response_model for serialization. Keep service and repository return types precise.
  • Store credentials through app/core/vault.py. Connector sources reference vault secret IDs; do not put credentials in a connector's CONFIG_MODEL or introduce deployment-wide Fernet keys, CHANNEL_ENCRYPTION_KEY or app/core/crypto.py.
  • Organization authority comes from membership and the permission catalog. Do not restore UserRole, User.has_role(), RoleChecker, CurrentAdmin, CurrentSuperuser or the old users.role column.
  • Use datetime.now(UTC) and secrets.compare_digest() for API key comparisons.
  • Migration numbering restarted after a baseline squash. Verify references against backend/alembic/versions/ and cite full filenames; use git history for removed revisions rather than assuming an old number still identifies the same migration.

Read the matching rule before writing code

Read the relevant files under .claude/rules/; their frontmatter defines the file scope. Load only the rules that apply to the change.

EditingRead
Any backend/app/** Pythonarchitecture.md — Routes → Services → Repositories, DI, thin vs. thick domains
schemas/, db/models/schemas-models.md — *Create/*Update/*Read/*List, SQLAlchemy
api/api-conventions.md — REST structure, status codes, pagination, auth aliases
core/, services/exceptions-security.md — domain exceptions, JWT, the permission model
Any Pythoncode-style.md — formatting, naming, imports, type hints
tests/testing.md — the layers, anyio, fixtures, the 100% gate
frontend/frontend.md — App Router, data layer, stores, i18n, permissions

Read the matching skill before starting a task

Skills live in .claude/skills/<name>/SKILL.md. Read the skills matching the task; .claude/README.md explains the layout.

DoingSkill
Giving an agent a new tool, or a capabilityagent-capability
Changing AgentSpec, SPEC_VERSION or publish validationagent-spec
Anything authorizationpermissions-rbac
Anything with a credential at restvault-secrets
MCP servers, or an integration with a SaaS productmcp-connections
Ingestion, retrieval, connectors, parsersrag-knowledge
Telegram / Slack / Mattermostchannel-bot
Prefect flows, or work that outlives a requestbackground-task
A schema change or a backfillalembic-migration
Backend tests, or a failing coverage gatebackend-tests
A Playwright spece2e-tests
A page, store, hook or permission-gated controlfrontend-feature
The docs siteproject-docs

Commands

make dev                                          # postgres, redis, api, worker, frontend
make platform-bootstrap BOOTSTRAP_API_KEY=sk-...  # an org, an owner, a model, an agent
make check                                        # aggregate pre-PR checks; excludes e2e

make help lists the rest. Day to day:

make lint / make formatruff + ty + vulture + deptry + eslint + prettier + tsc + the guard scripts + codespell
make lint-backend / make lint-frontendone half of it — CI runs them in two jobs
make dead-codevulture + knip, unused functions — a report to read, not a gate
make test-fastno coverage — the write-run-write loop
make testbackend + the 100% gate on the platform layer
make test-integrationonly the tests needing a real database
make test-frontend / make test-frontend-covvitest / vitest with the gate CI applies
make test-e2ePlaywright — needs a backend and its seed
make test-migrationsthe whole chain forwards and back
make db-checkalembic check — a model change with no migration fails here (in make check)
make db-migrate / make db-upgradeautogenerate / apply
make docs / make docs-buildserve on :8001 (DOCS_PORT= to move it) / --strict
uv run agenticos cmd doctorcan this deployment actually run an agent?
uv run agenticos cmd --helpevery custom command, including all rag-*

Verification

During implementation, run tests covering the change. Run frontend commands from frontend/, backend commands from backend/ and make targets from the root.

Before pushing, run make lint and the coverage gate for the side changed: make test and/or make test-frontend-cov. A passing run without coverage does not verify that gate. Before a PR, run make check. Report failures and unavailable checks. See .claude/rules/testing.md for scoped commands.

Inspect CI for the current commit. A later push can cancel an earlier run, and path-filtered jobs may be skipped. Consult docs/branching.md and workflow files for CI behaviour rather than assuming local commands and CI are identical.

Environment

  • Use the repository's pgvector-enabled PostgreSQL image; stock PostgreSQL lacks the vector extension required by RAG. Check the image if ingestion fails in a fresh environment.
  • Match backend/.python-version when creating or syncing the backend environment. Check the interpreter actually used by uv run before relying on test results.

Testing

Read docs/testing.md, .claude/rules/testing.md and the relevant testing skill for fixtures and patterns.

  • The platform layer has a 100% coverage gate. Exact modules are configured in backend/pyproject.toml; template-inherited subsystems are additionally reported by make coverage-all without that gate.
  • When adding a platform module, keep [tool.coverage.run] include and the matching [[tool.ty.overrides]] include aligned, including order. backend/tests/test_coverage_gate.py checks this contract.
  • Async tests use anyio: pytestmark = pytest.mark.anyio.
  • Cover refusal and failure paths: tenant isolation, scopes and grants, budgets checked before model calls and recorded on failure, invalid specs rejected at publish, and secrets excluded from responses, logs and audit entries. Also cover channel sender identity, parser/routing compatibility and existing stored JSONB when tightening validation. The testing skills contain worked examples.

Documentation

Update existing documentation in the same change when described behaviour changes. Refactors with unchanged behaviour and test-only changes do not require unrelated prose edits. Update rules and skills when referenced paths or contracts change. API reference changes belong in the generating docstrings.

Read the project-docs skill for site structure, writing conventions, generated pages and build checks. Add new pages to mkdocs.yml, relevant cross-links and the topic map below. scripts/docs_drift.py contains the code-to-page trigger map; its Stop hook is a reminder, not a completeness check or a gate.

The site publishes in four languages, so a published page owes a .pl.md, a .de.md and an .es.md beside it, and editing an English page makes all three stale. The same is true of README.md, CONTRIBUTING.md, SECURITY.md and CODE_OF_CONDUCT.md, which GitHub renders rather than MkDocs: those record the fingerprint in an HTML comment, cannot pin an anchor, rewrite their own in-page links per language, and point every other link at the reader's own language. scripts/check_docs_i18n.py gates make lint on all of it and names what is missing; docs/howto/translate.md is the workflow. Record a retranslated page with --update <page>.<locale>.md — it takes paths, because stamping one nobody retranslated is how a stale translation stops being visible.

TopicPage
Spec, version, exposure, rundocs/concepts.md
The three permission layers, scopes, grantsdocs/permissions.md
Groups, directory group mappings, LDAP and Kerberos sign-indocs/directory.md
Budgets, approvals, alerts, auditdocs/governance.md
What ships as a capability, its tools and configdocs/reference/capabilities.md
The agent spec, field by fielddocs/reference/spec.md
MCP connections, the server catalog, OAuthdocs/mcp.md
Providers, model profiles, fallbacks, costdocs/models.md
Which model to pick, open weights vs closeddocs/choosing-models.md
Adoption, roles, cost, the security reviewdocs/rollout.md
The vault, secret kinds, what never leaksdocs/secrets.md
Where personal data lives, what leaves, deletion, the controls and the open gapsdocs/data-protection.md
Third-party licences, the notices, the review and its open findingsdocs/licenses.md
Every component a deployment is made of, and the release SBOMdocs/reference/components.md
Threat model, data flow, at-rest, the controls matrixdocs/security.md
Skills — format, library, skills vs knowledgedocs/skills.md
Context files — standing knowledge bound to agentsdocs/context.md
Named environments, promotion, per-environment tracingdocs/environments.md
Surfaces: widget, WebSocket, Slack, Telegramdocs/channels.md
Published pages: artifacts, versions, public links, isolationdocs/artifacts.md
The desktop app: a Tauri shell around a deployment's consoledocs/desktop.md
Upload, parsing, ingestiondocs/file-processing.md
The console: dashboard widgets, chat, slash commands, the mapdocs/console.md
Every module, screenshotted in both themesdocs/screens.md
The sandbox: sessions, runtimes, isolation, lifetimesdocs/sandbox.md
Routes → services → repositoriesdocs/architecture.md
The Next.js console, for a contributordocs/frontend.md
Authenticating and calling the HTTP APIdocs/api.md
The ML services called without an agent, and what each one isdocs/ml-services.md
Adding a feature end to enddocs/adding_features.md
Test layers and what belongs in eachdocs/testing.md
The load suite: the workload, the thresholds, the measured runsdocs/load-testing.md
The automated pull request reviewerdocs/code-review.md
Branches, rulesets and what protects maindocs/branching.md
Recurring patternsdocs/patterns.md
Translating a page, and the terminology that has to be exactdocs/howto/translate.md
Getting it onto a host: sizing, TLS, the approved deploydocs/deploy.md
The deployment's identity, sign-up policy, noticesdocs/deployment.md
Settings and the production checklistdocs/configuration.md
What the platform does, on one pagedocs/features.md
Choosing a first task, and the 29 use-case tutorials it indexesdocs/use-cases.md (tutorials live in docs/howto/)
The Learn track's own landingdocs/learn/index.md
Help, contributing, extending the platformdocs/resources/index.md
Why it exists, and what it is notdocs/about/index.md
How it compares with other products, and its own gapsdocs/about/comparison.md
The six decisions that shape the codebasedocs/about/design.md (repo only)
Delivery state and what is leftdocs/ROADMAP.md (repo only)
Every notable changedocs/release-notes.md (reads CHANGELOG.md)

Git

  • Never commit on main. Use a feature or fix branch, one PR per coherent change, squashed on merge.
  • On a branch, commit and push each finished, verified piece without being asked. This is the project's exception to the global commit-on-request preference; explicit session instructions still take precedence.
  • No AI attribution in commits or PR descriptions: no Co-Authored-By: Claude, Generated with Claude Code or equivalent footer.
  • Stage only intended changes and review the staged diff. Exclude secrets, unrelated work and tool caches.
  • Use Conventional Commits: type(scope): summary, imperative, lower case after the colon, no trailing period, at most 72 characters. Types: feat, fix, refactor, perf, test, docs, ci, build, chore. Scope names the subsystem; omit it for repository-wide changes. Use ! and a BREAKING CHANGE: footer for breaking changes.
  • Add a body when the reason, verification or tradeoffs are not clear from the subject; wrap it at 72 characters. Put issue references in footers (Closes, Refs, Part-of); use Closes only when the issue is fully resolved.
  • PR descriptions explain the problem, resulting behaviour, verification and material limitations. Review the diff and surrounding code before declaring work finished. .claude/commands/review.md defines the local review standard. docs/code-review.md and .github/workflows/ai-review.yml describe automated review. A failed reviewer is not a clean review; assess findings against the code and explain rejected ones.
  • Fix confirmed in-scope defects; record out-of-scope defects without expanding the change. Before filing or triaging issues, read .claude/references/issue-triage.md for the repository's board conventions.

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.