agentleFS
salvo8519salvo8519/fairmark/.agents/skills/add-method/SKILL.md

add-method

Skill1 starsChanged 6 days agoApache-2.0View on GitHub

End-to-end checklist for adding a valuation method to the Fairmark engine (core, registry, schemas, Python, docs, tests). Use when implementing a new method id.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md
  1. Confirm an Approved spec exists and identify its method id (area.name).
  2. Golden cases first: /golden-case for each acceptance criterion with numbers.
  3. Core (crates/fairmark-core/src/<area>.rs):
    • <Name>Input with Serialize, Deserialize, JsonSchema, #[serde(deny_unknown_fields)], doc comment on every field with units; optional fields use #[serde(default)] and the default is documented.
    • <Name>Output with Serialize, JsonSchema.
    • pub fn <name>(input: &<Name>Input) -> Result<(<Name>Output, Explain)> using the checked helpers of crate::num; every visible number is an explain step; conventions listed.
    • A unit type pub struct <Name>; implementing Method (id <theme>.<name>, version "1", title, description, compute) in the same module (ADR 0009).
    • Unit tests for edge cases and errors.
  4. Registry (registry.rs): add one line, <theme>::<Name>, to the registry! list, in its theme group. Contract cases: tests/contracts/<id>.yaml with at least one extreme input and one conventions case (crates/fairmark-core/tests/contracts.rs fails without them).
  5. uv run just generate: writes schemas/<id>/v<N>.json, updates schemas/index.json (introduced_in: unreleased until the next release) and the methods reference. Never edit an earlier version file. Version rule: if the method already exists on main at version N, any numerical change or breaking input change makes it N+1 in this PR, once (several changes in one PR share the bump); CI refuses a breaking change to version N.
  6. Python: thin helper in python/fairmark/<area>.py, exported in __init__.py.
  7. Docs: docs/en/methods/<id>.md (via docs-writer), nav entry in zensical.toml, row in docs/en/methods/index.md (method and what it computes; the status block is generated); python scripts/docs_sync.py coverage must pass.
  8. uv run just check, then code-reviewer and numerical-auditor.
  9. Status: a new method is preview (ADR 0012). Add its id to the spec's entry in specs/method-evidence.yaml. Promotion to available is a separate, maintainer-approved change: one line in AVAILABLE (registry.rs) once the rule in docs/en/project/releases.md ("Method status") holds; python scripts/method_status.py check verifies it.

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.