commit-by-logic
分析git更改并分次提交,支持从git diff或git staged分析,每次提交都是逻辑上独立的功能
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
分析git更改并分次提交,支持从git diff或git staged分析,每次提交都是逻辑上独立的功能
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Capture a multi-step workflow into a timestamped pipeline memory after trial-and-error sessions. The core output is: (1) the final working commands saved as executable scripts (not bare shell commands), and (2) a structured markdown document separating the clean reproducible pipeline from the detours and pitfalls. Timestamped snapshots live in pipeline_memory/; mature pipelines can be promoted to PIPELINE.md and auto-loaded. Fully environment-agnostic — works for any project, any toolset, any domain. Use when the user finishes a multi-step task, says "保存工作流记忆", "save pipeline memory", "记录一下当前进展", or "/save-pipeline-memory". Takes an optional folder path.
Run Claude Code commands (including /insights, /doctor, custom prompts) via system crontab in non-interactive mode. Use when: (1) setting up daily/weekly automated Claude Code tasks, (2) scheduling reports or analysis via cron, (3) running Claude Code with third-party API backends (DeepSeek, Qwen, etc.) in headless environments, (4) "set up a daily report", "automate this in cron", "schedule insights". Covers: cron PATH setup, third-party API env vars for non-interactive mode, nvm/node auto-discovery, and wechat-reminder integration for notification delivery.
Use when the user wants to *learn* or *understand* a technical concept (an algorithm, a math derivation, an ML architecture, a systems internal) rather than just get a one-shot answer — triggers include "explain X", "teach me X", "help me understand X", or being stuck on a concept while reading a paper or code. Probe the user's level with a few questions FIRST, then teach interactively through a runnable Jupyter notebook with LaTeX derivations and small experiments.
Claudeception is a continuous learning system that extracts reusable knowledge from work sessions. Triggers: (1) /claudeception command to review session learnings, (2) "save this as a skill" or "extract a skill from this", (3) "what did we learn?", (4) After any task involving non-obvious debugging, workarounds, or trial-and-error discovery. Creates new Claude Code skills when valuable, reusable knowledge is identified.
Record a debugging session's findings into a timestamped markdown file under debug_experience/. Captures problem, root cause, solution, and key learnings in a structured, reusable format. Use when: you've just resolved a non-obvious bug, found an undocumented edge case, encountered an issue that took multiple attempts to fix, or when you say things like "保存调试经验", "save debug experience", "记录这次调试", "/save-debug-experience". Takes an optional folder path as argument.
MCP Notion工具使用指南,包含常见问题解决方案和最佳实践。使用当: (1) 访问Notion数据库view URL出现"URL type view not currently supported"错误, (2) 需要获取数据库schema和表结构信息, (3) 查询数据库中的条目内容, (4) 创建页面时MULTI_SELECT字段值不存在导致失败, (5) 需要更新数据库schema添加新选项, (6) 开发需要集成Notion数据的自动化工作流, (7) query_data_sources/query-database-view返回Business Plan要求错误, (8) 需要在无Business Plan的情况下枚举数据库所有条目。
| name | commit-by-logic |
| description | 分析git更改并分次提交,支持从git diff或git staged分析,每次提交都是逻辑上独立的功能 |
这个工具帮助你分析git更改并将更改分成多个逻辑上独立的提交。支持从git diff(未暂存更改)或git staged(已暂存更改)分析。每个提交都遵循<type>(<scope>): <description>格式。
运行 /commit-by-logic 或 /commit-by-logic [--source diff|staged] [type]
参数说明:
--source diff|staged: 可选,指定分析来源。diff表示分析未暂存更改(默认),staged表示分析已暂存更改type: 可选的提交类型前缀,如feat、fix等。如果不提供,系统会为每个分组自动选择合适的类型。示例:
/commit-by-logic - 分析未暂存更改并分次提交/commit-by-logic --source staged - 分析已暂存更改并分次提交/commit-by-logic --source diff feat - 分析未暂存更改,使用feat作为默认类型/commit-by-logic fix - 分析未暂存更改,使用fix作为默认类型<type>(<scope>): <description>格式的提交消息遵循Conventional Commits规范:<type>(<scope>): <description>
feat: 新功能fix: 修复bugdocs: 文档更新style: 代码格式调整(不影响功能)refactor: 代码重构test: 测试相关chore: 构建过程或辅助工具的变动perf: 性能优化ci: CI配置变更可选的模块或组件名称,如auth、api、ui、config等。
简短描述,使用英文,使用现在时祈使句,首字母不大写,不加句号。
解析用户提供的参数:
--source staged,设置 SOURCE="staged"--source diff,设置 SOURCE="diff"SOURCE="diff"根据分析来源检查状态:
# 检查git状态
git status --porcelain
# 根据SOURCE参数选择分析来源
if [ "$SOURCE" = "staged" ]; then
git diff --cached --name-status
else
git diff --name-status
fi
根据分析来源获取详细的更改信息:
if [ "$SOURCE" = "staged" ]; then
# 分析已暂存更改
git diff --cached --name-only
git diff --cached --stat
else
# 分析未暂存更改(默认)
git diff --name-only
git diff --stat
fi
请按照以下逻辑分析更改并分组:
按文件类型分组:
chore或configdocsteststyle按功能模块分组:
src/auth/, src/api/, ui/, components/等)按更改类型分组:
featrefactor或fix对于每个逻辑分组:
type和scopedescriptiontype(scope): description示例:
feat(auth): 添加用户登录功能fix(api): 修复用户查询接口空指针异常docs(readme): 更新安装说明chore(deps): 升级react到v18在开始提交前,请向我展示:
$SOURCE (diff或staged)等待我的确认后再开始执行提交操作。
对于每个确认的分组:
$SOURCE = "diff"(分析未暂存更改),需要先暂存文件:
git add [文件列表]
$SOURCE = "staged"(分析已暂存更改),文件已暂存,直接提交git commit -m "提交消息" 提交以下文件不应被提交,在分组时自动忽略:
CLAUDE.md、GEMINI.md 等 AI 指令文件core dump 文件)--source diff(默认):分析未暂存的更改(git diff)。适用于正在编辑但尚未暂存的文件。--source staged:分析已暂存的更改(git diff --cached)。适用于已经使用 git add 暂存的文件。--source diff 时,工具会自动暂存每个分组的文件然后提交--source staged 时,文件已经暂存,工具直接提交--source diff 且没有未暂存更改,提示:"No unstaged changes to commit. Use --source staged if you have staged changes."--source staged 且没有已暂存更改,提示:"No staged changes to commit. Use --source diff if you have unstaged changes."--source staged),然后再处理未暂存更改(--source diff)