Skip to content

feat(ci): add minimal pre-commit config (opt-in) for secret detection #34

Closed

Description

@wz-gsa

Problem

Quickstart is the entry point for users learning AI-assisted federal development. It currently lacks:

  1. Pre-commit configuration (no .pre-commit-config.yaml)
  2. Secret detection (gitleaks)
  3. Basic file hygiene checks

However, we must avoid interfering with user workflows (see GSA-TTS/agentic-coding-playbook#42).

Proposed Solution

Add minimal, opt-in pre-commit config:

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c  # v6.0.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-json

  - repo: https://github.com/gitleaks/gitleaks
    rev: ee6b38352380ce52369d16b7873093c4b8bf829b  # v8.24.3
    hooks:
      - id: gitleaks

Make it opt-in:

.PHONY: install-hooks
install-hooks:  ## [OPTIONAL] Install pre-commit hooks
	pre-commit install

Document in SBX guide:

Update docs/SBX_QUICKSTART.md to show:

  • How to install pre-commit in SBX
  • How to run checks without installing hooks (pre-commit run --all-files)
  • Why it's optional

Benefits

  • ✅ Sets example of secret detection for users
  • ✅ No interference (opt-in only)
  • ✅ Works in SBX (via pip install)
  • ✅ Aligns with playbook/patterns standards

Related

Acceptance Criteria

  • .pre-commit-config.yaml added with gitleaks + basic hooks
  • make install-hooks target added (NOT in make setup)
  • docs/SBX_QUICKSTART.md updated with pre-commit guidance
  • README mentions pre-commit is optional
  • No auto-installation in any make target

Priority: Medium
Type: Feature + Documentation

Activity

  1. added a commit that references this issue on May 26, 2026
    b40149a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions