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

agentic-net-examples / conversion

AGENTS.md1 starsChanged 2 months agoMITView on GitHub

Create production-minded, reproducible Aspose.Cells for .NET conversion examples. Follow ../AGENTS.md, then this guide. In scope: Excel-to-PDF/HTML/CSV/text/image/ODS/XPS conversions, format-specific save options, worksheet selection, streams, encoding, pagination, fidelity checks, split outputs, and batch conversion. Use working-with-pdf, working-with-html, or working-with-images when advanced target-specific rendering is the dominant intent. Use open-workbook or save-workbook when loading or persistence mechanics are primary. Include System.IO only when file or stream validation is used. Each example must identify source and target formats, use one primary conversion objective, configure…

The file

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

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

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    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 production-minded, reproducible Aspose.Cells for .NET conversion examples.

    line 19
  2. Very specific:

    Use working-with-pdf, working-with-html, or working-with-images when advanced target-specific rendering is the dominant intent.

    line 23
  3. Distinctive:

    Treat PDF/image conversion as rendering.

    line 43
  4. Distinctive:

    Use streams safely and reset positions only when the consumer requires it.

    line 44
  5. Distinctive:

    Never claim perfect fidelity without inspecting representative output.

    line 45
  6. Distinctive:

    Use representative formulas, fonts, charts, images, and page setup only when fidelity is being tested.

    line 78
  7. Common:

    Never embed secrets or personal data in conversion samples.

    line 79
  8. Distinctive:

    Use fonts available in the deployment environment and report substitution issues.

    line 82
  9. Distinctive:

    Verify overloads and option ownership in the installed package.

    line 89

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

File Format Conversion Agent Instructions

Mission and scope

Create production-minded, reproducible Aspose.Cells for .NET conversion examples. Follow ../AGENTS.md, then this guide.

In scope: Excel-to-PDF/HTML/CSV/text/image/ODS/XPS conversions, format-specific save options, worksheet selection, streams, encoding, pagination, fidelity checks, split outputs, and batch conversion.

Use working-with-pdf, working-with-html, or working-with-images when advanced target-specific rendering is the dominant intent. Use open-workbook or save-workbook when loading or persistence mechanics are primary.

Canonical API map

TargetPreferred APIs
PDFWorkbook.Save, SaveFormat.Pdf, PdfSaveOptions
HTML/MHTMLHtmlSaveOptions, SaveFormat.Html, SaveFormat.MHtml
CSV/TSV/textTxtSaveOptions, SaveFormat.Csv, encoding/separator options
ImagesSheetRender, WorkbookRender, ImageOrPrintOptions
ODS and Excel formatsWorkbook.Save with an explicit SaveFormat or save-options type
StreamsMatching Workbook.Save(Stream, ...) overload verified for the target

Hard rules

  • Match file extension, SaveFormat, and save-options type.
  • State whether conversion applies to the workbook, active sheet, or each sheet.
  • Populate formulas and call calculation before conversion when rendered values must be current.
  • Configure encoding, delimiter, quoting, and sheet export deliberately for text formats.
  • Explain that CSV is single-sheet and does not preserve workbook formatting, charts, formulas, or comments as Excel objects.
  • Treat PDF/image conversion as rendering; verify page/image output, not only file existence.
  • Use streams safely and reset positions only when the consumer requires it.
  • Never claim perfect fidelity without inspecting representative output.

Canonical pattern

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

PdfSaveOptions options = new PdfSaveOptions
{
    OnePagePerSheet = true
};

workbook.Save("converted-workbook.pdf", options);

if (!File.Exists("converted-workbook.pdf"))
{
    throw new InvalidOperationException("PDF output was not created.");
}

Include System.IO only when file or stream validation is used.

Example contract

Each example must identify source and target formats, use one primary conversion objective, configure only relevant options, create deterministic content where possible, and verify output signature/count/size or reopenability.

Metadata must include source, target, primary API, important options, output, and expected result. Prefer filenames such as convert-xlsx-to-pdf-in-csharp.cs.

Fidelity, security, and scale

  • Use representative formulas, fonts, charts, images, and page setup only when fidelity is being tested.
  • Never embed secrets or personal data in conversion samples.
  • Sanitize hyperlinks and HTML; mitigate CSV formula injection for untrusted exported text.
  • Bound batch sizes, memory streams, image DPI, and output paths.
  • Use fonts available in the deployment environment and report substitution issues.
  • For benchmarks, report workbook dimensions, target format, package version, environment, and repeat count.

Discoverability and validation

Target direct intents such as "convert Excel to PDF in C#" or "export XLSX to CSV with UTF-8." Put source, target, and primary option in the opening comment without keyword stuffing.

Verify overloads and option ownership in the installed package. Compile, run, confirm output exists and is non-empty, then parse/reopen or inspect pages/images where feasible. Reject mismatched extensions, silent sheet loss, and unsupported fidelity claims.

Related knowledge

Definition of done

The example is done when source, target, scope, options, and expected artifact are explicit; output is validated proportionately to the format; and the conversion intent is easy to retrieve and cite.

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.