Git Skill
Use this skill when performing git operations or handling file changes.
File and Git Operations
- Delete unused or obsolete files when your changes make them irrelevant
(refactors, feature removals, etc.), and revert files only when the change is
yours or explicitly requested. If a git operation leaves you unsure about
other agents' in-flight work, stop and coordinate instead of deleting.
- Before attempting to delete a file to resolve a local type/lint failure,
stop and ask the user. Other agents are often editing adjacent files;
deleting their work to silence an error is never acceptable without explicit
approval.
- NEVER edit
.env or any environment variable files—only the user may change
them.
- Coordinate with other agents before removing their in-progress edits—don't
revert or delete work you didn't author unless everyone agrees.
- Moving/renaming and restoring files is allowed.
- ABSOLUTELY NEVER run destructive git operations (e.g.,
git reset --hard,
rm, git checkout/git restore to an older commit) unless the user gives
an explicit, written instruction in this conversation. Treat these commands
as catastrophic; if you are even slightly unsure, stop and ask before
touching them. (When working within Cursor or Codex Web, these git
limitations do not apply; use the tooling's capabilities as needed.)
- Never use
git restore (or similar commands) to revert files you didn't
author—coordinate with other agents instead so their in-progress work stays
intact.
- Always double-check git status before any commit.
- Keep commits atomic: commit only the files you touched and list each path
explicitly. For tracked files run
git commit -m "<scoped message>" -- path/to/file1 path/to/file2. For brand-new files, use the one-liner git restore --staged :/ && git add "path/to/file1" "path/to/file2" && git commit -m "<scoped message>" -- path/to/file1 path/to/file2.
- Commit message format: Use Conventional Commits specification with
parentheses for scope (e.g.,
fix(profiler): correct ProcedureCall type,
feat(client,zerospin): add batch support). Format:
<type>(<scope>): <description>. See
.cursor/rules/conventional-commits.mdc for full specification.
- Quote any git paths containing brackets or parentheses (e.g.,
src/app/[candidate]/**) when staging or committing so the shell does not
treat them as globs or subshells.
- When running
git rebase, avoid opening editors—export GIT_EDITOR=: and
GIT_SEQUENCE_EDITOR=: (or pass --no-edit) so the default messages are used
automatically.
- Never amend commits unless you have explicit written approval in the task
thread.
Commit Message Format
Use the Conventional Commits specification format for all commit messages:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Format Details
Type (required): One of the conventional commit types:
fix: A bug fix
feat: A new feature
docs: Documentation only changes
style: Changes that do not affect the meaning of the code
refactor: A code change that neither fixes a bug nor adds a feature
perf: A code change that improves performance
test: Adding missing tests or correcting existing tests
build: Changes that affect the 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
Scope (optional): Enclosed in parentheses (). The scope should indicate
the area of the codebase affected:
- Use package/app names when applicable (e.g.,
profiler, zerospin,
client, cloudflare)
- Examples:
fix(profiler):
- If all the changes are in a specific package folder, obviously use that
package for scope. Same goes for an app.
Description (required): A short, imperative-mood description of the change
(max 72 characters recommended)
Body (optional): Provide additional contextual information about the
change
Footer (optional): Reference issue numbers, breaking changes, etc.
Examples
fix(profiler): correct ProcedureCall type inference
feat(client): add OPFSAdapter support
Important Notes
- Always use parentheses
() for scope, not square brackets []
- The scope is optional—omit the parentheses entirely if no scope is needed:
fix: resolve memory leak
- Keep the description concise and in imperative mood ("fix bug" not "fixed bug"
or "fixes bug")
1---2name: git-83description: Git workflow and safety rules for this workspace.4---5
6# Git Skill
7
8Use this skill when performing git operations or handling file changes.
9
10## File and Git Operations
11
12- Delete unused or obsolete files when your changes make them irrelevant
13 (refactors, feature removals, etc.), and revert files only when the change is
14 yours or explicitly requested. If a git operation leaves you unsure about
15 other agents' in-flight work, stop and coordinate instead of deleting.
16- **Before attempting to delete a file to resolve a local type/lint failure,
17 stop and ask the user.** Other agents are often editing adjacent files;
18 deleting their work to silence an error is never acceptable without explicit
19 approval.
20- NEVER edit `.env` or any environment variable files—only the user may change
21 them.
22- Coordinate with other agents before removing their in-progress edits—don't
23 revert or delete work you didn't author unless everyone agrees.
24- Moving/renaming and restoring files is allowed.
25- ABSOLUTELY NEVER run destructive git operations (e.g., `git reset --hard`,
26 `rm`, `git checkout`/`git restore` to an older commit) unless the user gives
27 an explicit, written instruction in this conversation. Treat these commands
28 as catastrophic; if you are even slightly unsure, stop and ask before
29 touching them. *(When working within Cursor or Codex Web, these git
30 limitations do not apply; use the tooling's capabilities as needed.)*
31- Never use `git restore` (or similar commands) to revert files you didn't
32 author—coordinate with other agents instead so their in-progress work stays
33 intact.
34- Always double-check git status before any commit.
35- Keep commits atomic: commit only the files you touched and list each path
36 explicitly. For tracked files run `git commit -m "<scoped message>" --
37 path/to/file1 path/to/file2`. For brand-new files, use the one-liner `git
38 restore --staged :/ && git add "path/to/file1" "path/to/file2" && git commit
39 -m "<scoped message>" -- path/to/file1 path/to/file2`.
40- Commit message format: Use Conventional Commits specification with
41 parentheses for scope (e.g., `fix(profiler): correct ProcedureCall type`,
42 `feat(client,zerospin): add batch support`). Format:
43 `<type>(<scope>): <description>`. See
44 `.cursor/rules/conventional-commits.mdc` for full specification.
45- Quote any git paths containing brackets or parentheses (e.g.,
46 `src/app/[candidate]/**`) when staging or committing so the shell does not
47 treat them as globs or subshells.
48- When running `git rebase`, avoid opening editors—export `GIT_EDITOR=:` and
49 `GIT_SEQUENCE_EDITOR=:` (or pass `--no-edit`) so the default messages are used
50 automatically.
51- Never amend commits unless you have explicit written approval in the task
52 thread.
53
54## Commit Message Format
55
56Use the Conventional Commits specification format for all commit messages:
57
58```
59<type>(<scope>): <description>
60
61[optional body]
62
63[optional footer(s)]
64```
65
66### Format Details
67
68- **Type** (required): One of the conventional commit types:
69 - `fix`: A bug fix
70 - `feat`: A new feature
71 - `docs`: Documentation only changes
72 - `style`: Changes that do not affect the meaning of the code
73 - `refactor`: A code change that neither fixes a bug nor adds a feature
74 - `perf`: A code change that improves performance
75 - `test`: Adding missing tests or correcting existing tests
76 - `build`: Changes that affect the build system or external dependencies
77 - `ci`: Changes to CI configuration files and scripts
78 - `chore`: Other changes that don't modify src or test files
79 - `revert`: Reverts a previous commit
80
81- **Scope** (optional): Enclosed in parentheses `()`. The scope should indicate
82 the area of the codebase affected:
83 - Use package/app names when applicable (e.g., `profiler`, `zerospin`,
84 `client`, `cloudflare`)
85 - Examples: `fix(profiler):`
86 - If all the changes are in a specific package folder, obviously use that
87 package for scope. Same goes for an app.
88
89- **Description** (required): A short, imperative-mood description of the change
90 (max 72 characters recommended)
91
92- **Body** (optional): Provide additional contextual information about the
93 change
94
95- **Footer** (optional): Reference issue numbers, breaking changes, etc.
96
97### Examples
98
99```
100fix(profiler): correct ProcedureCall type inference
101feat(client): add OPFSAdapter support
102```
103
104### Important Notes
105
106- Always use parentheses `()` for scope, not square brackets `[]`
107- The scope is optional—omit the parentheses entirely if no scope is needed:
108 `fix: resolve memory leak`
109- Keep the description concise and in imperative mood ("fix bug" not "fixed bug"
110 or "fixes bug")