# Implementation Plan: comment-hook-fix **Branch**: `[fix/comment-hook]` | **Date**: 2026-02-05 | **Spec**: `docs/todo_list.md#18` **Input**: Resolve the comment-hook failure introduced by the recharge code/superadmin DTO changes. ## Summary Identify the comment-hook rule being violated in the DTO updates, adjust or remove offending comments in the affected backend DTOs, and verify the hook/lints pass without modifying generated files. ## Technical Context **Language/Version**: Go 1.x **Primary Dependencies**: Fiber, GORM-Gen **Storage**: PostgreSQL **Testing**: `go test ./...` (if required), LSP diagnostics for changed files **Target Platform**: Linux server **Project Type**: Web application (backend + frontend) **Performance Goals**: N/A **Constraints**: Follow `backend/llm.txt`; no generated file edits; respect comment-hook rules **Scale/Scope**: Backend DTO comments only ## Constitution Check - Follow `backend/llm.txt` (thin controllers, services handle DB, Chinese comments for business logic). - Do not edit generated files (`*.gen.go`, `backend/docs/docs.go`). - Verify hook compliance before finishing. ## Project Structure ### Documentation (this feature) ```text docs/ └── plan.md ``` ### Source Code (repository root) ```text backend/ └── app/http/super/v1/dto/super.go ``` **Structure Decision**: Web application; scope is limited to backend DTO comment fixes. ## Plan Phases 1. **Diagnose hook failure**: Inspect the comment-hook rule and locate offending comments in DTO files. 2. **Apply fixes**: Adjust/remove comments to satisfy the hook while preserving API docs via struct tags if needed. 3. **Verify**: Run gofmt on touched files, LSP diagnostics, and re-run hook/tests as required. ## Tasks 1. Review the hook failure output and hook rules to identify the forbidden comment pattern. 2. Update DTO comment blocks to comply with the rule (no generated-file edits). 3. Run gofmt and LSP diagnostics; re-run the hook/tests if needed. ## Dependencies - Task 1 must complete before Task 2 (need exact rule to apply correct fix). - Task 2 must complete before Task 3 (verification after edits). ## Acceptance Criteria - Comment-hook passes without errors. - Updated DTO file(s) are gofmt’d and LSP diagnostics are clean. - No generated files are edited manually. ## Risks - Removing comments could reduce Swagger clarity; mitigate by keeping struct tags or non-offending comment styles if required. - Hook may flag multiple files; ensure all offenders are addressed before verification. ## Complexity Tracking > **Fill ONLY if Constitution Check has violations that must be justified** | Violation | Why Needed | Simpler Alternative Rejected Because | |-----------|------------|-------------------------------------| | N/A | N/A | N/A |