# Implementation Plan: Pre-Commit Gate **Branch**: `006-pre-commit-gate` | **Date**: 2026-03-05 | **Spec**: [spec.md](./spec.md) **Input**: Feature specification from `/specs/006-pre-commit-gate/spec.md` ## Summary Enforce a pre-commit quality gate by adding Lefthook as a Git hooks manager. A `lefthook.yml` configuration defines a pre-commit hook that runs `pnpm check`. The hook auto-installs via a `prepare` script in `package.json`, ensuring zero manual setup for developers after `pnpm install`. ## Technical Context **Language/Version**: TypeScript 5.x (project), Go binary via npm (Lefthook) **Primary Dependencies**: `lefthook` (npm devDependency) **Storage**: N/A **Testing**: Manual verification (commit with passing/failing checks) **Target Platform**: macOS, Linux (developer workstations) **Project Type**: Monorepo (pnpm workspaces) -- web application with domain/application/web layers **Performance Goals**: No additional overhead beyond `pnpm check` execution time **Constraints**: Must auto-install on `pnpm install`; must not interfere with CI **Scale/Scope**: 2 files changed (lefthook.yml created, package.json modified) ## Constitution Check *GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.* | Principle | Status | Notes | |-----------|--------|-------| | I. Deterministic Domain Core | N/A | No domain logic changes | | II. Layered Architecture | PASS | Tooling-only change, no layer imports affected | | III. Agent Boundary | N/A | No agent layer changes | | IV. Clarification-First | PASS | User explicitly specified Lefthook; no ambiguity | | V. Escalation Gates | PASS | Feature is within spec scope | | VI. MVP Baseline Language | PASS | No permanent bans introduced | | VII. No Gameplay Rules | N/A | Not a gameplay feature | | Development Workflow (merge gate) | PASS | Directly implements the "automated checks must pass" rule | | Layer boundary compliance | N/A | No source code layer changes | **Post-design re-check**: All gates still pass. No design decisions introduced new violations. ## Project Structure ### Documentation (this feature) ```text specs/006-pre-commit-gate/ ├── plan.md # This file ├── research.md # Phase 0 output ├── quickstart.md # Phase 1 output ├── spec.md # Feature specification └── checklists/ └── requirements.md # Spec quality checklist ``` ### Source Code (repository root) ```text ./ ├── lefthook.yml # NEW — Lefthook configuration (pre-commit hook) ├── package.json # MODIFIED — add lefthook devDep + prepare script └── (all existing files unchanged) ``` **Structure Decision**: This feature only adds tooling configuration at the repository root. No source code directories are created or modified. The existing monorepo structure (`packages/*`, `apps/*`) is unchanged. ## Complexity Tracking No constitution violations. Table not applicable.