agentleFS
aspose-cellsaspose-cells/agentic-net-examples/macro-project/AGENTS.md

agentic-net-examples / macro-project

AGENTS.md1 starsChanged 2 months agoMITView on GitHub

Create focused Aspose.Cells for .NET examples for VBA project inspection and preservation, module editing, references, protection, and digital signatures. Follow ../AGENTS.md. Aspose.Cells manages VBA project content; examples must never claim that macros are executed by Aspose.Cells. Treat all VBA code and references as untrusted active content. In scope: Workbook.VbaProject, modules, code, module names/types, copying projects/modules, COM references, designer storage, protection, signatures, validation, macro assignment, and macro-enabled save formats. Keep general workbook signatures in encryption-and-protection and ordinary workbook saving in save-workbook.

The file

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

9 rules. About 1 is common, 5 are distinctive, and 3 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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. Very specific:

    Create focused Aspose.Cells for .NET examples for VBA project inspection and preservation, module editing, references, protection, and …

    line 19
  2. Very specific:

    Keep general workbook signatures in encryption-and-protection and ordinary workbook saving in save-workbook.

    line 27
  3. Distinctive:

    Never save to XLSX while claiming VBA is preserved.

    line 32
  4. Distinctive:

    Do not execute, compile, or trust imported VBA code.

    line 33
  5. Distinctive:

    Do not add system COM references unless the task requires them and the environment dependency is explicit.

    line 34
  6. Common:

    Use test certificates only.

    line 35
  7. Very specific:

    Verify VbaProject.IsValidSigned or current equivalent only after reopening where signature persistence matters.

    line 38
  8. Distinctive:

    Avoid logging complete production macro source.

    line 64
  9. Distinctive:

    Keep certificate access platform-aware and CI-safe.

    line 66

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

VBA and Macro Project Agent Instructions

Mission and security posture

Create focused Aspose.Cells for .NET examples for VBA project inspection and preservation, module editing, references, protection, and digital signatures. Follow ../AGENTS.md.

Aspose.Cells manages VBA project content; examples must never claim that macros are executed by Aspose.Cells. Treat all VBA code and references as untrusted active content.

Scope

In scope: Workbook.VbaProject, modules, code, module names/types, copying projects/modules, COM references, designer storage, protection, signatures, validation, macro assignment, and macro-enabled save formats.

Keep general workbook signatures in encryption-and-protection and ordinary workbook saving in save-workbook.

Hard rules

  • Save macro-bearing workbooks in macro-capable formats such as XLSM or XLSB as appropriate.
  • Never save to XLSX while claiming VBA is preserved.
  • Do not execute, compile, or trust imported VBA code.
  • Do not add system COM references unless the task requires them and the environment dependency is explicit.
  • Use test certificates only; never embed private-key passwords or real certificates.
  • Distinguish a valid signature from an unchanged signature: modifying VBA normally invalidates/removes prior trust.
  • Preserve module attributes and designer storage when copying them is the intent.
  • Verify VbaProject.IsValidSigned or current equivalent only after reopening where signature persistence matters.

Canonical inspection pattern

Workbook workbook = new Workbook("input.xlsm");
VbaProject project = workbook.VbaProject;

Console.WriteLine($"Module count: {project.Modules.Count}");
foreach (VbaModule module in project.Modules)
{
    Console.WriteLine(module.Name);
}

workbook.Save("macro-project-copy.xlsm", SaveFormat.Xlsm);

Example contract

Each example must state whether it inspects, modifies, copies, protects, or signs VBA; identify input/output macro format; use synthetic harmless VBA; and verify module/reference/signature state.

Metadata must include macro operation, primary API, trust assumptions, output format, and expected result. Prefer filenames such as list-vba-modules-in-xlsm.cs.

Enterprise safety and validation

  • Analyze or display VBA as text only; never invoke it.
  • Avoid logging complete production macro source.
  • Reject external reference paths from untrusted inputs.
  • Keep certificate access platform-aware and CI-safe.
  • Save/reopen and compare module count, names, code hashes or reference metadata as appropriate.
  • Confirm that non-macro formats intentionally remove VBA when removal is the scenario.

Reject examples that use nonexistent module constructors, assume COM libraries are installed, expose secrets, or claim signature validity after project modification without verification.

SEO, GEO, and AEO

Target one direct intent such as "read VBA modules from XLSM in C#," "copy Excel macros," or "sign a VBA project." State clearly that Aspose.Cells manages but does not execute VBA.

Related knowledge

Definition of done

The example is done when active-content risk, macro format, operation, environment dependencies, and post-save project/signature state are explicit and verified.

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.