agentleFS
hby7921hby7921/BannerlordSage/AGENTS.md

BannerlordSage

AGENTS.md21 starsChanged 8 months agoMITView on GitHub

This repository is a Windows-first MCP server for Mount & Blade II: Bannerlord. Use this file when an AI coding agent is asked to inspect, install, configure, verify, or run this repo. Help the user get BannerlordSage installed and running against a local Bannerlord installation. When you first open this repo, read these files before making assumptions: If the user wants a normal install, use this order: If the user needs the authoring helpers too: Recommended MCP entry: If the…

  • 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 33,398 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 repositoryOne other file it gives its agents.

The file

Show its rules and text

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

24 rules. About 0 are common, 14 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this file when an AI coding agent is asked to inspect, install, configure, verify, or run this repo.

    line 5
  2. Distinctive:

    Never invent a game path; ask for it or discover it from local context

    line 24
  3. Very specific:

    Do not commit dist/, extracted game assets, SQLite databases, or local secrets

    line 25
  4. Distinctive:

    When you first open this repo, read these files before making assumptions:

    line 29
  5. Distinctive:

    If the user wants a normal install, use this order:

    line 40
  6. Distinctive:

    Start the MCP server:

    line 52
  7. Distinctive:

    If the user needs the authoring helpers too:

    line 55
  8. Distinctive:

    If the user wants the full toolset:

    line 71
  9. Distinctive:

    Use one of these:

    line 83
  10. Very specific:

    If the workspace contains src/, the repo automatically uses that as the effective source root.

    line 89
  11. Distinctive:

    Use these tools deliberately:

    line 116
  12. Distinctive:

    Default operating rules for AI agents:

    line 125
  13. Very specific:

    Before answering questions about past decisions, prior fixes, user preferences, rejected approaches, or ongoing task state, call …

    line 128
  14. Very specific:

    Use project_memory_add for one important entry.

    line 130
  15. Very specific:

    After a task completes, store one short session memory only if the session produced reusable knowledge that would matter in a future thread.

    line 132
  16. Very specific:

    When a previous conclusion is no longer true, call project_memory_invalidate on the old memory instead of silently adding a conflicting …

    line 133
  17. Very specific:

    Keep the summary to one line.

    line 153
  18. Very specific:

    Keep text concrete and self-contained.

    line 154
  19. Distinctive:

    Prefer one memory per conclusion.

    line 155
  20. Very specific:

    Use workspace, topic, and kind consistently.

    line 156
  21. Very specific:

    Add source when a file, issue, or session label would help future lookup.

    line 157
  22. Distinctive:

    Prefer using the repo's real scripts instead of inventing new setup steps

    line 161
  23. Distinctive:

    Prefer placeholder paths in docs and examples

    line 162
  24. Distinctive:

    If asked to improve the docs, keep the README focused on:

    line 165

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

BannerlordSage Agent Guide

This repository is a Windows-first MCP server for Mount & Blade II: Bannerlord.

Use this file when an AI coding agent is asked to inspect, install, configure, verify, or run this repo.

Primary Goal

Help the user get BannerlordSage installed and running against a local Bannerlord installation.

What This Repo Does

  • imports Bannerlord XML from a local game install
  • decompiles official Bannerlord DLLs
  • builds SQLite indexes
  • exposes MCP tools for Bannerlord querying, modding, and reverse engineering
  • can also index and read the user's own local mod source workspace

Important Constraints

  • This repo does not include Bannerlord assets
  • The user must have a legitimate local Bannerlord installation
  • Commands that use --game-dir require the user's real local path
  • Never invent a game path; ask for it or discover it from local context
  • Do not commit dist/, extracted game assets, SQLite databases, or local secrets

First Files To Read

When you first open this repo, read these files before making assumptions:

  1. README.md
  2. package.json
  3. src/server.ts
  4. src/entrypoints/bannerlord-stdio.ts
  5. src/entrypoints/bannerlord-full-stdio.ts
  6. src/entrypoints/bannerlord-setup.ts

Standard Human Install Flow

