IRONSOFTWAREHOME

Grounding Cursor in IronBarcode's Documentation

Curtis Chau
Curtis Chau
Updated: September 21, 2026

BarcodeReaderOptions.CropArea in IronBarcode takes an IronSoftware.Drawing.Rectangle, not the System.Drawing type of the same name, and a model working from memory reaches for the familiar one. The same habit writes dotnet add package IronBarcode, but the package is BarCode and the namespace is IronBarCode.

Cursor used to answer this by indexing a documentation site behind an @Docs mention. That mention no longer appears in Cursor's documentation. What stands in its place is a link pasted into the prompt, which the agent's web tool fetches, or guidance carried in a rule or a skill. All three point the agent at real pages, and none of them waits on an index.

Cursor is an AI-first editor, and its agent works at two very different reaches:

  • Inline edit and Tab work where your cursor is, with Ctrl+K (Cmd+K on a Mac) stating a change in one sentence and Tab predicting your next edit.
  • Agent mode plans across files, runs the build, reads the errors, and iterates, while Plan mode makes it settle the approach with you first.

Tab opens a portal to another file when the follow-on change lands there, and an inline edit shows its diff in place for you to accept or reject.

Rules reach agent mode and chat, and nothing else. Cursor's documentation states plainly that rules do not impact Cursor Tab or other AI features. So a rule you committed is not there when Tab suggests a method.

Grounding Cursor for barcode work takes two committed files and a link pasted into the prompt. That preparation matters most on precise changes, narrowing reader options, adding a crop region, picking a reading speed, or identifying the single image correction that rescues a batch of bad scans.

Nothing here concerns the confidence scoring inside IronBarcode's reader, which has its own worked example.

Quickstart
NuGetInstall with NuGet

PM > Install-Package BarCode

Install IronBarcode by running the command above in the NuGet Package Manager Console, or search for the package in the NuGet Package Manager.

Open a C# project in Cursor and give the agent a page to read before it writes.

In Program.cs, generate a Code 128 barcode for an asset tag and style it for a
printed label. Set the bar color and the background with ChangeBarCodeColor and
ChangeBackgroundColor, size it with ResizeTo, and print the value under the
bars. The license comes out of IRONBARCODE_LICENSE_KEY.

Work from https://ironsoftware.com/barcode/csharp/llms-full.txt, use only
members that appear in it, and tell me which page each styling call came from.
Text

The color and sizing members are easy to half-remember, which is why the prompt sends the agent to the page first. The barcode styling guide names all three exactly.

Please note: Any prompt you paste is stored in the session, so a license key pasted into one is a key you have published to your editor's history. Read it from the environment instead, as the license key guide sets out.


Which model should run your barcode session?

Cursor is the only tool in this series where you choose the model. Composer, its own agentic model, is tuned for tool use, file edits, and terminal work inside the editor, and its fast variant is what you get by default. The picker also lists frontier models from OpenAI, Anthropic, Google, and SpaceXAI. Tab sits outside that choice and works from your recent edits, the surrounding code, and linter errors.

Most of a barcode session is cheap and repetitive. You add a format, rebuild, decode the test set, and tweak. Now and then a batch of real scans will not decode and no error says why, and that is when to switch to a model that reasons longer before editing. The model also shapes the code, so pin the symbology, the output size, and the read-back condition instead of leaving them to a default.

This is where the series overlaps. Run a Claude model in Cursor and the notes in the Claude Code guide apply to its output. The model is the same. Only the interface differs.

How do you ground Cursor in IronBarcode's documentation?

Three moves replace the old index, and they stack:

  • Paste the link: point at llms-full.txt rather than the documentation hub, so one URL puts the guides, the examples, and the member names in front of the agent.
  • Commit the skill: save IronBarcode's published skill.md as .cursor/skills/ironbarcode/SKILL.md, set name: ironbarcode to match the folder, and commit it.
  • Commit the rule: the next section covers what goes in it.

Cursor loads Agent Skills from .cursor/skills/ and .agents/skills/, in the project root or in a subdirectory, each skill a folder holding a SKILL.md whose frontmatter carries name and description. The agent pulls one in when a task looks relevant, and typing /ironbarcode calls it directly. .agents/skills/ is the neutral path for the same file, so Codex and Antigravity load it from there as well.

