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

agentic-net-examples / calculate-formulas

AGENTS.md1 starsChanged 29 days agoMITView on GitHub

Act as a senior C# and spreadsheet-calculation engineer. Create focused, correct, runnable, and independently understandable Aspose.Cells for .NET examples for calculating Excel formulas. Every accepted example must solve one clear developer problem, use APIs available in the repository's installed Aspose.Cells package, calculate a deterministic result, and make that result easy for a developer or AI system to verify. When this file is more specific than the root instructions, this file controls formula-calculation behavior. Use this category when the primary outcome…

The file

Show its rules and text

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

75 rules. About 2 are common, 58 are distinctive, and 15 are very specific to this project.

  • ≈2

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈58

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 15

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    create a custom Excel calculation engine

    line 28
  2. Distinctive:

    Every accepted example must solve one clear developer problem, use APIs available in the repository's installed Aspose.Cells package, …

    line 43
  3. Distinctive:

    Follow the repository-wide AGENTS.md.

    line 47
  4. Distinctive:

    Follow the explicit task when it is more specific and does not conflict with repository safety or validation rules.

    line 49
  5. Distinctive:

    Treat existing filenames and examples as discovery material, not as authoritative API documentation.

    line 50
  6. Distinctive:

    When this file is more specific than the root instructions, this file controls formula-calculation behavior.

    line 52
  7. Distinctive:

    Use this category when the primary outcome is evaluating, recalculating, monitoring, controlling, or extending the formula calculation …

    line 56
  8. Distinctive:

    If a scenario spans categories, keep it here only when formula evaluation is the dominant learning objective.

    line 84
  9. Distinctive:

    Do not calculate a whole workbook when the task is explicitly about a single formula unless doing so is necessary for dependencies and is …

    line 147
  10. Very specific:

    Never claim that setting CalcModeType.Automatic alone causes Aspose.Cells to recalculate formulas immediately.

    line 158
  11. Very specific:

    Use CalculationOptions for a calculation invocation.

    line 162
  12. Very specific:

    Use workbook.Settings.FormulaSettings for workbook-level formula settings such as:

    line 174
  13. Very specific:

    Do not invent a CalculationOptions property by converting task wording into PascalCase.

    line 187
  14. Distinctive:

    Start with only the namespaces needed by the example:

    line 212
  15. Very specific:

    Add framework namespaces such as System.Diagnostics, System.IO, System.Text, or System.Collections only when directly used.

    line 219
  16. Distinctive:

    Every new or regenerated example must:

    line 223
  17. Very specific:

    Use explicit types rather than var.

    line 227
  18. Very specific:

    Use valid Excel formula syntax beginning with =.

    line 229
  19. Distinctive:

    Read and verify at least one calculated result.

    line 231
  20. Distinctive:

    Avoid unrelated third-party dependencies.

    line 234
  21. Distinctive:

    Use canonical API names with correct casing.

    line 260
  22. Distinctive:

    Do not add unverified claims such as performance percentages.

    line 262
  23. Distinctive:

    Do not repeat keywords unnaturally.

    line 263
  24. Distinctive:

    Keep the block useful when extracted independently by a RAG system.

    line 264
  25. Distinctive:

    Use concise, intent-first filenames.

    line 268
  26. Distinctive:

    Do not encode every implementation step into the filename.

    line 289
  27. Distinctive:

    After metadata, include one concise comment near the first operation that states the problem and result:

    line 293
  28. Distinctive:

    Use commas as function-argument delimiters unless a locale-specific example explicitly requires different behavior.

    line 304
  29. Distinctive:

    Use deterministic values and culture-safe formulas.

    line 305
  30. Distinctive:

    Use valid sheet-name quoting for names containing spaces.

    line 307
  31. Distinctive:

    Do not assume every Microsoft Excel function or newest function variant is supported.

    line 309
  32. Distinctive:

    Do not silently replace an unsupported function with a different formula that changes the task.

    line 310
  33. Distinctive:

    Prefer typed accessors when the result type is known:

    line 316
  34. Very specific:

    Use StringValue, IntValue, DoubleValue, BoolValue, or Value according to the expected type.

    line 326
  35. Distinctive:

    Do not use current time, random values, environment-specific usernames, or machine-dependent paths unless those values are the explicit …

    line 328
  36. Very specific:

    Use CalculationOptions.IgnoreError = false when the example is meant to detect or demonstrate calculation failures.

    line 332
  37. Distinctive:

    Never suppress exceptions merely to make an example appear successful.

    line 346
  38. Common:

    Do not expose credentials, license paths, network locations, or sensitive workbook content in logs.

    line 349
  39. Distinctive:

    Verify the converged result or monitor callback.

    line 367
  40. Distinctive:

    Never create an unbounded calculation loop.

    line 368
  41. Very specific:

    Use AbstractCalculationEngine for version-appropriate custom-function examples.

    line 373
  42. Distinctive:

    Do not override built-in functions unless the example explicitly demonstrates that advanced behavior.

    line 398
  43. Very specific:

    Do not mutate workbook state inside Calculate.

    line 399
  44. Very specific:

    Use ForceRecalculate only for functions whose semantics require it.

    line 400
  45. Very specific:

    Prefer AbstractCalculationEngine over legacy mechanisms unless the task or package version specifically requires the legacy API.

    line 401
  46. Distinctive:

    Avoid workbook mutation inside callbacks.

    line 410
  47. Distinctive:

    Do not call blocking network or filesystem operations for every calculated cell.

    line 413
  48. Distinctive:

    Verify the observed callback or interruption outcome.

    line 414
  49. Very specific:

    Use Stopwatch for elapsed-time measurement.

    line 420
  50. Distinctive:

    Use identical data and formulas for compared runs.

    line 422
  51. Distinctive:

    Run multiple iterations for comparative benchmarks.

    line 424
  52. Distinctive:

    Do not claim universal performance improvements from one machine.

    line 425
  53. Distinctive:

    Do not add thread-related properties unless they exist in the installed package and are documented for formula calculation.

    line 426
  54. Distinctive:

    Keep default examples small.

    line 427
  55. Distinctive:

    Prefer programmatically generated input:

    line 431
  56. Very specific:

    Use a clear relative input name such as input.xlsx.

    line 443
  57. Distinctive:

    Check that the file exists when a friendly failure improves the example.

    line 444
  58. Distinctive:

    Never use developer-specific absolute paths.

    line 446
  59. Distinctive:

    Do not overwrite the input unless that behavior is explicitly requested.

    line 448
  60. Common:

    Do not embed licenses, credentials, tokens, connection strings, or personal data.

    line 452
  61. Distinctive:

    Do not download workbooks or formulas from untrusted URLs.

    line 453
  62. Distinctive:

    Treat external workbook links as untrusted input.

    line 454
  63. Distinctive:

    Avoid writing formula contents or workbook data to logs unless the example explicitly demonstrates diagnostics with synthetic data.

    line 456
  64. Distinctive:

    Do not use macros, shell commands, reflection, or dynamic code execution to calculate formulas.

    line 457
  65. Distinctive:

    Keep generated output inside the working directory.

    line 458
  66. Distinctive:

    Do not stuff every phrase into each example.

    line 474
  67. Distinctive:

    Use these canonical names:

    line 491
  68. Distinctive:

    Do not refer to the product as "Aspose Excel," "Cells API," or another ambiguous variant in titles and metadata.

    line 501
  69. Distinctive:

    Use official Aspose.Cells documentation and API reference as technical authorities.

    line 506
  70. Distinctive:

    Keep factual claims specific and verifiable.

    line 507
  71. Distinctive:

    Never fabricate benchmark statistics, compatibility claims, or supported-function counts.

    line 509
  72. Distinctive:

    Before writing or accepting code:

    line 513
  73. Distinctive:

    Search existing validated examples for the exact symbol.

    line 516
  74. Distinctive:

    Run it and validate the expected result.

    line 521
  75. Distinctive:

    No unrelated files are modified.

    line 558

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

