mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-28 17:58:41 +00:00
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:
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
38
.claude/skills/fish-validate/SKILL.md
Normal file
38
.claude/skills/fish-validate/SKILL.md
Normal 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)
|
||||
22
.claude/skills/lua-format/SKILL.md
Normal file
22
.claude/skills/lua-format/SKILL.md
Normal 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)
|
||||
Reference in New Issue
Block a user