agentleFS
neosun100neosun100/DeepSeek-OCR-WebUI/frontend/CLAUDE.md

DeepSeek-OCR-WebUI / frontend

CLAUDE.md447 starsChanged 10 months agoMITView on GitHub

This file contains the shared rules and context for all AI Agents working on this project. Do not edit the synced sections in individual Agent files; edit .agent/rules/common.md instead. The tool converts scanned images/multi-page PDFs into: - Markdown - DOCX - Text+Image PDF All processing except OCR API calls must run entirely in the browser. src/ ├─ main.ts ├─ App.vue ├─ stores/ │ └─ pages.ts ├─ db/ │ └─ index.ts ├─ components/ │ ├─ page-list/ │ ├─ page-viewer/ │ ├─…

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

15 rules. About 0 are common, 14 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No backend services are allowed except third-party OCR APIs.

    line 15
  2. Distinctive:

    All processing except OCR API calls must run entirely in the browser.

    line 22
  3. Distinctive:

    No database except browser storage

    line 32
  4. Very specific:

    Use IndexedDB (via Dexie.js)

    line 35
  5. Distinctive:

    All intermediate results must survive page refreshes

    line 36
  6. Distinctive:

    Avoid loading all images into memory at once

    line 42
  7. Distinctive:

    Never implicit or hidden states

    line 84
  8. Distinctive:

    Prefer clarity over cleverness

    line 87
  9. Distinctive:

    Use Composition API only

    line 122
  10. Distinctive:

    All side effects must be explicit

    line 124
  11. Distinctive:

    Every long-running operation must:

    line 125
  12. Distinctive:

    All log information must use consola, do not use console

    line 129
  13. Distinctive:

    Use Naive UI components whenever possible for common UI patterns

    line 136
  14. Distinctive:

    Only create custom components when Naive UI doesn't provide the needed functionality

    line 138
  15. Distinctive:

    Always use TypeScript for new features.

    line 154

≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.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
CLAUDE.md

Project: Browser-only Image/PDF OCR & Converter - Claude Code Rules

<!-- RULES_START -->

trigger: always_on

Common Coding Standards & Project Context

This file contains the shared rules and context for all AI Agents working on this project. Do not edit the synced sections in individual Agent files; edit .agent/rules/common.md instead.

Overview

This is a pure frontend, browser-only document processing tool. No backend services are allowed except third-party OCR APIs.

The tool converts scanned images/multi-page PDFs into:

  • Markdown
  • DOCX
  • Text+Image PDF

All processing except OCR API calls must run entirely in the browser.


Core Constraints (VERY IMPORTANT)

  1. Frontend only
    • Vue 3 + Vite
    • No Node.js backend
    • No server-side rendering
    • No database except browser storage
  2. Persistence
    • Use IndexedDB (via Dexie.js)
    • All intermediate results must survive page refreshes
    • Support resume / recovery
  3. Large documents
    • PDFs may have hundreds of pages
    • Use virtual lists
    • Avoid loading all images into memory at once
  4. Long-running tasks
    • OCR may take hours
    • UI must always remain responsive
    • Tasks must be resumable

Technology Stack

  • Framework: Vue 3 (Composition API)
  • Bundler: Vite
  • UI Library: Naive UI
  • State Management: Pinia
  • Local Storage: Dexie.js
  • PDF Rendering: pdfjs-dist
  • PDF Generation: pdf-lib
  • Markdown: markdown-it
  • DOCX: docx
  • Drag & Drop: vue-draggable-next
  • Virtual List: vue-virtual-scroller
  • Task Queue: p-queue
  • Utilities: @vueuse/core
  • Unit Testing: Vitest
  • E2E Testing: Playwright
  • Logging: Consola

Architecture Principles

  1. Page-centric design
    • Each image/PDF page is an independent unit
    • Each page has its own status, logs, and outputs
  2. State-driven UI
    • UI reflects state
    • Avoid DOM-driven logic
  3. Explicit task states
    • idle / processing / success / error
    • Never implicit or hidden states
  4. Readable, maintainable code
    • Prefer clarity over cleverness
    • Avoid premature optimization

Folder Structure (Target)

src/ ├─ main.ts ├─ App.vue ├─ stores/ │ └─ pages.ts ├─ db/ │ └─ index.ts ├─ components/ │ ├─ page-list/ │ ├─ page-viewer/ │ ├─ preview/ │ └─ ... ├─ services/ │ ├─ add/ │ ├─ pdf/ │ ├─ ocr/ │ ├─ export/ │ └─ ... ├─ workers/ │ └─ pdf.worker.ts └─ types/


Coding Rules

  • Use TypeScript
  • Use <script setup>
  • Use Composition API only
  • Prefer async/await
  • All side effects must be explicit
  • Every long-running operation must:
    • report progress
    • be cancellable if possible
    • log status updates
  • All log information must use consola, do not use console

UI Component Guidelines

  • Use existing UI components and avoid reinventing the wheel
  • Use Naive UI components whenever possible for common UI patterns
  • Leverage existing Naive UI message/notification system instead of custom implementations
  • Only create custom components when Naive UI doesn't provide the needed functionality

Language Requirements

  • IMPORTANT: All thinking processes, plans, execution processes, and final summaries of the Agent must be output in Chinese.
  • IMPORTANT: All code and documentation generated by the Agent must be in English.
  • IMPORTANT: All Implementation Plan, Task and Walkthrough documents generated by the Agent must be in Chinese.
<!-- RULES_END -->

Claude Specifics

  • Claude should focus on providing efficient, modern Vue 3 code.
  • Always use TypeScript for new features.

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.

Reviews can't be read right now.

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.