agentleFS
lbdremylbdremy/phax/CLAUDE.md

phax

CLAUDE.md2 starsChanged 5 months agoApache-2.0View on GitHub

Guidance for AI agents working in this repo. Keep this file lean — detailed rules live in the project skills (see the table below); the README covers user-facing usage. A deterministic local CLI that drives an AI coding agent (Claude Code, Mistral Vibe, or OpenAI Codex) through isolated, gated phases. Each phase runs in its own Git worktree with a same-session fix loop and a kept-open final phase for human review. Provider selection is handled by the model-routing layer; Claude…

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    All I/O goes through a port.

    line 54
  2. Distinctive:

    No back-compat shims in persisted schemas: new fields are required, not optional.

    line 81
  3. Distinctive:

    Prefer explicit per-variant enums over a permissive superset.

    line 82
  4. Very specific:

    When the user asks to commit doc-only changes (files under docs/) or pure text files (e.g.

    line 86

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

Guidance for AI agents working in this repo. Keep this file lean — detailed rules live in the project skills (see the table below); the README covers user-facing usage.

What phax is

A deterministic local CLI that drives an AI coding agent (Claude Code, Mistral Vibe, or OpenAI Codex) through isolated, gated phases. Each phase runs in its own Git worktree with a same-session fix loop and a kept-open final phase for human review. Provider selection is handled by the model-routing layer; Claude Code is the default and fallback.

Commands

This repo uses pnpm (see the packageManager field in package.json); CI and the phax gate profiles both invoke pnpm. Don't use npm/yarn or commit a package-lock.json. Use the package scripts — don't reach for raw tool invocations.

  • pnpm check:full — the real pre-merge gate (typecheck + unit + integration + type tests + lint + format check + architecture audit + knip). Run this before considering work done.
  • pnpm dev — run the CLI from source (tsx src/cli/main.ts).
  • pnpm build — compile to dist/.
  • pnpm test:unit / test:integration / test:e2e:real — test tiers (e2e hits real provider CLIs; run deliberately).
  • pnpm test:type — typechecks the whole test suite (tests/**, including the type-level tests in tests/type/) against src/ (tsconfig.test.json). The main tsconfig.json excludes tests/, so this is the only thing that keeps fixtures in step with the types.
  • pnpm audit:architecture — enforces the layer boundaries below as a test.
  • pnpm lint / lint:fix — oxlint (not eslint).
  • pnpm format / format:check — oxfmt (not prettier).
  • pnpm knip — dead-code / unused-dependency check.

Architecture

Four layers, dependencies point inward; side effects only at the edge:

cli → app → domain ← ports ← infra
  • src/domain/ — pure logic (state machines, routing, reconciliation, security). No I/O.
  • src/ports/ — interfaces for all side effects (fs, git, shell, github, editor, lock, output, telemetry).
  • src/infra/ — the only place side effects live; adapters implementing the ports.
  • src/app/ — use cases orchestrating domain + ports via Effect dependency injection.
  • src/cli/ — thin command layer: one definition per command family under src/cli/definitions/, run by the command library's runner; each calls one use case and renders its answer.
  • src/schemas/ — Effect Schemas decoding every external input at the boundary.

Non-negotiables (enforced by audit:architecture):

  • All I/O goes through a port; never call fs/shell/git directly in app/, domain/, or cli/.
  • Decode external input (files, env, CLI args, API responses) through a schema before it enters the domain.
  • Transition RunState/PhaseState only through the functions in src/domain/state.ts.
  • CLI command files contain no business logic.

Project skills

These load on demand. Reach for the matching one before editing that area:

SkillWhen
boundariesadding/moving code across the four layers
cli-view-layertouching src/cli/definitions/
effect-servicesadding a side-effecting operation (route it through a port)
infrastructure-adaptersimplementing an adapter in src/infra/
validation-boundariesdecoding any external input
state-machineschanging RunState/PhaseState transitions
model-routingprovider adapters, model families/tiers, resolution algorithm
observabilityOpenTelemetry / SystemTelemetry port wiring
phax-planningauthoring/reviewing plan.md → phax-plan.json

Conventions

  • TypeScript 7 (native compiler) + Effect (v3) throughout; Effect handles dependency injection and effects.
  • Schemas pin to specific library versions — when checking an Effect / @effect/platform API, cross-check against package.json; installed versions may differ from training data.
  • No back-compat shims in persisted schemas: new fields are required, not optional.
  • Prefer explicit per-variant enums over a permissive superset.

Git

  • When the user asks to commit doc-only changes (files under docs/) or pure text files (e.g. CLAUDE.md, README.md) while on main, commit directly on main — do not create a branch first. The branch-first rule still applies to code changes.

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.