Skip to content

ci: add lint and configuration validation workflow - #16

Merged
skateddu merged 3 commits into
mainfrom
ci/add-validation-workflow
Aug 13, 2026
Merged

ci: add lint and configuration validation workflow#16
skateddu merged 3 commits into
mainfrom
ci/add-validation-workflow

Conversation

@skateddu

@skateddu skateddu commented Aug 13, 2026

Copy link
Copy Markdown
Owner

What

Adds .github/workflows/ci.yml and scripts/validate_config.py. Until now this repository had no automated verification at all — the previous four PRs each merged with zero checks.

What it checks

Check Catches
ruff check / ruff format --check Lint and formatting
scripts/validate_config.py Config coherence (below)
shellcheck --severity=warning Quoting and logic bugs in the hook scripts

The validator targets the failure modes specific to a config template — the ones that fail silently for whoever copies .claude/:

  • Hook scripts referenced by settings.json that don't exist. A renamed or deleted script doesn't error; the guardrail simply stops firing. protect-main.sh blocks force-pushes and rm -rf /, so losing it quietly is the bad case.
  • CLAUDE.md @-imports that don't resolve. A broken path drops that rule from Claude's context with no warning — the standards silently stop applying.
  • Skills whose SKILL.md lost its name/description frontmatter. Claude discovers skills through those fields, so a malformed one becomes invisible to automatic invocation. With 22 skills, 10 of them re-synced from upstream in chore(skills): re-sync vendored skills with anthropics/skills #13, this is worth a guard.
  • Unparseable settings.json or MCP config. The only one that's loud, and the cheapest to check.

shellcheck is there because hook bugs have shipped twice: #10 (a PreToolUse if condition that silently disabled both hooks) and #11 (a \b word-boundary that let rm -rf / through). Severity is capped at warning so style nitpicks don't gate merges.

What the first runs actually caught

CI is now green, after two red runs that were worth having:

  1. astral-sh/setup-uv@v10 didn't resolve. I read v10.0.0 from the releases API, but setup-uv stopped publishing floating major tags after v7 — only full semver tags exist for v8 onward. Pinned to @v10.0.0. (actions/checkout@v7 does maintain a floating tag and was fine.)
  2. shellcheck flagged SC2034 in session-start.sh: input=$(cat) assigned the payload to a variable nothing read. Not a bug — that hook inspects the filesystem, not the payload — but the dead assignment implied the payload mattered. Now cat >/dev/null with a comment saying stdin is drained so Claude Code's write to the pipe completes. Smoke-tested by piping a payload in and confirming valid JSON out.

Verification

The validator was tested by injecting each fault — pointing a hook at verify-typo.sh and an import at testing-typo.md — and confirming it reported both and exited non-zero. A check that can't fail isn't a check.

Also in this PR

pyproject.toml's ruff include was ["pyproject.toml", "src/**/*.py"], which covered nothing this repository actually ships — there is no src/. Extended to scripts/**/*.py and .claude/statusline.py; both already pass, so this is scope, not fixes. Vendored .claude/skills/ scripts stay excluded.

No test job: this repo ships configuration, not application code. The pytest config in pyproject.toml is for projects built from the template.

🤖 Generated with Claude Code

skateddu and others added 3 commits August 13, 2026 14:53
Nothing verified this repository until now: every PR merged without an
automated check. Beyond ruff, the workflow checks the failure modes that
break the template silently for whoever copies it — a hook whose script
was renamed stops firing, a broken CLAUDE.md @-import drops that rule
from context, and a skill missing frontmatter becomes undiscoverable.
None of those surface an error at runtime.

shellcheck covers the hooks because quoting and boundary bugs in them
have shipped twice before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
setup-uv publishes no floating major tag past v7, so @v10 does not
resolve. Caught by the workflow's own first run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
shellcheck SC2034, surfaced by the new CI on its first run. The hook
inspects the filesystem, not the payload, so the assignment was dead
weight that implied otherwise. stdin is still drained.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@skateddu
skateddu merged commit b958059 into main Aug 13, 2026
1 check passed
@skateddu
skateddu deleted the ci/add-validation-workflow branch August 13, 2026 12:59
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