About add-shader-cursor-trail
A coding skill for implementing a Shaders cursor-trail effect as progressive enhancement while preserving a section’s content and static fallback. It specifies capability gates, shader structure, and validation steps.
Key features
- 01Framework-specific Shaders imports
- 02Exact six-node shader structure
- 03WebGPU and visibility gating
- 04Static image or background fallback
- 05GPU cleanup when section exits view
Use cases
- 01Adding a cursor trail behind section content
- 02Keeping a section complete without JavaScript
- 03Disabling the effect for limited capabilities
- 04Validating motion and accessibility behavior
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ mengto/ skills --skill add-shader-cursor-trailAfter installing, type/add-shader-cursor-trailin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
agents/openai.yamlassets/react/cursor-trail.cssCursorTrailGate.tsxCursorTrailShader.tsxreferences/implementation.mdscripts/verify-cursor-trail.mjsDetails
From the project READMEAdd Shader Cursor Trail
Implement the exact trail as progressive enhancement. Preserve the host section's semantic content, imagery, controls, and static first frame.
Workflow
- Inspect the framework, rendering mode, existing motion stack, layer order, reduced-motion rules, and package manager. Do not add another smooth-scroll engine or replace the section's content.
- Install
shaderswith the existing package manager. Import from the matching framework subpath:shaders/react,shaders/vue,shaders/svelte, orshaders/solid. - Read references/implementation.md before implementation. Keep the six shader nodes, their order, both invisible drivers, and both ID linkages exact.
- For React or Next.js, copy and adapt the files in
assets/react/. Keep the lightweight capability gate separate from the heavy shader module so ineligible visitors do not request the shader bundle. - Place one full-bleed,
aria-hidden="true"shader layer behind the section content. Keep links and controls above it. Do not setpointer-events: noneon the canvas unless cursor tracking is verified to use global events. - Gate loading on WebGPU, a fine hover pointer, normal motion/transparency preferences, document visibility, window focus, and section intersection. Unmount when the section leaves view so GPU work stops.
- Keep the original image or dark background as the complete fallback. Hide the layer for reduced motion, reduced transparency, coarse/no-hover pointers, and forced colors.
- Adapt only presentation variables such as opacity and blend mode. Do not change the graph to decorative noise, add WebGL/Three.js, or hotlink Shaders preview assets.
Validate
Run the project's lint, typecheck/tests, and production build. For React implementations, also run:
node /path/to/add-shader-cursor-trail/scripts/verify-cursor-trail.mjs \
path/to/CursorTrailShader.tsx \
path/to/CursorTrailGate.tsx \
path/to/cursor-trail.css
Verify the static section with JavaScript unavailable, keyboard access to content above the layer, touch behavior, reduced motion, unsupported WebGPU, focus/visibility cleanup, and absence of runtime requests to previews.shaders.com or data.shaders.com.
Report the chosen blend mode, fallback, capability gates, production-build result, and any browser limitation. Do not claim WebGPU visual verification unless it was actually performed in a compatible browser.