--- name: github-pages-architecture description: > GitHub Pages 정적 웹 UI의 3계층 아키텍처(Presentation/Application/Infrastructure) 설계 원칙. docs/ 디렉토리 구조 설계, 탭 추가, 모듈 분리, Lazy loading, 차트 인스턴스 관리, 데이터 흐름 정의 시 반드시 이 스킬을 사용한다. Use this skill when designing docs/ directory structure, adding tabs, splitting modules, implementing lazy loading, managing chart instances, or defining data flow in a GitHub Pages static web UI. --- # GitHub Pages 3계층 아키텍처 가이드 ## 1. When to use / When NOT to use ### 사용하는 경우 - docs/ 디렉토리 구조를 새로 설계하거나 리팩터링할 때 - 새 탭/페이지를 추가할 때 - JavaScript 모듈을 분리하거나 책임을 재배치할 때 - 데이터 로딩 흐름(fetch -> 렌더)을 설계할 때 - 차트 인스턴스 관리 전략을 결정할 때 - Lazy loading / 탭 라우팅을 구현할 때 ### 사용하지 않는 경우 - GitHub API로 config.json을 읽고 쓰는 작업 -> **github-pages-gitops** skill 사용 - Python 백엔드 로직, GitHub Actions 워크플로 수정 - 데이터 파일(JSON) 스키마 변경만 하는 경우 --- ## 2. 3계층 아키텍처 원칙 ``` ┌─────────────────────────────────────────────┐ │ Presentation (표현 계층) │ │ index.html · css/style.css │ │ HTML 구조, CSS 스타일, CDN 라이브러리 로드 │ ├─────────────────────────────────────────────┤ │ Application (응용 계층) │ │ js/main.js · js/ui.js · js/charts.js │ │ 오케스트레이션, DOM 업데이트, 차트 렌더링 │ ├─────────────────────────────────────────────┤ │ Infrastructure (인프라 계층) │ │ js/utils.js · data/*.json │ │ 순수 계산, 데이터 파일, 외부 API 없음 │ └─────────────────────────────────────────────┘ ``` ### 의존 방향 (단방향) ``` Presentation -> Application -> Infrastructure ✗ 역방향 의존 금지 ``` - **Infrastructure(utils.js)**: 다른 모듈을 import하지 않는다. DOM에 접근하지 않는다. - **Application(ui.js, charts.js)**: utils.js만 import한다. index.html의 DOM 구조에 의존한다. - **Presentation(index.html)**: main.js를 `