Community写作与编辑github.com

thanatornPik/nextjs-skill-app-workshop

在提交代码、编写提交信息或审查此 Next.js 项目的 Git 历史时使用此技能。触发词包括:"commit this"、"write a commit message"、"what should my commit say"、"git commit" 或任何暂存并提交更改的请求。提供针对项目的约定式提交格式、泰语注释约定以及匹配此代码库结构的作用域规则。

nextjs-skill-app-workshop 是什么?

此技能为 Next.js 项目提供了一套结构化的 Git 提交指南,旨在帮助开发者和 AI 助手(如 Claude Code、Cursor 等)遵循一致的提交格式。它定义了使用 `<type>(<scope>): <subject>` 格式的约定式提交,其中 type 包括 `feat`、`fix`、`refactor`、`style`、`chore`、`docs` 和 `perf`。作用域(如 `auth`、`product`、`cart`、`prisma` 等)直接映射到项目的文件结构,确保提交信息与代码变更精确对应。此外,该技能还强制执行编写主体的规则(使用现在时、不超过 72 个字符、不加句号),并包含一个提交前检查清单,以防止常见错误,如提交 `.env` 文件或跳过 Git 钩子。对于在提交工作流中寻求清晰和一致性的团队来说,此技能非常有用,它支持多种 AI 代理工具,并有助于维护高质量的 Git 历史记录。

兼容平台~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 提交指南

提交消息格式

<类型>(<作用域>): <主题(泰语或英语)>

[可选正文]

类型

类型使用时机
feat添加新功能或页面
fix修复 Bug
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,则必须在提交 schema 之前运行 npx prisma generate
  • 不要无故使用 --no-verify 跳过钩子

提交前检查清单

  • 暂存区中没有 .env 文件或 secret
  • 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.

相关技能