agentleFS
maister-devmaister-dev/maister/AGENTS.md

maister

AGENTS.md10 starsChanged 6 months agoMITView on GitHub

Structural map for AI agents and new contributors. Read this file first to orient yourself, then drill into the referenced documents. Maintained by /aif. Update when the project structure changes significantly. The Documentation section is maintained by /aif-docs. MAIster is the self-hosted execution and governance layer for reproducible AI-powered SDLC processes over private code. Current validation wedge: processes from core packages running across internal/private projects through the Web control plane, ACP supervisor, graph-only Flow engine, multi-workspace execution, HITL, evidence, review,…

  • Reads credentials

The file

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

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    When this file disagrees with CLAUDE.md or docs/, those win — update this file.

    line 219
  2. Very specific:

    Read CLAUDE.md and web/CLAUDE.md first: before touching any code. Both files encode product spine, current implementation boundaries, …

    line 229

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

Structural map for AI agents and new contributors. Read this file first to orient yourself, then drill into the referenced documents.

Maintained by /aif. Update when the project structure changes significantly. The Documentation section is maintained by /aif-docs.

Project Overview

MAIster is the self-hosted execution and governance layer for reproducible AI-powered SDLC processes over private code. Current validation wedge: processes from core packages running across internal/private projects through the Web control plane, ACP supervisor, graph-only Flow engine, multi-workspace execution, HITL, evidence, review, and promotion. External ACP adapters remain the agent runtimes.

Full description: .ai-factory/DESCRIPTION.md.

Tech Stack

  • Framework: Next.js 16.2 (App Router)
  • Language: TypeScript 5.6 (strict)
  • UI library: HeroUI v3 (@heroui/react 3.2.6)
  • Styling: Tailwind CSS 4 + tailwind-variants
  • Database: Postgres 16 via Drizzle ORM
  • Supervisor daemon (supervisor/): Fastify 5 + pino + zod; ACP via @agentclientprotocol/sdk@2.0.2 spawning claude-agent-acp@0.95.0, codex-acp@2.2.2, and readiness-gated gemini --acp, opencode acp, and mimo acp adapter binaries
  • Tests: vitest (unit + integration), Playwright (E2E)
  • Package manager: pnpm (monorepo workspace: web + supervisor)
  • Node: 24

Project Structure

mAIster/
├── .ai-factory/                # AI Factory project context
│   ├── config.yaml             # AI Factory configuration (language, paths, git)
│   ├── DESCRIPTION.md          # Project specification
│   ├── ARCHITECTURE.md         # Architecture pattern, folder structure, deps
│   ├── ROADMAP.md              # Roadmap and completed work
│   ├── plans/                  # Full-mode /aif-plan output, branch-keyed
│   └── rules/                  # Project conventions for AI agents
│       ├── base.md             # Project-wide rules
│       ├── frontend.md         # Web-tier rules (HeroUI, RSC, lint)
│       ├── backend.md          # Server-tier rules (subprocess, SSE, errors)
│       └── database.md         # Drizzle / Postgres rules
├── .github/                    # Public issue forms and pull-request template
│   ├── ISSUE_TEMPLATE/
│   └── PULL_REQUEST_TEMPLATE.md
├── .agents/                    # Codex agent bundles (do not hand-edit)
├── .claude/                    # Claude skills + agents (managed via /aif)
├── .codex/                     # Codex skills + config.toml
├── .mcp.json                   # MCP servers: github, filesystem, postgres,
│                               #              chromeDevtools, playwright
├── .ai-factory.json            # AI Factory installed-skills registry
├── .pre-commit-config.yaml     # Pre-commit hooks: lint/typecheck/prettier (web + supervisor)
├── pnpm-workspace.yaml         # Monorepo: web + supervisor + site + site-docs
├── pnpm-lock.yaml              # Frozen lockfile (root)
├── Dockerfile                  # Single image; web/supervisor selected via command:
├── compose.yml                 # Postgres only; web + supervisor run on the host
├── compose.production.yml      # Prod hardening: read_only, cap_drop, tmpfs
├── docs/                       # Product & engineering documentation
│   ├── VISION.md
│   ├── PRODUCT_VIEW.md
│   ├── supervisor.md           # HTTP+SSE API, lifecycle, event/object plane
│   ├── configuration.md
│   ├── database-schema.md
│   ├── error-taxonomy.md
│   ├── getting-started.md
│   ├── architecture.md
│   ├── decisions.md
│   ├── api/
│   ├── db/
│   └── system-analytics/
├── site/                       # Public EN/RU product landing (Next.js)
│   ├── app/                    # Localized routes + GitHub repository proxy
│   ├── components/             # Landing UI; reuses the web login SpineGraph
│   ├── lib/                    # Localized copy, locale and GitHub contracts
│   └── public/                 # Landing-only generated/static artwork
├── site-docs/                  # Public EN/RU user docs (Mintlify + Markdown)
│   ├── concepts/               # Public product concepts
│   ├── guides/                 # Public task-oriented guides
│   ├── operations/             # Public operator guides
│   ├── reference/              # Public manifest and runtime reference
│   ├── ru/                     # Russian public-doc parity tree
│   └── docs.json               # Navigation, theme, AI-context integrations
├── supervisor/                 # ── ACP SUPERVISOR DAEMON ──
│   ├── src/
│   │   ├── main.ts             # Fastify boot + graceful shutdown
│   │   ├── http-api.ts         # 6 routes (POST/DELETE/GET /sessions, SSE, checkpoint/input stubs)
│   │   ├── spawn.ts            # child_process dispatch (claude-agent-acp | codex-acp)
│   │   ├── heartbeat.ts        # exit/error → session.exited/crashed + orphan watcher
│   │   ├── cost.ts             # cache/input/output usage normalization
│   │   ├── registry.ts         # In-memory SessionRecord map + per-session event ring buffer
│   │   ├── types.ts            # Zod schemas + SessionEvent union + SupervisorError
│   │   └── __tests__/          # 30 unit + 9 integration tests
│   ├── test/fixtures/
│   │   └── fake-acp.mjs        # Stand-in for the real ACP binary in tests
│   ├── package.json            # @maister/supervisor; tsx runtime
│   ├── tsconfig.json
│   ├── vitest.workspace.ts     # unit | integration split
│   └── eslint.config.mjs
├── web/                        # ── NEXT.JS WEB TIER ──
│   ├── app/                    # App Router (layout, pages, api/, server actions)
│   ├── components/             # HeroUI-based React components
│   ├── config/                 # Site config (navItems), fonts
│   ├── lib/                    # Server-only modules (errors, atomic, config, db, supervisor-client)
│   ├── i18n/                   # EN + RU translations (required from day one)
│   ├── styles/                 # globals.css (Tailwind 4 + HeroUI styles)
│   ├── types/                  # Shared TS types
│   ├── public/                 # Static assets
│   ├── CLAUDE.md               # Web slice conventions — READ THIS
│   ├── package.json            # Dependencies, scripts (dev/build/start/lint)
│   ├── tsconfig.json           # strict, @/* path alias
│   ├── next.config.mjs
│   ├── eslint.config.mjs       # ESLint 9 flat config
│   └── postcss.config.mjs      # @tailwindcss/postcss
├── CLAUDE.md                   # Root project instructions for AI agents
├── AGENTS.md                   # This file
├── README.md                   # Landing page: quick start, docs index
├── CONTRIBUTING.md             # Development and contribution workflow
├── SECURITY.md                 # Private vulnerability-reporting policy
├── CODE_OF_CONDUCT.md          # Contributor Covenant 2.1
├── .env.example                # Server env vars (web + supervisor)
├── .dockerignore
├── LICENSE                     # MIT
└── .gitignore

