Files
comfyui_o1key/web/AGENTS.md
T
Jony ba920f2b66 Publish current ComfyUI O1Key code baseline
Replace the prior release tree with the current plugin, frontend, tests, and documentation. Document retired node IDs and the public Gitea update source.
2026-09-24 19:56:48 +08:00

14 lines
1.1 KiB
Markdown

# Frontend extension rules
These instructions apply to `web/`.
- ComfyUI auto-loads every JavaScript file below this directory through `WEB_DIRECTORY = "./web"`. A new file is a runtime feature, not passive documentation.
- Keep extensions idempotent: avoid duplicate buttons, listeners, styles, timers, and monkey patches after frontend reloads.
- Reuse ComfyUI's `app` and `api` modules through the existing relative import convention.
- Keep DOM IDs and extension names globally unique with the `o1key` prefix.
- Treat values received from workflows, API responses, filenames, and prompts as untrusted. Prefer `textContent`; sanitize before using `innerHTML`.
- Preserve old workflows through narrowly targeted rules in `js/migrateWorkflow.js`. A migration must be safe to run repeatedly.
- Do not introduce a bundler or external CDN dependency without an explicit architecture decision.
- When changing `js/o1keyImageGenerator.js`, run `node ../tests/test_o1key_image_generator_frontend.mjs`.
- Document new panels, server routes, or workflow migrations in `../docs/architecture.md` and `../docs/development.md`.