diff --git a/.claude/agents/code-reviewer.md b/.claude/agents/code-reviewer.md new file mode 100644 index 0000000..5ea868a --- /dev/null +++ b/.claude/agents/code-reviewer.md @@ -0,0 +1,14 @@ +--- +name: code-reviewer +description: Reviews shell/fish/lua changes for correctness and style +tools: [Read, Grep, Glob, Bash] +--- + +Review the changed files for: + +1. **Shell scripts**: POSIX compliance for /bin/sh scripts, proper quoting, shellcheck issues +2. **Fish files**: fish syntax correctness, consistent function patterns +3. **Lua files**: stylua compliance, Neovim API usage patterns +4. **All**: EditorConfig compliance (2-space indent, LF endings) + +Report only high-confidence issues. Skip vendor files (fzf-tmux). diff --git a/.claude/settings.json b/.claude/settings.json index 8f8eede..018a721 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -22,6 +22,10 @@ { "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" + }, + { + "type": "command", + "command": "fp=$(cat | jq -r '.tool_input.file_path // empty') && [ -n \"$fp\" ] && [ -f \"$fp\" ] && case \"$fp\" in *.lua) command -v stylua > /dev/null && stylua \"$fp\";; esac; exit 0" } ] } diff --git a/.claude/skills/yaml-validate/SKILL.md b/.claude/skills/yaml-validate/SKILL.md new file mode 100644 index 0000000..83acefe --- /dev/null +++ b/.claude/skills/yaml-validate/SKILL.md @@ -0,0 +1,38 @@ +--- +name: yaml-validate +description: >- + Validate YAML files after editing. + Apply when writing or modifying any .yml or .yaml file. +user-invocable: false +allowed-tools: Bash, Read +--- + +After editing any YAML file, validate it: + +## 1. Syntax check + +Run yamllint on the file: + +```bash +yamllint +``` + +If yamllint is not available, fall back to: + +```bash +python3 -c "import yaml; yaml.safe_load(open(''))" +``` + +## 2. GitHub Actions workflows + +If the file is under `.github/workflows/`, also run: + +```bash +actionlint +``` + +If actionlint is not available, skip silently. + +## Files to skip + +- `config/gh/hosts.yml` — managed by `gh` CLI, not hand-edited diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 857c073..c4f35e5 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -5,7 +5,7 @@ name: Lint Code Base # yamllint disable-line on: pull_request: - branches: [master, main] + branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml index 8c05e85..4072c31 100644 --- a/.github/workflows/update-submodules.yml +++ b/.github/workflows/update-submodules.yml @@ -5,7 +5,7 @@ name: Update submodules on: schedule: # At 04:00 on Monday and Thursday. - - cron: "0 4 * * 1" + - cron: "0 4 * * 1,4" workflow_dispatch: concurrency: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 746cac7..ae20969 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,13 +39,13 @@ repos: hooks: - id: yamllint - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 + - repo: local hooks: - id: prettier + name: Prettier (YAML) + entry: yarn prettier --write + language: system types_or: [yaml] - additional_dependencies: - - prettier@3.8.1 - repo: https://github.com/shellcheck-py/shellcheck-py rev: v0.11.0.1 diff --git a/.prettierignore b/.prettierignore index fe65171..9b6c81d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -15,5 +15,4 @@ config/zsh local/bin/antigen.zsh local/bin/asdf tools -docs/plans config/gh/hosts.yml diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index 390dc61..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,55 +0,0 @@ -# Project guidelines - -This repository contains configuration files and helper scripts for managing -a development environment. -Dotbot drives installation, and host-specific folders under `hosts/` contain extra configs. - -## Setup - -1. Run `yarn install` to fetch linting tools and the Bats test framework. -2. Re-run `yarn install` whenever `package.json` changes. -3. Yarn is the package manager of choice; avoid `npm` commands. - -## Keeping the repository up to date - -1. Update submodules with `git submodule update --remote --merge`. -2. Pull the latest changes and run `./install`. - -## Linting and tests - -- Format files with: - - ```bash - yarn fix:prettier - yarn fix:markdown - ``` - -- Shell scripts must pass `shellcheck`. - - ```bash - find . -path ./node_modules -prune -o -name '*.sh' -print0 | xargs -0 shellcheck - ``` - -- Ensure `.editorconfig` rules pass: - - ```bash - tools/install-ec.sh - ec - ``` - -- Execute tests with `yarn test` when code changes. - -## Debugging lint issues - -- `yarn lint:prettier` and `yarn lint:markdown` show formatting errors. -- Ensure shell scripts have a shebang or `# shellcheck shell=bash` directive. -- Consult `.shellcheckrc` for project specific checks. - -Scripts rely on helpers in `config/shared.sh` so they run under Bash, Zsh and Fish by default. - -## Commits and PRs - -- Use Semantic Commit messages: `type(scope): summary`. -- Keep PR titles in the same format. - - diff --git a/CLAUDE.md b/CLAUDE.md index 9635746..da4906c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -52,13 +52,13 @@ yarn test # Run all tests in tests/ shellcheck