Cursor rule
.cursor/rules/e2e-ocr.mdcE2E OCR assertions with Tesseract.js for canvas-only UI such as PDF pages in Cypress page objects
Cursor rules
Quality
46/100
Scores the file, not the repository.Length
191 words
4 headings · 0 code blocksRepository
49
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.123456# E2E OCR Rules78Use this rule when asserting text that is not in the DOM, such as PDF content drawn only to `<canvas>`. Keep OCR in test infrastructure, not product code.910## Tesseract Setup1112- Use `tesseract.js`, a root devDependency, for canvas-only assertions via `cy.task`.13- Register a Node task in `e2e_test/config/common.ts`.14- The task should call `tesseract.js` `createWorker` and `recognize` on image bytes, such as base64 PNG without the `data:image/png;base64,` prefix.15- Example task name: `ocrCanvasImage`.1617## Language Data1819- Commit `e2e_test/tesseract/eng.traineddata` uncompressed.20- Pass `langPath` and `cachePath` to that directory when creating the worker.21- This prevents Tesseract from writing `eng.traineddata` to the repo root. Root-level traineddata files are gitignored as a fallback.2223## Page Object Pattern2425- Wait until the canvas has real ink before OCR. Sampling `getImageData` for dark pixels is better than checking only non-zero alpha, because an empty white fill can still have alpha.26- Export with `toDataURL("image/png")`.27- Strip the data URL prefix.28- Use `cy.task(..., { timeout: ... })` for slow OCR.29- Assert the returned string contains the expected substring with a clear message.30- Reference: `e2e_test/start/pageObjects/bookReadingPage.ts`, from `expectPdfBeginningVisible` through `expectCurrentPage(1).expectVisibleOCRContains`.31
Also in nerds-odd-e/doughnut
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| nerds-odd-e/doughnut.clinerules/daisyui.md · 49 | Cline rules | setuplint-formatstyleui+1 | 57/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/architecture-decisions.mdc · 49 | Cursor rules | no sections | 16/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/backend-code.mdc · 49 | Cursor rules | styletypesdatabasedo-not | 61/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/backend-testing.mdc · 49 | Cursor rules | buildteststyletesting-strategy+2 | 73/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49 | Cursor rules | setupbuildteststyle+4 | 96/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/db-migration.mdc · 49 | Cursor rules | stylearchdatabasedeployment | 64/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/e2e-authoring.mdc · 49 | Cursor rules | setupteststylearch+3 | 80/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-api.mdc · 49 | Cursor rules | styletesting-strategyapido-not | 57/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-component.mdc · 49 | Cursor rules | testlint-formatstylearch+2 | 76/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-storybook.mdc · 49 | Cursor rules | buildteststyletesting-strategy+1 | 69/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-testing.mdc · 49 | Cursor rules | buildteststyletesting-strategy+2 | 89/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/general.mdc · 49 | Cursor rules | styledo-not | 49/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/gsd-coexistence.mdc · 49 | Cursor rules | style | 60/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/linting_formating.mdc · 49 | Cursor rules | testlint-formatstylearch+6 | 88/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/mcp-server.mdc · 49 | Cursor rules | buildtestlint-formatarch+2 | 85/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/planning.mdc · 49 | Cursor rules | teststylearchdo-not+1 | 75/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/script.mdc · 49 | Cursor rules | testarch | 58/100 | 3 days ago | |
| nerds-odd-e/doughnutAGENTS.md · 49 | AGENTS.md | no sections | 47/100 | 3 days ago | |
| nerds-odd-e/doughnutCLAUDE.md · 49 | CLAUDE.md | agent-behaviour | 47/100 | 3 days ago |
Diff against .clinerules/daisyui.md Diff against .cursor/rules/architecture-decisions.mdc Diff against .cursor/rules/backend-code.mdc Diff against .cursor/rules/backend-testing.mdc Diff against .cursor/rules/cli.mdc Diff against .cursor/rules/db-migration.mdc Diff against .cursor/rules/e2e-authoring.mdc Diff against .cursor/rules/frontend-api.mdc Diff against .cursor/rules/frontend-component.mdc Diff against .cursor/rules/frontend-storybook.mdc Diff against .cursor/rules/frontend-testing.mdc Diff against .cursor/rules/general.mdc Diff against .cursor/rules/gsd-coexistence.mdc Diff against .cursor/rules/linting_formating.mdc Diff against .cursor/rules/mcp-server.mdc Diff against .cursor/rules/planning.mdc Diff against .cursor/rules/script.mdc Diff against AGENTS.md Diff against CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago |
