Git Commit Helper by davila7/claude-code-templates
npx skills add https://github.com/davila7/claude-code-templates --skill 'Git Commit Helper'包含钩子
此技能使用 Claude 钩子,可以自动执行代码以响应事件。安装前请仔细审查。
分析暂存的更改并生成提交信息:
# 查看暂存的更改
git diff --staged
# 根据更改生成提交信息
# (Claude 将分析差异并建议信息)
遵循约定式提交格式:
<类型>(<范围>): <描述>
[可选正文]
[可选页脚]
功能提交:
feat(auth): 添加 JWT 身份验证
实现基于 JWT 的身份验证系统,包括:
- 带有令牌生成的登录端点
- 令牌验证中间件
- 刷新令牌支持
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
错误修复:
fix(api): 处理用户配置文件中的空值
防止当用户配置文件字段为空时崩溃。
在访问嵌套属性之前添加空值检查。
重构:
refactor(database): 简化查询构建器
将常见查询模式提取到可重用函数中。
减少数据库层的代码重复。
审查将要提交的内容:
# 显示已更改的文件
git status
# 显示详细更改
git diff --staged
# 显示统计信息
git diff --staged --stat
# 显示特定文件的更改
git diff --staged path/to/file
应做:
不应做:
当提交多个相关更改时:
refactor(core): 重构身份验证模块
- 将身份验证逻辑从控制器移动到服务层
- 将验证提取到单独的验证器中
- 更新测试以使用新结构
- 为身份验证流程添加集成测试
破坏性变更:身份验证服务现在需要配置对象
前端:
feat(ui): 向仪表板添加加载旋转器fix(form): 验证电子邮件格式后端:
feat(api): 添加用户配置文件端点fix(db): 解决连接池泄漏基础设施:
chore(ci): 将 Node 版本更新到 20feat(docker): 添加多阶段构建清晰地指出破坏性变更:
feat(api)!: 重构 API 响应格式
破坏性变更:所有 API 响应现在遵循 JSON:API 规范
先前格式:
{ "data": {...}, "status": "ok" }
新格式:
{ "data": {...}, "meta": {...} }
迁移指南:更新客户端代码以处理新的响应结构
git diff --staged使用 git add -p 进行选择性暂存:
# 交互式暂存更改
git add -p
# 审查暂存的内容
git diff --staged
# 提交并附带信息
git commit -m "type(scope): description"
修复最后一次提交信息:
# 仅修改提交信息
git commit --amend
# 修改并添加更多更改
git add forgotten-file.js
git commit --amend --no-edit
每周安装
–
仓库
GitHub 星标
23.6K
首次出现
–
安全审计
Contains Hooks
This skill uses Claude hooks which can execute code automatically in response to events. Review carefully before installing.
Analyze staged changes and generate commit message:
# View staged changes
git diff --staged
# Generate commit message based on changes
# (Claude will analyze the diff and suggest a message)
Follow conventional commits format:
<type>(<scope>): <description>
[optional body]
[optional footer]
Feature commit:
feat(auth): add JWT authentication
Implement JWT-based authentication system with:
- Login endpoint with token generation
- Token validation middleware
- Refresh token support
Bug fix:
fix(api): handle null values in user profile
Prevent crashes when user profile fields are null.
Add null checks before accessing nested properties.
Refactor:
refactor(database): simplify query builder
Extract common query patterns into reusable functions.
Reduce code duplication in database layer.
Review what's being committed:
# Show files changed
git status
# Show detailed changes
git diff --staged
# Show statistics
git diff --staged --stat
# Show changes for specific file
git diff --staged path/to/file
DO:
DON'T:
When committing multiple related changes:
refactor(core): restructure authentication module
- Move auth logic from controllers to service layer
- Extract validation into separate validators
- Update tests to use new structure
- Add integration tests for auth flow
Breaking change: Auth service now requires config object
Frontend:
feat(ui): add loading spinner to dashboardfix(form): validate email formatBackend:
feat(api): add user profile endpointfix(db): resolve connection pool leakInfrastructure:
chore(ci): update Node version to 20feat(docker): add multi-stage buildIndicate breaking changes clearly:
feat(api)!: restructure API response format
BREAKING CHANGE: All API responses now follow JSON:API spec
Previous format:
{ "data": {...}, "status": "ok" }
New format:
{ "data": {...}, "meta": {...} }
Migration guide: Update client code to handle new response structure
git diff --stagedUse git add -p for selective staging:
# Stage changes interactively
git add -p
# Review what's staged
git diff --staged
# Commit with message
git commit -m "type(scope): description"
Fix the last commit message:
# Amend commit message only
git commit --amend
# Amend and add more changes
git add forgotten-file.js
git commit --amend --no-edit
Weekly Installs
–
Repository
GitHub Stars
23.6K
First Seen
–
Security Audits
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
147,400 周安装