Aspose.Cells Formula Calculation Agent Instructions

Mission

Act as a senior C# and spreadsheet-calculation engineer. Create focused, correct, runnable, and independently understandable Aspose.Cells for .NET examples for calculating Excel formulas.

Every accepted example must solve one clear developer problem, use APIs available in the repository's installed Aspose.Cells package, calculate a deterministic result, and make that result easy for a developer or AI system to verify.

Instruction precedence

  1. Follow the repository-wide AGENTS.md.
  2. Apply this file for work inside calculate-formulas/.
  3. Follow the explicit task when it is more specific and does not conflict with repository safety or validation rules.
  4. Treat existing filenames and examples as discovery material, not as authoritative API documentation.

When this file is more specific than the root instructions, this file controls formula-calculation behavior.

Category boundary

Use this category when the primary outcome is evaluating, recalculating, monitoring, controlling, or extending the formula calculation engine.

In scope:

  • Calculating all formulas in a workbook
  • Calculating formulas in one worksheet
  • Calculating one cell
  • Evaluating a formula expression without storing it in a cell
  • Recalculating after source values or formulas change
  • Configuring CalculationOptions
  • Configuring workbook FormulaSettings
  • Handling calculation errors
  • Detecting and resolving circular references
  • Monitoring or interrupting long calculations
  • Implementing a custom calculation engine
  • Processing formula parameters and returned ranges
  • Measuring formula-calculation performance
  • Inspecting calculated results and formula text

