agentleFS
sbroennesbroenne/mcp-server-excel/tests/AGENTS.md

mcp-server-excel / tests

AGENTS.md803 starsChanged 56 days agoMITView on GitHub

Follow the repository rules. These are implementation instructions; review tasks use the root Code Review Rules. Use scripts\Test-ExcelBehavior.ps1 -Project <name> -Filter <filter> for required affected Excel behavior validation and retain its results. Use -Full for ordered, reconciled acceptance, not during every commit. Commit-hook scope is unchanged. The runner sets hard execution deadlines; returning control while a test keeps running is not a timeout. Session/batch infrastructure changes also require relevant ComInterop OnDemand tests. Core OnDemand tests are optional diagnostics, not mandatory…

  • 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 repository6 other files it gives its agents.

The file

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

7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow the repository rules.

    line 3
  2. Very specific:

    Use scripts\Test-ExcelBehavior.ps1 -Project <name> -Filter <filter> for required affected Excel behavior validation and retain its results.

    line 8
  3. Very specific:

    Follow nearby trait conventions: Category, Feature, Layer, RequiresExcel, Speed, and RunType where applicable.

    line 32
  4. Distinctive:

    Verify inside the test after the operation and before cleanup.

    line 41
  5. Distinctive:

    Do not assume failed operations automatically roll back or clean up workbook changes.

    line 48
  6. Very specific:

    Do not call batch.Save() for in-memory assertions.

    line 71
  7. Distinctive:

    Test design and failure investigation: tests/README.md.

    line 74

≈ “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

Testing strategy

Follow the repository rules. These are implementation instructions; review tasks use the root Code Review Rules.

Commands

Use scripts\Test-ExcelBehavior.ps1 -Project <name> -Filter <filter> for required affected Excel behavior validation and retain its results. Use -Full for ordered, reconciled acceptance, not during every commit. Commit-hook scope is unchanged. The runner sets hard execution deadlines; returning control while a test keeps running is not a timeout. Session/batch infrastructure changes also require relevant ComInterop OnDemand tests. Core OnDemand tests are optional diagnostics, not mandatory CI gates. VBA needs Trust Center access; run screenshots separately because they use desktop/clipboard resources.

Commands and prerequisites: tests/README.md.

Fixtures and assertions

  • Public workbook behavior requires real Excel and defaults to ExcelMcpService.ProcessAsync, not mocked IExcelBatch or direct Core. Direct Core needs a named internal contract Service cannot expose. Pure parsing, mapping, serialization, and generator tests need no Excel.
  • Independent Facts/Theories must isolate their state, even with a reviewed class fixture. Do not combine class and collection fixtures on one class. Lifecycle, transport, global-state, and raw-COM capability tests retain the actual boundary and isolation their subject requires.
  • Cleanup always runs, preserves primary and cleanup failures, and never silently recreates a failed shared session.
  • Follow nearby trait conventions: Category, Feature, Layer, RequiresExcel, Speed, and RunType where applicable. Every discovered test must resolve to exactly one RequiresExcel=true or false value.
  • Excel and other global-state tests belong to an explicitly non-parallel collection; separate Excel testhosts must not overlap. RequiresExcel=false alone does not establish parallel safety or low cost.
  • Positive tests assert successful prerequisites and verification responses, then concrete workbook state and returned fields. Setup failure or an expected error is not a successful positive test.
  • Verify inside the test after the operation and before cleanup. No exception, success alone, object existence, or a loose count is not an outcome check. Replacements prove old/new state; refresh changes the source first; persistence checks exact reopened contents.
  • Negative tests check the intended error and preserved state, rollback, or unusable-session/recovery behavior promised by that operation. Ask whether the test would fail for a no-op, wrong target, or partial change before error.
  • Do not assume failed operations automatically roll back or clean up workbook changes. Assert the actual partial state and error; leave cleanup decisions to the caller unless rollback is an explicit operation contract.
  • Cleanup may terminate only exact owned identities using PID plus start time and retained handles. Never kill unrelated Excel processes. Fixture COM access follows COM safety.

Fixture, template, raw-COM/OOXML, and parallel-safety procedures: tests/README.md.

Entry-point and migration coverage

CLI and MCP tests cover adapter responsibilities, not a second full workbook matrix. Preserve adapter regressions and real Excel smokes; do not shorten production waits for test speed.

Adapter test design: CLI and MCP coverage. Migration case mapping and final-source evidence: Complete normal-suite verification.

Save and round-trip behavior

Do not call batch.Save() for in-memory assertions. When testing persistence, save/close and reopen in a new batch before asserting. Use .xlsm for VBA.

Test design and failure investigation: tests/README.md.

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.