Token导航 LogoToken导航

Agent Skill · 开发

debug%3anuxtjs(调试%3anuxtjs)

debug%3anuxtjs 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

debug%3anuxtjs 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,暂无第三方扫描结果,按安装量在开发类的 21,746 个 Skill 里排第 15,264。

总安装 612周安装 25GitHub Stars 7下载 198核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:debug%3anuxtjs(调试%3anuxtjs)
来源仓库:https://github.com/snakeo/claude-debug-and-refactor-skills-plugin
仓库路径:skills/debug%3Anuxtjs
安装命令:
npx skills add https://github.com/snakeo/claude-debug-and-refactor-skills-plugin --skill debug:nuxtjs
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/snakeo/claude-debug-and-refactor-skills-plugin --skill debug:nuxtjs

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

debug%3anuxtjs 专注 Nuxt.js 的 SSR/SSG 调试,解决服务端渲染与客户端水合不一致问题。适用于 Vue 生态下的 hydration mismatch、Nitro 服务器异常、composables 状态泄漏等场景。

提供浏览器 API 使用规范与异步数据加载的最佳实践,避免服务端执行环境冲突。需结合项目使用的 Nuxt 版本与构建工具(如 Vite)进行适配,防止方案不兼容。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/debug%3Anuxtjs

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/snakeo/claude-debug-and-refactor-skills-plugin…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

debug%3anuxtjs 怎么安装?

在终端执行 npx skills add https://github.com/snakeo/claude-debug-and-refactor-skills-plugin --skill d…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

debug%3anuxtjs 支持哪些 AI 工具?

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

debug%3anuxtjs 需要什么权限?

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

debug%3anuxtjs 是免费的吗?

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

debug%3anuxtjs 用的人多吗?

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

debug%3anuxtjs 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
debug%3anuxtjs

调试%3anuxtjs · 本页

6127操作浏览器未明确未收录

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

SKILL.md 原文

Nuxt.js Debugging Guide

This guide provides a systematic approach to debugging Nuxt.js applications, covering SSR/SSG issues, Nitro server problems, hydration mismatches, composables, and more.

Common Error Patterns

1. Hydration Mismatches

Hydration mismatches occur when the server-rendered HTML differs from what Vue expects on the client.

Symptoms:

  • Console warning: "Hydration text/node mismatch"
  • Content flickers or changes after page load
  • [Vue warn]: Hydration completed but contains mismatches

Common Causes:

// BAD: Using browser-only APIs during SSR
const windowWidth = window.innerWidth // Errors on server

// GOOD: Guard with process.client or useNuxtApp()
const windowWidth = ref(0)
onMounted(() => {
  windowWidth.value = window.innerWidth
})

// GOOD: Use ClientOnly component
<ClientOnly>
  <BrowserOnlyComponent />
</ClientOnly>

// BAD: Date/time rendering inconsistency
<span>{{ new Date().toLocaleString() }}</span> // Different on server vs client

// GOOD: Use consistent formatting or client-only
<ClientOnly>
  <span>{{ formattedDate }}</span>
  <template #fallback>Loading...</template>
</ClientOnly>

Debugging Steps:

  1. Check browser console for specific mismatch details
  2. Look for window, document, localStorage usage outside onMounted or process.client
  3. Check for random values, dates, or user-specific data rendered during SSR
  4. Use Vue DevTools to inspect component tree

2. useFetch/useAsyncData Errors

Common Issues:

// ERROR: "useFetch is not defined" or composable called outside setup
// BAD: Calling in regular function
function fetchData() {
  const { data } = useFetch('/api/data') // Error!
}

// GOOD: Call in setup or use $fetch in functions
const { data, error, pending, refresh } = useFetch('/api/data')

// Or for functions:
async function fetchData() {
  const data = await $fetch('/api/data')
}

Key/Caching Issues:

