Make incremental commits during development, linking to Linear issue and syncing progress.
Creates atomic commits with AI-generated messages linked to Linear issues and synced to Linear.
/plugin marketplace add wuyuxiangX/yux-claude-hub/plugin install yux-linear-workflow@yux-claude-hubMake incremental commits during development, linking to Linear issue and syncing progress.
Usage: /yux-linear-commit [description]
Optional commit description (reference only, Claude auto-generates the message): $ARGUMENTS
Get current branch:
git branch --show-current
Extract Linear issue ID (LIN-xxx pattern)
/yux-linear-start firstRead local state file:
.claude/linear-tasks/<ISSUE_ID>.jsonCheck uncommitted changes:
git status --porcelain
Run git status --porcelain and categorize:
Chinese:
=== Current Changes ===
New files (3):
[1] src/components/Login.tsx
[2] src/utils/auth.ts
[3] tests/login.test.ts
Modified files (2):
[4] src/App.tsx
[5] package.json
Deleted files (1):
[6] src/old-login.js
Suggested to ignore (not numbered):
- .env.local (sensitive file)
- .DS_Store (system file)
English:
=== Current Changes ===
New files (3):
[1] src/components/Login.tsx
[2] src/utils/auth.ts
[3] tests/login.test.ts
Modified files (2):
[4] src/App.tsx
[5] package.json
Deleted files (1):
[6] src/old-login.js
Suggested to ignore (not numbered):
- .env.local (sensitive file)
- .DS_Store (system file)
Use AskUserQuestion tool to let user choose:
Chinese:
Select files to commit:
1. Commit all changes (6 files)
2. Select specific files (enter numbers, e.g.: 1,2,4)
3. Exclude specific files (enter numbers to exclude, e.g.: -5,-6)
4. Cancel
English:
Select files to commit:
1. Commit all changes (6 files)
2. Select specific files (enter numbers, e.g.: 1,2,4)
3. Exclude specific files (enter numbers to exclude, e.g.: -5,-6)
4. Cancel
Before generating commit message, analyze atomicity of changes:
Analyze changes:
If changes contain multiple independent features, suggest splitting:
Chinese:
Suggest splitting commit
Detected multiple independent changes:
1. UI changes: src/components/Login.tsx, src/App.tsx
2. API changes: src/api/auth.ts
Suggestion:
- First commit: UI files (select 1,2)
- Second commit: API files (select 3)
Split commit? (y/n to continue with current selection)
English:
Suggest splitting commit
Detected multiple independent changes:
1. UI changes: src/components/Login.tsx, src/App.tsx
2. API changes: src/api/auth.ts
Suggestion:
- First commit: UI files (select 1,2)
- Second commit: API files (select 3)
Split commit? (y/n to continue with current selection)
Atomic check passed (all changes belong to same feature)
Claude auto-generates commit message (user input is reference only):
Analyze changes:
Auto-determine commit message:
emoji: Choose emoji based on typetype: feat/fix/docs/refactor/test/chore/style/perfscope: Infer module from changed files (e.g., auth, ui, api)subject: Chinese description, max 50 charactersEmoji mapping:
| Type | Emoji | Meaning |
|---|---|---|
| feat | ✨ | New feature |
| fix | 🐛 | Bug fix |
| docs | 📝 | Documentation |
| style | 💄 | Format/style |
| refactor | ♻️ | Refactoring |
| perf | ⚡️ | Performance |
| test | ✅ | Tests |
| build | 📦 | Build |
| ci | 👷 | CI/CD |
| chore | 🔧 | Chores |
Chinese (when user language is Chinese):
生成的提交信息:
✨ feat(auth): 增加登录组件和认证工具
**变更内容**
- 在 `src/components` 中添加 LoginForm.tsx 组件
- 添加 `auth.ts` 认证工具
- 更新 App.tsx 集成登录路由
**变更原因**
为用户提供登录入口,实现基础认证流程。
Refs: LIN-456
**提交者**
Co-Authored-By: wuyuxiang 🤖 由 Claude AI 生成
确认提交? (y/修改/n)
English (when user language is English):
Generated commit message:
✨ feat(auth): add login component and auth utilities
**What**
- Add LoginForm.tsx component in `src/components`
- Add `auth.ts` authentication utility
- Update App.tsx to integrate login route
**Why**
Provide login entry for users and implement basic authentication flow.
Refs: LIN-456
**Who**
Co-Authored-By: wuyuxiang 🤖 Generated by Claude AI
Confirm? (y/modify/n)
Format based on user language:
Chinese format:
<emoji> <type>(<scope>): <中文主题描述>
**变更内容**
- 变更点 1
- 变更点 2
**变更原因**
解释动机
Refs: LIN-456
**提交者**
Co-Authored-By: <username> 🤖 由 Claude AI 生成
English format:
<emoji> <type>(<scope>): <English subject>
**What**
- Change point 1
- Change point 2
**Why**
Explain motivation
Refs: LIN-456
**Who**
Co-Authored-By: <username> 🤖 Generated by Claude AI
Important rules:
git push, only git add and git commitgit pushStage selected files:
git add <file1> <file2> ...
Create commit:
git commit -m "<message>"
Display commit result:
Chinese:
Committed 4 files
Commit hash: abc1234
Message: feat(auth): add login component
Related Issue: LIN-456
English:
Committed 4 files
Commit hash: abc1234
Message: feat(auth): add login component
Related Issue: LIN-456
After successful commit, must add comment to Linear issue:
mcp__linear__create_comment(
issueId: "<issue-uuid>",
body: "**Commit**: `abc1234`\n\n```\nfeat(auth): add login component\n```\n\n**Files changed**: 4\n- src/components/Login.tsx\n- src/utils/auth.ts\n- ..."
)
Display sync result:
Chinese:
Synced to Linear: LIN-456
English:
Synced to Linear: LIN-456
Chinese:
=== Commit Complete ===
Commit hash: abc1234
Message: feat(auth): add login component
Files: 4
Linear: LIN-456
Next steps:
- Continue development
- /yux-linear-commit to commit again
- /yux-linear-pr to create PR
- git push (manual)
English:
=== Commit Complete ===
Commit hash: abc1234
Message: feat(auth): add login component
Files: 4
Linear: LIN-456
Next steps:
- Continue development
- /yux-linear-commit to commit again
- /yux-linear-pr to create PR
- git push (manual)
| Pattern | Reason |
|---|---|
.env* | Sensitive config |
*.local | Local config |
node_modules/** | Dependencies |
.DS_Store | macOS system file |
Thumbs.db | Windows system file |
*.log | Log files |
credentials* | Credential files |
*.key | Key files |
*.pem | Certificate files |
.claude/ | Claude config (except linear-tasks) |
Chinese:
Not on a Linear branch
Current branch: main
Please run /yux-linear-start to create a task branch first.
English:
Not on a Linear branch
Current branch: main
Please run /yux-linear-start to create a task branch first.
Chinese:
Local state file not found
Please run /yux-linear-status to sync state before committing.
English:
Local state file not found
Please run /yux-linear-status to sync state before committing.
Chinese:
No changes to commit
Working directory is clean.
English:
No changes to commit
Working directory is clean.
Chinese:
Commit failed
Error: <git error message>
Please fix the issue and try again.
English:
Commit failed
Error: <git error message>
Please fix the issue and try again.
Chinese:
Linear sync failed
Commit completed (abc1234), but failed to sync to Linear.
Error: <error message>
Please manually record this commit on Linear.
English:
Linear sync failed
Commit completed (abc1234), but failed to sync to Linear.
Error: <error message>
Please manually record this commit on Linear.
User: /yux-linear-commit 实现了登录表单
Claude:
=== 当前变更 ===
新增文件 (1):
[1] src/components/LoginForm.tsx
修改文件 (2):
[2] src/App.tsx
[3] src/routes/index.ts
选择要提交的文件:
1. 提交所有变更 (3 个文件)
2. 选择特定文件
3. 排除特定文件
4. 取消
User: 1
Claude:
✓ 原子性检查通过(所有变更属于同一功能)
生成的提交信息:
✨ feat(auth): 增加登录表单组件和路由集成
**变更内容**
- 创建 `LoginForm.tsx` 组件用于用户登录界面
- 更新 `App.tsx` 集成登录组件
- 更新 `routes/index.ts` 添加登录路由
**变更原因**
为用户提供登录入口,实现基础认证流程。
Refs: LIN-456
**提交者**
Co-Authored-By: wuyuxiang 🤖 由 Claude AI 生成
确认提交? (y/修改/n)
User: y
Claude:
已提交 3 个文件
已同步到 Linear: LIN-456
=== 提交完成 ===
Commit hash: a1b2c3d
Linear: LIN-456
下一步:
- 继续开发
- /yux-linear-commit 再次提交
- /yux-linear-pr 创建 PR
- git push (手动执行)
User: /yux-linear-commit
Claude:
=== 当前变更 ===
新增文件 (1):
[1] src/utils/auth.ts
修改文件 (3):
[2] src/App.tsx
[3] package.json
[4] package-lock.json
选择要提交的文件:
...
User: 1,2
Claude:
✓ 原子性检查通过
生成的提交信息:
✨ feat(auth): 增加认证工具模块
**变更内容**
- 创建 `auth.ts` 认证工具
- 更新 `App.tsx` 集成认证模块
**变更原因**
提供统一的认证逻辑处理。
Refs: LIN-456
**提交者**
Co-Authored-By: wuyuxiang 🤖 由 Claude AI 生成
确认提交? (y/修改/n)
User: y
Claude:
已提交 2 个文件
已同步到 Linear: LIN-456
...
User: /yux-linear-commit
Claude:
...
生成的提交信息:
✨ feat(auth): 增加登录验证
**变更内容**
- 添加登录验证逻辑
**变更原因**
确保用户输入有效。
Refs: LIN-456
**提交者**
Co-Authored-By: wuyuxiang 🤖 由 Claude AI 生成
确认提交? (y/修改/n)
User: 改成 fix 类型,修复验证逻辑
Claude:
修改后的提交信息:
🐛 fix(auth): 修复登录验证逻辑
**变更内容**
- 修复登录验证逻辑中的边界条件
**变更原因**
解决用户无法正常登录的问题。
Refs: LIN-456
**提交者**
Co-Authored-By: wuyuxiang 🤖 由 Claude AI 生成
确认提交? (y/修改/n)
User: y
Claude:
已提交 2 个文件
...