@@ -1,37 +1,23 @@
11 ---
22 name: commit-all
3-description: Format, lint, and commit all changes with a generated message
3+description: Stage and commit all changes with a generated message
44 ---
55
6-Run the following steps to clean and commit the code:
6+Run the following steps to stage and commit the code. If you want formatting and linting, run `/format-then-lint` first.
77
8-1. **Detect Available Code Quality Tools**:
9- - Examine the current project to identify available formatting and linting commands:
10- - Check for `package.json`, `Makefile`, `pyproject.toml`, `Cargo.toml`, or other project configuration files
11- - Look for common script names like `format`, `lint`, `check`, or similar
12- - Identify the appropriate command runner (npm, bun, pnpm, make, cargo, poetry, etc.)
13- - If no code quality tools are found, skip to step 3 (staging changes).
14-
15-2. **Run Code Quality Tools** (if available):
16- - Execute the detected formatting command first (if available)
17- - Then execute the detected linting command (if available)
18- - If any command fails, stop immediately and report the issues.
19- - If no commands are configured, skip this step gracefully.
20-
21-3. **Stage Changes**:
8+1. **Stage Changes**:
229 - Run `git add .` to stage all modified and untracked files.
2310
24-4. **Generate Commit**:
11+2. **Generate Commit**:
2512 - Analyze the staged changes (using `git diff --cached` if necessary to understand the context).
2613 - Draft a concise, descriptive commit message following the **Conventional Commits** specification (e.g., `feat: add search`, `fix: handle null url`).
2714 - Create the commit using `git commit -m "..."`.
2815
29-5. **Handle Pre-commit Hook Failures**:
16+3. **Handle Pre-commit Hook Failures**:
3017 - If the commit fails due to pre-commit hooks (e.g., lint checks, formatting checks, tests):
3118 - Report the error output clearly to the user
3219 - Ask the user how they would like to proceed (e.g., fix the issues automatically, skip hooks, or abort)
3320 - Report all other errors or unexpected output to the user and ask for next steps.
3421
35-6. **Report**:
36- - Output the result of the commit operation, including which tools were run (if any).
37- - If pre-commit hooks failed and were fixed, report what issues were resolved.
22+4. **Report**:
23+ - Output the result of the commit operation.