Lefthook is a CLI-first Git hooks manager. Contributions must be predictable, backwards-compatible, and dependency-light.
php artisan boost:add-skill evilmartians/lefthook
Save this content to: AGENTS.md
# AGENTS.md
Lefthook is a CLI-first Git hooks manager. Contributions must be predictable,
backwards-compatible, and dependency-light.
## Requirements
- Go 1.27+ (respect `go.mod` toolchain)
- Git, Make
```
make build # compile
make test # unit tests
make test-integration # integration tests
make lint # golangci-lint
make jsonschema # regenerate schema.json after config changes
```
## Codebase map
| Path | Purpose |
|---|---|
| `cmd/` | CLI commands |
| `internal/config/` | Config parsing, validation, JSON schema |
| `internal/run/` | Hook runner, parallelism |
| `internal/command/` | Top-level orchestrator |
| `internal/git/` | Git utilities |
| `docs/` | documentation source → lefthook.dev |
| `tests/` | Integration/fixture tests |
## Rules
**Errors** — always wrap with context; never silently ignore; no panic in production paths.
**Concurrency** — no goroutine leaks; use `context.Context`; deterministic output when order matters.
**CLI** — preserve exit codes, flag names, and output format. Update docs and tests for any behavior change.
**Config** — edit structs in `internal/config/`, then run `make jsonschema`. Both `schema.json` and `internal/config/jsonschema.json` must be committed.
**Security** — treat user input as untrusted; no unsafe shell concatenation; sanitize paths.
## Testing
Prefer table-driven unit tests. Integration tests should validate CLI behavior and real git interaction — not internal implementation details.
Unit tests: follow [.agents/rules/unit_tests.md](.agents/rules/unit_tests.md).
## PR checklist
- [ ] `make lint` passes
- [ ] `make test` passes
- [ ] Docs updated if behavior changed or new config option added
When in doubt, follow existing patterns. Consistency over cleverness.
Lefthook is a CLI-first Git hooks manager. Contributions must be predictable, backwards-compatible, and dependency-light.
go.mod toolchain)make build # compile
make test # unit tests
make test-integration # integration tests
make lint # golangci-lint
make jsonschema # regenerate schema.json after config changes
| Path | Purpose |
|---|---|
cmd/ |
CLI commands |
internal/config/ |
Config parsing, validation, JSON schema |
internal/run/ |
Hook runner, parallelism |
internal/command/ |
Top-level orchestrator |
internal/git/ |
Git utilities |
docs/ |
documentation source → lefthook.dev |
tests/ |
Integration/fixture tests |
Errors — always wrap with context; never silently ignore; no panic in production paths.
Concurrency — no goroutine leaks; use context.Context; deterministic output when order matters.
CLI — preserve exit codes, flag names, and output format. Update docs and tests for any behavior change.
Config — edit structs in internal/config/, then run make jsonschema. Both schema.json and internal/config/jsonschema.json must be committed.
Security — treat user input as untrusted; no unsafe shell concatenation; sanitize paths.
Prefer table-driven unit tests. Integration tests should validate CLI behavior and real git interaction — not internal implementation details.
Unit tests: follow .agents/rules/unit_tests.md.
make lint passesmake test passesWhen in doubt, follow existing patterns. Consistency over cleverness.
How can I help you explore Laravel packages today?