Skip all three and the model answers from training data that was never checked against the current release. Method names go first. BarcodeScanner.DecodeImageFile() reads like a real call and fails at the build.

With a page to work from, questions that would have been guesses become lookups.

Which options narrow a read to two symbologies inside a fixed region of a
larger image? Give me the exact class and property names, and quote the lines
you took them from in https://ironsoftware.com/barcode/csharp/llms-full.txt.
Text

If the agent cannot quote a page for the API it suggested, verify before building on it.

Tips: This works for any unfamiliar class. With the file in context, BarcodeReaderOptions is something you interrogate rather than scroll, and the answer cites the API reference page it came from.

How do you write project rules that encode your IronBarcode conventions?

Project rules go in a .cursor/rules folder at the repository root. They are under version control, committed with the code, so every developer gets the same behavior with zero setup.

Each rule is an .mdc file, which is markdown with YAML frontmatter that sets description, globs, and alwaysApply. Cursor searches the folder recursively, so subfolders work. A plain .md file there is ignored, because it has no frontmatter to activate it. An IronBarcode rule looks like this.

---
description: IronBarcode conventions for barcode reading and writing in this project
globs: ["**/Services/**/*.cs", "**/Barcodes/**/*.cs"]
alwaysApply: false
---

# IronBarcode conventions

Applies to the barcode code in this folder only.

- IronBarcode (package BarCode, namespace IronBarCode) writes and reads every
  barcode here. Never reach for a second barcode package.
- Reader options are explicit: set ExpectBarcodeTypes to the formats this
  feature really reads, and reuse one BarcodeReaderOptions per format set
  rather than allocating per call.
- Reads on a request path are async.
- CropArea takes IronSoftware.Drawing.Rectangle, not System.Drawing.
- Verified recipes: https://ironsoftware.com/barcode/csharp/skill.md
- If you are unsure a member exists, say so and cite the page. Do not guess a
  method name that sounds plausible.
Text

Telling the model that uncertainty is acceptable is what stops the invented API, and a rule says it once for every session that follows.

Copy the globs line on purpose. A rule with alwaysApply: true loads into every request and spends context on work that has no barcodes in it. Scoping it to the folders that hold barcode code keeps it where it belongs.

Please note: Cursor also reads a plain AGENTS.md, the same file ChatGPT Codex and Google Antigravity use. It carries no frontmatter and therefore no globs, and Cursor reads it in the project root and in subdirectories, so nesting is the only scoping it offers. Use .cursor/rules when you want glob patterns, and AGENTS.md when you want one instructions file for several tools.

Which mode fits the change?

Cursor offers more ways to edit than any other tool in this series. Pick by size, from a single line to the whole repository:

ModeUse it whenBarcode example
TabThe next edit is predictableRepeating a reader option
Inline editOne file, one sentenceNarrowing a read to two formats
AgentWork spans files and needs a build loopA label endpoint and a scan endpoint
Plan modeThe rewrite is too big to review afterwardsMigrating off another barcode library
Cloud agentIt can run unattendedRound-trip tests across every format

What does an @ mention change?

An @ mention hands the agent the thing to read, which can be a file, a folder, a terminal, an earlier chat, a Git diff, or the browser. Referencing the file that reads barcodes beats describing it, because a description loses the detail that the bug lives in.

@Services/ScanService.cs @TestData/depot/

Read https://ironsoftware.com/barcode/csharp/llms-full.txt for the options.

Half the photos in TestData/depot/ come back empty. The reader options are
where this gets fixed, not the label generator. Name the setting that was
missing, and give me a decode rate for the folder before your change and after
it.
Text

A folder mention suits module-wide work, and the whole codebase is there when you cannot say which file matters. Pairing the code with the documentation covers both halves of the question: the file shows what your code does now, and the page shows what the library actually provides.

Which setting rescues a batch of photos depends on how they are damaged, and no description substitutes for the agent running against the images. The reading speed and image correction pages cover the individual settings.

How do you plan and run a migration to IronBarcode?

