/ .pre-commit-config.yaml
.pre-commit-config.yaml
  1  # default_stages: [commit]
  2  # Markdown/yaml/json lint and format, plan naming, Lua tests, extra hooks
  3  fail_fast: true
  4  repos:
  5    - repo: local
  6      hooks:
  7        - id: agents-generate
  8          name: Regenerate agent platform files from .agents/ source
  9          entry: task
 10          language: system
 11          args: [agents:generate]
 12          pass_filenames: false
 13          files: '^\.agents/(agents|commands|skills|templates|data)/'
 14        - id: rename-cursor-plans
 15          name: Rename .cursor/plans/*.plan.md to YYYY-MM-DD_username_slug.plan.md
 16          entry: scripts/rename-cursor-plans.sh
 17          language: system
 18          pass_filenames: false
 19        - id: cursor-plan-names
 20          name: Validate .cursor/plans/*.plan.md filenames (must match convention)
 21          entry: scripts/validate-cursor-plan-names.sh
 22          language: system
 23          pass_filenames: false
 24        - id: fix-curly-quotes
 25          name: fix-curly-quotes
 26          entry: bash scripts/fix-curly-quotes.sh
 27          language: system
 28          types: [text]
 29          pass_filenames: true
 30        - id: check-prereqs
 31          name: check-prereqs
 32          entry: bash scripts/check-prereqs.sh
 33          language: system
 34          pass_filenames: false
 35        - id: shellcheck
 36          name: shellcheck
 37          entry: shellcheck
 38          language: system
 39          types: [shell]
 40          pass_filenames: true
 41          exclude: '\.(zsh|tmux)$|^\.cursor/|^etc/|^tmux/'
 42        - id: markdownlint
 43          name: markdownlint
 44          entry: markdownlint
 45          language: system
 46          types: [markdown]
 47          exclude: '^(\.cursor|\.claude|\.agents)/commands/'
 48          pass_filenames: true
 49          args: ["-c", ".markdownlint.yaml", "-i", "CHANGELOG.md"]
 50        - id: task-yamlfmt
 51          name: task-yamlfmt
 52          entry: task
 53          language: system
 54          args: [yamlfmt]
 55          types: [yaml]
 56          pass_filenames: false
 57        - id: task-jsonfmt
 58          name: task-jsonfmt
 59          entry: task
 60          language: system
 61          args: [jsonfmt]
 62          types: [json]
 63          pass_filenames: false
 64        - id: task-test-lua
 65          name: Run Lua tests (Busted)
 66          entry: task
 67          language: system
 68          args: [test:lua]
 69          types: [lua]
 70          pass_filenames: false
 71  
 72    - repo: https://github.com/pre-commit/pre-commit-hooks
 73      rev: v6.0.0
 74      hooks:
 75        - id: detect-private-key
 76        - id: check-merge-conflict
 77        - id: mixed-line-ending
 78        - id: trailing-whitespace
 79          exclude_types:
 80            - "json"
 81        - id: end-of-file-fixer
 82          exclude_types:
 83            - "json"
 84        - id: check-added-large-files
 85          args: ["--maxkb=2000"]
 86        - id: check-yaml
 87        - id: check-json
 88        - id: check-toml
 89        - id: check-xml
 90        - id: check-case-conflict
 91        - id: debug-statements
 92  
 93    - repo: https://github.com/lunarmodules/luacheck
 94      rev: v1.2.0
 95      hooks:
 96        - id: luacheck
 97          name: Luacheck
 98          description: Lint and static analysis of Lua code
 99          entry: luacheck
100          language: lua
101          types: [lua]