Token导航 LogoToken导航

Agent Skill · 图像处理

nextjs-image-art-direction(Next.js 图像 ART direction)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

nextjs-image-art-direction 是图像处理类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在图像处理类的 1,562 个 Skill 里排第 1,344。

总安装 441周安装 18GitHub Stars 235下载 141核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nextjs-image-art-direction(Next.js 图像 ART direction)
来源仓库:https://github.com/flpbalada/my-opencode-config
仓库路径:skills/nextjs-image-art-direction
安装命令:
npx skills add https://github.com/flpbalada/my-opencode-config --skill nextjs-image-art-direction
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/flpbalada/my-opencode-config --skill nextjs-image-art-direction

这个 Skill 是做什么的

图像处理类 Skill 处理生成、裁剪、压缩和批量转换图片的任务。

用于 Next.js 中图片资源的艺术指导与优化配置。支持响应式尺寸裁剪、格式转换与懒加载设置。提升视觉表现同时保障加载性能。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。应结合 CDN 与压缩策略,减少带宽消耗。

nextjs-image-art-direction 属于图像处理类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/nextjs-image-art-direction

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/flpbalada/my-opencode-config --skill nextjs-im…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

nextjs-image-art-direction 怎么安装?

在终端执行 npx skills add https://github.com/flpbalada/my-opencode-config --skill nextjs-image-art-di…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

nextjs-image-art-direction 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

nextjs-image-art-direction 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

nextjs-image-art-direction 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

nextjs-image-art-direction 用的人多吗?

公开数据是累计安装 441 次,近一周安装 18 次,下载 141 次,GitHub 235 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

nextjs-image-art-direction 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理图像处理类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

图像处理类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
ai-image-generation

AI 图像生成 · Codex、Claude

4,365,552382调用外部服务未明确有提醒
openai-image-gen

OpenAI 图像生成 · OpenClaw

1,906,88432需要联网MIT-0有提醒
image

图像 · OpenClaw

525,99926需要联网MIT-0通过
baoyu-cover-image

宝玉封面图 · Codex、Claude

474,24016,779只读MIT有提醒
baoyu-image-gen

宝玉图像生成器 · Codex、Claude

468,00716,778接触敏感数据MIT通过
nextjs-image-art-direction

Next.js 图像 ART direction · 本页

441235操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Next.js Image: Art Direction

Art direction means showing completely different images based on viewport size — not just resizing the same image. Common use cases include homepage carousels with different assets for mobile vs desktop, switching from landscape (desktop) to portrait (mobile), or showing cropped vs full compositions.

Art Direction vs Responsive Images

ApproachPurposeImplementation
Art DirectionDifferent image content/composition<picture> with multiple <source> elements
Responsive ImagesSame image, different sizessizes prop with srcset

Use Art Direction When:

  • Homepage carousels with different images for mobile and desktop (e.g., square images on mobile, wide banner on desktop)
  • Mobile shows portrait crop, desktop shows landscape
  • Different focal points for different screen sizes
  • Completely different compositions are needed
  • Content hierarchy changes between breakpoints
  • Different image assets optimized for each viewport (e.g., mobile-optimized JPEGs vs desktop quality)

Use Responsive Images When:

  • Same image works at all sizes
  • Only the dimensions change
  • Standard responsive behavior is sufficient

Implementation with getImageProps()

The getImageProps() function (stable since Next.js 14.1.0) generates the necessary props without calling React useState(), making it ideal for art direction.

Step-by-Step Implementation

import { getImageProps } from 'next/image'

export default function ArtDirectedImage() {
  // Common props shared across all image versions
  const common = {
    alt: 'Mountain landscape',
    sizes: '100vw'
  }

  // Desktop version (landscape, higher quality)
  const {
    props: { srcSet: desktop },
  } = getImageProps({
    ...common,
    src: '/hero-desktop.jpg',
    width: 1440,
    height: 875,
    quality: 80,
  })

  // Mobile version (portrait, smaller dimensions)
  const {
    props: { srcSet: mobile, ...rest },
  } = getImageProps({
    ...common,
    src: '/hero-mobile.jpg',
    width: 750,
    height: 1334,
    quality: 70,
  })

  return (
    <picture>
      {/* Desktop: min-width 1000px */}
      <source media="(min-width: 1000px)" srcSet={desktop} />

      {/* Mobile: min-width 500px */}
      <source media="(min-width: 500px)" srcSet={mobile} />

      {/* Fallback img element (rendered if no media query matches) */}
      <img {...rest} style={{ width: '100%', height: 'auto' }} />
    </picture>
  )
}

Key Implementation Details

Props to Vary by Breakpoint:

  • src: Different image file
  • width / height: Different dimensions
  • quality: Different compression levels

Common Props (Shared):

  • alt: Accessibility text (must work for all versions)
  • sizes: Responsive size hints for browser

HTML Structure:

  • <picture> wrapper element
  • <source> elements with media attribute for each breakpoint
  • <img> element last as fallback (required)

Breakpoint Strategy

