Skip to content

ci: add pre-commit workflow and AI artifact hooks - #4

Merged
nitrocode merged 1 commit into
mainfrom
worktree-precommit-hygiene
May 24, 2026
Merged

ci: add pre-commit workflow and AI artifact hooks#4
nitrocode merged 1 commit into
mainfrom
worktree-precommit-hygiene

Conversation

@nitrocode

Copy link
Copy Markdown
Owner

what

  • New GitHub Actions workflow (.github/workflows/pre-commit.yaml) that runs pre-commit on every PR and push to main, via cloudposse/github-action-pre-commit@v4.0.0 (SHA-pinned).
  • New .pre-commit-config.yaml with two layers of hooks:
    • Standard hygiene from pre-commit/pre-commit-hooks@v6.0.0: trailing whitespace, EOF fixer, merge-conflict markers, YAML/JSON syntax, large files, line endings.
    • Markdown-scoped AI artifact deny rules (local pygrep hooks): em dashes, smart quotes, unicode ellipsis, AI filler vocabulary (delve, leverage, seamless, robust, comprehensive, in conclusion, it is worth noting, dive deep, navigate the landscape/complexities), bolded section titles (**Title:** on a line), and bolded callout prefixes (**Note:**, **Tip:**, **Warning:**, etc.).
  • Top-level excludes for CLAUDE.md, BLOG_POST_TEMPLATE.md, the config itself, _site/, and Gemfile.lock.

why

  • Keeps the blog readable and free of common AI-generated stylistic tells when drafting in markdown.
  • Adds basic CI hygiene the repo did not have (whitespace, EOF, malformed JSON/YAML, accidentally-staged conflict markers or giant files).
  • Prose hooks intentionally scoped to markdown only. Existing hand-written HTML pages (resume headings like Company — Role, quote attributions like — Albert Einstein, lists like Hanjie…) use em dashes and ellipses as typography, not AI artifacts. The existing HTML would also trip no-ai-filler on leverage AI tooling and robust systems if widened; left for a follow-up if desired.

references

  • All hooks pass locally on the current repo (pre-commit run --all-files).
  • Smoke-tested against a deliberately AI-flavored markdown file: all six AI-artifact hooks fire as expected.
  • CodeRabbit review run against the diff. One finding applied (pre-commit-hooks v5.0.0 to v6.0.0); one dismissed (suggestion to swap CloudPosse action for upstream pre-commit/action, since CloudPosse fork was chosen deliberately).
  • Note on the smart-quote pattern: pygrep matches the regex against raw file bytes, so a character class like [“”‘’] becomes a class of individual UTF-8 bytes and false-positives on unrelated multi-byte chars (, , ⚙️). Alternation (“|”|‘|’) is correct; documented inline in the config.

🦊 Pair-programmed with Claude Code.

Adds a GitHub Actions workflow that runs pre-commit on every PR and push
to main, plus a pre-commit config covering:

- Standard hygiene (trailing whitespace, EOF, merge conflicts, YAML/JSON,
  large files, line endings) via pre-commit/pre-commit-hooks v6.0.0.
- Markdown-scoped deny rules for common AI-generated stylistic tells:
  em dashes, smart quotes, unicode ellipsis, filler vocabulary (delve,
  leverage, seamless, robust, comprehensive, etc.), bolded section
  titles, and bolded callout prefixes.

Workflow uses cloudposse/github-action-pre-commit v4.0.0; all actions
SHA-pinned per security baseline. Prose hooks scoped to markdown so
existing HTML pages (titles, quote attributions, resume headings) keep
their intentional typography.

Co-Authored-By: my CLI familiar (🤖 trained on the public internet, mostly) <noreply@anthropic.com>
@nitrocode
nitrocode merged commit 1f42fa4 into main May 24, 2026
1 check passed
@nitrocode
nitrocode deleted the worktree-precommit-hygiene branch May 24, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant