Next.js ambient panel texture
Add an optional decorative texture (preset SVG masks and/or procedural tiles) behind a primary panel using CSS mask-image, plus a small customization surface (props-controlled React state by default—no required persistence).
Bundled assets (default, required on install)
This skill directory includes bundled-patterns/pattern-1.svg … pattern-33.svg (33 tileable masks). Copy them into the host app’s public/ tree so Next.js can serve them. Default public prefix: /ambient-texture-patterns/ (see reference.md).
Do not ask the user to download presets elsewhere unless they explicitly opt out of bundled assets.
Idempotent asset install: If the target directory already has 33 files matching pattern-*.svg, skip copying and only verify the preset URL helper matches that path.
Read licensing.md before shipping to end users.
Idempotency gates (run before creating or editing code)
Stop and report status instead of duplicating work when:
- Feature folder —
frontend/features/ambient-panel-texture/(or the user’s chosen name from Q1) exists with a barrel (index.tsx/index.ts) exporting the texture hook. Then merge or skip creation; do not add a second feature tree. - Public presets — If
public/<presetPrefix>/already holds 33pattern-*.svgfiles, do not re-copy frombundled-patterns/. - Library helpers — If
generateAmbientPanelTile/ambient-texture-presets(or equivalent) already exist underfrontend/lib/, extend them instead of duplicating files. - Overlay integration — Search the chosen shell file for
maskImage/WebkitMaskImagepaired with the texture hook name. If present, do not insert a second overlay stack.
If a partial install is detected (helpers without UI or vice versa), complete or remove the partial work—never leave duplicate overlays.
Phase 1 — Discovery (readonly subagents)
Launch 2–3 parallel explore subagents (readonly: true). Each agent returns a short bullet digest (paths + one-line findings).
Agent A — layout and aliases
- Map
frontend/(orsrc/) structure,@/path alias,app/vspages/, Tailwind entry (globals.css/@theme). - List existing
features/naming conventions.
Agent B — overlay mount targets
- Find the primary scrollable panel or chat root (the element that should feel “papered” with texture).
- Confirm which ancestor must be
relativeand z-index ordering forpointer-events-noneoverlays.
Agent C — customization placement
- Find Settings / Appearance patterns, or an existing dev route under
app/dev/, or propose a single minimal route/modal for the settings card.
Synthesize digests into: preset public path, primary overlay file, optional mirror surfaces, settings slot.
Phase 2 — User steering (one question at a time)
Use AskQuestion when available; otherwise ask in chat and wait before the next question.
Suggested order (skip questions already answered by the repo):
- Feature folder name: default
ambient-panel-textureor override? - Public URL prefix for presets: default
/ambient-texture-patterns/or override? - Primary file path to mount the overlay (from Agent B).
- Add mirrored texture on secondary shell (e.g. settings column): yes / no?
- Where to mount
AmbientPanelTextureSettingsCard: existing settings section, newapp/dev/...page, or standalone modal?
Forbidden: multi-part questionnaires in a single turn.
Phase 3 — Apply (after answers)
Copy bundled SVGs (unless gate 2 says skip):
mkdir -p public/ambient-texture-patterns cp -n "<SKILL_DIR>/bundled-patterns/"*.svg public/ambient-texture-patterns/<SKILL_DIR>= directory containing thisSKILL.md(repo:.cursor/skills/nextjs-ambient-panel-texture/; personal install:~/.cursor/skills/nextjs-ambient-panel-texture/).Port types, bounds, hook, tile generator, preset table, settings card per reference.md. Replace imports with host design-system primitives.
Default state: implement the customization card as controlled props (
config+onConfigChange) backed byuseStatein a parent or page. Do not requirelocalStorageor APIs unless the user asks later.Wire
useAmbientPanelTexture()(or chosen name) in the primary panel; optionally mirror on secondary shell.Run the host repo’s fast checks (e.g.
bun run typecheck,just check).
Verification checklist
- All 33 preset SVGs are reachable at the configured public prefix (HTTP 200 in dev).
- Overlay is
pointer-events-none, does not block clicks, stacks under interactive content. - Re-running the skill does not duplicate overlays, feature folders, or preset files.
- licensing.md is understood / linked for any redistribution of presets.
Additional resources
- reference.md — source file map, rename table, copy commands, stacking notes.
- licensing.md — Telegram-derived SVG provenance and IP warning.