Order matters! The browser uses the first matching <source>. List from largest to smallest (desktop-first) or smallest to largest (mobile-first).

Desktop-First (Largest to Smallest)

<picture>
  <source media="(min-width: 1000px)" srcSet={desktop} />
  <source media="(min-width: 500px)" srcSet={tablet} />
  <img {...rest} style={{ width: '100%', height: 'auto' }} />
</picture>

Mobile-First (Smallest to Largest)

<picture>
  <source media="(max-width: 499px)" srcSet={mobile} />
  <source media="(max-width: 999px)" srcSet={tablet} />
  <img {...rest} style={{ width: '100%', height: 'auto' }} />
</picture>

Common Pitfalls

⚠️ Cannot Use preload or loading="eager"

These would cause all images to load immediately, defeating the purpose of art direction:

// BAD: Would load both desktop and mobile
getImageProps({
  src: '/desktop.jpg',
  preload: true, // Don't do this!
})

// BAD: Same problem
getImageProps({
  src: '/desktop.jpg',
  loading: 'eager', // Don't do this!
})

Solution: Use fetchPriority="high" if you need to prioritize the LCP image:

const common = {
  alt: 'Hero image',
  fetchPriority: 'high', // Only load the matching image eagerly
}

⚠️ Alt Text Must Work for All Versions

The alt text is shared across all image versions. Make sure it accurately describes all possible images:

// BAD: Only describes desktop version
const common = { alt: 'Wide panoramic mountain landscape' }

// GOOD: Describes both versions
const common = { alt: 'Mountain landscape with snow-capped peaks' }

⚠️ Cannot Use placeholder Prop

getImageProps() doesn't support the placeholder prop because the placeholder would never be removed. Handle loading states manually if needed.

⚠️ Ensure Images Exist for All Breakpoints

Missing images will cause broken image icons on certain devices. Always test on actual devices or browser dev tools with different viewport sizes.

Complete Example: Hero Section

import { getImageProps } from 'next/image'

export default function Hero() {
  const common = {
    alt: 'Team collaboration in modern office',
    sizes: '100vw',
    fetchPriority: 'high',
  }

  // Large desktop: Full office scene
  const { props: { srcSet: desktop } } = getImageProps({
    ...common,
    src: '/hero-office-wide.jpg',
    width: 1920,
    height: 1080,
    quality: 85,
  })

  // Tablet: Focused team shot
  const { props: { srcSet: tablet } } = getImageProps({
    ...common,
    src: '/hero-team-focused.jpg',
    width: 1024,
    height: 768,
    quality: 80,
  })

  // Mobile: Single person portrait
  const { props: { srcSet: mobile, ...rest } } = getImageProps({
    ...common,
    src: '/hero-person-portrait.jpg',
    width: 750,
    height: 1334,
    quality: 75,
  })

  return (
    <section className="relative">
      <picture>
        <source media="(min-width: 1200px)" srcSet={desktop} />
        <source media="(min-width: 768px)" srcSet={tablet} />
        <source media="(min-width: 500px)" srcSet={mobile} />
        <img
          {...rest}
          className="w-full h-auto object-cover"
          style={{ maxHeight: '80vh' }}
        />
      </picture>
      <div className="absolute inset-0 flex items-center justify-center">
        <h1 className="text-white text-4xl font-bold drop-shadow-lg">
          Welcome to Our Platform
        </h1>
      </div>
    </section>
  )
}

Advanced: CSS Background Images

You can use getImageProps() to optimize background images with image-set():

import { getImageProps } from 'next/image'

function getBackgroundImage(srcSet = '') {
  const imageSet = srcSet
    .split(', ')
    .map((str) => {
      const [url, dpi] = str.split(' ')
      return `url("${url}") ${dpi}`
    })
    .join(', ')
  return `image-set(${imageSet})`
}

export default function HeroBackground() {
  const {
    props: { srcSet },
  } = getImageProps({
    alt: '',
    width: 1920,
    height: 1080,
    src: '/hero-bg.jpg',
    quality: 80,
  })

  const backgroundImage = getBackgroundImage(srcSet)

  return (
    <main
      style={{
        height: '100vh',
        width: '100vw',
        backgroundImage,
        backgroundSize: 'cover',
        backgroundPosition: 'center',
      }}
    >
      <h1>Content Here</h1>
    </main>
  )
}

Quick Reference

DO

  • Use getImageProps() for multiple image versions
  • Share alt and sizes across all versions
  • Order <source> elements correctly (first match wins)
  • Use fetchPriority="high" for LCP images (not preload)
  • Test on actual devices or responsive mode in dev tools
  • Ensure all image files exist for defined breakpoints

DON'T

  • Use preload prop (loads all images)
  • Use loading="eager" (loads all images)
  • Use placeholder prop with getImageProps()
  • Write alt text that only describes one version
  • Forget to include the final <img> element
  • Use art direction when simple responsive images suffice

References

平台分布

Codex

34.3%
按下载量换算48

Claude

31.61%
按下载量换算45

Cursor

16.41%
按下载量换算23

Gemini CLI

9.95%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills