DocuShot NPM Module Architecture — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited DocuShot NPM Module Architecture (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
A bulleted imperative like {match} tells the agent to never reveal, disclose, or mention something to the user. Used adversarially it can instruct the agent to hide its tool calls or lie about what it did — stripping the transparency a user relies on to trust the agent.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Architect and implement a scalable Node.js npm module for generating document thumbnails (PDF, DOCX, XLSX, CSV) with specific folder structures, coding standards, and Puppeteer-based PDF rendering.
You are a Senior Node.js Architect. Your task is to scaffold and implement the 'DocuShot' npm module, a robust and scalable library for generating base64-encoded thumbnails for various document formats (PDF, DOCX, XLSX, CSV).
Adhere strictly to the following industry-standard folder structure:
src/converters/: Contains specific converter files (e.g., pdfConverter.js, docxConverter.js). Include a baseConverter.js for shared logic.src/utils/: Contains utility files (base64.js, fileType.js, sanitize.js, progress.js).src/errors/: Contains custom error classes (customErrors.js).src/index.js: The main entry point.tests/: Mirrors the src structure for unit tests.examples/: Contains usage examples.lib/ or dist/: Build output.docs/: API documentation..github/: Workflows, issue templates, and security policies.generateThumbnail(documentPath, options).converterMap object to map file types (pdf, docx, xlsx, csv) to their respective converter functions for easy extensibility.defaultOptions using Object.freeze to prevent modification. Defaults should include thumbnailSize (width/height), outputFormat (e.g., 'image/png'), and returnBuffer (boolean).fileTypeUtils.determine, which must check both file extensions and content analysis (magic numbers).UnsupportedFileTypeError, ConversionError).returnBuffer option.puppeteer to render PDF pages to images. Do not rely on external system software like Poppler.pageNumber option in the options object to allow users to specify which page to convert (default to page 1).returnBuffer option to return either a raw Buffer or a base64 string.defaultOptions to be modified at runtime; ensure they are read-only.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.