Two Node processes: web/ (Next.js — UI + Route Handlers + server actions

  • Drizzle DB access + SSE bridge) and supervisor/ (Fastify daemon — owns ACP sessions and spawns agent processes). They communicate over HTTP+SSE through web/lib/supervisor-client.ts; the supervisor runs as a separate process on the supported single host. Stage B removes the web runtime-data mount; Stage C owns remote repository/workspace placement.

Key Entry Points

FilePurpose
web/app/layout.tsxRoot layout: Providers + Navbar + container
web/app/page.tsxHome page (template stub — to replace with portfolio grid)
web/app/providers.tsxnext-themes ThemeProvider wrapper
web/app/error.tsxRoot error boundary
web/lib/supervisor-client.tsThe ONLY place web/ talks to supervisor/ (HTTP+SSE)
web/lib/errors.tsMaisterError discriminated union (11 codes)
web/lib/db/schema.tsDrizzle schema; node_attempts is the sole Flow execution ledger
web/lib/agents/activity-queries.tsScoped active executions and retained run/attempt history
web/lib/tasks/qualification.tsVersioned request assessments and authoritative admission
web/components/agents/Project agent history, grouped incidents, retries and qualification controls
web/lib/agents/launch-contract.tsImmutable agent kind, definition and operational completion snapshots
web/lib/run-results/operational-projection.tsShared operational diagnostic projection for run details, collect and automation history
web/lib/gc/operational-disposition.tsDurable operational cleanup through existing workspace lifecycle claims
web/lib/execution-host/events/projection-runtime.tsAutonomous canonical projection registry and worker activation
web/lib/config.tsmaister.yaml v2 loader (zod-validated)
web/lib/project-config-persistence/Reviewed configuration projection, commit/push intents, Git publication and recovery
site/app/[locale]/page.tsxPublic localized landing page
site/app/api/github/route.tsValidated live GitHub repository widget endpoint
site-docs/docs.jsonPublic Markdown docs navigation, theme, and AI context
site-docs/AGENTS.mdPublic-doc authoring boundary; excludes internal docs/
supervisor/src/main.tsSupervisor daemon entrypoint (Fastify on :7777)
supervisor/src/http-api.tsSix HTTP routes + SSE bridge
supervisor/src/spawn.tschild_process.spawn dispatcher (claude-agent-acp / codex-acp)
supervisor/package.json@maister/supervisor; scripts: dev, start, test:unit, test:integration
pnpm-workspace.yamlMonorepo: web + supervisor + site + site-docs
.mcp.jsonMCP server configuration