// BAD: Same key returns cached data
const { data: user1 } = useFetch('/api/user', { key: 'user' })
const { data: user2 } = useFetch('/api/user', { key: 'user' }) // Returns same cached data!

// GOOD: Use unique keys
const { data: user1 } = useFetch('/api/user/1', { key: 'user-1' })
const { data: user2 } = useFetch('/api/user/2', { key: 'user-2' })

// Force refresh
const { data, refresh } = useFetch('/api/data')
await refresh() // Bypasses cache

Watch for Reactive Parameters:

// BAD: Non-reactive parameter won't trigger refetch
const userId = '123'
const { data } = useFetch(`/api/user/${userId}`)

// GOOD: Use computed or getter for reactive URLs
const userId = ref('123')
const { data } = useFetch(() => `/api/user/${userId.value}`)

// Or with watch
const { data } = useFetch('/api/user', {
  query: { id: userId },
  watch: [userId]
})

3. Nitro Server Errors

500 Internal Server Errors:

// Check server/api/ files for issues
// server/api/example.ts

// BAD: Unhandled errors crash the endpoint
export default defineEventHandler(async (event) => {
  const data = await fetchExternalAPI() // Unhandled rejection
  return data
})

// GOOD: Proper error handling
export default defineEventHandler(async (event) => {
  try {
    const data = await fetchExternalAPI()
    return data
  } catch (error) {
    throw createError({
      statusCode: 500,
      statusMessage: 'Failed to fetch data',
      data: { originalError: error.message }
    })
  }
})

Reading Request Body:

// BAD: Wrong method to read body
export default defineEventHandler(async (event) => {
  const body = event.body // undefined!

  // GOOD: Use readBody
  const body = await readBody(event)

  // For query params
  const query = getQuery(event)

  // For route params
  const { id } = event.context.params
})

4. Plugin Initialization Issues

// plugins/my-plugin.ts

// BAD: Plugin errors break the entire app
export default defineNuxtPlugin(() => {
  const api = new ExternalAPI() // May throw
})

// GOOD: Error handling in plugins
export default defineNuxtPlugin({
  name: 'my-plugin',
  enforce: 'pre', // or 'post'
  async setup(nuxtApp) {
    try {
      const api = new ExternalAPI()
      return {
        provide: {
          api
        }
      }
    } catch (error) {
      console.error('Plugin initialization failed:', error)
      // Provide fallback or skip
    }
  }
})

// Client-only plugin
export default defineNuxtPlugin({
  name: 'client-only-plugin',
  setup() {
    // This only runs on client
  }
})
// Name file: plugins/my-plugin.client.ts

5. Module Conflicts

Diagnosing Module Issues:

// nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    '@nuxtjs/tailwindcss',
    '@pinia/nuxt',
    // Module order can matter!
  ],

  // Debug module loading
  debug: true, // Shows module loading in console
})

Common Module Conflicts:

# Clear module cache
rm -rf node_modules/.cache
rm -rf .nuxt

# Reinstall dependencies
rm -rf node_modules
npm install

Debugging Tools

1. Nuxt DevTools (Recommended)

// nuxt.config.ts
export default defineNuxtConfig({
  devtools: { enabled: true }
})

Features:

  • Component inspector and tree
  • Pages and routing visualization
  • Composables state inspection
  • Server routes overview
  • Module dependencies
  • Payload inspection
  • Timeline for performance

Access: Press Shift + Alt + D or click floating icon in dev mode

2. Sourcemaps Configuration

// nuxt.config.ts
export default defineNuxtConfig({
  sourcemap: {
    server: true,
    client: true
  }
})

3. VS Code Debugging

Create .vscode/launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Debug Nuxt Client",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "Debug Nuxt Server",
      "program": "${workspaceFolder}/node_modules/nuxi/bin/nuxi.mjs",
      "args": ["dev"],
      "cwd": "${workspaceFolder}"
    }
  ]
}

4. Node Inspector (Server-Side)

# Start with debugger
nuxi dev --inspect

