smart-commit
Analyze staged changes and split them into logical Conventional Commits. Use when asked to plan or create multiple cohesive commits.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze staged changes and split them into logical Conventional Commits. Use when asked to plan or create multiple cohesive commits.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
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 | smart-commit |
| description | Analyze staged changes and split them into logical Conventional Commits. Use when asked to plan or create multiple cohesive commits. |
Analyze all currently staged git changes, group them by logical concern, and create multiple well-structured commits following Conventional Commits v1.0.0.
$smart-commit [--dry-run]
Arguments:
--dry-run: Only show the proposed commit plan without executingEvery commit message MUST follow this format:
<type>[optional scope][optional !]: <description>
[optional body]
[optional footer(s)]
| Type | When to Use |
|---|---|
feat | A new feature (correlates with MINOR in SemVer) |
fix | A bug fix (correlates with PATCH in SemVer) |
docs | Documentation only changes |
style | Formatting, missing semi-colons, etc. (not CSS) |
refactor | Code change that neither fixes a bug nor adds a feature |
perf | Performance improvement |
test | Adding or correcting tests |
build | Changes to build system or external dependencies |
ci | Changes to CI configuration files and scripts |
chore | Other changes that don't modify src or test files |
revert | Reverts a previous commit |
Subject line (first line):
git log --oneline, git shortlog, etc.<type>(scope): — e.g., feat(auth): Add JWT refresh, NOT feat(auth): add JWT refreshBody:
Scope & Breaking Changes:
scope: noun describing the section of the codebase (e.g., auth, api, parser)! after type/scope: indicates a BREAKING CHANGE (correlates with MAJOR in SemVer)BREAKING CHANGE: footer for breaking change detailsCloses #123 / Refs #456 in footer to reference issues# List all staged files
git diff --cached --name-only
# Get full staged diff
git diff --cached
# Get staged file stats (additions/deletions per file)
git diff --cached --stat
If no staged changes exist, stop and inform the user.
For each staged file, read the full diff carefully. Understand:
Analyze all staged changes and group them by logical concern. Each group becomes one commit.
Grouping Principles (priority order):
feat and fix in the same commit; don't mix docs with code changesCommon Grouping Patterns:
| Pattern | Example |
|---|---|
| Feature + its tests | feat(auth): Add JWT token refresh (includes both src/auth/refresh.ts and test/auth/refresh.test.ts) |
| Config/dependency change | build(deps): Upgrade axios to v1.6 |
| Documentation update | docs(api): Update authentication examples |
| Independent bug fixes | Each fix = separate commit |
| Refactor + affected tests | refactor(parser): Simplify AST traversal |
| Style/formatting batch | style: Apply prettier formatting (can batch unrelated files) |
Anti-Patterns (DO NOT do these):
Order commits so that:
Display the plan in this format:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Commit Plan: N commits from M staged files
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Commit 1/N
Message: fix(parser): Handle empty input without panic
Files:
- src/parser/input.go
- src/parser/input_test.go
Commit 2/N
Message: feat(api): Add batch processing endpoint
Files:
- src/api/batch.go
- src/api/batch_test.go
- src/api/routes.go
Commit 3/N
Message: docs(api): Document batch processing endpoint
Files:
- docs/api/batch.md
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
If --dry-run was specified, stop here.
Ask user to confirm the plan. If user wants to adjust grouping, re-plan.
For each commit in order:
Unstage everything first (only before the first commit):
git reset HEAD -- .
Stage only the files for this commit:
git add <file1> <file2> ...
If a file has both related and unrelated changes (i.e., partial staging needed), use:
git add -p <file>
and guide the user through hunk selection, OR stage the whole file if all changes belong to this commit.
Create the commit:
git commit -m "$(cat <<'EOF'
<type>(<scope>): <description>
<body if needed>
EOF
)"
Verify the commit succeeded:
git log --oneline -1
After all commits are created:
# Show the commit log
git log --oneline -N # where N = number of commits created
# Verify no staged changes remain
git diff --cached --name-only
# Show working tree status
git status
Display summary:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Done! Created N commits:
abc1234 fix(parser): Handle empty input without panic
def5678 feat(api): Add batch processing endpoint
ghi9012 docs(api): Document batch processing endpoint
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
If all staged changes belong to ONE logical concern, create a single commit. Don't split artificially.
When a file contains changes for multiple commits, use git add -p for patch-level staging. Explain to the user which hunks belong to which commit.
If a commit fails due to pre-commit hooks:
If there are also unstaged changes in the working tree:
Staged files:
src/auth/login.ts (bug fix: null check)src/auth/login.test.ts (test for the fix)src/api/users.ts (new endpoint)src/api/users.test.ts (tests for new endpoint)docs/api/users.md (documentation)package.json (new dependency)Commit Plan:
Commit 1/4: build(deps): Add zod validation library
→ package.json
Commit 2/4: fix(auth): Add null check for user in login flow
→ src/auth/login.ts, src/auth/login.test.ts
Commit 3/4: feat(api): Add user listing endpoint
→ src/api/users.ts, src/api/users.test.ts
Commit 4/4: docs(api): Add user endpoint documentation
→ docs/api/users.md
Staged files:
src/utils/string.ts (extracted helper)src/parser/tokenizer.ts (uses new helper)src/parser/tokenizer.test.ts (updated tests)Commit Plan:
Commit 1/1: refactor(parser): Extract string utilities from tokenizer
→ src/utils/string.ts, src/parser/tokenizer.ts, src/parser/tokenizer.test.ts
(Single commit because all changes are part of one refactor.)