If the user wants a normal install, use this order:

  1. Install prerequisites:
    • Bun
    • ripgrep
    • .NET SDK 8+
    • ILSpyCmd
  2. Install repo dependencies:
    • bun install
  3. Run Bannerlord setup:
    • bun run setup:bannerlord -- --game-dir "<BANNERLORD_GAME_DIR>"
    • setup indexes local decompiled source/XML plus public official/community docs and official API search data by default; use --skip-docs only for offline setup
  4. Start the MCP server:
    • bun run start:bannerlord

If the user needs the authoring helpers too:

  • bun run start:bannerlord:full

MCP Client Config

Recommended MCP entry:

[mcp_servers.bannerlordsage]
command = "bun"
args = ["run", "src/entrypoints/bannerlord-stdio.ts"]
cwd = "<REPO_DIR>"
enabled = true

If the user wants the full toolset:

[mcp_servers.bannerlordsage]
command = "bun"
args = ["run", "src/entrypoints/bannerlord-full-stdio.ts"]
cwd = "<REPO_DIR>"
enabled = true

If The User Wants Their Own Mod Source Indexed

Use one of these:

  • pass workspaceRoot directly to the mod-source tools
  • set BANNERSAGE_MOD_SOURCE_DIR
  • set BANNERSAGE_BANNERLORD_MOD_SOURCE_DIR

If the workspace contains src/, the repo automatically uses that as the effective source root.

Important Commands

  • bun run setup:bannerlord
  • bun run start:bannerlord
  • bun run start:bannerlord:full
  • bun run index:gameplay
  • bun run index:docs
  • bun run index:api-docs
  • bun run index:mod-source -- --source-dir "<MOD_SOURCE_DIR>"
  • bun run verify:bannerlord -- --game-dir "<BANNERLORD_GAME_DIR>"
  • bun run smoke:release
  • bun run report:scopes -- --game-dir "<BANNERLORD_GAME_DIR>"

Validation

Minimum pre-release check:

  • bun run smoke:release

Stronger local validation:

  • bun run verify:bannerlord -- --game-dir "<BANNERLORD_GAME_DIR>"

Project Memory Workflow

Use these tools deliberately:

  • project_memory_wakeup
  • project_memory_search
  • project_memory_add
  • project_memory_capture_session
  • project_memory_recent
  • project_memory_invalidate

Default operating rules for AI agents:

  1. At the start of a new task or resumed thread, call project_memory_wakeup for the active workspace before making assumptions.
  2. Before answering questions about past decisions, prior fixes, user preferences, rejected approaches, or ongoing task state, call project_memory_search first.
  3. Store decision, pitfall, and preference memories only when they are likely to matter again.
  4. Use project_memory_add for one important entry.
  5. Near the end of a meaningful task, prefer project_memory_capture_session over a burst of manual single-entry writes.
  6. After a task completes, store one short session memory only if the session produced reusable knowledge that would matter in a future thread.
  7. When a previous conclusion is no longer true, call project_memory_invalidate on the old memory instead of silently adding a conflicting replacement.

What to store:

  • decisions with rationale
  • pitfalls with symptom and fix
  • user preferences that are likely to recur
  • durable TODOs or follow-up constraints
  • release or validation findings that future sessions need

What not to store:

  • temporary shell output
  • large code dumps
  • facts already covered by the indexed game data or source tools
  • obvious one-off steps with no reuse value
  • speculative ideas that were not acted on

Quality bar for each memory:

  • Keep the summary to one line.
  • Keep text concrete and self-contained.
  • Prefer one memory per conclusion.
  • Use workspace, topic, and kind consistently.
  • Add source when a file, issue, or session label would help future lookup.

If You Are An AI Agent

  • Prefer using the repo's real scripts instead of inventing new setup steps
  • Prefer placeholder paths in docs and examples
  • Explain clearly that workspaceRoot? means an optional local workspace path
  • Explain clearly that --game-dir points to the user's local Bannerlord install
  • If asked to improve the docs, keep the README focused on:
    • tool list
    • install/configure steps
    • MCP client setup
    • mod-source setup

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.