feat(claude): add fish-validate and lua-format skills

Add fish-validate skill for syntax checking and formatting .fish files,
lua-format skill for stylua formatting, and fish_indent PostToolUse hook.
This commit is contained in:
2026-02-28 10:49:45 +02:00
parent d81ff6dabb
commit 63faf4c4bf
3 changed files with 64 additions and 0 deletions

View File

@@ -18,6 +18,10 @@
{
"type": "command",
"command": "fp=$(cat | jq -r '.tool_input.file_path // empty') && [ -n \"$fp\" ] && [ -f \"$fp\" ] && case \"$fp\" in *.sh|*/bin/*) head -1 \"$fp\" | grep -qE '^#!.*(ba)?sh' && command -v shfmt > /dev/null && shfmt -i 2 -bn -ci -sr -fn -w \"$fp\";; esac; exit 0"
},
{
"type": "command",
"command": "fp=$(cat | jq -r '.tool_input.file_path // empty') && [ -n \"$fp\" ] && [ -f \"$fp\" ] && case \"$fp\" in *.fish) command -v fish_indent > /dev/null && fish_indent -w \"$fp\";; esac; exit 0"
}
]
}

View File

@@ -0,0 +1,38 @@
---
name: fish-validate
description: >-
Validate fish scripts after editing.
Apply when writing or modifying any .fish file
in config/fish/.
user-invocable: false
allowed-tools: Bash, Read
---
After editing any `.fish` file in `config/fish/`, validate it:
## 1. Syntax check
```bash
fish --no-execute <file>
```
If syntax check fails, fix the issue before proceeding.
## 2. Format check
Run `fish_indent` to verify formatting:
```bash
fish_indent --check <file>
```
If formatting differs, apply it:
```bash
fish_indent -w <file>
```
## Key files to never validate
- Files inside `config/fish/functions/` prefixed with `_tide_`
(managed by the tide prompt plugin)

View File

@@ -0,0 +1,22 @@
---
name: lua-format
description: >-
Format Lua files after editing.
Apply when writing or modifying any .lua file.
user-invocable: false
allowed-tools: Bash
---
After editing any `.lua` file, format it with stylua:
```bash
stylua <file>
```
Project settings are in `stylua.toml` (90-char line length).
If stylua is not available, skip formatting silently.
## Files to never format
- Files inside `config/nvim/` managed by plugins (lazy.nvim lockfile)