# Repository rules - Use Go 1.27; normal builds and tests use CGO_ENABLED=0. Enable CGO only for race tests. - Follow lightweight hexagonal architecture: cmd/nefercap and internal/app wire internal/core, internal/ports, and internal/adapters. Core imports only stdlib and ports; ports contain no framework types. - Layer surfaces go through internal/adapters/layerui: neferclient owns the Wayland surface and NeferGUI's Renderer draws it. Use the versions pinned in go.mod, and zerowrap with a component field for logging. Reuse NeferWL dependency versions where applicable; do not add unrelated compositor dependencies. - Sign every commit and tag; commit format: type(scope): description. - Minimize footprint. Bound buffers, queues and subprocess lifetimes. Reuse frame storage; test and benchmark steady-state allocations. Do not claim zero allocations without measurements. - Test doubles are generated by Mockery v3 with the testify template. No handwritten fakes, stubs, spies or function-field replacements. Cross-layer interfaces live in internal/ports; generated mocks in internal/mocks/ports. Adapter-private seams stay in the adapter with generated *_mock_test.go files. Use .EXPECT(). - Check before merging: make check, make race, make mocks-check, staticcheck ./.... - Never overwrite capture files silently. Validate dimensions, stride and formats; close file descriptors and stop subprocesses on all exit paths. - Keep docs concise and describe current behavior, not planned capabilities. Do not put personal paths, names, or emails in source, tests, docs or commit messages.