agentleFS
aspose-cellsaspose-cells/agentic-net-examples/manage-formulas/AGENTS.md

agentic-net-examples / manage-formulas

AGENTS.md1 starsChanged 29 days agoMITView on GitHub

Create focused examples for authoring, editing, copying, inspecting, auditing, and organizing Excel formulas with Aspose.Cells for .NET. Follow ../AGENTS.md. This category manages formula expressions and relationships. Use calculate-formulas when evaluation, calculation options, custom engines, monitoring, or calculation performance is the dominant intent. In scope: standard/local/R1C1 formulas, shared and array formulas, dynamic arrays, table calculated columns, named ranges, external references, precedents/dependents, formula search/replacement, auditing, validation, locking formula cells, and calculation-mode coordination after edits. Each example must identify formula type, target cell/range,…

The file

Show its rules and text

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

14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Create focused examples for authoring, editing, copying, inspecting, auditing, and organizing Excel formulas with Aspose.Cells for .NET.

    line 19
  2. Distinctive:

    Use valid sheet quoting and absolute/relative references deliberately.

    line 45
  3. Distinctive:

    Do not perform naive string replacement when formula token boundaries, quoted strings, or external links can change meaning.

    line 46
  4. Distinctive:

    Verify supported functions and dynamic-array behavior for the installed package.

    line 47
  5. Distinctive:

    Treat external workbook links and user-provided formulas as untrusted input.

    line 48
  6. Distinctive:

    Do not label Excel functions "deprecated" without an authoritative source and compatibility rationale.

    line 49
  7. Distinctive:

    Use stable, valid Excel names and avoid collisions with cell references.

    line 74
  8. Very specific:

    Update RefersTo with valid formula syntax and verify dependent formulas after recalculation.

    line 76
  9. Distinctive:

    Treat precedent/dependent results as potentially spanning worksheets/workbooks.

    line 77
  10. Distinctive:

    Do not claim a complete dependency graph from an API that returns only direct relationships.

    line 78
  11. Distinctive:

    Do not overwrite spill ranges or table-managed columns accidentally.

    line 83
  12. Distinctive:

    Verify every resulting cell or the expected spilled range.

    line 84
  13. Distinctive:

    Use the API designed for the formula type instead of copying text manually.

    line 85
  14. Distinctive:

    Never fetch external workbooks or execute arbitrary code from formula text.

    line 97

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

Formula Management Agent Instructions

Mission and category boundary

Create focused examples for authoring, editing, copying, inspecting, auditing, and organizing Excel formulas with Aspose.Cells for .NET. Follow ../AGENTS.md.

This category manages formula expressions and relationships. Use calculate-formulas when evaluation, calculation options, custom engines, monitoring, or calculation performance is the dominant intent.

Scope

In scope: standard/local/R1C1 formulas, shared and array formulas, dynamic arrays, table calculated columns, named ranges, external references, precedents/dependents, formula search/replacement, auditing, validation, locking formula cells, and calculation-mode coordination after edits.

Canonical API map

IntentAPIs
Assign standard formulaCell.Formula or verified SetFormula overload
Localized formulaCell.FormulaLocal
R1C1 formulaVersion-supported R1C1 property/method
Array formulaSetArrayFormula / dynamic-array APIs verified for the package
Shared formulaSetSharedFormula
Named rangeNameCollection, Name.RefersTo, range APIs
Audit dependenciesGetPrecedents, GetDependents, calculation-specific dependency APIs as documented
Evaluate after editingWorkbook.CalculateFormula from the calculation workflow

Hard rules

  • Begin formula strings with = and use documented invariant syntax unless FormulaLocal is explicitly required.
  • Distinguish formula text from calculated value.
  • Recalculate before asserting a result, but keep calculation mechanics secondary here.
  • Use valid sheet quoting and absolute/relative references deliberately.
  • Do not perform naive string replacement when formula token boundaries, quoted strings, or external links can change meaning.
  • Verify supported functions and dynamic-array behavior for the installed package.
  • Treat external workbook links and user-provided formulas as untrusted input.
  • Do not label Excel functions "deprecated" without an authoritative source and compatibility rationale.

Canonical pattern

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];

worksheet.Cells["A1"].PutValue(10);
worksheet.Cells["A2"].PutValue(20);
worksheet.Cells["A3"].Formula = "=SUM(A1:A2)";

workbook.CalculateFormula();
double result = worksheet.Cells["A3"].DoubleValue;

if (Math.Abs(result - 30.0) > 0.000001)
{
    throw new InvalidOperationException("Formula result was not 30.");
}

workbook.Save("managed-formula.xlsx");

Named ranges and dependencies

  • Use stable, valid Excel names and avoid collisions with cell references.
  • State workbook versus worksheet scope.
  • Update RefersTo with valid formula syntax and verify dependent formulas after recalculation.
  • Treat precedent/dependent results as potentially spanning worksheets/workbooks.
  • Do not claim a complete dependency graph from an API that returns only direct relationships.

Array, shared, and table formulas

  • State target range dimensions and anchor cell.
  • Do not overwrite spill ranges or table-managed columns accidentally.
  • Verify every resulting cell or the expected spilled range.
  • Use the API designed for the formula type instead of copying text manually.

Example contract

Each example must identify formula type, target cell/range, expression, dependencies, primary API, expected formula text/value, and output. Use deterministic data and concise action-first filenames.

Metadata and the opening comment should answer one intent such as "set SUM formula in C#," "create named range formula," or "find formula precedents." Avoid keyword stuffing.

Security and validation

  • Validate user-supplied formulas against an allowlist/policy appropriate to the application.
  • Audit external links, volatile functions, hidden-sheet references, and formula injection risks.
  • Never fetch external workbooks or execute arbitrary code from formula text.
  • Compile, run, verify stored formula text, calculate when required, assert values/dependencies, save/reopen, and confirm persistence.

Reject invented functions/APIs, unsafe text replacement, broken references, unsupported compatibility claims, and results read before calculation.

Related knowledge

Definition of done

The example is done when formula type, syntax, target, dependencies, security assumptions, stored expression, calculated result where relevant, and persistence 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.