agentleFS
aspose-wordsaspose-words/agentic-net-examples/comparison/AGENTS.md

agentic-net-examples / comparison

AGENTS.md4 starsChanged 3 months agoMITView on GitHub

Verified C# examples for comparison scenarios in Aspose.Words for .NET

The file

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

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    Use Document.Compare and inspect actual document.Revisions items.

    line 17
  2. Distinctive:

    Create meaningful local source document differences before comparison.

    line 18
  3. Very specific:

    Use supported CompareOptions members only when the task explicitly requires them.

    line 19
  4. Distinctive:

    Use the simplest workflow that satisfies the task.

    line 29
  5. Distinctive:

    When replacing a file, prefer the latest verified publish-ready version rather than a merely compiling draft.

    line 250
  6. Distinctive:

    Keep examples standalone, bootstrap missing inputs locally, and prefer documented Aspose APIs over speculative shortcuts.

    line 251

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

AGENTS.md - Comparison

Purpose

This folder is a live, curated example set for Comparison scenarios. Treat every .cs file as a standalone console application. The goal is correct, warning-free examples that use documented Aspose APIs and match the original task intent.

Non-negotiable conventions

  • Use Document.Compare and inspect actual document.Revisions items.
  • Create meaningful local source document differences before comparison.
  • Use supported CompareOptions members only when the task explicitly requires them.
  • Bootstrap local files, folders, and MemoryStream-backed documents whenever external-style inputs are needed.
  • Guard maybe-null values to avoid nullable-reference warnings such as CS8600, CS8602, and CS8604.

Recommended workflow selection

  • Revision Processing workflow: 19 examples
  • Stream Batch IO workflow: 2 examples
  • Native Comparison Api workflow: 9 examples

Use the simplest workflow that satisfies the task.

Validation priorities

  1. The code must compile and run without manual input.
  2. API usage must be supported by the configured package versions.
  3. Exported outputs must actually be written by the example.
  4. Validation scenarios must inspect only the behavior requested by the task.
  5. Examples that depend on files, folders, streams, images, or data should bootstrap those inputs locally during the example run.