# Or with specific host for Docker
nuxi dev --inspect=0.0.0.0

5. Console Logging (Server vs Client)

// Runs on both server and client
console.log('Universal log')

// Server-only logging
if (process.server) {
  console.log('Server-side only')
}

// Client-only logging
if (process.client) {
  console.log('Client-side only')
}

// In composables
const nuxtApp = useNuxtApp()
if (nuxtApp.ssrContext) {
  console.log('Server-side render')
}

6. Vue DevTools

# Install Vue DevTools browser extension
# Or use standalone
npx @vue/devtools

The Four Phases of Nuxt Debugging

Phase 1: Identify the Context

Determine where the error occurs:

// Check execution context
console.log('Server:', process.server)
console.log('Client:', process.client)
console.log('Dev:', process.dev)
console.log('SSR:', !!useNuxtApp().ssrContext)

Questions to answer:

  • Does it happen during SSR, hydration, or client navigation?
  • Is it a build-time or runtime error?
  • Does it only happen on certain routes?
  • Is it reproducible in development AND production?

Phase 2: Isolate the Component

<template>
  <div>
    <!-- Wrap suspect components -->
    <NuxtErrorBoundary @error="logError">
      <SuspectComponent />
      <template #error="{ error }">
        <p>Error: {{ error.message }}</p>
      </template>
    </NuxtErrorBoundary>
  </div>
</template>

<script setup>
function logError(error) {
  console.error('Caught error:', error)
}
</script>

Phase 3: Check Data Flow

// Debug useFetch/useAsyncData
const { data, error, pending, status } = useFetch('/api/data')

watch([data, error, pending], ([d, e, p]) => {
  console.log('Data:', d)
  console.log('Error:', e)
  console.log('Pending:', p)
})

// Check payload (what's sent from server to client)
const nuxtApp = useNuxtApp()
console.log('Payload:', nuxtApp.payload)

Phase 4: Verify Build and Config

# Type check
nuxi typecheck

# Analyze bundle
nuxi analyze

# Clean build
rm -rf .nuxt .output node_modules/.cache
nuxi build

Quick Reference Commands

Development

# Start dev server
nuxi dev

# Start with debugging
nuxi dev --inspect

# Start on specific port
nuxi dev --port 3001

# Start with HTTPS
nuxi dev --https

Building and Analysis

# Production build
nuxi build

# Generate static site
nuxi generate

# Preview production build
nuxi preview

# Analyze bundle size
nuxi analyze

# Type checking
nuxi typecheck

# Prepare Nuxt (generate types)
nuxi prepare

Maintenance

# Clean Nuxt files
nuxi cleanup

# Upgrade Nuxt
nuxi upgrade

# Add module
nuxi module add @nuxtjs/tailwindcss

# Create new component/page/etc
nuxi add component MyComponent
nuxi add page about
nuxi add composable useMyComposable
nuxi add api hello

Error Handling Patterns

Global Error Handler

// plugins/error-handler.ts
export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.config.errorHandler = (error, instance, info) => {
    console.error('Vue Error:', error)
    console.error('Component:', instance)
    console.error('Info:', info)
  }

  nuxtApp.hook('vue:error', (error, instance, info) => {
    console.error('Nuxt Vue Error Hook:', error)
  })

  nuxtApp.hook('app:error', (error) => {
    console.error('App Error:', error)
  })
})

Custom Error Page

<!-- error.vue (in root, NOT in pages/) -->
<template>
  <div class="error-page">
    <h1>{{ error.statusCode }}</h1>
    <p>{{ error.message }}</p>
    <button @click="handleError">Go Home</button>
  </div>
</template>

<script setup>
const props = defineProps({
  error: Object
})

const handleError = () => clearError({ redirect: '/' })
</script>

Programmatic Error Handling

// Throw errors
throw createError({
  statusCode: 404,
  statusMessage: 'Page not found',
  fatal: true // Triggers error page
})

