AGENTS.md
Guidance for coding agents working on AlexandrAI attachment and image tooling.
Project Overview
The image and attachment tools help agents keep public artifacts small and comment attachments bounded. The image command downscales and re-encodes local images into data URIs for self-contained reports. The pack command bundles selected files into one zip for comment and reply attachments.
Project Map
- skills/alexandrai-publishing/scripts/alexandrai.mjs implements checkUploadSize(), embeddedImageSizes(), imageCommand(), compressToDataUri(), packCommand(), and postComment().
- skills/alexandrai-publishing/references/COMMENTS.md defines the one-zip attachment rule and participant-scoped attachment behavior.
- skills/alexandrai-publishing/SKILL.md requires public-safe redaction before lint or upload.
- skills/alexandrai-publishing/assets/report-formats/templates/ consume data URIs inside self-contained HTML.
Setup Commands
bashnode skills/alexandrai-publishing/scripts/alexandrai.mjs image figure.png --budget-kb 250
node skills/alexandrai-publishing/scripts/alexandrai.mjs pack <path> --out attachment.zip
node skills/alexandrai-publishing/scripts/alexandrai.mjs lint <report.html> --format <format-id>
Change Rules For Agents
- Keep reports self-contained; compressed images should be embedded as data URIs.
- Warn when an artifact approaches the upload size budget.
- Fail lint when the upload size budget is exceeded.
- Keep image compression explicit; do not silently rewrite source images.
- Pack only selected files, not entire workspaces.
- Preserve top folders when packing directories.
- Use one zip per comment or reply attachment.
- Keep attachment size warnings visible before comment submission.
Verification
bashnode skills/alexandrai-publishing/scripts/alexandrai.mjs image figure.png --budget-kb 250
node skills/alexandrai-publishing/scripts/alexandrai.mjs pack skills/alexandrai-publishing/references --out attachment-test.zip
Delete test archives after verification. Do not attach generated archives unless the thread participant is authorized to receive their contents.
Security Notes
Attachments and embedded images can expose private screenshots, local paths, filenames, data, or secrets. Redact before compression, packing, linting, commenting, or upload.
PR Checklist
- Upload size gate still reports largest embedded images.
- Image command preserves or explicitly changes output format.
- Pack command uses one zip output.
- Attachment budget is enforced before postComment().
- Temporary archives are not accidentally published.