Skip to content

feat(rules): pre-commit architecture rule#661

Open
JacobPEvans-personal wants to merge 1 commit into
mainfrom
feat/pre-commit-rule
Open

feat(rules): pre-commit architecture rule#661
JacobPEvans-personal wants to merge 1 commit into
mainfrom
feat/pre-commit-rule

Conversation

@JacobPEvans-personal
Copy link
Copy Markdown
Member

Summary

New auto-loaded rule at agentsmd/rules/pre-commit.md documenting the shared pre-commit architecture rolled out across dryvist/nix-devenv PRs #34, #35 and dryvist/.github PR #12.

Captures the single-canonical-home-per-artifact principle so future agents working on consumer repos pull from the canonical sources instead of duplicating hook definitions or lint configs.

What it documents

  • Canonical homes table — which repo + path owns each artifact (hook definitions, shared lint configs, zizmor policy) for both Nix-flake and non-Nix consumption paths
  • Six profile namesbase / nix / markdown / terraform / ansible / python, what each layers on top of base hygiene, and which inventory repos match
  • Consumer pattern — minimum flake.nix for the Nix path + gh api fetch commands for the non-Nix path
  • Rules for AI agents — don't duplicate hook definitions, don't re-implement shared lint configs, hook versions flow from flake.lock
  • Known limitations — git-hooks.nix tflint wrapper, terraform-validate network needs, gitleaks not yet in git-hooks.nix

Test plan

  • CI green
  • Auto-loaded into next Claude session in any workspace repo

Refs: dryvist/nix-devenv#34, #35, dryvist/.github#12, dryvist/terraform-runs-on#80

Assisted-by: Claude noreply@anthropic.com

Document the shared pre-commit architecture as an auto-loaded rule.
Single canonical home per artifact:

  dryvist/nix-devenv        - hook definitions (Nix path)
  dryvist/.github precommit - hook definitions (non-Nix path) + shared
                              lint configs

Covers:
  - The six profiles (base, nix, markdown, terraform, ansible, python)
    and what each layers on top of the base hygiene set
  - Consumer patterns for Nix and non-Nix paths, with code snippets
  - Rules for AI agents adopting the architecture in new repos
  - Known limitations: cachix/git-hooks.nix tflint wrapper drops args
    beyond $1; terraform-validate needs network; gitleaks not in
    git-hooks.nix yet

Pairs with dryvist/nix-devenv#34, #35 and dryvist/.github#12.

Assisted-by: Claude <noreply@anthropic.com>
JacobPEvans-personal added a commit to dryvist/docs that referenced this pull request May 31, 2026
* docs(conventions): pre-commit architecture page

Document the shared pre-commit architecture as a public-facing
convention page mirroring the auto-loaded agentsmd rule.

Adds conventions/pre-commit.mdx and the corresponding entry to
docs.json's Conventions group nav.

Covers:
  - Canonical homes table (Nix-path nix-devenv, non-Nix-path
    dryvist/.github precommit/, lint configs in dryvist/.github)
  - Six profiles (base, nix, markdown, terraform, ansible, python)
  - Consumer patterns for Nix and non-Nix paths with full snippets
  - The `nix flake init -t #with-hooks` scaffold
  - Why one canonical home per artifact (single update propagates,
    drift dies, one-line onboarding)
  - What stays per-repo (checkov, bandit, detect-secrets, AWS/GCP/
    Azure tflint plugins) and why
  - Known limitations matching the agentsmd rule

Mirrors:
  https://github.com/dryvist/ai-assistant-instructions/blob/main/agentsmd/rules/pre-commit.md

Refs: dryvist/nix-devenv#34, #35, dryvist/.github#12, dryvist/terraform-runs-on#80, dryvist/ai-assistant-instructions#661

Assisted-by: Claude <noreply@anthropic.com>

* docs(nav): wire conventions/pre-commit into docs.json sidebar

Forgot to stage the nav update in the previous commit; the page
exists but wasn't discoverable through the sidebar.

Assisted-by: Claude <noreply@anthropic.com>
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