agentleFS
zebbernzebbern/claude-code-discord/AGENTS.md

claude-code-discord

AGENTS.md229 starsChanged 3 months agoMITView on GitHub

It can be spawned agents for specific tasks, but don't let them run wild. Always review their output and verify it against the real code/real run before accepting it. Build for flexible, context-aware presentation rather than fixed dimensions or one-size layouts. Do not rely solely on your internal knowledge or training data when making implementation decisions. Your memory is frequently outdated. Before implementing anything non-trivial (especially integrations, tools, SDKs, platforms, AI agents, or architectural patterns): Why this matters: Defaulting to…

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

42 rules. About 0 are common, 41 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈41

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer clean architecture, verifying and using up to date information, flexibility over rigidity, flexible code/development, good dead-code …

    line 5
  2. Distinctive:

    Prefer structures that adapt to the surface (Discord embeds and components, CLI/TUI output, docs, or a future web UI) instead of hard-coded …

    line 14
  3. Distinctive:

    Keep text readable across contexts: scale or truncate thoughtfully, avoid walls of unreadable output, and preserve hierarchy (title → …

    line 15
  4. Distinctive:

    When content must fit platform limits (e.g.

    line 16
  5. Distinctive:

    Do not rely solely on your internal knowledge or training data when making implementation decisions.

    line 20
  6. Distinctive:

    Before implementing anything non-trivial (especially integrations, tools, SDKs, platforms, AI agents, or architectural patterns):

    line 22
  7. Distinctive:

    Check whether newer versions, official solutions, or better patterns already exist that would change how the task should be approached.

    line 25
  8. Distinctive:

    Prefer using current best practices and existing tools over rebuilding something from scratch based on older knowledge.

    line 26
  9. Distinctive:

    If there is any uncertainty about the current recommended way to do something, ask clarifying questions instead of defaulting to what you …

    line 27
  10. Distinctive:

    Do not create test files or full test suites by default.

    line 34
  11. Distinctive:

    Only keep automated tests when they provide clear and lasting value.

    line 36
  12. Distinctive:

    Do not keep tests for:

    line 38
  13. Distinctive:

    When a mock/unit test can't catch the bug class (dead URL, wrong query flag, SDK contract, runtime-only import), either:

    line 55
  14. Distinctive:

    Verify with a real run / smoke path, or

    line 57
  15. Distinctive:

    Keep a narrow contract/integration check that exercises the real boundary — and mark network-dependent tests clearly so they aren't treated …

    line 58
  16. Distinctive:

    Do not treat a large green suite as evidence that integrations work.

    line 60
  17. Distinctive:

    When verifying that a feature, flow, or change works:

    line 62
  18. Distinctive:

    Test it the way a real user would.

    line 64
  19. Distinctive:

    Prefer observing the real user-facing outcome over assuming that green tests equal a working feature.

    line 66
  20. Distinctive:

    When fixing a bug, incorrect pattern, anti-pattern, or issue in one place, do not stop at the single occurrence that was reported or …

    line 72
  21. Distinctive:

    Search the codebase for similar instances of the same problem or pattern.

    line 76
  22. Distinctive:

    Prefer consistent, thorough fixes over narrow one-off patches.

    line 78
  23. Distinctive:

    Keep the scope proportional.

    line 87
  24. Distinctive:

    Do not ship half-features: APIs, Maps, helpers, or modules that nothing calls, or PR claims that the code does not actually do.

    line 91
  25. Distinctive:

    Prefer deleting unused scaffolding over leaving dead "future" code that looks complete.

    line 94
  26. Distinctive:

    When touching session, AbortController, query, or similar shared state:

    line 98
  27. Distinctive:

    Verify both: the intended isolation path and that other channels/sessions are not aborted, overwritten, or left stale.

    line 101
  28. Distinctive:

    If multiple interpretations exist, present them — don't pick silently.

    line 111
  29. Distinctive:

    If a simpler approach exists, say so.

    line 112
  30. Distinctive:

    If something is unclear, stop.

    line 113
  31. Distinctive:

    No features beyond what was asked.

    line 119
  32. Distinctive:

    No abstractions for single-use code.

    line 120
  33. Distinctive:

    No error handling for impossible scenarios.

    line 122
  34. Distinctive:

    If you write 200 lines and it could be 50, rewrite it.

    line 123
  35. Distinctive:

    Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.

    line 125
  36. Distinctive:

    When editing existing code:

    line 131
  37. Distinctive:

    Don't "improve" adjacent code, comments, or formatting.

    line 133
  38. Distinctive:

    Don't refactor things that aren't broken.

    line 134
  39. Distinctive:

    If you notice unrelated dead code, mention it — don't delete it.

    line 136
  40. Distinctive:

    When your changes create orphans:

    line 138
  41. Very specific:

    Remove imports/variables/functions that YOUR changes made unused.

    line 140
  42. Distinctive:

    Don't remove pre-existing dead code unless asked.

    line 141

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

AGENTS GUIDELINES

  • You have skills which have practices, patterns or good information for specific work
  • Quality over quantity — fewer high-quality outputs over many low-quality ones and use caution over speed.
  • Prefer clean architecture, verifying and using up to date information, flexibility over rigidity, flexible code/development, good dead-code & dependency hygiene (knip) if relevant, for trivial tasks, use judgment.
  • TypeScript: keep imports at the top of the file (no inline imports). Switches over unions/enums must be exhaustive (never in default).

It can be spawned agents for specific tasks, but don't let them run wild. Always review their output and verify it against the real code/real run before accepting it.

Presentation & UX

Build for flexible, context-aware presentation rather than fixed dimensions or one-size layouts.

  • Prefer structures that adapt to the surface (Discord embeds and components, CLI/TUI output, docs, or a future web UI) instead of hard-coded widths, lengths, or one-device assumptions.
  • Keep text readable across contexts: scale or truncate thoughtfully, avoid walls of unreadable output, and preserve hierarchy (title → summary → detail).
  • When content must fit platform limits (e.g. Discord embed caps), truncate safely with a clear indicator rather than failing or overflowing silently.

Knowledge Freshness & Research Preferences

Do not rely solely on your internal knowledge or training data when making implementation decisions. Your memory is frequently outdated.

Before implementing anything non-trivial (especially integrations, tools, SDKs, platforms, AI agents, or architectural patterns):

  1. Actively look up the latest official documentation, release notes, changelogs, and recommended approaches.
  2. Check whether newer versions, official solutions, or better patterns already exist that would change how the task should be approached.
  3. Prefer using current best practices and existing tools over rebuilding something from scratch based on older knowledge.
  4. If there is any uncertainty about the current recommended way to do something, ask clarifying questions instead of defaulting to what you remember.

Why this matters: Defaulting to internal knowledge often leads to outdated implementations. For example, an agent might implement an older pattern for something like MCP or an AI agent integration simply because that is what it "knows," without checking whether a newer release, official SDK, or simpler approach has become available. Always verify first.

Testing & Verification Preferences

Do not create test files or full test suites by default.

Only keep automated tests when they provide clear and lasting value. Good candidates include complex business logic, algorithms with meaningful edge cases, high-risk code (security, concurrency, money), or behavior that is expensive to verify manually over time.

Do not keep tests for:

  • Trivial code (simple getters/setters, constructors without logic, pure data classes)
  • Configuration, constants, or one-off scripts
  • Simple CRUD, glue code, or thin wrappers
  • Anything where the cost of writing and maintaining the test outweighs its value

Temporary tests while working: You may write short-lived tests to reproduce a bug, drive a fix, or check an edge case. When the work is done, delete those tests unless they meet the keep-criteria above. Do not leave session-only or glue tests in the repo.

Passing automated tests, scripts, or environment checks does not mean something works correctly or as intended. Automated tests often confirm that code responded or that elements appeared, but they frequently miss whether the intended outcome actually happened for a user.

Real runs over green mocks

Automated tests that mock the network, SDK, or filesystem often stay green while production is broken. Prefer a real run for anything that crosses a boundary (HTTP, Discord API, Claude SDK, git/shell, MCP).

Watch for silent negatives: empty results, "not found," or soft failures that mean "we never checked" or "the request was invalid," not "there is nothing." Prefer failures that surface the real error over empty success.

When a mock/unit test can't catch the bug class (dead URL, wrong query flag, SDK contract, runtime-only import), either:

  1. Verify with a real run / smoke path, or
  2. Keep a narrow contract/integration check that exercises the real boundary — and mark network-dependent tests clearly so they aren't treated as proof of uptime.

Do not treat a large green suite as evidence that integrations work.

When verifying that a feature, flow, or change works:

  • Test it the way a real user would.
  • For anything involving a UI or browser, open the application and perform the actual clicks, navigation, and steps a user would take. Confirm that the final result matches what was intended.
  • Prefer observing the real user-facing outcome over assuming that green tests equal a working feature.

This is especially important when verifying your own changes — the same assumptions that produced the code can also produce tests that pass while the feature remains broken for users.

Systematic Fix Preferences

When fixing a bug, incorrect pattern, anti-pattern, or issue in one place, do not stop at the single occurrence that was reported or noticed.

Many bugs follow recurring patterns (missing checks, incorrect error handling, copy-pasted logic, deprecated usage, etc.). Leaving the same problem elsewhere creates inconsistency and technical debt.

  • Search the codebase for similar instances of the same problem or pattern.
  • Fix all reasonable occurrences that share the same root cause or approach in the same change.
  • Prefer consistent, thorough fixes over narrow one-off patches.

This is especially important for:

  • Security-related issues
  • Repeated error handling or validation
  • Copy-pasted or duplicated logic
  • Deprecated or incorrect patterns that appear in multiple places

Keep the scope proportional. Do not turn a focused fix into a large unrelated refactor — limit the change to the same class of problem.

Claimed vs Wired

Do not ship half-features: APIs, Maps, helpers, or modules that nothing calls, or PR claims that the code does not actually do.

  • Either finish the wiring end-to-end (call sites, control paths, cancel/status) or do not land the claim.
  • Prefer deleting unused scaffolding over leaving dead "future" code that looks complete.

Concurrency & Shared State

When touching session, AbortController, query, or similar shared state:

  • State explicitly whether it is per-channel (or per-session/thread) or global.
  • Verify both: the intended isolation path and that other channels/sessions are not aborted, overwritten, or left stale.
  • Get/set/clear keys must be symmetric (same default key when an id is omitted).

Think Before Coding

Don't assume. Don't hide confusion. Surface tradeoffs.

Before implementing:

  • State your assumptions explicitly. If uncertain, ask.
  • If multiple interpretations exist, present them — don't pick silently.
  • If a simpler approach exists, say so. Push back when warranted.
  • If something is unclear, stop. Name what's confusing. Ask.

Simplicity First

Minimum code that solves the problem. Nothing speculative.

  • No features beyond what was asked.
  • No abstractions for single-use code.
  • No "flexibility" or "configurability" that wasn't requested.
  • No error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it.

Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.

Surgical Changes

Touch only what you must. Clean up only your own mess.

When editing existing code:

  • Don't "improve" adjacent code, comments, or formatting.
  • Don't refactor things that aren't broken.
  • Match existing style, even if you'd do it differently.
  • If you notice unrelated dead code, mention it — don't delete it.

When your changes create orphans:

  • Remove imports/variables/functions that YOUR changes made unused.
  • Don't remove pre-existing dead code unless asked.

The test: Every changed line should trace directly to the user's request.

Goal-Driven Execution

Define success criteria. Loop until verified.

Transform tasks into verifiable goals. Prefer real user-facing checks. Use automated tests only when they meet the keep-criteria in Testing & Verification (or as temporary repros you delete afterward):

  • "Add validation" → "Confirm invalid inputs are rejected the way a user would hit them" (keep a unit test only if the logic is high-risk / edge-heavy)
  • "Fix the bug" → "Reproduce it, fix it, confirm the user-facing path works; delete any temporary repro test unless it meets keep-criteria"
  • "Refactor X" → "Ensure existing verification still passes before and after"

For multi-step tasks, state a brief plan:

1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]

Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.


These guidelines are working if: fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, clarifying questions come before implementation rather than after mistakes, and the repo does not accumulate low-value tests.

@README.md - Info about Project, @CHANGELOG.md - Hold changelogs,

Download now (ZIP)

  • 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 28,693 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.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.