# How to Use IronQR with Cursor
ZXing.Net is the open-source .NET port of the ZXing barcode library. When you ask an AI agent for C# code that reads QR codes from customer photos, it may apply ZXing.Net conventions even if you specify IronQR, such as comparing `Result.Text`, filtering on the `QR_CODE` format, or wrapping the `QrImageInput` in a using statement. In IronQR 2026.10.1, disposing of the input that way throws a NotImplementedException.
Cursor is an AI code editor based on the VS Code codebase. Whether it generates IronQR code or a ZXing.Net translation depends on two features. The agent follows documentation links you provide, and it applies project rules from `.cursor/rules`. This guide demonstrates both with a warranty intake service that extracts serial numbers and registration links from customer photos, and it moves that service from ZXing.Net to IronQR. IronQR supports QR, Micro QR, and rMQR symbols.
This guide focuses on writing code with Cursor. For details on IronQR's reading options, refer to the [scan modes guide](https://ironsoftware.com/qr/csharp/how-to/read-qr-codes-with-scan-modes/), [QR type guide](https://ironsoftware.com/qr/csharp/how-to/read-qr-code-type/), and [value and coordinates guide](https://ironsoftware.com/qr/csharp/how-to/read-qr-code-value/).
*as-heading:2(Quickstart)*
!!!--LIBRARY_NUGET_INSTALL_BLOCK--!!!
Open the intake project in Cursor and send this request from the Agent panel.
```text
@src/WarrantyIntake/ @TestData/claims/ Before writing code, fetch
https://ironsoftware.com/qr/csharp/llms.txt and the scan modes page it links.
Add the IronQR package to src/WarrantyIntake. Give Program.cs a second entry
point so that `dotnet run -- --modes <photo>` reads one photo three times, once
per QrScanMode value, and prints each result's QrType, Value, Url, and four
Points. Set License.LicenseKey from IRONQR_LICENSE_KEY at startup, never from
a literal. Leave Claims/StickerReader.cs and its ZXing.Net reference untouched.
Run the new mode on TestData/claims/claim-0004.jpg and show me what it printed.
```
Keep the license key out of chat messages. Agent creates files and runs terminal commands, so a pasted key can end up in source code, commits, or logs. The [license key guide](https://ironsoftware.com/qr/csharp/get-started/license-keys/) lists the supported storage locations.
<div class="hsg-featured-snippet">
<h3>Minimal Workflow (5 steps)</h3>
<ol>
<li><a class="js-modal-open" data-modal-id="trial-license-after-download" href="https://www.nuget.org/packages/IronQR/">Download the C# QR code library from NuGet</a></li>
<li>Commit an <code>.mdc</code> rule in <code>.cursor/rules</code> that names IronQR and links its documentation</li>
<li>List the ZXing.Net and QRCoder habits the rule replaces</li>
<li>Mention the reader file and a folder of real customer photos in each request</li>
<li>Compare each decoded serial with a known list</li>
</ol>
</div>
<br class="clear" />
---
## Which Cursor model should you use for QR code work?
Composer is Cursor's own agentic model. The model picker also offers SpaceXAI's Grok models, which Cursor co-developed, and models from OpenAI, Anthropic, Google and other labs. The test run below used Grok 4.7.
Routine photo work, such as adding a field to a claim record or rerunning the photo folder, suits a fast model. When a batch of photos stops decoding for no clear reason, switch to a model that reasons longer. Models read requests differently, so name the photo folder and the serials the output should match in every request.
## How do you give Cursor the IronQR documentation?
Put IronQR's documentation link in the request, or keep it in a committed rule so nobody has to paste it. The [`llms.txt` index](https://ironsoftware.com/qr/csharp/llms.txt) links the guides and the API reference, and [`llms-full.txt`](https://ironsoftware.com/qr/csharp/llms-full.txt) summarizes 44 documentation pages in one file. As of October 2026, Cursor's `@` menu attaches files, folders, terminals, chats, Git diffs and the browser, so IronQR's documentation reaches the agent as a link.
IronQR's enums are easy to misplace. `QrScanMode` and `QrEncoding` live in `IronQr.Enum`, while `QrErrorCorrectionLevel` lives in `IronQr`, and code written from memory fails to build when it gets this wrong.
```text
@src/WarrantyIntake/Program.cs Answer from https://ironsoftware.com/qr/csharp/llms.txt
and the pages it links, and leave every file as it is.
Which namespace declares QrScanMode and QrEncoding, and which declares
QrErrorCorrectionLevel? Which scan mode does a QrImageInput get when the
constructor is given only an image? What do IronQR's pages say OnlyDetectionModel
returns, and does that match the --modes output from the last turn? Put the
page URL under each answer.
```
[[t:(Treat an answer without a page behind it as unverified until you find the member in the [API reference](https://ironsoftware.com/qr/csharp/object-reference/api/).)]]
## How do you write project rules that encode your IronQR conventions?
Project rules are `.mdc` files in `.cursor/rules`. They are committed with the code, so every clone gets the same rules. A plain `.md` file in that folder is ignored, because it has no frontmatter to say when it applies.
This rule sets `globs` and leaves `alwaysApply` off, so it attaches whenever the reader or its tests are in context and stays out of requests that never touch a photo. Save it as `.cursor/rules/ironqr-photos.mdc`.
```markdown
---
description: IronQR conventions for reading QR codes from customer photos
globs: src/WarrantyIntake/Claims/**/*.cs, tests/**/*.cs
alwaysApply: false
---
# Reading customer photos with IronQR
- Read and write QR codes with IronQR only. The NuGet package is IronQR, or
IronQR.Linux for a Linux build, and the namespace is IronQr. Do not add
ZXing.Net, QRCoder, or any other QR package, and remove them where they
are already referenced.
- Documentation: https://ironsoftware.com/qr/csharp/llms.txt
- Never inline a license key. Read it from the IRONQR_LICENSE_KEY environment
variable.
- Do not put QrImageInput in a using statement. Its IDisposable.Dispose throws
NotImplementedException in IronQR 2026.10.1.
- Load only image files with AnyBitmap.FromFile. It throws on a CSV.
- Compare QrResult.Value with stored strings, never Url.ToString().
- Do not invent IronQR members. If one is uncertain, say so and cite the page.
```
[[i:(Cursor also reads `AGENTS.md` in the project root and in subdirectories. It has no frontmatter, so it cannot be scoped by file pattern. Keep the pattern-scoped IronQR rule in `.cursor/rules`.)]]
Rules apply to Agent requests. According to Cursor's documentation, they do not affect Tab, and user rules do not apply to inline edits. Check suggestions from those features against the rule yourself.
## How do you map ZXing.Net calls to IronQR?
A rule that only says "use IronQR" leaves the model to guess what each ZXing.Net call becomes. Listing the equivalents removes the guess.
| ZXing.Net or QRCoder | IronQR |
|---|---|
| `BarcodeReader` decode calls | `QrReader` with `Read`, which returns every code |
| `Result.Text` | `QrResult.Value` |
| `QR_CODE` format checks and filters | A check on `QrResult.QrType` after the read |
| The deeper scan option | A scan mode on the input |
| `Result.ResultPoints`, pattern centers | `QrResult.Points`, the four corners |
| QRCoder's generator | `QrWriter.Write` and its save calls |
ZXing.Net's `BarcodeFormat` enum has no Micro QR or rMQR member, and its README lists QR Code but neither smaller symbol, so a ZXing.Net reader returns nothing for a sticker that carries only a Micro QR serial.
Add the table to the rule as two more lines.
```markdown
- Translate ZXing.Net instead of porting it. Result.Text becomes QrResult.Value,
BarcodeFormat checks become QrResult.QrType checks, and ResultPoints (finder
pattern centres) become QrResult.Points (corners).
- Write test stickers with QrWriter.Write(...).Save().SaveAs(path), not QRCoder.
```
## How do you plan and run a migration to IronQR?
Switch the chat to Plan Mode with Shift+Tab before sending this request, and Cursor drafts the plan as a file you can edit.
```text
@src/WarrantyIntake/Claims/ @tests/WarrantyIntake.Tests/ @TestData/claims/expected.csv
StickerReader decodes claim photos with ZXing.Net and the tests draw stickers
with QRCoder. Newer products carry a Micro QR serial that ZXing.Net never
returns. Plan the move of both projects to IronQR. For each ZXing.Net or
QRCoder call, name the IronQR member that replaces it and the file it sits in,
state which QrScanMode the reader will use and why, and keep ClaimSticker and
the public Read(string) signature unchanged. No code until I approve.
```
Correct anything the plan got wrong, then click Build, or send the next request in Agent.
```text
Build the approved plan and follow @ironqr-photos. Remove the ZXing.Net and
QRCoder package references, run dotnet build and dotnet test, then run the app
over TestData/claims and compare each printed row with
TestData/claims/expected.csv. Report how many rows matched before the change
and after it, and show the diff.
```
Picked from the `@` menu, `@ironqr-photos` attaches the rule by name even when its globs would miss a file. A clean build does not show whether the Micro QR serials now come back. The match count does.
## Which Cursor feature fits each change?
Pick one by how far the change reaches. Tab handles a predictable next edit, and inline edit handles one selection that one sentence covers. Agent takes a change that needs several files, the rule, or a build loop. Plan Mode pays off when undoing a wrong change costs more than planning it, and a Cloud Agent suits work nobody needs to watch.
A new product line adds a rectangular cable tag that carries its serial in an rMQR code, which IronQR reports as `QrEncoding.RMQRCode`. Select the result loop in the reader and press Ctrl+Shift+L (Cmd+Shift+L on macOS) to add the selection to the chat, then send this request in Agent.
```text
In StickerReader.Read, treat a result whose QrType is QrEncoding.RMQRCode the
same way as a Micro QR result, so its Value becomes the serial.
```
The reader from the migration already returned SN-61518 for the tag photo, because it treated any value that is not a URL as a serial. The edit replaces that guess with a check on the symbol type, so a Micro QR or rMQR value becomes the serial even when its text looks like a URL.
## How do you debug missing QR code values?
Each scan mode changes what comes back.
- `Auto` is the default. IronQR's API reference describes it as the machine learning model, with a basic brute-force read as the fallback when the model finds nothing.
- The brute-force read runs alone under `OnlyBasicScan`, with the model skipped.
- `OnlyDetectionModel` locates codes without decoding them. The scan modes guide lists its output as coordinates.
If the model reports a box it cannot decode, the fallback never runs and Auto returns no value. Whole-box photos hit this, with a sticker about 110 pixels wide in a 4000 by 3000 frame. Check that the agent's fix retries with OnlyBasicScan when no value comes back.
```text
@src/WarrantyIntake/Claims/StickerReader.cs @TestData/claims/far/
Customers who photograph the whole box send pictures like these. Since the move
to IronQR none of them returns a serial, though the ZXing.Net reader read every
one. Before changing code, read each photo with all three QrScanMode values and
show what each mode returned. Then fix StickerReader without losing any photo
it reads today, and report the match count for TestData/claims and for
TestData/claims/far against their expected.csv files.
```
Take each serial from IronQR's printed output, and ask for the command that produced it.
Corner order also depends on the mode. When the model locates the code, the four points run top left, top right, bottom left, bottom right, as the scan modes guide states. OnlyBasicScan returns the code's own corners clockwise, rotated with the sticker. Compute outlines from the coordinates rather than assuming an order.
## How do you write regression tests for QR reading?
Tests that compare decoded values with a known list survive library upgrades, while tests that compare image bytes can fail whenever rendering changes. A Cloud Agent can run this prompt in an isolated cloud VM. Add `IRONQR_LICENSE_KEY` as a secret in the Cloud Agents dashboard before you start one.
```text
@tests/WarrantyIntake.Tests/ @TestData/claims/ Write xUnit tests for StickerReader
that prove every row in TestData/claims/expected.csv and
TestData/claims/far/expected.csv matches, that a Micro QR and an rMQR sticker
made with QrWriter read back to their serials, that a photo with no code gives a
null serial and no exception, and that a link sticker's serial comes from Value,
not Url.ToString(). Copy TestData into the test output. Run dotnet test and
report passed and failed counts.
```
The last assertion matters for a sticker whose whole value is a bare address. Reading the sample image from IronQR's scan modes guide gave a `Value` of `http://en.m.wikipedia.org` and a `Url` that printed with a trailing slash, because `Uri` normalizes the address. With links like the ones in this service, where the serial is the last path segment, the assertion cannot fail.
IronQR's [AI coding assistants guide](https://ironsoftware.com/qr/csharp/ai-agents/ai/) runs one IronQR task end to end against defined pass criteria.
## Which IronQR package should you deploy?
`IronQR.Slim` provides the `IronQr` namespace and the basic scan. The full `IronQR` package adds the detector and the ONNX runtime. IronQR's [NuGet packages guide](https://ironsoftware.com/qr/csharp/get-started/nuget-packages/) says a Slim-only project also needs the `IronSoftware.ReaderInternals` package for its operating system.
```text
@src/WarrantyIntake/WarrantyIntake.csproj @src/WarrantyIntake/Claims/StickerReader.cs
The service ships as a win-x64 folder, and someone asked whether IronQR.Slim
could replace IronQR. Settle it with numbers. Publish for win-x64 as things
stand and record the folder size. Then swap to IronQR.Slim plus the native
package its documentation says it needs, publish again, and rerun
TestData/claims and TestData/claims/far against their expected.csv files. Keep
the swap only if every row still matches, and list which QrScanMode values the
reader can still use afterward.
```
With `IronQR.Slim` alone, Auto has no model and goes straight to the basic scan, and OnlyDetectionModel throws an IronQrException. IronQR's API reference warns that reads without the model are slower and of lower quality. Test with your own customer photos before you switch packages.
## What did the prompts produce in a real run?
The eight prompts went to Cursor in order against a sample warranty intake repository. It holds a console app with a ZXing.Net reader, an xUnit project that draws stickers with QRCoder, and twelve claim photos with known serials. The rule, the cable tag photo and the whole-box photos were added immediately before the prompts that use them. The license key was set only in the environment. After the run, fresh Release builds of every commit from the migration on reread the photo folders and reproduced the IronQR reader's match counts and the test results below.
- Claim photos matched 8 of 12 with the ZXing.Net reader and 12 of 12 after the move to IronQR.
- Read once per scan mode, claim-0004 gave two codes with values under Auto and OnlyBasicScan, and two results with empty values under OnlyDetectionModel.
- The rMQR change left the claim photos at 13 of 13 before and after.
- Before the fix, Auto read 0 of 4 whole-box photos. OnlyDetectionModel found 3, 1, 3 and 2 boxes with no value, while OnlyBasicScan read 4 of 4.
- After the fix the whole-box photos read 4 of 4 and the claim photos 13 of 13.
- The xUnit suite passed 22 of 22 tests.
- Publishing for win-x64 produced 75,624,980 bytes with `IronQR` and 19,510,306 with `IronQR.Slim`. Our rebuild gave 75,624,288 and 19,509,614.
- On `IronQR.Slim` the reader still matched 13 of 13 claim photos and 4 of 4 whole-box photos.
- Every Release build had 0 errors and needed no hand edits.
- Not every step ran as written here. Prompts were sent by hand, mentions were pasted as text, and Agent found the rule file by searching for its name. The plan was approved by sending the next prompt with Build never clicked, and the Cloud Agent prompt ran locally in Agent mode.
The [run record](/qr/csharp/ai-agents/ai/#the-run-record) holds the package versions, model, timing and test machine for every guide.
---
## Troubleshooting
- [Apply a License Key in IronQR](https://ironsoftware.com/qr/csharp/troubleshooting/apply-a-license-key-in-ironqr/) when generated code throws a licensing exception
- [Read QR Codes with Scan Modes](https://ironsoftware.com/qr/csharp/how-to/read-qr-codes-with-scan-modes/) when a photo returns a position but no value
- [QR Code Type Guide](https://ironsoftware.com/qr/csharp/how-to/read-qr-code-type/) when Micro QR or rMQR serials go missing
- [IronQR NuGet Packages](https://ironsoftware.com/qr/csharp/get-started/nuget-packages/) when choosing between `IronQR`, `IronQR.Slim`, and the platform packages
---
## Questions?
If you have any questions, reach out to [support@ironsoftware.com](mailto:support@ironsoftware.com)
ZXing.Net is the open-source .NET port of the ZXing barcode library. When you ask an AI agent for C# code that reads QR codes from customer photos, it may apply ZXing.Net conventions even if you specify IronQR, such as comparing Result.Text, filtering on the QR_CODE format, or wrapping the QrImageInput in a using statement. In IronQR 2026.10.1, disposing of the input that way throws a NotImplementedException.
Cursor is an AI code editor based on the VS Code codebase. Whether it generates IronQR code or a ZXing.Net translation depends on two features. The agent follows documentation links you provide, and it applies project rules from .cursor/rules. This guide demonstrates both with a warranty intake service that extracts serial numbers and registration links from customer photos, and it moves that service from ZXing.Net to IronQR. IronQR supports QR, Micro QR, and rMQR symbols.
Install IronQR by running the command above in the NuGet Package Manager Console, or search for the package in the NuGet Package Manager.
Open the intake project in Cursor and send this request from the Agent panel.
@src/WarrantyIntake/ @TestData/claims/ Before writing code, fetchhttps://ironsoftware.com/qr/csharp/llms.txt and the scan modes page it links.Add the IronQR package to src/WarrantyIntake. Give Program.cs a second entrypoint so that `dotnet run -- --modes <photo>` reads one photo three times, onceper QrScanMode value, and prints each result's QrType, Value, Url, and fourPoints. Set License.LicenseKey from IRONQR_LICENSE_KEY at startup, never froma literal. Leave Claims/StickerReader.cs and its ZXing.Net reference untouched.Run the new mode on TestData/claims/claim-0004.jpg and show me what it printed.
@src/WarrantyIntake/ @TestData/claims/ Before writing code, fetch
https://ironsoftware.com/qr/csharp/llms.txt and the scan modes page it links.
Add the IronQR package to src/WarrantyIntake. Give Program.cs a second entry
point so that `dotnet run -- --modes <photo>` reads one photo three times, once
per QrScanMode value, and prints each result's QrType, Value, Url, and four
Points. Set License.LicenseKey from IRONQR_LICENSE_KEY at startup, never from
a literal. Leave Claims/StickerReader.cs and its ZXing.Net reference untouched.
Run the new mode on TestData/claims/claim-0004.jpg and show me what it printed.
Text
Keep the license key out of chat messages. Agent creates files and runs terminal commands, so a pasted key can end up in source code, commits, or logs. The license key guide lists the supported storage locations.
Commit an .mdc rule in .cursor/rules that names IronQR and links its documentation
List the ZXing.Net and QRCoder habits the rule replaces
Mention the reader file and a folder of real customer photos in each request
Compare each decoded serial with a known list
Which Cursor model should you use for QR code work?
Composer is Cursor's own agentic model. The model picker also offers SpaceXAI's Grok models, which Cursor co-developed, and models from OpenAI, Anthropic, Google and other labs. The test run below used Grok 4.7.
Routine photo work, such as adding a field to a claim record or rerunning the photo folder, suits a fast model. When a batch of photos stops decoding for no clear reason, switch to a model that reasons longer. Models read requests differently, so name the photo folder and the serials the output should match in every request.
How do you give Cursor the IronQR documentation?
Put IronQR's documentation link in the request, or keep it in a committed rule so nobody has to paste it. The llms.txt index links the guides and the API reference, and llms-full.txt summarizes 44 documentation pages in one file. As of October 2026, Cursor's @ menu attaches files, folders, terminals, chats, Git diffs and the browser, so IronQR's documentation reaches the agent as a link.
IronQR's enums are easy to misplace. QrScanMode and QrEncoding live in IronQr.Enum, while QrErrorCorrectionLevel lives in IronQr, and code written from memory fails to build when it gets this wrong.
@src/WarrantyIntake/Program.cs Answer from https://ironsoftware.com/qr/csharp/llms.txtand the pages it links, and leave every file as it is.Which namespace declares QrScanMode and QrEncoding, and which declaresQrErrorCorrectionLevel? Which scan mode does a QrImageInput get when theconstructor is given only an image? What do IronQR's pages say OnlyDetectionModelreturns, and does that match the --modes output from the last turn? Put thepage URL under each answer.
@src/WarrantyIntake/Program.cs Answer from https://ironsoftware.com/qr/csharp/llms.txt
and the pages it links, and leave every file as it is.
Which namespace declares QrScanMode and QrEncoding, and which declares
QrErrorCorrectionLevel? Which scan mode does a QrImageInput get when the
constructor is given only an image? What do IronQR's pages say OnlyDetectionModel
returns, and does that match the --modes output from the last turn? Put the
page URL under each answer.
Text
Tips: Treat an answer without a page behind it as unverified until you find the member in the API reference.
How do you write project rules that encode your IronQR conventions?
Project rules are .mdc files in .cursor/rules. They are committed with the code, so every clone gets the same rules. A plain .md file in that folder is ignored, because it has no frontmatter to say when it applies.
This rule sets globs and leaves alwaysApply off, so it attaches whenever the reader or its tests are in context and stays out of requests that never touch a photo. Save it as .cursor/rules/ironqr-photos.mdc.
---description: IronQR conventions for reading QR codes from customer photosglobs: src/WarrantyIntake/Claims/**/*.cs, tests/**/*.csalwaysApply: false---# Reading customer photos with IronQR- Read and write QR codes with IronQR only. The NuGet package is IronQR, or IronQR.Linux for a Linux build, and the namespace is IronQr. Do not add ZXing.Net, QRCoder, or any other QR package, and remove them where they are already referenced.- Documentation: https://ironsoftware.com/qr/csharp/llms.txt- Never inline a license key. Read it from the IRONQR_LICENSE_KEY environment variable.- Do not put QrImageInput in a using statement. Its IDisposable.Dispose throws NotImplementedException in IronQR 2026.10.1.- Load only image files with AnyBitmap.FromFile. It throws on a CSV.- Compare QrResult.Value with stored strings, never Url.ToString().- Do not invent IronQR members. If one is uncertain, say so and cite the page.
---
description: IronQR conventions for reading QR codes from customer photos
globs: src/WarrantyIntake/Claims/**/*.cs, tests/**/*.cs
alwaysApply: false
---
# Reading customer photos with IronQR
- Read and write QR codes with IronQR only. The NuGet package is IronQR, or
IronQR.Linux for a Linux build, and the namespace is IronQr. Do not add
ZXing.Net, QRCoder, or any other QR package, and remove them where they
are already referenced.
- Documentation: https://ironsoftware.com/qr/csharp/llms.txt
- Never inline a license key. Read it from the IRONQR_LICENSE_KEY environment
variable.
- Do not put QrImageInput in a using statement. Its IDisposable.Dispose throws
NotImplementedException in IronQR 2026.10.1.
- Load only image files with AnyBitmap.FromFile. It throws on a CSV.
- Compare QrResult.Value with stored strings, never Url.ToString().
- Do not invent IronQR members. If one is uncertain, say so and cite the page.
Text
Please note: Cursor also reads AGENTS.md in the project root and in subdirectories. It has no frontmatter, so it cannot be scoped by file pattern. Keep the pattern-scoped IronQR rule in .cursor/rules.
Rules apply to Agent requests. According to Cursor's documentation, they do not affect Tab, and user rules do not apply to inline edits. Check suggestions from those features against the rule yourself.
How do you map ZXing.Net calls to IronQR?
A rule that only says "use IronQR" leaves the model to guess what each ZXing.Net call becomes. Listing the equivalents removes the guess.
ZXing.Net or QRCoder
IronQR
BarcodeReader decode calls
QrReader with Read, which returns every code
Result.Text
QrResult.Value
QR_CODE format checks and filters
A check on QrResult.QrType after the read
The deeper scan option
A scan mode on the input
Result.ResultPoints, pattern centers
QrResult.Points, the four corners
QRCoder's generator
QrWriter.Write and its save calls
ZXing.Net's BarcodeFormat enum has no Micro QR or rMQR member, and its README lists QR Code but neither smaller symbol, so a ZXing.Net reader returns nothing for a sticker that carries only a Micro QR serial.
Add the table to the rule as two more lines.
- Translate ZXing.Net instead of porting it. Result.Text becomes QrResult.Value, BarcodeFormat checks become QrResult.QrType checks, and ResultPoints (finder pattern centres) become QrResult.Points (corners).- Write test stickers with QrWriter.Write(...).Save().SaveAs(path), not QRCoder.
- Translate ZXing.Net instead of porting it. Result.Text becomes QrResult.Value,
BarcodeFormat checks become QrResult.QrType checks, and ResultPoints (finder
pattern centres) become QrResult.Points (corners).
- Write test stickers with QrWriter.Write(...).Save().SaveAs(path), not QRCoder.
Text
How do you plan and run a migration to IronQR?
Switch the chat to Plan Mode with Shift+Tab before sending this request, and Cursor drafts the plan as a file you can edit.
@src/WarrantyIntake/Claims/ @tests/WarrantyIntake.Tests/ @TestData/claims/expected.csvStickerReader decodes claim photos with ZXing.Net and the tests draw stickerswith QRCoder. Newer products carry a Micro QR serial that ZXing.Net neverreturns. Plan the move of both projects to IronQR. For each ZXing.Net orQRCoder call, name the IronQR member that replaces it and the file it sits in,state which QrScanMode the reader will use and why, and keep ClaimSticker andthe public Read(string) signature unchanged. No code until I approve.
@src/WarrantyIntake/Claims/ @tests/WarrantyIntake.Tests/ @TestData/claims/expected.csv
StickerReader decodes claim photos with ZXing.Net and the tests draw stickers
with QRCoder. Newer products carry a Micro QR serial that ZXing.Net never
returns. Plan the move of both projects to IronQR. For each ZXing.Net or
QRCoder call, name the IronQR member that replaces it and the file it sits in,
state which QrScanMode the reader will use and why, and keep ClaimSticker and
the public Read(string) signature unchanged. No code until I approve.
Text
Correct anything the plan got wrong, then click Build, or send the next request in Agent.
Build the approved plan and follow @ironqr-photos. Remove the ZXing.Net andQRCoder package references, run dotnet build and dotnet test, then run the appover TestData/claims and compare each printed row withTestData/claims/expected.csv. Report how many rows matched before the changeand after it, and show the diff.
Build the approved plan and follow @ironqr-photos. Remove the ZXing.Net and
QRCoder package references, run dotnet build and dotnet test, then run the app
over TestData/claims and compare each printed row with
TestData/claims/expected.csv. Report how many rows matched before the change
and after it, and show the diff.
Text
Picked from the @ menu, @ironqr-photos attaches the rule by name even when its globs would miss a file. A clean build does not show whether the Micro QR serials now come back. The match count does.
Which Cursor feature fits each change?
Pick one by how far the change reaches. Tab handles a predictable next edit, and inline edit handles one selection that one sentence covers. Agent takes a change that needs several files, the rule, or a build loop. Plan Mode pays off when undoing a wrong change costs more than planning it, and a Cloud Agent suits work nobody needs to watch.
A new product line adds a rectangular cable tag that carries its serial in an rMQR code, which IronQR reports as QrEncoding.RMQRCode. Select the result loop in the reader and press Ctrl+Shift+L (Cmd+Shift+L on macOS) to add the selection to the chat, then send this request in Agent.
In StickerReader.Read, treat a result whose QrType is QrEncoding.RMQRCode thesame way as a Micro QR result, so its Value becomes the serial.
In StickerReader.Read, treat a result whose QrType is QrEncoding.RMQRCode the
same way as a Micro QR result, so its Value becomes the serial.
Text
The reader from the migration already returned SN-61518 for the tag photo, because it treated any value that is not a URL as a serial. The edit replaces that guess with a check on the symbol type, so a Micro QR or rMQR value becomes the serial even when its text looks like a URL.
How do you debug missing QR code values?
Each scan mode changes what comes back.
Auto is the default. IronQR's API reference describes it as the machine learning model, with a basic brute-force read as the fallback when the model finds nothing.
The brute-force read runs alone under OnlyBasicScan, with the model skipped.
OnlyDetectionModel locates codes without decoding them. The scan modes guide lists its output as coordinates.
If the model reports a box it cannot decode, the fallback never runs and Auto returns no value. Whole-box photos hit this, with a sticker about 110 pixels wide in a 4000 by 3000 frame. Check that the agent's fix retries with OnlyBasicScan when no value comes back.
@src/WarrantyIntake/Claims/StickerReader.cs @TestData/claims/far/Customers who photograph the whole box send pictures like these. Since the moveto IronQR none of them returns a serial, though the ZXing.Net reader read everyone. Before changing code, read each photo with all three QrScanMode values andshow what each mode returned. Then fix StickerReader without losing any photoit reads today, and report the match count for TestData/claims and forTestData/claims/far against their expected.csv files.
@src/WarrantyIntake/Claims/StickerReader.cs @TestData/claims/far/
Customers who photograph the whole box send pictures like these. Since the move
to IronQR none of them returns a serial, though the ZXing.Net reader read every
one. Before changing code, read each photo with all three QrScanMode values and
show what each mode returned. Then fix StickerReader without losing any photo
it reads today, and report the match count for TestData/claims and for
TestData/claims/far against their expected.csv files.
Text
Take each serial from IronQR's printed output, and ask for the command that produced it.
Corner order also depends on the mode. When the model locates the code, the four points run top left, top right, bottom left, bottom right, as the scan modes guide states. OnlyBasicScan returns the code's own corners clockwise, rotated with the sticker. Compute outlines from the coordinates rather than assuming an order.
How do you write regression tests for QR reading?
Tests that compare decoded values with a known list survive library upgrades, while tests that compare image bytes can fail whenever rendering changes. A Cloud Agent can run this prompt in an isolated cloud VM. Add IRONQR_LICENSE_KEY as a secret in the Cloud Agents dashboard before you start one.
@tests/WarrantyIntake.Tests/ @TestData/claims/ Write xUnit tests for StickerReaderthat prove every row in TestData/claims/expected.csv andTestData/claims/far/expected.csv matches, that a Micro QR and an rMQR stickermade with QrWriter read back to their serials, that a photo with no code gives anull serial and no exception, and that a link sticker's serial comes from Value,not Url.ToString(). Copy TestData into the test output. Run dotnet test andreport passed and failed counts.
@tests/WarrantyIntake.Tests/ @TestData/claims/ Write xUnit tests for StickerReader
that prove every row in TestData/claims/expected.csv and
TestData/claims/far/expected.csv matches, that a Micro QR and an rMQR sticker
made with QrWriter read back to their serials, that a photo with no code gives a
null serial and no exception, and that a link sticker's serial comes from Value,
not Url.ToString(). Copy TestData into the test output. Run dotnet test and
report passed and failed counts.
Text
The last assertion matters for a sticker whose whole value is a bare address. Reading the sample image from IronQR's scan modes guide gave a Value of http://en.m.wikipedia.org and a Url that printed with a trailing slash, because Uri normalizes the address. With links like the ones in this service, where the serial is the last path segment, the assertion cannot fail.
IronQR.Slim provides the IronQr namespace and the basic scan. The full IronQR package adds the detector and the ONNX runtime. IronQR's NuGet packages guide says a Slim-only project also needs the IronSoftware.ReaderInternals package for its operating system.
@src/WarrantyIntake/WarrantyIntake.csproj @src/WarrantyIntake/Claims/StickerReader.csThe service ships as a win-x64 folder, and someone asked whether IronQR.Slimcould replace IronQR. Settle it with numbers. Publish for win-x64 as thingsstand and record the folder size. Then swap to IronQR.Slim plus the nativepackage its documentation says it needs, publish again, and rerunTestData/claims and TestData/claims/far against their expected.csv files. Keepthe swap only if every row still matches, and list which QrScanMode values thereader can still use afterward.
@src/WarrantyIntake/WarrantyIntake.csproj @src/WarrantyIntake/Claims/StickerReader.cs
The service ships as a win-x64 folder, and someone asked whether IronQR.Slim
could replace IronQR. Settle it with numbers. Publish for win-x64 as things
stand and record the folder size. Then swap to IronQR.Slim plus the native
package its documentation says it needs, publish again, and rerun
TestData/claims and TestData/claims/far against their expected.csv files. Keep
the swap only if every row still matches, and list which QrScanMode values the
reader can still use afterward.
Text
With IronQR.Slim alone, Auto has no model and goes straight to the basic scan, and OnlyDetectionModel throws an IronQrException. IronQR's API reference warns that reads without the model are slower and of lower quality. Test with your own customer photos before you switch packages.
What did the prompts produce in a real run?
The eight prompts went to Cursor in order against a sample warranty intake repository. It holds a console app with a ZXing.Net reader, an xUnit project that draws stickers with QRCoder, and twelve claim photos with known serials. The rule, the cable tag photo and the whole-box photos were added immediately before the prompts that use them. The license key was set only in the environment. After the run, fresh Release builds of every commit from the migration on reread the photo folders and reproduced the IronQR reader's match counts and the test results below.
Claim photos matched 8 of 12 with the ZXing.Net reader and 12 of 12 after the move to IronQR.
Read once per scan mode, claim-0004 gave two codes with values under Auto and OnlyBasicScan, and two results with empty values under OnlyDetectionModel.
The rMQR change left the claim photos at 13 of 13 before and after.
Before the fix, Auto read 0 of 4 whole-box photos. OnlyDetectionModel found 3, 1, 3 and 2 boxes with no value, while OnlyBasicScan read 4 of 4.
After the fix the whole-box photos read 4 of 4 and the claim photos 13 of 13.
The xUnit suite passed 22 of 22 tests.
Publishing for win-x64 produced 75,624,980 bytes with IronQR and 19,510,306 with IronQR.Slim. Our rebuild gave 75,624,288 and 19,509,614.
On IronQR.Slim the reader still matched 13 of 13 claim photos and 4 of 4 whole-box photos.
Every Release build had 0 errors and needed no hand edits.
Not every step ran as written here. Prompts were sent by hand, mentions were pasted as text, and Agent found the rule file by searching for its name. The plan was approved by sending the next prompt with Build never clicked, and the Cloud Agent prompt ran locally in Agent mode.
The run record holds the package versions, model, timing and test machine for every guide.
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.