Skip to content

hooks: autoformat on Edit/Write for all collectives #41

@BryanChasko

Description

@BryanChasko

context

ran npm run lint manually multiple times in chrome-extension-moodle-uploader session. shannon already has a PostToolUse autoformat hook that delegates to a core formatter — this project now has one too, but each collective implements it separately

what

centralize the autoformat hook in heraldstack-infra:

  • heraldstack-infra/scripts/autoformat.sh — core formatter, detects project type (node/python/go), runs appropriate formatter
  • each collective's .claude/hooks/autoformat.sh delegates to the core script
  • PostToolUse matcher: Edit|Write, 30s timeout

reference

shannon: .claude/hooks/autoformat.sh delegates to heraldstack-infra/scripts/autoformat.sh --claude

acceptance

  • core autoformat.sh in heraldstack-infra handles node (prettier), python (black/ruff), go (gofmt)
  • all collectives wire PostToolUse hook
  • 30s timeout prevents formatter hangs from blocking conversation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions