Imported from mantoufan/cvcm (
AGENTS.md). Install upstream withnpx skills add mantoufan/cvcm. Copyright stays with the author.
cv.cm
Browser toolkit on a Cloudflare Worker (Pages advanced mode _worker.js).
Hard rules
- Image and PDF tools (watermark, collage, convert, image-pdf, resize, crop, meme, pdf-jpg, merge-pdf, compress-pdf, split-pdf, invoice) process files in the page. Do not add upload APIs for those tools, analytics beacons, or extra third-party
connect-srchosts. - Clipboard text lives in D1 (
cvcm/ bindingDB, tableclips). Non-text files go to s3.cv.cm bucketfilesvia Worker-presigned PUT. No KV or R2. - The Worker serves static files, locale redirects, security headers,
/api/clip, and/api/clip/upload. Reject otherPOST/PUT/PATCH/DELETEwith 405. - Clipboard notes: no login; auto-delete after 10 views or 24 hours. Text max 64 KB, files max 32 MB. No listing endpoint.
- New local tools process data with Web APIs in the page. Add a locale path, strings in
src/locales/*, and an entry insrc/shared/path.tsTOOLS. - Tutorials must be minimal, complete, and illustrated (owner correction, 2026-09-13). Explain the whole task from preparation through completion with concise steps and meaningful instructional diagrams. Use captions to explain each image. Present tutorials, not exercise cards, assignments, submission requirements, or grading criteria. Keep photography first. JK/Lolita/Hanfu fashion examples use adults.
Layout
src/worker.ts— edge Workersrc/clip-api.ts/src/clip-store.ts— clipboard API + D1migrations/— D1 schemasrc/client/— SPAsrc/client/clip/— cloud clipboardsrc/client/watermark/— image watermarksrc/client/collage/— photo collagesrc/client/convert/— image formats (PNG / JPG / WebP / AVIF / GIF / BMP / ICO)src/client/image-pdf/— images to PDFsrc/client/audio/— audio to WAVsrc/client/data/— JSON / CSV / Base64 / Markdownsrc/client/qr/— QR code generatorsrc/client/barcode/— barcode generator (Code 128, Code 39, EAN-13)src/client/password/— password generatorsrc/client/word-count/— word / character countersrc/client/color/— color pickersrc/client/resize/— resize / compress imagessrc/client/crop/— crop imagessrc/client/meme/— meme generator (top/bottom captions)src/client/pdf-jpg/— PDF to JPG / PNG / WebPsrc/client/merge-pdf/— merge PDFssrc/client/compress-pdf/— compress PDF by re-encoding pagessrc/client/split-pdf/— split PDF by page or rangesrc/client/invoice/— invoice PDF generatorsrc/client/names/— name and username generatorsrc/client/timezone/— time zone convertersrc/client/lorem/— lorem ipsum generatorsrc/client/units/— unit convertersrc/client/tts/— text to speech (browser SpeechSynthesis)src/client/learn/— minimal, complete illustrated tutorialssrc/shared/path.ts—CATEGORIES,TOOLS,TUTORIALS(/{locale}/learn/{id}/; locale paths lowercase:zh-cnzh-tw)src/shared/md.ts— markdown/html render + highlightsrc/s3-sign.ts— SigV4 presign for s3.cv.cmsrc/locales/—enfirst, thenzh-CNzh-TWjakoviidessrc/shared/— locale, path, zip, filenames (used by Worker and tests)
Deploy
The Cloudflare API token in use has Pages + DNS + D1. Ship with:
npm run build
npx wrangler d1 migrations apply cvcm --remote
npx wrangler pages deploy dist --project-name cvcm
dist/_worker.js is the Worker. Domain: cv.cm. D1 database id: 1a809cf5-bb42-4f8d-b2c6-6cd7430226c5.