Imported from Neuroklast/zardonic-industrial (
AGENTS.md). Install upstream withnpx skills add Neuroklast/zardonic-industrial. Copyright stays with the author.
Zardonic Industrial — Agent Guidelines
Zardonic artist website: public site + admin CMS.
Stack: Next.js App Router, React, Supabase (PostgreSQL), Cloudflare R2, Vercel, TypeScript, Tailwind 4, Framer Motion, Lenis.
Package manager: npm only (npm ci in CI).
Session start (read before coding)
- This file — critical rules, checks, and docs closeout.
- Topic file — open the matching
docs/agent/{topic}.mdfrom the table below for the area you touch. - docs/DEVELOPMENT_STATUS.md — only when the task is product/phase-shaped (not pure refactors/CI).
- End of session — docs refresh is mandatory; follow docs/agent/workflow.md.
Skipping specs and fixing production later costs more than reading first.
Mandatory checks (every code change)
Prefer the full local pipeline (same surface as GitHub CI):
npm run lint && npm run typecheck && npm run build && npm run test
No PR with failing checks. No as any, @ts-ignore, or eslint-disable to silence errors (except documented, pre-existing suppressions).
Definition of done is production, not a green PR:
- CI green on the PR.
- Merge to
main. - Confirm Vercel Production deploy for the merge commit SHA.
- Tell the user to hard-refresh (Ctrl+Shift+R) when visual bugs were fixed.
A green PR that is still open is not shipped. Do not claim “fixed” until main + Production match the fix.
Mandatory docs update (end of every agent session)
Always refresh documentation before you declare work done, open a PR, or hand off — not only when the user asks. Treat docs as part of the deliverable, same as code.
- Update every stale markdown that describes what you changed (agent specs, product docs, living docs).
- Run the full end-of-session review in docs/agent/workflow.md.
- When product behaviour changed: CHANGELOG.md, QA_CHECKLIST.md; when a reusable lesson appeared: docs/LESSONS_LEARNED.md.
- New/changed patterns → matching
docs/agent/*.md. Public surface / ops →README.md,docs/ADMIN_GUIDE.md,SECURITY.mdas applicable.
Skipping docs because “the task was only code” is a process failure.
Critical rules (always apply)
- Minimal diffs — smallest change that fully solves the task; no drive-by refactors
- Strict TypeScript — no
anyin production code - PageLayout on every public page; z-index via
var(--z-*)only (architecture) - Two-click embeds — Spotify/YouTube never auto-load (security)
- Legal data — Supabase
site_config.legalonly; pages/legal-notice,/privacy-policy; admin/admin/legal - Consent — import from
@/lib/consent, not UI components, in non-UI code - Overlays — gallery / release / gig detail use
CyberpunkOverlayonly (public-ui); it portals todocument.body— never render it inline under atransform/filter/backdrop-filterancestor - Partner logos — white mode via canvas pipeline (
lib/partner-logo-white.ts); never CSSbrightness(0) invert(1)on remote PNGs (public-ui) - Media is ALWAYS on R2 — never Supabase Storage. Images/videos/logos/downloads resolve via
lib/r2.tsresolveImageUrl/toDirectImageUrl; a*.supabase.coasset URL is invalid and resolves tonull/''. Never re-add.supabase.coas a trusted direct host. Legacy rows are migrated to R2 automatically (once) — seelib/legacy-url-migration-on-deploy.ts, badgelib/legacy-url-audit.ts, manualnpm run migrate-legacy. - Nav labels — compact defaults in
lib/nav-links.ts(Bio,Releases, …); full titles stay on section headings - Nav logo — flex flow
shrink-0, neverposition: absoluteover the link row - Docs — always update markdown at session end (see above)
Public UI — decision trees (read before touching chrome)
Navigation / logo
- Logo is a flex sibling of the nav (
shrink-0), not absolutely positioned over links. - Desktop nav: icon per section (
lib/nav-icons.ts); hover/focus glitches to short label (lib/nav-links.ts). Never rely on always-visible long text — BIO disappears when the row overflows. - Section page headings may stay long (
Biography,Discography) via section config — do not put those strings in the top nav. - After any nav change: every visible section has a desktop icon (including bio); mobile menu lists icon + label.
Modals / lightboxes
- Release, gig, gallery, contact, member → open
CyberpunkOverlaywith the correctCyberpunkOverlayStatetype. - Do not invent a second modal shell (custom fixed panels, one-off lightboxes).
- Overlay open → lock body + Lenis (
lenis.stop()/start()), same asCyberpunkOverlay. - Gallery content lives in
components/overlays/GalleryOverlayContent.tsxinside the shared shell. - The shell portals to
document.bodyand centers with flex (notop: 50%+translateY(-50%)); the inner content region scrolls. Never render it inline undertransform/filter/backdrop-filter/perspective(containing-block trap → off-center + unreachable content).
Partner / credit logos (PNG alpha)
- White logos:
PartnerLogoWhite→loadLogoImageForCanvas+processLogoToWhiteSilhouette(soft-alpha: only transparent stays transparent, all ink → white; opaque light/dark plates stripped). - Native colour: class
partner-logo-native— same CSS chromatic hover as white mode. - Forbidden: CSS
mask-imageon cross-origin R2 URLs (CORS → solid white box). - Forbidden:
filter: brightness(0) invert(1)on logos that may have a baked white background (→ solid white box, e.g. QUESTEC). - Forbidden: inline
style.filteron partner logos (blocks hover chromatic). - Fallback if canvas fails: show original without invert — never invent a white plate.
Footer
- Social icons ≥
h-7/sm:h-8; legal links ≥text-sm/sm:text-base. - Always
flex-wrap+min-h-[44px]touch targets.
Full detail: docs/agent/public-ui.md.
Detailed guidelines
Read the relevant file before working in that area:
| Topic | File |
|---|---|
| CI loop, docs maintenance, multi-agent, PR closeout | workflow.md |
| Layers, PageLayout, site_config, IoC, legal routes | architecture.md |
| GDPR, cookies, admin auth, legal fields | security.md |
| Admin / Supabase mutations, registries | admin.md |
| Typography, a11y, mobile (generic) | ui.md |
| Public chrome hazards (nav, overlay, logos, footer) | public-ui.md |
| Session gate checklist + known stable fixes | session-checklist.md |
After introducing new patterns, update the relevant docs/agent/*.md file.
Before finishing any session or opening a PR: complete the mandatory docs update above and the end-of-session review in workflow.md.
Human / external docs
- Architecture · Admin guide · GDPR
- Development status · Tech debt
- Agent workflow (human) · Changelog
- Lessons learned · QA checklist · Security
When conventions change, update the relevant docs/agent/*.md file and CHANGELOG.md — keep this root file as the session control plane, not a dump of every rule.