Community寫作與編輯github.com

thanatornPik/nextjs-skill-app-workshop

在此 Next.js 專案中提交程式碼、撰寫提交訊息或檢視 Git 歷史紀錄時使用。觸發詞為「commit this」、「write a commit message」、「what should my commit say」、「git commit」或任何要求暫存並提交變更的請求。提供專案專用的 Conventional Commit 格式、泰語註釋慣例,以及與此程式碼庫結構相符的範圍規則。

nextjs-skill-app-workshop 是什麼?

此技能為一組專為 Next.js 專案設計的 Git 提交準則,可直接整合至 AI 助手(如 Claude Code、Cursor、Codex)中。當使用者要求暫存、撰寫提交訊息或審查提交歷史時,技能會自動觸發,確保提交訊息遵循 Conventional Commit 格式:`<type>(<scope>): <subject>`。技能定義了多種型別(如 feat、fix、refactor)及專屬範圍(如 auth、product、cart),每個範圍皆對應到專案中的特定目錄或檔案。此外,它強制主題行使用現在式、長度不超過 72 個字元,並提供提交前檢查清單。此技能特別適用於需要維持一致提交慣例的團隊,並內建針對 `.env` 檔案、Prisma schema 生成及 husky hooks 等專案特定防護措施。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/thanatornPik/nextjs-skill-app-workshop/tree/HEAD/.agents/skills/git-commit-automate

Installed? Explore more 寫作與編輯 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Git 提交準則

提交訊息格式

<type>(<scope>): <subject in Thai or English>

[optional body]

型別

型別使用時機
feat新增功能或頁面
fix修正錯誤
refactor重構程式碼,不改變行為
style僅 UI/CSS 變更(無邏輯變動)
chore設定、依賴、工具(如 prisma generate)
docs文件或註解變更
perf效能改善

此專案的範圍對應

範圍對應路徑
authsrc/lib/auth.ts、src/lib/auth-client.ts、(auth)/ 路由
product(front)/product/、app-product-card.tsx
cartsrc/lib/cart-store.ts、購物車元件
course(front)/course/、src/services/course-service.ts
contact(front)/contact/、src/app/api/contact/
prismaprisma/schema.prisma、src/lib/prisma.ts
uisrc/components/ui/、src/components/
layout(front)/layout.tsx、(auth)/layout.tsx
apisrc/app/api/
confignext.config.ts、prisma.config.ts、.env

主體規則

  • 僅使用英文
  • 簡短描述,不超過 72 個字元
  • 結尾不需句點
  • 使用現在式:「add」、「fix」、「update」,而非「added」、「fixed」

範例

feat(product): add product detail page
fix(cart): fix totalPrice calculation when qty is 0
chore(prisma): regenerate Prisma client after schema changes
style(ui): update badge color in hero component
refactor(auth): extract signIn logic from page component
feat(api): add GET /api/products endpoint with pagination
fix(contact): prevent XSS in email HTML template

注意事項

  • 禁止提交 .env 檔案 — 其中包含 BETTER_AUTH_SECRET 和 DATABASE_URL
  • generated/prisma/ 檔案已加入 gitignore — 無需暫存
  • 若修改 schema,必須先執行 npx prisma generate 再提交 schema 檔案
  • 未經正當理由,不得使用 --no-verify 跳過 hook

提交前檢查清單

  • 暫存區中無 .env 或機密檔案
  • npm run lint 通過且無錯誤
  • 新的型別定義位於 src/types/ 中,而非元件內聯
  • 檔案名稱使用 kebab-case,例如 product-service.ts

Individual skills in this repo

This repo contains 2 individual skills — each has its own dedicated page.

相關技能