Files
superport/.claude/guide.md
JiWoong Sul e0bc5894b2 UI 전체 리디자인 및 개선사항 적용
## 주요 변경사항:

### UI/UX 개선
- shadcn/ui 스타일 기반의 새로운 디자인 시스템 도입
- 모든 주요 화면에 대한 리디자인 구현 완료
  - 로그인 화면: 모던한 카드 스타일 적용
  - 대시보드: 통계 카드와 차트를 활용한 개요 화면
  - 리스트 화면들: 일관된 테이블 디자인과 검색/필터 기능
- 다크모드 지원을 위한 테마 시스템 구축

### 기능 개선
- Equipment List: 고급 필터링 (상태, 담당자별)
- Company List: 검색 및 정렬 기능 강화
- User List: 역할별 필터링 추가
- License List: 만료일 기반 상태 표시
- Warehouse Location: 재고 수준 시각화

### 기술적 개선
- 재사용 가능한 컴포넌트 라이브러리 구축
- 일관된 코드 패턴 가이드라인 작성
- 프로젝트 구조 분석 및 문서화

### 문서화
- 프로젝트 분석 문서 추가
- UI 리디자인 진행 상황 문서
- 코드 패턴 가이드 작성
- Equipment 기능 격차 분석 및 구현 계획

### 삭제/리팩토링
- goods_list.dart 제거 (equipment_list로 통합)
- 불필요한 import 및 코드 정리

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 19:45:32 +09:00

8.2 KiB
Raw Blame History

🎯 Mandatory Response Format

Before starting any task, you MUST respond in the following format:

[Model Name]. I have reviewed all the following rules: [rule file list or categories]. Proceeding with the task. Master!

Examples:

  • Claude Sonnet 4. I have reviewed all the following rules: development guidelines, class structure, testing rules. Proceeding with the task. Master!
  • For extensive rules: coding style, class design, exception handling, testing rules (categorized summary)

🚀 Mandatory 3-Phase Task Process

Phase 1: Codebase Exploration & Analysis

Required Actions:

  • Systematically discover ALL relevant files, directories, modules
  • Search for related keywords, functions, classes, patterns
  • Thoroughly examine each identified file
  • Document coding conventions and style guidelines
  • Identify framework/library usage patterns

Phase 2: Implementation Planning

Required Actions:

  • Create detailed implementation roadmap based on Phase 1 findings
  • Define specific task lists and acceptance criteria per module
  • Specify performance/quality requirements

Phase 3: Implementation Execution

Required Actions:

  • Implement each module following Phase 2 plan
  • Verify ALL acceptance criteria before proceeding
  • Ensure adherence to conventions identified in Phase 1

Core Development Principles

Language & Type Rules

  • Write ALL code, variables, and names in English
  • Write ALL comments, documentation, prompts, and responses in Korean
  • Always declare types explicitly for variables, parameters, and return values
  • Avoid any, dynamic, or loosely typed declarations (except when strictly necessary)
  • Define custom types when needed
  • Extract magic numbers and literals into named constants or enums

Naming Conventions

Element Style Example
Classes PascalCase UserService, DataRepository
Variables/Methods camelCase userName, calculateTotal
Files/Folders under_score_case user_service.dart, data_models/
Environment Variables UPPERCASE API_URL, DATABASE_PASSWORD

Critical Rules:

  • Boolean variables must be verb-based: isReady, hasError, canDelete
  • Function/method names start with verbs: executeLogin, saveUser
  • Use meaningful, descriptive names
  • Avoid abbreviations unless widely accepted: i, j, err, ctx, API, URL

🔧 Function & Method Design

Function Structure Principles

  • Keep functions short and focused (≤20 lines recommended)
  • Avoid blank lines inside functions
  • Follow Single Responsibility Principle
  • Use verb + object format for naming:
    • Boolean return: isValid, canRetry, hasPermission
    • Void return: executeLogin, saveUser, startAnimation

Function Optimization Techniques

  • Use early returns to avoid nested logic
  • Extract logic into helper functions
  • Prefer arrow functions for short expressions (≤3 lines)
  • Use named functions for complex logic
  • Minimize null checks by using default values
  • Minimize parameters using RO-RO pattern (Receive Object Return Object)

📦 Data & Class Design

