Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:22:52 +08:00
commit ba1e6370e1
7 changed files with 399 additions and 0 deletions

39
commands/commit.md Normal file
View File

@@ -0,0 +1,39 @@
---
name: commit
description: Create git commits with user approval and no Claude attribution
---
# Committing Work
## Overview
**Core principle:** Analyze changes → Plan commits → Execute.
## The Process
**IMPORTANT:** use skill `committing-work` to learn how to draft good commit messages and how to organize commits.
### Step 1: Think about what changed
1. Review the conversation history and understand what was accomplished
2. Run `git status` to see current changes
3. Run `git diff` to understand the modifications
4. Consider whether changes should be one commit or multiple logical commits
### Step 2: Plan your commit(s)
1. Identify which files belong together
2. Draft clear, descriptive commit messages
3. Use imperative mood in commit messages
4. Focus on why the changes were made, not just what
### Step 3: Present your plan to the user
> **IMPORTANT** this step can be skipped if the user explicitely allowed.
1. List the files you plan to add for each commit
2. Show the commit message(s) you'll use
3. Ask: "I plan to create [N] commit(s) with these changes. Shall I proceed?"
### Step 4: Execute planned commits
1. Use `git add` with specific files (never use `-A` or `.`)
- Create commits with your planned messages
- Show the result with `git log --oneline -n [number]`

38
commands/create-pr.md Normal file
View File

@@ -0,0 +1,38 @@
---
name: create-pr
description: Create a new branch, push to remote, and create a pull request on GitHub
---
You are helping create a GitHub pull request. Follow these steps:
**ASSUMPTIONS:**
- All changes are already committed locally
- The current branch is the one with the changes
**STEPS:**
1. **Analyze the commits:**
- Run `git log origin/main..HEAD` (or appropriate base branch) to see all commits that will be included
- Run `git diff origin/main...HEAD` to see the full diff
2. **Create a new branch:**
- Generate a descriptive branch name based on the changes (use kebab-case, e.g., `feature/add-user-auth` or `fix/memory-leak`)
- Create and checkout the new branch: `git checkout -b <branch-name>`
3. **Push to remote:**
- Push the new branch to origin with tracking: `git push -u origin <branch-name>`
4. **Create the pull request:**
- Analyze ALL commits (not just the latest) to understand the full scope of changes
- Generate a clear, concise title (max 72 characters) that describes what the PR does
- Create a PR body with:
- Brief summary of changes (2-3 sentences)
- Why these changes were made
- Any relevant context or notes
**IMPORTANT:**
- DO NOT use the TodoWrite tool
- Be concise and focused
- Return the PR URL when done
- If $ARGUMENTS is provided, use it as context or as the target base branch
- Use the GH cli tool to interact with GitHub