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

agentic-net-examples / manage-workbook

AGENTS.md1 starsChanged 2 months agoMITView on GitHub

Create focused enterprise examples for workbook lifecycle and workbook-level structures with Aspose.Cells for .NET. Follow ../AGENTS.md. In scope: workbook creation/lifecycle, settings, worksheet collection coordination, copying between workbooks, content-type properties, custom XML parts, style cleanup, streams, disposal, shared-workbook settings, workbook-wide replace/audit, and batch management. Use working-with-worksheets for worksheet-only operations, document-properties for ordinary metadata, open-workbook for loading mechanics, and save-workbook for output-format behavior. The root repository generally prefers explicit types. A using declaration is acceptable only if repository policy permits it; otherwise…

The file

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

11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    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 enterprise examples for workbook lifecycle and workbook-level structures with Aspose.Cells for .NET.

    line 19
  2. Very specific:

    Use working-with-worksheets for worksheet-only operations, document-properties for ordinary metadata, open-workbook for loading mechanics, …

    line 23
  3. Distinctive:

    Keep one workbook-level objective per example.

    line 39
  4. Distinctive:

    Do not dispose a workbook before the caller finishes reading or saving it.

    line 41
  5. Distinctive:

    Verify workbook-wide cleanup does not change visible content or required styles.

    line 43
  6. Distinctive:

    Treat custom XML as untrusted structured input.

    line 44
  7. Distinctive:

    Use memory streams only for genuinely stream-based scenarios.

    line 69
  8. Distinctive:

    Avoid holding many large workbooks simultaneously.

    line 70
  9. Distinctive:

    Do not expose custom XML, metadata, or formula content in logs.

    line 71
  10. Distinctive:

    Use secure XML parsing and synthetic data.

    line 72
  11. Distinctive:

    Verify exact collection members and settings against the installed package.

    line 80

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

Workbook Management Agent Instructions

Mission and scope

Create focused enterprise examples for workbook lifecycle and workbook-level structures with Aspose.Cells for .NET. Follow ../AGENTS.md.

In scope: workbook creation/lifecycle, settings, worksheet collection coordination, copying between workbooks, content-type properties, custom XML parts, style cleanup, streams, disposal, shared-workbook settings, workbook-wide replace/audit, and batch management.

Use working-with-worksheets for worksheet-only operations, document-properties for ordinary metadata, open-workbook for loading mechanics, and save-workbook for output-format behavior.

Canonical API map

IntentAPIs
Create/load workbookWorkbook constructors with verified options
Workbook settingsWorkbook.Settings / WorkbookSettings
Coordinate worksheetsWorkbook.Worksheets / WorksheetCollection
Custom XMLWorkbook.CustomXmlParts and verified collection APIs
Content-type metadataWorkbook.ContentTypeProperties
Remove unused stylesWorkbook.RemoveUnusedStyles
LifecycleIDisposable, Dispose, streams, exception-safe ownership

Hard rules

  • Keep one workbook-level objective per example.
  • Define ownership of workbooks and streams; dispose only objects the example owns.
  • Do not dispose a workbook before the caller finishes reading or saving it.
  • For streams, document whether they remain open and reset position only when required.
  • Verify workbook-wide cleanup does not change visible content or required styles.
  • Treat custom XML as untrusted structured input; parse securely and avoid entity expansion.
  • Distinguish document properties, content-type properties, and custom XML parts.
  • Preserve formulas, styles, drawings, and named ranges deliberately when copying worksheets.

Canonical pattern

using Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Name = "Summary";
worksheet.Cells["A1"].PutValue("Managed workbook");

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

The root repository generally prefers explicit types. A using declaration is acceptable only if repository policy permits it; otherwise use try/finally with explicit disposal.

Example contract

Each example must state workbook source, owned resources, primary workbook operation, affected collections/settings, output, and expected postcondition. Use deterministic workbook content and task-specific output names.

For batch examples, isolate per-file failures, avoid overwriting inputs, bound concurrency, and report successes/failures without leaking paths or workbook data.

Lifecycle, safety, and performance

  • Use memory streams only for genuinely stream-based scenarios.
  • Avoid holding many large workbooks simultaneously; dispose each after its output is verified.
  • Do not expose custom XML, metadata, or formula content in logs.
  • Use secure XML parsing and synthetic data.
  • Measure cleanup and batch performance with equivalent inputs and report dimensions/environment.
  • Reopen outputs and verify worksheet counts, names, custom XML/content properties, and representative cell/style values.

Discoverability and validation

Target one intent such as "create Excel workbook in C#," "remove unused Excel styles," "add custom XML to XLSX," or "dispose Aspose.Cells Workbook." The opening comment must identify the workbook-level operation and expected state.

Verify exact collection members and settings against the installed package. Compile, run, reopen, and assert the postcondition. Reject mixed-feature demos, ambiguous ownership, invalid custom XML assumptions, and cleanup claims without comparison.

Related knowledge

Definition of done

The example is done when workbook ownership, scope, operation, affected state, security assumptions, output, and reopened postcondition 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.