·nextjs-pathname-id-fetch
</>

nextjs-pathname-id-fetch

wsimmonds/claude-nextjs-skills

在 Next.js 中使用 URL 參數獲取數據的集中模式。涵蓋創建動態路由([id]、[slug])以及訪問服務器組件中的路由參數以從 API 獲取數據。在構建基於 URL 參數顯示單個項目(產品頁面、博客文章、用戶個人資料)的頁面時使用。使用簡化的常見情況模式補充 nextjs-dynamic-routes-params。

40安裝·0熱度·@wsimmonds

安裝

$npx skills add https://github.com/wsimmonds/claude-nextjs-skills --skill nextjs-pathname-id-fetch

SKILL.md

Use this pattern whenever a page needs to load data based on whatever identifier appears in the URL. Common scenarios include:

If the requirement says the data should change depending on the current URL path, the route segment must be dynamic (e.g., [id], [slug], [...slug]).

Unless requirements explicitly call for /products/[id], keep the structure at the top level (app/[id]/page.tsx).

在 Next.js 中使用 URL 參數獲取數據的集中模式。涵蓋創建動態路由([id]、[slug])以及訪問服務器組件中的路由參數以從 API 獲取數據。在構建基於 URL 參數顯示單個項目(產品頁面、博客文章、用戶個人資料)的頁面時使用。使用簡化的常見情況模式補充 nextjs-dynamic-routes-params。 來源:wsimmonds/claude-nextjs-skills。

查看原文

可引用資訊

為搜尋與 AI 引用準備的穩定欄位與指令。

安裝指令
npx skills add https://github.com/wsimmonds/claude-nextjs-skills --skill nextjs-pathname-id-fetch
分類
</>開發工具
認證
收錄時間
2026-02-01
更新時間
2026-02-18

快速解答

什麼是 nextjs-pathname-id-fetch?

在 Next.js 中使用 URL 參數獲取數據的集中模式。涵蓋創建動態路由([id]、[slug])以及訪問服務器組件中的路由參數以從 API 獲取數據。在構建基於 URL 參數顯示單個項目(產品頁面、博客文章、用戶個人資料)的頁面時使用。使用簡化的常見情況模式補充 nextjs-dynamic-routes-params。 來源:wsimmonds/claude-nextjs-skills。

如何安裝 nextjs-pathname-id-fetch?

開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等) 複製並執行以下指令:npx skills add https://github.com/wsimmonds/claude-nextjs-skills --skill nextjs-pathname-id-fetch 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code 或 Cursor 中使用

這個 Skill 的原始碼在哪?

https://github.com/wsimmonds/claude-nextjs-skills