Class Design Principles

  • Strictly follow Single Responsibility Principle (SRP)
  • Favor composition over inheritance
  • Define interfaces/abstract classes to establish contracts
  • Prefer immutable data structures (use readonly, const)

File Size Management

  • Split by responsibility when exceeding 200 lines (responsibility-based, not line-based)
  • May remain as-is if:
    • Has single clear responsibility
    • Is easy to maintain
  • 🔁 Must split when:
    • Contains multiple concerns
    • Requires excessive scrolling
    • Patterns repeat across files
    • Difficult for new developer onboarding

Class Recommendations

  • ≤ 200 lines (not mandatory)
  • ≤ 10 public methods
  • ≤ 10 properties

Data Model Design

  • Avoid excessive use of primitives — use composite types or classes
  • Move validation logic inside data models (not in business logic)

Exception Handling

Exception Usage Principles

  • Use exceptions only for truly unexpected or critical issues
  • Catch exceptions only to:
    • Handle known failure scenarios
    • Add useful context
  • Otherwise, let global handlers manage them

🧪 Testing

Test Structure

  • Follow ArrangeActAssert pattern
  • Clear test variable naming: inputX, mockX, actualX, expectedX
  • Write unit tests for every public method

Test Doubles Usage

  • Use test doubles (mock/fake/stub) for dependencies
  • Exception: allow real use of lightweight third-party libraries

Integration Testing

  • Write integration tests per module
  • Follow GivenWhenThen structure
  • Ensure 100% test pass rate in CI and apply immediate fixes for failures

🧠 Error Analysis & Rule Documentation

Mandatory Process When Errors Occur

  1. Analyze root cause in detail
  2. Document preventive rule in .cursor/rules/error_analysis.mdc
  3. Write in English including:
    • Error description and context
    • Cause and reproducibility steps
    • Resolution approach
    • Rule for preventing future recurrences
    • Sample code and references to related rules

Rule Writing Standards

---
description: Clear, one-line description of what the rule enforces
globs: path/to/files/*.ext, other/path/**/*
alwaysApply: boolean
---

**Main Points in Bold**
- Sub-points with details
- Examples and explanations

🏗️ Architectural Guidelines

Clean Architecture Compliance

  • Layered structure: modules, controllers, services, repositories, entities
  • Apply Repository Pattern for data abstraction
  • Use Dependency Injection (getIt, inject, etc.)
  • Controllers handle business logic (not view processing)

Code Structuring

  • One export or public declaration per file
  • Centralize constants, error messages, and configuration
  • Make all shared logic reusable and place in dedicated helper modules

🌲 UI Structure & Component Design

UI Optimization Principles

  • Avoid deeply nested widget/component trees:
    • Flatten hierarchy for better performance and readability
    • Easier state management and testability
  • Split large components into small, focused widgets/components
  • Use const constructors (or equivalents) for performance optimization
  • Apply clear naming and separation between view, logic, and data layers

📈 Continuous Rule Improvement

Rule Improvement Triggers

  • New code patterns not covered by existing rules
  • Repeated similar implementations across files
  • Common error patterns that could be prevented
  • New libraries or tools being used consistently
  • Emerging best practices in the codebase

Rule Update Criteria

Add New Rules When:

  • A new technology/pattern is used in 3+ files
  • Common bugs could be prevented by a rule
  • Code reviews repeatedly mention the same feedback

Modify Existing Rules When:

  • Better examples exist in the codebase
  • Additional edge cases are discovered
  • Related rules have been updated

Quality Validation Checklist

Before completing any task, confirm:

  • All three phases completed sequentially
  • Each phase output meets specified format requirements
  • Implementation satisfies all acceptance criteria
  • Code quality meets professional standards
  • Started with mandatory response format
  • All naming conventions followed
  • Type safety ensured
  • Single Responsibility Principle adhered to

🎯 Success Validation Framework

Expert-Level Standards Verification

  • Minimalistic Approach: High-quality, clean solutions without unnecessary complexity
  • Professional Standards: Every output meets industry-standard software engineering practices
  • Concrete Results: Specific, actionable details at each step

Final Quality Gates

  • All acceptance criteria validated
  • Code follows established conventions
  • Minimalistic approach maintained
  • Expert-level implementation standards met
  • Korean comments and documentation provided
  • English code and variable names used consistently