fairmark
AGENTS.md1 starsChanged 5 days agoApache-2.0View on GitHub
Instructions for AI coding agents (Claude Code, Codex, Copilot, Cursor, …) working on this repository. Humans: see CONTRIBUTING.md. Users of Fairmark (not developers): see skills/fairmark/SKILL.md.
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 31,700 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 repository39 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- add-methodSkill
- adr-newSkill
- commitSkill
- explain-changesSkill
- fix-ciSkill
- golden-caseSkill
- implement-specSkill
- onboardingSkill
- plan-sprintSkill
- pre-prSkill
- pr-triageSkill
- releaseSkill
- roadmap-updateSkill
- run-sprintSkill
- session-endSkill
- session-startSkill
- spec-newSkill
- translateSkill
- add-methodSkill
- adr-newSkill
- commitSkill
- explain-changesSkill
- fix-ciSkill
- golden-caseSkill
- implement-specSkill
- onboardingSkill
- plan-sprintSkill
- pre-prSkill
- pr-triageSkill
- releaseSkill
- roadmap-updateSkill
- run-sprintSkill
- session-endSkill
- session-startSkill
- spec-newSkill
- translateSkill
- fairmarkSkill
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 2 are distinctive, and 9 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.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Start: every session with the session-start skill (or uv run python scripts/project_state.py): branch, issue, journal, pull requests, CI, …
- Very specific: line 34
End: every session with session-end: gate, journal entry in .agents/journal/, release note, commit, push and a complete pull request.
- Very specific: line 42
Read plan.md and tasks.md.
- Very specific: line 52
Every calculation step that produces a number the user sees goes into Explain.
- Very specific: line 58
Never modify expected values of an existing golden case: If a result must change it is a numerical-change: stop and ask the maintainer.
- Distinctive: line 61
An approval covers only the golden cases it names: When an approved change would also modify golden cases outside the scope named in its …
- Distinctive: line 69
Never commit real client data.
- Very specific: line 74
Roadmap as code: Create issues with python scripts/roadmap.py new (it sets the milestone, the labels and the entry in roadmap/roadmap.yaml).
- Very specific: line 78
When a request adds, changes, moves or drops planned work, propose the roadmap change first (skill roadmap-update) and apply it after the …
- Very specific: line 137
Context for agents: before working on an area, read the relevant entries of CHANGELOG.md, the unreleased fragments in changes/, the spec …
- Very specific: line 163
Add one line to the registry list in registry.rs.
≈ “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.
Files
AGENTS.md
Instructions for AI coding agents (Claude Code, Codex, Copilot, Cursor, …) working on this
repository. Humans: see CONTRIBUTING.md. Users of Fairmark (not developers): see
skills/fairmark/SKILL.md.
What this project is
Fairmark is a deterministic valuation engine (Rust core) with thin adapters: Python SDK,
CLI, MCP server, function-calling tools. It values private companies (and later real assets)
with exact decimal arithmetic and a full audit trail. Read specs/constitution.md before
changing anything: its principles override convenience.
Repository map
| Path | What lives there |
crates/fairmark-core/ | ALL financial logic. Methods, decimal math, explain, registry, errors. No I/O. |
crates/fairmark-cli/ | fairmark binary (methods / schema / run / verify). Adapter only. |
crates/fairmark-py/ | PyO3 bridge: 3 functions, JSON strings across the boundary. |
python/fairmark/ | Pythonic API, tools.py (function calling), mcp_server.py. Adapters only. |
tests/golden/ | Golden cases shared by Rust and Python. Human-reviewed. |
schemas/ | Versioned JSON Schema snapshots: <method>/v<N>.json for every method version, index.json with the history (the "migrations"). Earlier versions are immutable. |
specs/ | Spec-driven development: constitution, templates, one folder per feature. |
docs/ | Documentation: en/ (source), it/ (translation), _shared/ (assets). References are generated. |
i18n/ | Language editions configuration and the translation glossary. |
roadmap/roadmap.yaml | Milestones → epics → tasks with their issue and spec; checked and synchronised by scripts/roadmap.py. |
.agents/ | Canonical agent roles (agents/) and skills (skills/). .claude/ is generated from it. |
sprints/ | Sprint plans (SNN.yaml) used by the orchestrator. |
.agents/journal/ | Session handover notes, one file per branch and day. |
Sessions and project memory
- Start every session with the
session-startskill (oruv run python scripts/project_state.py): branch, issue, journal, pull requests, CI, sprint and the issues that can run in parallel. - End every session with
session-end: gate, journal entry in.agents/journal/, release note, commit, push and a complete pull request. Never leave work only on a laptop. - Review the queue with
pr-triage. Agents comment and recommend; only the maintainer approves and merges.
How work is done here: spec-driven
- Find or write the spec:
specs/NNNN-*/spec.md. No method code without anApprovedspec. Tooling, docs and refactors don't need one. - Read
plan.mdandtasks.md. Work one task at a time, test first. - Cite requirement ids in commits and PRs:
feat(dcf): FCFF build-up [SPEC-0001 R2]. - Tick tasks in
tasks.mdonly whenjust checkpasses.
Hard rules
rust_decimal::Decimalfor every value. Neverf32/f64in a calculation path; in Python neverfloatfor money or rates (useDecimalor strings).- Financial logic only in
fairmark-core. Adapters translate, they never compute. - New input types:
Serialize + Deserialize + JsonSchema,#[serde(deny_unknown_fields)], a doc comment on every field stating units (rates are decimal fractions). - Every calculation step that produces a number the user sees goes into
Explain; every convention that changes a number goes intoexplain.conventions. - Method versions: bump on any numerical change or breaking input change. The schema of each
version is kept in
schemas/<method>/v<N>.json; earlier versions are never edited (CI checks). - Errors: add a variant to
FairmarkErrorwith the next free stable code, document it indocs/en/reference/errors.md. Never reuse or renumber codes. - Never modify expected values of an existing golden case. If a result must change it is
a
numerical-change: stop and ask the maintainer. New golden cases need an independent source noted in the file. - An approval covers only the golden cases it names. When an approved change would also modify golden cases outside the scope named in its approval (inputs, expected values or expected names), stop and ask the maintainer to extend the approval first. Never bypass the protection of existing golden files, by any means.
- Code identifiers are always English, using the term of international financial practice
(method ids, fields, enum values, types, messages). Italian names of Italian methods appear
only in the Italian documentation and in
i18n/glossary.yaml; an internationally recognised acronym (for examplemixed.uec) may be kept. - Never commit real client data. Anonymise or reconstruct.
- Names follow
docs/en/project/conventions.md, enforced byscripts/conventions.py: branch<type>/<issue>-<slug>; commit and pull request title<type>(<scope>): <subject>(Conventional Commits, scope required); pull request bodyCloses #<issue>; squash merge. - New dependencies and updates follow
docs/en/project/dependencies.md. - Roadmap as code. Create issues with
python scripts/roadmap.py new(it sets the milestone, the labels and the entry inroadmap/roadmap.yaml); a pull request may only close an issue that is in the roadmap, and every spec must be referenced by a roadmap task (CI).roadmap.py synccopies issue states from GitHub; a scheduled workflow reports differences. When a request adds, changes, moves or drops planned work, propose the roadmap change first (skillroadmap-update) and apply it after the maintainer confirms. - Sign off commits (
git commit -s, DCO).
House style (enforced by CI)
- No icons, emoji, pictograms or decorative symbols in any file: documentation, README,
code comments, commit messages, PR descriptions, issue text and generated output. Use words
("Available", "Planned", "Note:") instead. Typographic symbols of finance and maths
(× − Σ → · ≤ ≥ €) are fine.
scripts/check_style.pyfails the build otherwise. - Corporate, precise English: short sentences, explicit units, no marketing superlatives, no exclamation marks.
- Diagrams use the brand palette (
docs/en/project/brand.md) and plain text labels.
Languages
- Repository language: English. Code, comments, commit messages, PR and issue text, specs,
ADRs and the source documentation (
docs/en/,README.md) are written in English. - Conversation language: the contributor's choice. Personal preferences go in
CLAUDE.local.md(not committed; seeCLAUDE.local.md.example). Thecommitskill shows the English message with a translation for review;explain-changesexplains changes in any language;onboardingguides newcomers in their language. - Documentation editions: English (source) and Italian. Translations live in
docs/it/andREADME.it.md, each tracking the hash of its English source.scripts/i18n.py checkfails when a required translation is stale or missing; thetranslateskill and thetranslatoragent fix it, usingi18n/glossary.yaml. New languages are added only by the maintainers.
Agents and skills
Roles and workflows live in .agents/ (see .agents/README.md): architect, spec-writer,
test-engineer, core-engineer, docs-writer, code-reviewer, numerical-auditor,
security-reviewer, ci-investigator, release-manager, sprint-planner, translator; skills
spec-new, implement-spec, add-method, golden-case, adr-new, pre-pr, fix-ci,
release, plan-sprint, run-sprint, commit, explain-changes, translate, onboarding,
session-start, session-end, pr-triage, roadmap-update. Sprints: see sprints/README.md.
Edit them in .agents/ only; uv run just generate mirrors them to .claude/.
Documentation stays in sync automatically
- Generated, never hand-edited:
schemas/,docs/en/reference/methods.md, the Python API reference (docstrings),.claude/andCHANGELOG.md(git-cliff, from Conventional Commits). scripts/docs_sync.py coverage: every method has a methodology page, nav entry, index row, golden cases and a Python helper.scripts/docs_sync.py impact: a change to a method, error codes, CLI, MCP or function calling must come with the matching documentation change. Runs in pre-commit, CI and as a Claude Code Stop hook. Waive only with the PR labelno-docs-neededor the commit trailerDocs-impact: none.- Numerical changes carry the commit trailer
Numerical-change: <method> v<N> -> v<N+1>; the CHANGELOG lists them first.
Versions, releases and project memory
- Releases: each milestone names the release that ships it (
roadmap/roadmap.yaml);python scripts/release.py ready <version>decides whether a version can be released (docs/en/project/releases.md). The maintainer decides when to release. - One version:
[workspace.package] versioninCargo.toml. Everything else derives from it;scripts/version.py checkverifies it in CI,scripts/version.py bumpchanges it. - Two audiences, two documents:
CHANGELOG.md, technical, generated by git-cliff from Conventional Commits: precise context for agents and developers;RELEASE_NOTES.md, functional, built by towncrier from fragments inchanges/, written for analysts in plain language. Every user-facing PR adds one fragment (changes/README.md); CI checks it (labelno-release-noteotherwise).
- Context for agents: before working on an area, read the relevant entries of
CHANGELOG.md, the unreleased fragments inchanges/, the spec and the ADRs. The docs site publishesllms.txtandllms-full.txtfor external agents.
Commands
Install uv and Rust stable. just is installed by uv.
| Goal | Command |
| Set up everything | uv sync --all-extras --all-groups |
| Full local gate (run before every PR) | uv run just check |
| Format everything | uv run just fmt |
| Rust tests incl. golden | cargo test --workspace |
| Python tests incl. golden and docs snippets | uv run pytest |
Regenerate schemas, methods reference, .claude/ | uv run just generate |
| Translation status | uv run just i18n |
| Project state for a new session | uv run python scripts/project_state.py |
| Outdated dependencies / advisories | uv run just deps-outdated / uv run just deps-audit |
| Version check / preview of release notes | uv run just version / uv run just release-notes |
| Build both documentation sites | uv run just docs |
| Docs preview (English or Italian) | uv run just docs-serve / uv run just docs-serve it |
Adding a method (checklist)
- Spec approved → golden cases from an independent source in
tests/golden/<method>/. crates/fairmark-core/src/<theme>.rs: input/output types and a unit type implementing theMethodtrait (ADR 0009).- Add one line to the registry list in
registry.rs. uv run just generate→ writesschemas/<method>/v<N>.json, updatesschemas/index.jsonanddocs/en/reference/methods.md. A breaking input change needs a new method version.- Python helper in
python/fairmark/<area>.py; methodology page indocs/en/methods/. - Conventional Commit messages (the CHANGELOG is generated by git-cliff).
uv run just check. - The method is
preview(ADR 0012): list it inspecs/method-evidence.yaml. Promotion toavailableis one line inAVAILABLE(registry.rs), approved by the maintainer and checked byscripts/method_status.pyagainstdocs/en/project/releases.md.
Review standards (what reviewers and CI check)
See .agents/agents/code-reviewer.md and .agents/agents/numerical-auditor.md. In short:
constitution compliance, decimal-only arithmetic, explain completeness, schema docs, golden
cases with independent sources, no adapter logic, tests for every acceptance criterion.
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.

