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…
In this repository16 other files it gives its agents.
- boundariesSkill
- cli-view-layerSkill
- effect-servicesSkill
- find-docsSkill
- infrastructure-adaptersSkill
- model-routingSkill
- observabilitySkill
- phax-cliSkill
- phax-decide-planSkill
- phax-decide-reviewSkill
- phax-decide-specSkill
- phax-planningSkill
- phax-reviewSkill
- phax-specSkill
- state-machinesSkill
- validation-boundariesSkill
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
- Very specific: line 54
All I/O goes through a port.
- Distinctive: line 81
No back-compat shims in persisted schemas: new fields are required, not optional.
- Distinctive: line 82
Prefer explicit per-variant enums over a permissive superset.
- Very specific: line 86
When the user asks to commit doc-only changes (files under docs/) or pure text files (e.g.
≈ “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.
Files
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 todist/.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 intests/type/) againstsrc/(tsconfig.test.json). The maintsconfig.jsonexcludestests/, 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 ← infrasrc/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 undersrc/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/, orcli/. - Decode external input (files, env, CLI args, API responses) through a schema before it enters the domain.
- Transition
RunState/PhaseStateonly through the functions insrc/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:
| Skill | When |
boundaries | adding/moving code across the four layers |
cli-view-layer | touching src/cli/definitions/ |
effect-services | adding a side-effecting operation (route it through a port) |
infrastructure-adapters | implementing an adapter in src/infra/ |
validation-boundaries | decoding any external input |
state-machines | changing RunState/PhaseState transitions |
model-routing | provider adapters, model families/tiers, resolution algorithm |
observability | OpenTelemetry / SystemTelemetry port wiring |
phax-planning | authoring/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/platformAPI, cross-check againstpackage.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 onmain, commit directly onmain— do not create a branch first. The branch-first rule still applies to code changes.
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.

