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

agentic-net-examples / cells-data

AGENTS.md1 starsChanged 2 months agoMITView on GitHub

Create focused, runnable Aspose.Cells for .NET examples for working with Excel cell data. Follow ../AGENTS.md, then these category rules. Existing filenames are discovery hints, not proof that an API exists. In scope: A1 and row/column access, typed values, formatted and raw values, enumeration, search/replace, bulk import, sorting, validation, conversion of numeric strings, rich text, hyperlinks, subtotals, and data-oriented audits. Use another category when the dominant intent is styling (format-cells), formulas (manage-formulas), ranges (managing-ranges), or row/column structure (rows-and-columns). Every example must…

The file

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

12 rules. About 1 is common, 7 are distinctive, and 4 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Create focused, runnable Aspose.Cells for .NET examples for working with Excel cell data.

    line 19
  2. Very specific:

    Use another category when the dominant intent is styling (format-cells), formulas (manage-formulas), ranges (managing-ranges), or …

    line 25
  3. Very specific:

    Use PutValue rather than assigning through the cell indexer.

    line 44
  4. Distinctive:

    Treat imported HTML, hyperlinks, CSV, JSON, and external paths as untrusted input.

    line 49
  5. Distinctive:

    Keep sorting keys, validation areas, and import offsets explicit and verify them after execution.

    line 50
  6. Distinctive:

    Do not use current culture implicitly for parsing.

    line 51
  7. Very specific:

    Every example must demonstrate one primary data operation, use explicit types, generate deterministic data where possible, verify a …

    line 86
  8. Distinctive:

    Prefer bulk import APIs for arrays and object collections rather than repeated per-cell writes.

    line 92
  9. Distinctive:

    Do not claim thread safety broadly.

    line 95
  10. Distinctive:

    Never mutate a workbook concurrently without an explicitly documented safe pattern.

    line 96
  11. Common:

    Avoid credentials, personal data, UNC paths, and developer-specific absolute paths.

    line 103
  12. Distinctive:

    Verify exact methods, overloads, enums, and option properties against the installed package or official API reference.

    line 114

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

Cell Data Agent Instructions

Mission and precedence

Create focused, runnable Aspose.Cells for .NET examples for working with Excel cell data. Follow ../AGENTS.md, then these category rules. Existing filenames are discovery hints, not proof that an API exists.

Scope

In scope: A1 and row/column access, typed values, formatted and raw values, enumeration, search/replace, bulk import, sorting, validation, conversion of numeric strings, rich text, hyperlinks, subtotals, and data-oriented audits.

Use another category when the dominant intent is styling (format-cells), formulas (manage-formulas), ranges (managing-ranges), or row/column structure (rows-and-columns).

Canonical APIs

IntentPreferred APIs
Write a valueCell.PutValue
Read a typed valueValue, StringValue, IntValue, DoubleValue, BoolValue, DateTimeValue
Access a cellworksheet.Cells["A1"] or worksheet.Cells[row, column]
Bulk importImportArray, ImportTwoDimensionArray, ImportCustomObjects, ImportData
SearchCells.Find, FindOptions
EnumerateCells.GetEnumerator, row/column enumerators, MaxDisplayRange
Convert numeric textCells.ConvertStringToNumericValue
SortWorkbook.DataSorter, DataSorter, CellArea
Validate inputValidation, ValidationCollection, CellArea
Rich textCell.Characters, Cell.SetCharacters, FontSetting

Hard rules

  • Use PutValue rather than assigning through the cell indexer.
  • Preserve data types; do not stringify numbers, dates, or booleans without a stated reason.
  • Remember that numeric row and column indexes are zero-based.
  • Distinguish raw values from formatted display strings.
  • Bound enumeration to used or display ranges where practical; avoid scanning an entire worksheet grid.
  • Treat imported HTML, hyperlinks, CSV, JSON, and external paths as untrusted input.
  • Keep sorting keys, validation areas, and import offsets explicit and verify them after execution.
  • Do not use current culture implicitly for parsing; specify culture when the scenario depends on it.

Canonical pattern

using System;
using Aspose.Cells;

namespace AsposeCellsCellData
{
    internal class Program
    {
        static void Main()
        {
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];
            Cell cell = worksheet.Cells["A1"];

            cell.PutValue(125.50);
            double value = cell.DoubleValue;

            if (Math.Abs(value - 125.50) > 0.000001)
            {
                throw new InvalidOperationException("Unexpected cell value.");
            }

            workbook.Save("cell-data-result.xlsx");
            Console.WriteLine($"A1 value: {value}");
        }
    }
}

Example contract

Every example must demonstrate one primary data operation, use explicit types, generate deterministic data where possible, verify a concrete value/count/address, save only when persistence matters, and compile against the repository package.

New examples should start with metadata naming Title, Intent, Category, Primary API, Input, Output, and Expected Result. Use concise action-first filenames such as write-datetime-value-to-excel-cell.cs.

Bulk data and performance

  • Prefer bulk import APIs for arrays and object collections rather than repeated per-cell writes.
  • State starting row/column and whether headers are imported.
  • Compare equivalent workloads in benchmarks and report dimensions and iterations.
  • Do not claim thread safety broadly; enable documented multi-thread reading only for supported read-only scenarios.
  • Never mutate a workbook concurrently without an explicitly documented safe pattern.

Validation and security

  • Validate nulls, types, bounds, duplicate keys, and culture-sensitive conversions.
  • Neutralize or reject untrusted spreadsheet formulas when importing user-controlled text if formula injection is a risk.
  • Reject javascript: and unsafe external links in sanitization examples.
  • Avoid credentials, personal data, UNC paths, and developer-specific absolute paths.
  • Reopen saved output when persistence or type preservation is the subject.

SEO, GEO, and AEO

Target one natural intent such as "write data to Excel in C#," "read cell value with Aspose.Cells," or "import an array into Excel." The opening comment must state the operation and expected result. Use canonical product/API names and avoid keyword stuffing.

An extracted example must reveal the input type, target cell/range, primary API, expected value, and output file without external context.

Anti-hallucination and review gate

Verify exact methods, overloads, enums, and option properties against the installed package or official API reference. Compile and run. Reject code that invents collection indexers, scans unbounded grids, loses data types unintentionally, or claims validation without checking the result.

Review checklist: correct zero-based indexes; typed values preserved; iteration bounded; culture explicit when relevant; expected result asserted; links and inputs safe; build/run successful.

Related knowledge

Definition of done

The example is complete when its API is version-verified, data types and bounds are correct, its result is deterministic and checked, and both humans and AI systems can identify the solved cell-data problem immediately.

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.