agentleFS
Sidiora-LabsSidiora-Labs/Paxeer-X-Network/consensus/AGENTS.md

Paxeer-X-Network / consensus

AGENTS.md575 starsChanged 3 months agoApache-2.0View on GitHub

Within the consensus subdirectory * consensus is the embedded consensus-engine tree, but it is not the root of the repo. When refactoring, check references across the whole repo. * use consensus/libs/utils.Option for optional values, passing nil as function value is not allowed, unless explicitly documented (except for maps and slices, for which nil is a valid empty value). * use consensus/libs/utils/scope.Run for structured concurrency (instead of waitgroup) * use new golang features wherever possible, which is at least 1.25. In…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 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 repository7 other files it gives its agents.

The file

Show its rules and text

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

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    use consensus/libs/utils.Option for optional values, passing nil as function value is not allowed, unless explicitly documented (except for …

    line 3
  2. Very specific:

    use consensus/libs/utils/scope.Run for structured concurrency (instead of waitgroup)

    line 5
  3. Distinctive:

    use new golang features wherever possible, which is at least 1.25.

    line 6
  4. Distinctive:

    avoid capturing loop iterators ("tc := tc" is not needed)

    line 8
  5. Distinctive:

    use slices, maps libraries whenever they do not harm readability

    line 9
  6. Distinctive:

    use t.Context() in tests instead of context.Background().

    line 10
  7. Distinctive:

    use public api of types in tests, never malform internal state of types.

    line 11
  8. Distinctive:

    when writing tests, focus on asserting the publically visible properties, especially the API contract.

    line 13
  9. Very specific:

    Avoid sleeping and active polling in tests.

    line 14
  10. Very specific:

    Avoid checking human readable error messages in tests.

    line 15
  11. Very specific:

    After introducing changes, you may Use go test --count=0 to quickly check if tests compile.

    line 16
  12. Distinctive:

    Avoid removing comments and logs which are not obviously obsolete.

    line 18
  13. Distinctive:

    Use TestRng.Split() (before spawning) if you need to pass entropy source to a spawned goroutine to ensure deterministic entropy across the …

    line 20

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

Within the consensus subdirectory

  • consensus is the embedded consensus-engine tree, but it is not the root of the repo. When refactoring, check references across the whole repo.
  • use consensus/libs/utils.Option for optional values, passing nil as function value is not allowed, unless explicitly documented (except for maps and slices, for which nil is a valid empty value).
  • use consensus/libs/utils/scope.Run for structured concurrency (instead of waitgroup)
  • use new golang features wherever possible, which is at least 1.25. In particular:
    • modern range iteration ("for range N", to iterate N times)
    • avoid capturing loop iterators ("tc := tc" is not needed)
    • use slices, maps libraries whenever they do not harm readability
    • use t.Context() in tests instead of context.Background().
  • use public api of types in tests, never malform internal state of types. For read-only access, you can use private fields directly in case it is not accessible via public api.
  • when writing tests, focus on asserting the publically visible properties, especially the API contract. Avoid asserting implementation details.
  • Avoid sleeping and active polling in tests. Prefer waiting for updates (for example by using consensus/libs/utils.Watch or AtomicWatch).
  • Avoid checking human readable error messages in tests. If programatic error type check is requested, use errors.Is/As/AsType instead.
  • After introducing changes, you may Use go test --count=0 to quickly check if tests compile. You may run go test to actually run the tests afterwards. Prefer running modified tests selectively and run the whole test suite only if requested or looking for failures.
  • Avoid removing comments and logs which are not obviously obsolete. Keep the original wording, only fixing mistakes or obsolete parts.
  • TestRng instance should be one per test, constructed directly in the test function. In case of nested/table tests, each nested test should create its own instance. Use TestRng.Split() (before spawning) if you need to pass entropy source to a spawned goroutine to ensure deterministic entropy across the goroutines.

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.