Skip to content

feat: add pre-commit hook to auto-sync module copies #139

Description

@yvonnedevlinrh

Summary

Add a pre-commit hook that runs task sync-module automatically when canonical skill or command files change, so contributors don't have to remember to sync manually.

Context

PR #126 introduced module/ as the lola-distributable copy of canonical sources in skills/ and .opencode/commands/. It includes:

  • task sync-module — manual sync step
  • task check-module-sync — manual drift check
  • A CI job in ci_local.yml that gates PRs on drift detection

The CI job catches drift, but contributors still have to manually run task sync-module before committing. A pre-commit hook would automate this.

Proposed Change

Add a local hook to .pre-commit-config.yaml:

- repo: local
  hooks:
    - id: sync-module
      name: Sync module copies
      entry: task sync-module
      language: system
      files: ^(skills/|\.opencode/commands/comply-)
      pass_filenames: false

This triggers only when canonical source files are staged, keeping pre-commit fast for unrelated changes.

Prerequisites

  • Requires task (Taskfile runner) installed locally
  • Requires contributors to set up pre-commit hooks (pre-commit install)

Acceptance Criteria

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions