swap-file-scanner
Replace the upload virus scanner (ClamAV) with a scanning API or cloud malware scanning. Use when the user decides on a different scanner. Not for debugging; when something fails, use the debug skill.
Files1
View on GitHubSKILL.md.claude/skills/swap-file-scanner/SKILL.md
GitHubSwap the file scanner
- Interface:
FileScanner(scan(bytes): Promise<ScanResult>) inapps/worker/src/files/file-scanner.ts. - Today:
ClamdScannerstreams the bytes to clamd (INSTREAM);NoScanneraccepts everything and is refused in production when uploads are on. - Selected in:
createScanner()inapps/worker/src/files/files.module.ts. - Env:
FILE_SCANNER(clamav|none),CLAMAV_URL(apps/worker/src/env.ts). In Kubernetes, clamd is the stack chart'sclamavservice (services.clamavindeploy/charts/stack/values.yaml, enabled per environment).
Swap
- A class implementing
FileScanner:{ clean: true }, or{ clean: false, signature }for a detection. Throw on errors and timeouts so the job retries; never report clean when the scan didn't happen. - Add its name to the
FILE_SCANNERenum and its settings toapps/worker/src/env.ts,.env.exampleanddocs/environment.md; add a branch increateScanner(). - If ClamAV is no longer used, set
services.clamav.enabled: falsein the environments'stack.yaml.
Tests
apps/worker/src/files/file-scanner.test.ts (unit, a fake clamd), and the uploads
tests in apps/worker/test/worker.integration.test.ts, which scan real files with
ClamAV (EICAR). Add the same cases for the new scanner.
Finish
- The verify skill.
- Ask the
revieweragent to review the change, and thesecurity-revieweragent: a new implementation brings its own credentials and sends data somewhere new. If you wrote a migration, themigration-revieweragent too. - Update the seam's row in the README's "Scaling path" table if what's "Now" changed.