Documentation

DocumentPathDescription
READMEREADME.mdLanding page: quick start, key features, docs table
ContributingCONTRIBUTING.mdSetup, validation, PR, privacy, and AI-assistance expectations
Security PolicySECURITY.mdSupported versions and private vulnerability-reporting path
Code of ConductCODE_OF_CONDUCT.mdCommunity behavior and enforcement policy
Getting Starteddocs/getting-started.mdInstall, dev workflow, first run
Russian Guidedocs/ru/README.mdPurpose, workflow, operator guide
Supervisordocs/supervisor.mdACP daemon: HTTP+SSE API, lifecycle, durable events, runtime objects, env vars
Database Schemadocs/database-schema.md155 tables, FK cascade chain, indexes, Drizzle workflow
Error Taxonomydocs/error-taxonomy.mdMaisterError codes — when each fires, what the UI does
Configurationdocs/configuration.mdmaister.yaml v2 + flow.yaml v1 + form_schema versioning + env vars
Project configuration persistencedocs/system-analytics/project-config-persistence.mdReviewed export, commits, recovery and push; Implemented
Visiondocs/VISION.mdOne-liner, product spine, principles, validation goal
Product Viewdocs/PRODUCT_VIEW.mdLean Canvas, JTBD, gaps, MVP / Phase 2 / Later
Architecturedocs/architecture.mdCurrent system architecture, C4 diagrams, data flows
Decisionsdocs/decisions.mdADRs and locked technical decisions
Agent activity designdocs/system-analytics/agent-activity-history.mdActive executions and retained history
Task qualification designdocs/system-analytics/task-qualification.mdIncoming requests and admission contracts
Task launch admissiondocs/system-analytics/task-launch-admission.mdExplicit manual authority and qualified automation
Agent preparationdocs/system-analytics/agent-preparation.mdFenced checkout, baseline, handoff and cleanup
System Analyticsdocs/system-analytics/Domain flows for projects, runs, HITL, executors, Flow DSL, and test database infrastructure
Screens Referencedocs/screens/README.mdUser-facing screens and shared chrome
API Contractsdocs/api/Web/supervisor OpenAPI and SSE AsyncAPI contracts
README (web)web/README.mdHeroUI template README — replace when something to say
Public documentationsite-docs/Published EN/RU product docs authored as Markdown; separate from internal docs/
Run Git guidesite-docs/guides/run-git.mdWorktree changes, publication, PRs, restoration, staged-work rescue; EN/RU
Agent messaging guidesite-docs/guides/message-a-running-agent.mdSteering, queued messages, recovery; EN/RU
Personal librarian guidesite-docs/guides/personal-librarian.mdTasks, clarifications, confirmations, personal memory and history; EN/RU

AI Context Files

FilePurpose
AGENTS.mdThis file — structural map for AI agents and new contributors
CLAUDE.mdRoot project instructions: product spine, locked architectural decisions, conventions
web/CLAUDE.mdWeb/Next.js slice: stack details, scripts, structure, HeroUI conventions
.ai-factory/DESCRIPTION.mdProject specification synthesized from product docs
.ai-factory/ARCHITECTURE.mdArchitecture pattern, folder structure, dependency rules, code examples
.ai-factory/config.yamlAI Factory configuration (language, paths, git settings)
.ai-factory/ROADMAP.mdRoadmap and completed work
.ai-factory/rules/base.mdProject-wide conventions extracted from CLAUDE.md files
.ai-factory/rules/frontend.mdWeb-tier rules (HeroUI, RSC, lint)
.ai-factory/rules/backend.mdServer-tier rules (supervisor, SSE, errors, concurrency)
.ai-factory/rules/database.mdDrizzle / Postgres rules

When this file disagrees with CLAUDE.md or docs/, those win — update this file.

Agent Rules

  • Decompose shell commands — run each command separately, not chained, so failures surface clearly and approvals stay scoped.
    • Wrong (combined): git checkout main && git pull
    • Right (decomposed): first git checkout main, then git pull origin main
  • Read CLAUDE.md and web/CLAUDE.md first before touching any code. Both files encode product spine, current implementation boundaries, and project conventions.
  • Surgical changes only — every changed line must trace directly to the user's request. Do not refactor adjacent code while you're there.
  • Throw MaisterError with code for known domain failures. Never use plain Error for domain errors. UI branches on code, never on string matching.
  • Atomic writes to .maister/ — always tmp + rename via atomicWriteJson. The Flow may read mid-write otherwise.
  • No chokidar / fs.watch / polling. State transitions are driven by ACP notifications (live path) plus artifact presence (recovery path); process exit codes feed the heartbeat-promoted crash event.
  • Agent processes live in supervisor/, not web/. The web tier reaches the supervisor through web/lib/supervisor-client.ts only. ACP sessions are held live across permission HITL; designed checkpoint resume uses the same acp_session_id handle.
  • Scope labels are descriptive, not blockers — use docs labels (Implemented, Designed, Phase 2) to explain trade-offs. Do not block useful work solely because an old planning note called it out of scope.

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.