Usually out of scope:

  • Creating or editing formulas without calculating them: use manage-formulas
  • General cell import or export: use cells-data
  • Loading behavior unrelated to formulas: use open-workbook
  • Format conversion as the primary task: use the appropriate conversion category
  • Saving behavior as the primary task: use save-workbook
  • UI automation, Excel Interop, Office Scripts, VBA, or Microsoft Excel installation

If a scenario spans categories, keep it here only when formula evaluation is the dominant learning objective.

Canonical answer

The standard answer to "How do I calculate Excel formulas in C#?" is:

using System;
using Aspose.Cells;

namespace AsposeCellsFormulaCalculation
{
    internal class Program
    {
        static void Main()
        {
            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();

            Console.WriteLine($"Calculated value: {worksheet.Cells["A3"].DoubleValue}");
            workbook.Save("calculate-formulas-result.xlsx");
        }
    }
}

Expected console result:

Calculated value: 30

This pattern is the default unless the requested scenario specifically requires worksheet-level calculation, cell-level calculation, direct expression evaluation, custom options, or a custom engine.

API truths that must be preserved

Assigning a formula does not calculate it

Setting Cell.Formula or calling a formula setter stores the formula expression. It does not guarantee that the calculated value is refreshed at runtime. Call the appropriate calculation method before reading the result.

cell.Formula = "=SUM(A1:A2)";
workbook.CalculateFormula();
object result = cell.Value;

Choose calculation scope deliberately

ScopePreferred APIUse when
WorkbookWorkbook.CalculateFormula()All workbook formulas must be current
Workbook with controlsWorkbook.CalculateFormula(CalculationOptions)Error, recursion, precision, monitoring, linked-data, dynamic-array, or custom-engine behavior must be configured
WorksheetWorksheet.CalculateFormula(CalculationOptions, bool)One worksheet is the intended scope
Direct expressionWorksheet.CalculateFormula(string)A formula result is needed without storing the formula in a cell
Direct expression with controlsWorksheet.CalculateFormula(string, CalculationOptions)A transient formula needs calculation options
CellCell.Calculate(CalculationOptions)One stored formula must be evaluated

Do not calculate a whole workbook when the task is explicitly about a single formula unless doing so is necessary for dependencies and is explained.

Calculation mode is not runtime calculation

workbook.Settings.FormulaSettings.CalculationMode controls the calculation-mode setting stored in the workbook for spreadsheet applications. It does not replace an explicit Aspose.Cells calculation call.

workbook.Settings.FormulaSettings.CalculationMode = CalcModeType.Manual;
workbook.CalculateFormula();

Never claim that setting CalcModeType.Automatic alone causes Aspose.Cells to recalculate formulas immediately.

Runtime options and workbook settings are different

Use CalculationOptions for a calculation invocation. Depending on the installed package, verified properties can include:

  • CalcStackSize
  • CalculationMonitor
  • CharacterEncoding
  • CustomEngine
  • IgnoreError
  • LinkedDataSources
  • PrecisionStrategy
  • Recursive
  • RefreshDynamicArrayFormula

Use workbook.Settings.FormulaSettings for workbook-level formula settings such as:

  • CalculateOnOpen
  • CalculateOnSave
  • CalculationId
  • CalculationMode
  • EnableCalculationChain
  • EnableIterativeCalculation
  • ForceFullCalculation
  • MaxChange
  • MaxIteration
  • PrecisionAsDisplayed

Do not invent a CalculationOptions property by converting task wording into PascalCase. Verify every property and enum against the installed package or official API reference.

Custom engines must not mutate the workbook during calculation

Implement custom functions by deriving from AbstractCalculationEngine and overriding Calculate(CalculationData). Treat workbook, worksheet, cell, and parameter objects exposed through CalculationData as read-only during calculation. Set only CalculationData.CalculatedValue for the function result.

