Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit 629d735

Browse files
phuctm97claude
andcommitted
Reorganize Claude commands for better workflow management
Replaced generate-nx-version-plan command with three separate commands: - git-commit: Pre-commit workflow and commit creation - git-push: Complete workflow including push to remote - version-plan: Dedicated version plan generation with improved guidelines This provides clearer separation of concerns and better aligns with typical development workflows. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 92ff01c commit 629d735

File tree

4 files changed

+117
-44
lines changed

4 files changed

+117
-44
lines changed

.claude/commands/generate-nx-version-plan.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

.claude/commands/git-commit.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
description: Format, type check, lint, and commit all changes
3+
allowed-tools: Bash(pnpm -w format), Bash(pnpm exec nx run-many -t typecheck:*), Bash(pnpm exec nx run-many -t lint:*), Bash(pnpm exec nx run-many -t lint --args=--fix), Bash(git status:*), Bash(git diff:*), Bash(git branch:*), Bash(git add:*), Bash(git commit:*)
4+
---
5+
6+
Run the pre-commit workflow and create a git commit with all changes.
7+
8+
Execute the following steps in order:
9+
10+
1. **Format code**: Run `pnpm -w format` to format all files
11+
2. **Type check**: Run `pnpm exec nx run-many -t typecheck` to check TypeScript types
12+
3. **Lint and auto-fix issues**: Run `pnpm exec nx run-many -t lint --args=--fix` to lint and auto-fix issues
13+
4. **Stage all changes**: Run `git add -A` to stage all changes (including any fixes from the above steps)
14+
5. **Review changes**: Run `git status` and `git diff` to review what will be committed
15+
6. **Create commit**: Generate an appropriate commit message based on the changes and create the commit
16+
17+
For the commit message:
18+
- Keep it concise and descriptive
19+
- Focus on the "why" rather than the "what"
20+
- DO NOT use conventional commit prefixes (no "fix:", "feat:", "chore:", etc.)
21+
22+
If any of the formatting, type checking, or linting steps fail, attempt to fix the issues. After fixing the issues or making any changes manually, repeat the entire process from step 1 to ensure everything is in order before committing.

.claude/commands/git-push.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
description: Format, type check, lint, commit all changes, and push to remote
3+
allowed-tools: Bash(pnpm -w format), Bash(pnpm exec nx run-many -t typecheck:*), Bash(pnpm exec nx run-many -t lint:*), Bash(pnpm exec nx run-many -t lint --args=--fix), Bash(git status:*), Bash(git diff:*), Bash(git branch:*), Bash(git add:*), Bash(git commit:*), Bash(git push:*)
4+
---
5+
6+
Run the pre-commit workflow, create a git commit with all changes, and push to the remote repository.
7+
8+
Execute the following steps in order:
9+
10+
1. **Format code**: Run `pnpm -w format` to format all files
11+
2. **Type check**: Run `pnpm exec nx run-many -t typecheck` to check TypeScript types
12+
3. **Lint and auto-fix issues**: Run `pnpm exec nx run-many -t lint --args=--fix` to lint and auto-fix issues
13+
4. **Stage all changes**: Run `git add -A` to stage all changes (including any fixes from the above steps)
14+
5. **Review changes**: Run `git status` and `git diff` to review what will be committed
15+
6. **Create commit**: Generate an appropriate commit message based on the changes and create the commit
16+
7. **Push to remote**: Check the current branch with `git branch --show-current` and push the changes with `git push`
17+
18+
For the commit message:
19+
- Keep it concise and descriptive
20+
- Focus on the "why" rather than the "what"
21+
- DO NOT use conventional commit prefixes (no "fix:", "feat:", "chore:", etc.)
22+
23+
If any of the formatting, type checking, or linting steps fail, attempt to fix the issues. After fixing the issues or making any changes manually, repeat the entire process from step 1 to ensure everything is in order before committing.
24+
25+
If the push fails (e.g., due to remote changes), report the errors to the user for resolution.

.claude/commands/version-plan.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
description: Generate an Nx version plan based on current git changes
3+
allowed-tools: Bash(git status:*), Bash(git diff:*), Read(.nx/version-plans/**), Edit(.nx/version-plans/**)
4+
---
5+
6+
Analyze the current git changes (both staged and unstaged) and generate a new Nx version plan file.
7+
8+
First, check `git status` and `git diff` to understand what has changed. If there are no changes, inform the user that no version plan is needed.
9+
10+
Then, check existing version plans in `.nx/version-plans/` to ensure you're not creating a duplicate or similar plan.
11+
12+
Analyze the changes to determine:
13+
1. The appropriate semantic version bump:
14+
- **patch**: Bug fixes, typo corrections, internal refactors that don't affect functionality
15+
- **minor**: New features, enhancements, non-breaking improvements
16+
- **major**: Breaking changes, API modifications, removal of features
17+
2. A concise, single-line changelog entry
18+
19+
Create the version plan file in `.nx/version-plans/` with a filename that briefly summarizes the change (using kebab-case).
20+
21+
The file format should be:
22+
```markdown
23+
---
24+
__default__: version-type
25+
---
26+
27+
Single line changelog entry describing the changes
28+
```
29+
30+
Examples:
31+
32+
1. Bug fix (patch):
33+
- Filename: `fix-memory-leak-in-parser.md`
34+
- Content:
35+
```markdown
36+
---
37+
__default__: patch
38+
---
39+
40+
Fix memory leak in parser when handling large files
41+
```
42+
43+
2. New feature (minor):
44+
- Filename: `add-authentication-feature.md`
45+
- Content:
46+
```markdown
47+
---
48+
__default__: minor
49+
---
50+
51+
Add authentication feature with OAuth support
52+
```
53+
54+
3. Breaking change (major):
55+
- Filename: `remove-deprecated-api-methods.md`
56+
- Content:
57+
```markdown
58+
---
59+
__default__: major
60+
---
61+
62+
Remove deprecated API methods from v1.x
63+
```
64+
65+
Important:
66+
- Always use `__default__` since this repository releases the same version for all projects
67+
- The changelog entry must be a single line without bullet points or multiple paragraphs
68+
- If there are multiple unrelated changes, create separate version plans for each
69+
- The filename should be descriptive, unique, and clearly indicate what changed
70+
- Avoid creating plans for changes that already have similar plans in the directory

0 commit comments

Comments
 (0)