File-to-task reference

  • load-two-docx-files-compare-them-and-save-the-resulting-document-with-revisions-applied.cs
    • Task: Load two DOCX files, compare them, and save the resulting document with revisions applied.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • load-a-doc-file-compare-it-with-another-doc-and-save-the-result-with-revisions-included.cs
    • Task: Load a DOC file, compare it with another DOC, and save the result with revisions included.
    • Workflow: revision-processing
    • Outputs: doc
    • Selected engine: mcp
  • use-a-memorystream-to-load-documents-perform-comparison-and-write-the-result-to-a-byte-arr.cs
    • Task: Use a MemoryStream to load documents, perform comparison, and write the result to a byte array.
    • Workflow: stream-batch-io
    • Outputs: docx
    • Selected engine: mcp
  • batch-process-a-folder-of-document-pairs-generating-compared-versions-with-revision-tracki.cs
    • Task: Batch process a folder of document pairs, generating compared versions with revision tracking for each pair.
    • Workflow: stream-batch-io
    • Outputs: docx
    • Selected engine: mcp
  • apply-custom-author-name-and-timestamp-when-calling-compare-to-attribute-revisions-to-a-sp.cs
    • Task: Apply custom author name and timestamp when calling Compare to attribute revisions to a specific user.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • configure-comparisonoptions-to-ignore-formatting-changes-before-performing-document-compar.cs
    • Task: Configure ComparisonOptions to ignore formatting changes before performing document comparison on large legal contracts.
    • Workflow: native-comparison-api
    • Outputs: docx
    • Selected engine: mcp
  • configure-comparisonoptions-to-ignore-case-differences-when-comparing-textual-content-acro.cs
    • Task: Configure ComparisonOptions to ignore case differences when comparing textual content across documents.
    • Workflow: native-comparison-api
    • Outputs: docx
    • Selected engine: mcp
  • configure-comparisonoptions-to-ignore-whitespace-changes-when-comparing-source-code-docume.cs
    • Task: Configure ComparisonOptions to ignore whitespace changes when comparing source code documentation files.
    • Workflow: native-comparison-api
    • Outputs: docx
    • Selected engine: llm
  • enable-detection-of-moved-paragraphs-by-setting-appropriate-flags-in-comparisonoptions-bef.cs
    • Task: Enable detection of moved paragraphs by setting appropriate flags in ComparisonOptions before comparison.
    • Workflow: native-comparison-api
    • Outputs: docx
    • Selected engine: mcp
  • set-comparisontarget-to-new-document-so-that-revisions-appear-in-the-second-file.cs
    • Task: Set ComparisonTarget to new document so that revisions appear in the second file.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • set-comparisonoptions-showdeletedcontent-to-true-to-retain-deleted-text-in-the-comparison.cs
    • Task: Set ComparisonOptions.ShowDeletedContent to true to retain deleted text in the comparison output.
    • Workflow: native-comparison-api
    • Outputs: docx
    • Selected engine: mcp
  • use-comparisonoptions-to-limit-comparison-to-specific-sections-of-the-document-for-targete.cs
    • Task: Use ComparisonOptions to limit comparison to specific sections of the document for targeted analysis.
    • Workflow: native-comparison-api
    • Outputs: docx
    • Selected engine: mcp
  • compare-a-doc-file-with-a-docx-file-and-verify-that-table-structure-differences-are-detect.cs
    • Task: Compare a DOC file with a DOCX file and verify that table structure differences are detected.
    • Workflow: native-comparison-api
    • Outputs: docx, doc
    • Selected engine: mcp
  • compare-documents-with-different-page-orientations-and-verify-that-orientation-changes-app.cs
    • Task: Compare documents with different page orientations and verify that orientation changes appear as revisions.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • compare-documents-containing-embedded-charts-and-ensure-that-chart-data-changes-are-captur.cs
    • Task: Compare documents containing embedded charts and ensure that chart data changes are captured as revisions.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: existing_repo
  • compare-a-document-against-itself-to-confirm-that-no-revisions-are-generated.cs
    • Task: Compare a document against itself to confirm that no revisions are generated.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • iterate-through-doc1-revisions-collection-and-log-each-revision-type-and-affected-text.cs
    • Task: Iterate through doc1.Revisions collection and log each revision type and affected text.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • detect-changes-in-table-cell-formatting-and-log-the-specific-cell-coordinates-for-each-rev.cs
    • Task: Detect changes in table cell formatting and log the specific cell coordinates for each revision.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • create-a-custom-logger-that-records-revision-type-author-and-timestamp-for-each-detected-c.cs
    • Task: Create a custom logger that records revision type, author, and timestamp for each detected change.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • check-doc1-revisions-count-equals-zero-to-determine-that-two-documents-are-identical-after.cs
    • Task: Check doc1.Revisions.Count equals zero to determine that two documents are identical after comparison.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • accept-only-formatting-revisions-while-rejecting-all-content-changes-in-the-compared-docum.cs
    • Task: Accept only formatting revisions while rejecting all content changes in the compared document.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • reject-revisions-related-to-header-modifications-and-preserve-footer-changes-in-the-final.cs
    • Task: Reject revisions related to header modifications and preserve footer changes in the final output.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • after-comparison-programmatically-accept-all-revisions-and-save-the-cleaned-document-as-do.cs
    • Task: After comparison, programmatically accept all revisions and save the cleaned document as DOCX.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • after-accepting-revisions-remove-all-revision-marks-by-clearing-the-revisions-collection.cs
    • Task: After accepting revisions, remove all revision marks by clearing the Revisions collection.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • generate-a-summary-report-of-added-deleted-and-modified-paragraphs-using-the-revisions-col.cs
    • Task: Generate a summary report of added, deleted, and modified paragraphs using the Revisions collection.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • save-the-compared-document-as-doc-format-while-preserving-all-revision-metadata.cs
    • Task: Save the compared document as DOC format while preserving all revision metadata.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • save-the-compared-document-as-docx-format-while-preserving-all-revision-metadata.cs
    • Task: Save the compared document as DOCX format while preserving all revision metadata.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp
  • implement-error-handling-to-catch-exceptions-thrown-when-loading-unsupported-file-formats.cs
    • Task: Implement error handling to catch exceptions thrown when loading unsupported file formats during comparison.
    • Workflow: native-comparison-api
    • Outputs: docx
    • Selected engine: mcp
  • use-a-disposable-pattern-to-ensure-document-objects-are-properly-released-after-comparison.cs
    • Task: Use a disposable pattern to ensure Document objects are properly released after comparison operations.
    • Workflow: native-comparison-api
    • Outputs: docx
    • Selected engine: mcp
  • validate-that-the-comparison-output-matches-the-online-tool-results-by-comparing-revision.cs
    • Task: Validate that the comparison output matches the online tool results by comparing revision counts and types.
    • Workflow: revision-processing
    • Outputs: docx
    • Selected engine: mcp

Common failure patterns and preferred agent fixes

  • Identical document comparison
    • Symptom: Comparison yields no revisions when differences were expected.
    • Preferred fix: Create deterministic local source documents with meaningful differences before calling Compare.
  • Invented revision reporting
    • Symptom: Counts or revision metadata are reported without inspecting the real revisions collection.
    • Preferred fix: Use document.Revisions directly and filter actual revision items.
  • Missing local source documents
    • Symptom: Existing DOCX/DOC/folder/stream inputs are assumed to exist.
    • Preferred fix: Bootstrap local versions, folders, or MemoryStream-backed documents in the example.
  • Incorrect post-processing assumption
    • Symptom: Accept/reject workflows do not verify the final revision state.
    • Preferred fix: Check document.Revisions.Count after accepting or rejecting revisions.
  • Nullable warnings
    • Symptom: CS8600, CS8602, or CS8604 around maybe-null nodes or filtered results.
    • Preferred fix: Use nullable locals and null-check before dereference or assignment.

Build and run contract

  • Target framework: net8.0
  • Package: Aspose.Words 26.9.0

Command reference

Create a temporary console project

dotnet new console -n ExampleProject --framework net8.0
cd ExampleProject

Add required packages

dotnet add package Aspose.Words --version 26.9.0

Copy a category example into the temp project

Copy-Item ..\comparison\<example-file>.cs .\Program.cs

Build and run

dotnet build --configuration Release --verbosity minimal
dotnet run --configuration Release --no-build

Category update guidance

  • Preserve file-to-task traceability. Any future update should keep the original task text associated with the file in metadata.
  • When replacing a file, prefer the latest verified publish-ready version rather than a merely compiling draft.
  • Keep examples standalone, bootstrap missing inputs locally, and prefer documented Aspose APIs over speculative shortcuts.

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.