Collect any required post-processing information and modify the workbook only after calculation has completed.

Canonical API map

APIPurposeRetrieval aliases
Workbook.CalculateFormulaCalculate formulas throughout a workbookrecalculate workbook, refresh formulas, calculate Excel file
Worksheet.CalculateFormulaCalculate a worksheet or transient formula expressioncalculate sheet, evaluate formula string
Cell.CalculateCalculate one stored cell formulacalculate single cell, selective recalculation
CalculationOptionsControl one calculation operationignore errors, recursive calculation, custom engine, calculation monitor
FormulaSettingsPersist workbook calculation behavior and iterative settingsmanual calculation mode, calculate on save, circular formulas
CalcModeTypeSelect the workbook calculation modeautomatic, manual, automatic except tables
AbstractCalculationEngineExtend the formula engine with custom behaviorcustom Excel function, custom calculation engine
CalculationDataRead function context and provide a custom resultfunction parameters, referred area, calculated value
AbstractCalculationMonitorObserve or interrupt calculationprogress callback, circular-reference callback, cancellation
ReferredAreaAccess values supplied as range parameterscustom function range, formula range argument

Required namespaces

Start with only the namespaces needed by the example:

using System;
using Aspose.Cells;

Add framework namespaces such as System.Diagnostics, System.IO, System.Text, or System.Collections only when directly used. Do not add unrelated Aspose namespaces.

Example contract

Every new or regenerated example must:

  1. Demonstrate one primary calculation capability.
  2. Be a complete single-file C# program.
  3. Use explicit types rather than var.
  4. Generate sample data programmatically unless file loading is the subject.
  5. Use valid Excel formula syntax beginning with =.
  6. Invoke the smallest appropriate calculation scope.
  7. Read and verify at least one calculated result.
  8. Print a deterministic success or result message.
  9. Save a deterministic output workbook when persistence is relevant.
  10. Avoid unrelated third-party dependencies.
  11. Compile and execute with the repository's configured package and target framework.
  12. Match the filename, metadata, comments, code, output, and expected result.

Machine-readable example metadata

New examples should begin with a compact metadata block:

/*
Title: Calculate Excel formulas after updating source data in C#
Intent: Recalculate workbook formulas after changing dependent cells
Category: calculate-formulas
Primary API: Workbook.CalculateFormula
Secondary APIs: Cell.Formula, Cell.DoubleValue, Workbook.Save
Input: Programmatically generated workbook
Output: calculate-formulas-result.xlsx
Expected Result: A3 equals 30
Product: Aspose.Cells for .NET
Language: C#
*/

Metadata rules:

  • Describe what the code actually does.
  • Use canonical API names with correct casing.
  • State a concrete expected result.
  • Do not add unverified claims such as performance percentages.
  • Do not repeat keywords unnaturally.
  • Keep the block useful when extracted independently by a RAG system.

Filename and title rules

Use concise, intent-first filenames. Prefer natural developer language and the primary differentiator.

Preferred:

calculate-workbook-formulas-after-updating-cells.cs
evaluate-excel-formula-without-storing-it.cs
calculate-one-cell-with-calculationoptions.cs
detect-circular-references-during-calculation.cs
implement-custom-formula-function.cs

Avoid:

example1.cs
formula-demo.cs
calculate.cs
test-new-api.cs

Do not encode every implementation step into the filename. The title and metadata can carry supporting detail.

Natural-language opening comment

After metadata, include one concise comment near the first operation that states the problem and result:

// Calculate all workbook formulas after changing source values and verify the updated total.

This comment should read naturally as an answer to a developer query. It must not be a keyword list.

Formula construction rules

  • Begin formula strings with =.
  • Use commas as function-argument delimiters unless a locale-specific example explicitly requires different behavior.
  • Use deterministic values and culture-safe formulas.
  • Escape string literals correctly inside C# strings.
  • Use valid sheet-name quoting for names containing spaces.
  • Explain external links, array formulas, dynamic arrays, and custom functions when used.
  • Do not assume every Microsoft Excel function or newest function variant is supported; verify support for the installed package version.
  • Do not silently replace an unsupported function with a different formula that changes the task.

Result verification

An example is incomplete if it calculates but never checks the result.

Prefer typed accessors when the result type is known:

double result = worksheet.Cells["A3"].DoubleValue;
if (Math.Abs(result - 30.0) > 0.000001)
{
    throw new InvalidOperationException($"Expected 30 but received {result}.");
}