An unreviewed rewrite across many files gets expensive during a migration, because undoing it is harder than writing it. Plan mode exists for this. Press Shift+Tab from the chat input, or pick it from the mode dropdown, and the agent asks clarifying questions, reads the codebase, and produces a plan you edit in chat or as markdown before any code appears. Plans save to your home directory, and "Save to workspace" moves one into the repository for the team to review.

The barcode code in @Labels/ belongs to another library. Using
https://ironsoftware.com/barcode/csharp/llms-full.txt, work out what replacing
it with IronBarcode would actually involve. Which files change, what the
equivalent call is for each thing the folder does today, and where the
documentation says no clean equivalent exists.

Public method signatures are fixed. If the plan needs one to change, say so in
the plan rather than changing it.
Text

Read the plan, fix it with a sentence or two, and send it back to build. Agent mode then reads the code, edits across files, runs commands, checks the output, and iterates, so the next prompt can be short.

Carry out the plan we agreed. Compile it, clear whatever errors come up, and
satisfy yourself that every symbology the folder handles still comes back out
the same as it went in. Show me the diff at the end. BarCode is the only package
that may appear in the .csproj.
Text

Drop those two limits and agents redesign the calling pattern while they migrate.

Work that needs no supervision can go to a cloud agent, formerly the background agent, while you keep the editor. A round-trip test suite suits that, because its assertions are decoded values rather than implementation details, so writing them does not wait on the migration.

@Services/

Send this to a cloud agent while I keep working on the reader options.

Cover the migrated service with xUnit. Use a [Theory] over the symbologies it
supports rather than one [Fact] per format, so adding a format later costs one
line. Each case writes a sample value and reads it back, and the assertion is on
the decoded string and the decoded format together.

Then three edge cases as their own facts: an empty image returns no results
instead of throwing, a letters-only value is refused as EAN-13, and a missing
path fails with a readable message. Image bytes are off limits as an assertion
target.
Text

Ruling out byte comparisons is what keeps the suite stable across platforms.

Where do reading problems live?

Unreadable barcodes are the most frequent IronBarcode question, and the answer almost always lives in the reader options rather than in the label. What Cursor adds is that you do not have to describe the failure. Mention the service and the folder of failing images, and the editor works from both.

Photos of returns labels read fine on a handheld scanner but come back empty
from @Services/ScanService.cs, and a few product photos carrying no barcode at
all return a value. Samples of both are in @TestData/returns/.

Explain the cause of each before changing anything, then fix both in the reader
options.
Text

Insisting on the explanation first leaves you with an argument to check instead of a change to reverse-engineer. Here the two symptoms need opposite fixes. Missed reads want a narrower format list, a crop area, and the right image filter, which the Barcode Not Recognized guide works through. Phantom values want RemoveFalsePositive and a confidence threshold, covered in the false positives guide.

A deployment failure usually traces back to the .csproj or the container image, not to any C# file, and an agent with terminal access can read both and run the build itself.

@Dockerfile @LabelScan.csproj @Terminals

Reading works on Windows but fails in our Linux container. The failing build is
in the terminal output above, so read it there rather than asking me to paste it.

Check which BarCode package the project references and whether the image has
the native dependencies IronBarcode needs on Linux. Explain the cause, then
propose the change. Don't modify C# code unless the cause is there.
Text

Say explicitly that the C# is not to be touched. Given a failing call and no boundary, an agent will reach for a try/catch and report the problem as solved. The Docker on Linux guide lists what the image actually needs.

What should you set up first?

The skill file and one scoped rule take about fifteen minutes, and they apply to every session after that. Pasting the documentation link stays a per-prompt habit, and it costs one line.

Change the model behind the editor and three checks still stand: the code compiles, the barcode decodes, and every member you used appears in IronBarcode's documented API. Those three are exactly what the AI coding assistants and agents guide measures. There is a page apiece for Claude Code, ChatGPT Codex, GitHub Copilot and Google Antigravity.


Troubleshooting


Questions?

If you have any questions, reach out to support@ironsoftware.com

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 2,468,794Version:2026.9just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package BarCode
nuget.org/packages/BarCode/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronBarCode"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

  1. Download and unzip IronBarCode to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronBarCode.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronBarcode
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package BarCode
nuget.org/packages/BarCode/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronBarCode"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

  1. Download and unzip IronBarCode to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronBarCode.dll"

Licenses from $999