// Show error without navigation
showError({
  statusCode: 500,
  statusMessage: 'Something went wrong'
})

// Clear error
clearError({ redirect: '/' })

// Access current error
const error = useError()

Error Boundary for Components

<template>
  <NuxtErrorBoundary>
    <RiskyComponent />

    <template #error="{ error, clearError }">
      <div class="error-box">
        <p>Component failed: {{ error.message }}</p>
        <button @click="clearError">Retry</button>
      </div>
    </template>
  </NuxtErrorBoundary>
</template>

SSR-Specific Debugging

Payload Issues

// Debug what's in the payload
const nuxtApp = useNuxtApp()
onMounted(() => {
  console.log('SSR Payload:', nuxtApp.payload)
  console.log('SSR Data:', nuxtApp.payload.data)
  console.log('SSR State:', nuxtApp.payload.state)
})

Async Data Not Available

// Ensure data is awaited properly
const { data } = await useFetch('/api/data')

// For lazy loading (doesn't block navigation)
const { data, pending } = useLazyFetch('/api/data')

// Watch for data availability
watch(data, (newData) => {
  if (newData) {
    console.log('Data loaded:', newData)
  }
})

Server-Only Code Leaking to Client

// Use server utilities correctly
// server/utils/db.ts - only available in server/

// For runtime config (secrets)
// nuxt.config.ts
export default defineNuxtConfig({
  runtimeConfig: {
    apiSecret: '', // Server-only
    public: {
      apiBase: '' // Exposed to client
    }
  }
})

// Usage
const config = useRuntimeConfig()
// config.apiSecret - only on server
// config.public.apiBase - available everywhere

Performance Debugging

Identify Slow Components

// nuxt.config.ts
export default defineNuxtConfig({
  experimental: {
    componentIslands: true // For heavy components
  }
})
<!-- Use islands for heavy server components -->
<NuxtIsland name="HeavyChart" :props="{ data: chartData }" />

Lazy Loading

// Lazy load components
const HeavyComponent = defineAsyncComponent(() =>
  import('~/components/HeavyComponent.vue')
)

// Or use Nuxt's auto-import with Lazy prefix
<template>
  <LazyHeavyComponent v-if="showHeavy" />
</template>

Bundle Analysis

# Generate bundle analysis
nuxi analyze

# Check what's in your bundle
cat .output/public/_nuxt/builds/meta/*.json | jq

Common Gotchas

1. Composables Must Be Called in Setup

// BAD
function handleClick() {
  const route = useRoute() // Error!
}

// GOOD
const route = useRoute()
function handleClick() {
  console.log(route.path)
}

2. Reactive Data in useFetch

// BAD: Non-reactive
const id = '123'
useFetch(`/api/items/${id}`)

// GOOD: Reactive
const id = ref('123')
useFetch(() => `/api/items/${id.value}`)

3. Navigate vs Router

// Prefer navigateTo over useRouter for navigation
await navigateTo('/dashboard')
await navigateTo({ path: '/user', query: { id: 1 } })

// For programmatic redirects in server
export default defineEventHandler((event) => {
  return sendRedirect(event, '/login', 302)
})

4. Middleware Execution Order

// Named middleware runs in alphabetical order
// middleware/01.auth.global.ts runs before middleware/02.analytics.global.ts

// Route-specific middleware
definePageMeta({
  middleware: ['auth', 'premium'] // Runs in order
})

5. State Pollution in SSR

// BAD: Shared state between requests
const globalState = reactive({})

// GOOD: Use useState for SSR-safe state
const state = useState('key', () => ({}))

// Or Pinia with proper SSR setup
const store = useMyStore()

Resources

平台分布

Codex

35.97%
按下载量换算71

Claude

30.59%
按下载量换算61

Cursor

18.34%
按下载量换算36

Gemini CLI

9.47%
按下载量换算19

安全审计

暂无安全审计结果可展示。

权限和风险

操作浏览器

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

安装前确认

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

继续浏览同类 Skills