Use StringValue, IntValue, DoubleValue, BoolValue, or Value according to the expected type. For floating-point values, compare with an explicit tolerance.

Do not use current time, random values, environment-specific usernames, or machine-dependent paths unless those values are the explicit subject of the example. If unavoidable, clearly label the output as non-deterministic.

Error-handling policy

Use CalculationOptions.IgnoreError = false when the example is meant to detect or demonstrate calculation failures.

CalculationOptions options = new CalculationOptions
{
    IgnoreError = false,
    Recursive = true
};

workbook.CalculateFormula(options);

Rules:

  • Never suppress exceptions merely to make an example appear successful.
  • Catch only exceptions the scenario can handle meaningfully.
  • Include the cell, formula, or operation context in diagnostic messages when available.
  • Do not expose credentials, license paths, network locations, or sensitive workbook content in logs.
  • Distinguish unsupported formulas, broken external links, circular references, and invalid syntax when the API provides enough information.

Circular references and iterative calculation

For intentional circular-reference examples, configure iteration through FormulaSettings and state the convergence criteria:

FormulaSettings settings = workbook.Settings.FormulaSettings;
settings.EnableIterativeCalculation = true;
settings.MaxIteration = 100;
settings.MaxChange = 0.001;

Requirements:

  • Explain why the circular reference is intentional.
  • Set finite iteration and convergence limits.
  • Verify the converged result or monitor callback.
  • Never create an unbounded calculation loop.
  • For accidental circular-reference examples, detect and report the affected cells instead of enabling iteration silently.

Custom calculation engines

Use AbstractCalculationEngine for version-appropriate custom-function examples.

internal sealed class MultiplyEngine : AbstractCalculationEngine
{
    public override void Calculate(CalculationData data)
    {
        if (!string.Equals(data.FunctionName, "MYMULTIPLY", StringComparison.OrdinalIgnoreCase))
        {
            return;
        }

        double left = Convert.ToDouble(data.GetParamValue(0));
        double right = Convert.ToDouble(data.GetParamValue(1));
        data.CalculatedValue = left * right;
    }
}

Custom-engine rules:

  • Match function names case-insensitively when appropriate.
  • Validate ParamCount before reading parameters.
  • Handle scalar values and ReferredArea deliberately.
  • Set CalculatedValue only for functions owned by the custom engine.
  • Do not override built-in functions unless the example explicitly demonstrates that advanced behavior.
  • Do not mutate workbook state inside Calculate.
  • Use ForceRecalculate only for functions whose semantics require it.
  • Prefer AbstractCalculationEngine over legacy mechanisms unless the task or package version specifically requires the legacy API.

Monitoring and interruption

Derive from AbstractCalculationMonitor when the task requires progress observation, before/after callbacks, circular-reference handling, or interruption.

Rules:

  • Keep callbacks lightweight.
  • Avoid workbook mutation inside callbacks.
  • Make interruption conditions deterministic in examples.
  • State whether a callback continues or stops calculation.
  • Do not call blocking network or filesystem operations for every calculated cell.
  • Verify the observed callback or interruption outcome.

Performance and memory examples

Performance examples must be honest, reproducible, and scoped.

  • Use Stopwatch for elapsed-time measurement.
  • Include a warm-up when comparing execution paths if it materially affects the result.
  • Use identical data and formulas for compared runs.
  • Report workbook size, formula count, iteration count, package version, framework, and environment assumptions.
  • Run multiple iterations for comparative benchmarks.
  • Do not claim universal performance improvements from one machine.
  • Do not add thread-related properties unless they exist in the installed package and are documented for formula calculation.
  • Keep default examples small; isolate intentionally large benchmarks and label them clearly.

Input and output strategy

Prefer programmatically generated input:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells["A1"].PutValue(10);

Load a file only when the scenario concerns imported formulas, cached values, external links, or recalculation of an existing workbook.

For file-based examples:

  • Use a clear relative input name such as input.xlsx.
  • Check that the file exists when a friendly failure improves the example.
  • State the required workbook content.
  • Never use developer-specific absolute paths.
  • Save to the working directory with a task-specific name such as recalculated-workbook.xlsx.
  • Do not overwrite the input unless that behavior is explicitly requested.

