agentic-net-examples / comments
AGENTS.md4 starsChanged 3 months agoMITView on GitHub
Verified C# examples for comments scenarios in Aspose.Words for .NET
3 other projects use a version of this.
Adopted by
Most recently taken up by
- postproxy/postproxy-claude-plugintheir own version, first seen Sep 8, 2026
- ayrshare/ayrshare-social-media-api-claude-plugintheir own version, first seen Jun 6, 2026
- anthropics/claude-for-legaltheir own version, first seen May 15, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- anthropics/claude-for-legal★ 9.6ksame name
- ayrshare/ayrshare-social-media-api-claude-plugin★ 19same name
- postproxy/postproxy-claude-plugin★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository29 other files it gives its agents.
- aspose-words-examplesAGENTS.md
- barcode-imageAGENTS.md
- chartsAGENTS.md
- comparisonAGENTS.md
- content-controlAGENTS.md
- conversionAGENTS.md
- extractionAGENTS.md
- find-and-replaceAGENTS.md
- fontsAGENTS.md
- form-fieldsAGENTS.md
- hyphenationAGENTS.md
- imagesAGENTS.md
- join-documentsAGENTS.md
- linq-reportingAGENTS.md
- listsAGENTS.md
- mail-mergeAGENTS.md
- officemathAGENTS.md
- ole-objectsAGENTS.md
- paragraphsAGENTS.md
- programming-with-documentsAGENTS.md
- rangeAGENTS.md
- renderingAGENTS.md
- security-and-protectionAGENTS.md
- shapesAGENTS.md
- split-documentAGENTS.md
- track-changesAGENTS.md
- vba-macrosAGENTS.md
- watermarkAGENTS.md
- working-with-tableAGENTS.md
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Use Aspose.Words.Comment class for comment APIs directly.
- Very specific: line 19
Do not use invented Document.Comments or Aspose.Words.Comments APIs.
- Very specific: line 20
Do not use undocumented save-option flags such as HtmlSaveOptions.ExportComments.
- Distinctive: line 21
Prefer simple, verifiable workflows over speculative markup tricks.
- Distinctive: line 22
Create realistic local sample inputs whenever the task mentions streams, files, folders, DOC/DOCX inputs, XML, JSON, or database-like …
- Distinctive: line 32
Use the simplest workflow that satisfies the task.
- Distinctive: line 253
When replacing a file, prefer the latest verified publish-ready version rather than a merely compiling draft.
- Distinctive: line 254
Keep examples standalone, bootstrap missing inputs locally, and prefer documented Aspose APIs over speculative shortcuts.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md - Comments
Purpose
This folder is a live, curated example set for Comments 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
Aspose.Words.Comment classfor comment APIs directly. - Enumerate comments with
doc.GetChildNodes(NodeType.Comment, true).OfType<Comment>(). - Do not use invented
Document.CommentsorAspose.Words.CommentsAPIs. - Do not use undocumented save-option flags such as
HtmlSaveOptions.ExportComments. - Prefer simple, verifiable workflows over speculative markup tricks.
- Create realistic local sample inputs whenever the task mentions streams, files, folders, DOC/DOCX inputs, XML, JSON, or database-like sources.
- Guard maybe-null values to avoid nullable-reference warnings such as
CS8600,CS8602, andCS8604.
Recommended workflow selection
- Native Comment Api workflow: 15 examples
- Export Report workflow: 7 examples
- Rendered Output workflow: 5 examples
- Stream Batch IO workflow: 3 examples
Use the simplest workflow that satisfies the task.
Validation priorities
- The code must compile and run without manual input.
- API usage must be supported by the configured package versions.
- Exported outputs must actually be written by the example.
- Validation scenarios must inspect only the behavior requested by the task.
- Examples that depend on files, folders, streams, images, or data should bootstrap those inputs locally during the example run.
File-to-task reference
load-a-docx-file-enumerate-all-comments-and-print-each-author-and-text-to-console.cs- Task: Load a DOCX file, enumerate all comments, and print each author and text to console.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
add-a-new-comment-to-a-specific-paragraph-in-a-word-document-and-save-as-docx.cs- Task: Add a new comment to a specific paragraph in a Word document and save as DOCX.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
update-the-text-of-an-existing-comment-identified-by-its-index-while-preserving-original-f.cs- Task: Update the text of an existing comment identified by its index while preserving original formatting.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
delete-all-comments-authored-by-a-particular-user-from-the-loaded-document-before-exportin.cs- Task: Delete all comments authored by a particular user from the loaded document before exporting.
- Workflow: export-report
- Outputs: docx
- Selected engine: mcp
set-custom-author-name-and-initials-for-programmatically-added-comments-in-a-document.cs- Task: Set custom author name and initials for programmatically added comments in a document.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
create-a-reply-to-an-existing-comment-and-ensure-the-reply-appears-nested-under-the-origin.cs- Task: Create a reply to an existing comment and ensure the reply appears nested under the original.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
iterate-through-the-comment-collection-and-remove-comments-older-than-a-specified-date-thr.cs- Task: Iterate through the comment collection and remove comments older than a specified date threshold.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
filter-comments-by-author-and-export-only-those-comments-to-a-separate-word-document-for-r.cs- Task: Filter comments by author and export only those comments to a separate Word document for review.
- Workflow: export-report
- Outputs: docx
- Selected engine: mcp
export-all-comments-from-a-docx-file-to-a-csv-file-with-author-date-and-text-columns.cs- Task: Export all comments from a DOCX file to a CSV file with author, date, and text columns.
- Workflow: export-report
- Outputs: docx, csv
- Selected engine: mcp
import-comments-from-an-exported-xml-file-and-attach-them-to-appropriate-locations-in-a-ne.cs- Task: Import comments from an exported XML file and attach them to appropriate locations in a new document.
- Workflow: export-report
- Outputs: docx, xml
- Selected engine: mcp
extract-comment-metadata-author-date-and-text-and-write-it-to-a-json-file.cs- Task: Extract comment metadata-author, date, and text-and write it to a JSON file.
- Workflow: export-report
- Outputs: docx, json
- Selected engine: llm
search-comments-containing-a-specific-keyword-and-highlight-the-corresponding-text-range-i.cs- Task: Search comments containing a specific keyword and highlight the corresponding text range in the document.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
load-multiple-word-documents-from-a-folder-aggregate-their-comments-and-generate-a-summary.cs- Task: Load multiple Word documents from a folder, aggregate their comments, and generate a summary report.
- Workflow: export-report
- Outputs: docx
- Selected engine: mcp
generate-a-printable-report-listing-all-comments-with-page-numbers-and-associated-paragrap.cs- Task: Generate a printable report listing all comments with page numbers and associated paragraph text.
- Workflow: export-report
- Outputs: docx
- Selected engine: mcp
apply-a-custom-style-to-all-comment-text-blocks-within-a-document-to-match-corporate-brand.cs- Task: Apply a custom style to all comment text blocks within a document to match corporate branding.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
preserve-comment-formatting-such-as-bold-and-italic-text-when-converting-a-document-to-htm.cs- Task: Preserve comment formatting such as bold and italic text when converting a document to HTML format.
- Workflow: rendered-output
- Outputs: docx, html
- Selected engine: mcp
convert-a-doc-file-to-pdf-while-retaining-all-comment-annotations-visible-in-the-output.cs- Task: Convert a DOC file to PDF while retaining all comment annotations visible in the output.
- Workflow: rendered-output
- Outputs: docx, pdf, doc
- Selected engine: mcp
convert-a-document-with-comments-to-xps-format-ensuring-comments-appear-as-markup-annotati.cs- Task: Convert a document with comments to XPS format, ensuring comments appear as markup annotations.
- Workflow: rendered-output
- Outputs: xps
- Selected engine: mcp
add-a-comment-containing-a-hyperlink-to-an-external-resource-and-verify-the-link-functions.cs- Task: Add a comment containing a hyperlink to an external resource and verify the link functions in PDF.
- Workflow: rendered-output
- Outputs: pdf
- Selected engine: mcp
validate-that-comment-reference-ids-update-correctly-after-inserting-new-paragraphs-into-t.cs- Task: Validate that comment reference IDs update correctly after inserting new paragraphs into the document.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
synchronize-comment-positions-after-document-sections-are-reordered-to-maintain-accurate-c.cs- Task: Synchronize comment positions after document sections are reordered to maintain accurate comment anchoring.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
use-comment-collection-events-to-trigger-custom-logging-whenever-a-comment-is-added-or-rem.cs- Task: Use comment collection events to trigger custom logging whenever a comment is added or removed.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
programmatically-accept-or-reject-comments-based-on-author-name-and-generate-a-revised-doc.cs- Task: Programmatically accept or reject comments based on author name and generate a revised document version.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
load-a-document-from-a-stream-add-comments-and-save-the-modified-document-back-to-a-memory.cs- Task: Load a document from a stream, add comments, and save the modified document back to a memory stream.
- Workflow: stream-batch-io
- Outputs: docx, doc
- Selected engine: mcp
create-a-batch-process-that-adds-a-standardized-disclaimer-comment-to-every-document-in-a.cs- Task: Create a batch process that adds a standardized disclaimer comment to every document in a directory.
- Workflow: stream-batch-io
- Outputs: docx
- Selected engine: mcp
load-a-document-change-comment-author-names-to-uppercase-and-save-the-updated-file.cs- Task: Load a document, change comment author names to uppercase, and save the updated file.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
extract-comment-text-and-embed-it-as-footnotes-within-the-same-document-for-alternative-pr.cs- Task: Extract comment text and embed it as footnotes within the same document for alternative presentation.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
implement-a-feature-that-hides-all-comments-in-the-document-view-without-removing-them-fro.cs- Task: Implement a feature that hides all comments in the document view without removing them from the file.
- Workflow: rendered-output
- Outputs: docx, pdf
- Selected engine: mcp
compare-two-versions-of-a-document-and-list-comments-that-were-added-modified-or-deleted.cs- Task: Compare two versions of a document and list comments that were added, modified, or deleted.
- Workflow: native-comment-api
- Outputs: docx
- Selected engine: mcp
create-a-utility-that-reads-comment-data-from-a-database-and-inserts-corresponding-comment.cs- Task: Create a utility that reads comment data from a database and inserts corresponding comments into a template document.
- Workflow: stream-batch-io
- Outputs: docx
- Selected engine: mcp
Common failure patterns and preferred agent fixes
- Wrong Node.Text usage
- Symptom: error CS1061: 'Node' does not contain a definition for 'Text'
- Preferred fix: Use Comment.GetText() for whole-comment content, or cast to a concrete node type such as Run before reading .Text.
- Invented comment collection APIs
- Symptom: Compile failures caused by Document.Comments or Aspose.Words.Comments usage.
- Preferred fix: Enumerate comments with doc.GetChildNodes(NodeType.Comment, true).OfType
<Comment>().
- Unsupported comment-reference or save-option APIs
- Symptom: Compile failures caused by CommentReference or undocumented save-option flags.
- Preferred fix: Prefer simpler comment workflows and documented Aspose.Words save options only.
- Unsafe live-collection mutation
- Symptom: Unstable behavior while deleting comments during forward iteration over a live collection.
- Preferred fix: Create a ToList copy first, then update or remove matching comments.
- Nullable-reference warnings
- Symptom: CS8600, CS8602, or CS8604 around maybe-null values such as CurrentParagraph or FirstOrDefault results.
- Preferred fix: Use nullable locals where needed and guard maybe-null values before dereference or assignment.
Build and run contract
- Target framework:
net8.0 - Package:
Aspose.Words26.9.0
Command reference
Create a temporary console project
dotnet new console -n ExampleProject --framework net8.0
cd ExampleProjectAdd required packages
dotnet add package Aspose.Words --version 26.9.0Copy a category example into the temp project
Copy-Item ..\comments\<example-file>.cs .\Program.csBuild and run
dotnet build --configuration Release --verbosity minimal
dotnet run --configuration Release --no-buildCategory 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.
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
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.

