xonecas.io
56101
Df

dotfiles / commit dad1bd4

feat: split commit-all command and introduce programing practices skill

Sean2026-01-29 dad1bd4599ba77939f733eed0a3475880b6592f6 parent 1b2afe6

4 files changed

opencode/commands/commit-all.md+7−21
@@ -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.
opencode/commands/format-then-lint.md+22−0
@@ -0,0 +1,22 @@
1+---
2+name: format-then-lint
3+description: Detect and run formatting then linting commands
4+---
5+
6+Run the following steps to format and lint the code:
7+
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, report that none were detected and stop.
14+
15+2. **Run Code Quality Tools**:
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. **Report**:
22+ - Output which tools were run (or that none were found).
opencode/install.sh+4−10
@@ -1,5 +1,5 @@
11 #!/usr/bin/env bash
2-# Link opencode config files and directories into ~/.config/opencode, skipping existing targets.
2+# Link opencode config files and directories into ~/.config/opencode, refreshing existing targets.
33 set -e
44
55 config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/opencode"
@@ -9,26 +9,20 @@ repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
99
1010 mkdir -p "$config_dir" "$commands_dir" "$skills_dir"
1111
12-if [ ! -e "$config_dir/AGENTS.md" ] && [ ! -L "$config_dir/AGENTS.md" ]; then
13- ln -s "$repo_dir/AGENTS.md" "$config_dir/AGENTS.md"
14-fi
12+ln -sf "$repo_dir/AGENTS.md" "$config_dir/AGENTS.md"
1513
1614 shopt -s nullglob # Avoid literal glob patterns when directories are empty.
1715 for item in "$repo_dir/commands"/*; do
1816 if [ -f "$item" ]; then
1917 target="$commands_dir/$(basename "$item")"
20- if [ ! -e "$target" ] && [ ! -L "$target" ]; then
21- ln -s "$item" "$target"
22- fi
18+ ln -sf "$item" "$target"
2319 fi
2420 done
2521
2622 for item in "$repo_dir/skills"/*; do
2723 if [ -d "$item" ]; then
2824 target="$skills_dir/$(basename "$item")"
29- if [ ! -e "$target" ] && [ ! -L "$target" ]; then
30- ln -s "$item" "$target"
31- fi
25+ ln -sf "$item" "$target"
3226 fi
3327 done
3428
opencode/skills/token-efficiency-opencode/token-efficiency-opencode+1−0
@@ -0,0 +1 @@
1+/Users/seancaetanomartin/src/dotfiles/opencode/skills/token-efficiency-opencode