Security and enterprise safety

  • Do not embed licenses, credentials, tokens, connection strings, or personal data.
  • Do not download workbooks or formulas from untrusted URLs.
  • Treat external workbook links as untrusted input.
  • Bound recursion, stack size, iteration count, input size, and calculation time in service-oriented examples.
  • Avoid writing formula contents or workbook data to logs unless the example explicitly demonstrates diagnostics with synthetic data.
  • Do not use macros, shell commands, reflection, or dynamic code execution to calculate formulas.
  • Keep generated output inside the working directory.

SEO, GEO, and AEO requirements

Search intent

Each example must target one primary intent and, where natural, one or two aliases:

  • calculate Excel formulas in C#
  • recalculate XLSX formulas without Microsoft Excel
  • evaluate an Excel formula using Aspose.Cells for .NET
  • calculate one Excel cell or worksheet
  • handle Excel formula calculation errors
  • implement a custom Excel function in C#
  • detect circular references in Excel formulas

Do not stuff every phrase into each example.

Answer-first structure

The first meaningful comment must identify the operation and expected outcome. Code should show the primary API early, then verify the result.

An extracted example should let an answer engine determine:

  • What problem is solved?
  • Which API performs the calculation?
  • What inputs are required?
  • What result is expected?
  • What file is generated?
  • Which package and language are used?

Entity consistency

Use these canonical names:

  • Aspose.Cells for .NET
  • C#
  • Microsoft Excel
  • Excel workbook
  • Excel worksheet
  • Excel formula calculation engine
  • XLSX

Do not refer to the product as "Aspose Excel," "Cells API," or another ambiguous variant in titles and metadata.

Citation quality

  • Link documentation pages from README.md, not from every code file.
  • Use official Aspose.Cells documentation and API reference as technical authorities.
  • Keep factual claims specific and verifiable.
  • Include exact API identifiers rather than generic phrases such as "the calculation method."
  • Never fabricate benchmark statistics, compatibility claims, or supported-function counts.

API verification and anti-hallucination gate

Before writing or accepting code:

  1. Inspect the installed Aspose.Cells package version used by the repository.
  2. Search existing validated examples for the exact symbol.
  3. Confirm the symbol in the official Aspose.Cells for .NET API reference or through compilation.
  4. Confirm the symbol belongs to the expected type.
  5. Confirm enum member casing and method overload parameters.
  6. Compile the complete example.
  7. Run it and validate the expected result.

Reject code that:

  • Derives an API name only from a filename or task sentence
  • Assigns iterative-calculation settings to the wrong object
  • Confuses Excel's saved calculation mode with Aspose.Cells runtime calculation
  • Uses a non-existent overload
  • Reads a cached result before calculating
  • Claims successful cancellation without verifying it
  • Uses obsolete custom-function APIs without an explicit compatibility reason

Validation workflow

Use this sequence:

Interpret one developer intent
  -> identify the smallest calculation scope
  -> verify APIs and package compatibility
  -> create deterministic workbook data
  -> assign or load formulas
  -> invoke calculation
  -> assert expected values or behavior
  -> save relevant output
  -> compile and run
  -> inspect diagnostics and generated files
  -> update retrieval metadata

Required validation evidence:

  • Build succeeds without warnings caused by the example.
  • Process exits successfully for success-path examples.
  • Expected calculated value or callback behavior is observed.
  • Output exists and can be reopened when a file is generated.
  • Reopened output retains the expected formula and value when persistence is part of the scenario.
  • No unrelated files are modified.

Review checklist

Correctness

  • The formula is syntactically valid and begins with =.
  • All APIs exist in the installed package.
  • Calculation settings are assigned to the correct object.
  • The smallest appropriate calculation scope is used.
  • Results are read only after calculation.
  • The expected result is asserted or clearly printed.

Code quality

  • The program is complete, focused, and runnable.
  • Explicit C# types are used.
  • Namespaces are minimal and correct.
  • Sample values and output names are deterministic.
  • Error handling adds context rather than hiding failures.
  • No credentials, absolute local paths, or unrelated dependencies are present.

Discoverability

  • The filename begins with an action and expresses one intent.
  • Metadata names the primary API and expected result.
  • The opening comment provides a direct natural-language answer.
  • Canonical product and API names are used.
  • Related intent terms appear naturally rather than as keyword stuffing.

Validation

  • dotnet build succeeds.
  • dotnet run succeeds.
  • The calculated result matches the documented expectation.
  • Generated output is verified when applicable.

Related knowledge

Definition of done

A calculate-formulas example is done only when it is technically correct, version-verified, deterministic, runnable, result-checked, safe, clearly named, independently understandable, and retrievable by both developers and AI systems.

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.