Skip to content

[Chore] Configure pre-push-gate with the framework's own CI checks (+ git pre-push hook for terminal pushes) #506

@atlas-apex

Description

@atlas-apex

Driver

CI fails on pushes for things that are cheap to catch locally (markdownlint MD032, site-counts hook-count drift, shellcheck) — most recently on PR #504. The framework already ships pre-push-gate.sh (#111), a blocking pre-push check-runner that reads .pre_push.commands from .claude/project-config.json and blocks git push on any non-zero check. But the framework repo itself never populated .pre_push.commands (the hook's own comment notes this: "the apexyard framework repo itself before it configures its own CI in a separate ticket"), so it silently no-ops here. Wire it up so the framework dog-foods its own pre-push gate.

Scope

  1. Add .pre_push.commands to .claude/project-config.json mirroring the locally-runnable CI jobs (from .github/workflows/):
    • markdownlint → the same markdownlint-cli2 invocation markdown-lint.yml uses (honour .markdownlint*.json)
    • shellcheckshellcheck .claude/hooks/*.sh (match shellcheck.yml scope)
    • site-countsbash .claude/hooks/tests/test_site_counts.sh
    • subpacksbash .claude/hooks/tests/test_subpack_extraction.sh
    • (Exclude lychee/link-check — slow + network-flaky, not pre-push-friendly; leave it CI-only.)
  2. pre-push-gate.sh is a Claude Code hook → only fires on pushes made through Claude. Add a real git pre-push hook for terminal pushes: a committed .githooks/pre-push running the same command set, plus a one-line opt-in (git config core.hooksPath .githooks) documented in docs/ and ideally auto-set by /setup. Keep the skip-marker escape hatch consistent with pre-push-gate.sh.
  3. Make each command degrade gracefully if its tool is missing (e.g. command -v shellcheck / npx guard) so a contributor without a tool installed gets a clear "install X" message, not a cryptic failure.

Acceptance Criteria

  • .pre_push.commands populated; a deliberately-broken commit (lint error / count drift) is BLOCKED by pre-push-gate.sh on a Claude-driven git push.
  • .githooks/pre-push runs the same set and blocks a terminal git push on red; core.hooksPath wiring documented.
  • Missing-tool case prints an actionable message, doesn't hard-crash.
  • The gate passes cleanly on a healthy HEAD (no false positives).

Risks / Dependencies

Low. Builds on existing pre-push-gate.sh (#111). Don't make it so slow that contributors routinely skip-marker around it (exclude the slow link-check).

Glossary

Term Definition
pre-push-gate.sh Existing Claude Code PreToolUse hook (#111) that runs .pre_push.commands and blocks git push on failure.
core.hooksPath Git config pointing at a committed hooks dir, so a real git pre-push hook ships in-repo and covers terminal pushes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreMaintenance / non-feature work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions