현재 cluefin-desk는 2개 화면(스크리닝 3탭 + 종목상세)만 제공. Kiwoom API 80+개, KIS 50+개, DART 공시/재무제표, XBRL 파싱 등 풍부한 데이터 소스가 있으나 활용되지 않고 있음. Bloomberg Terminal UI 패턴을 참고하여 한국 주식시장에 맞는 종합 TUI 대시보드를 설계한다.
Navigation Structure
Bloomberg 스타일 상단 버튼 바 + 숫자키 단축키로 화면 전환.
code
┌─────────────────────────────────────────────────────────────────────┐
│ CLUEFIN DESK [1·MKT] [2·RANK] [3·THEME] [4·ETF] [5·INV] [?·HELP] │
│ green green green green green amber │
└─────────────────────────────────────────────────────────────────────┘
1 = 시장 개요 (Market Overview) ← 기본 화면
2 = 랭킹 (Rankings) ← 현재 스크리닝 확장
3 = 테마/업종 (Theme & Sector) ← 신규
4 = ETF 분석 (ETF Analysis) ← 신규
5 = 투자자 동향 (Investor Flow) ← 신규
Enter = 종목 상세 (Stock Detail) ← Push screen
F = 재무 분석 (Financial Analysis) ← 종목 상세에서 진입
q = 종료, r = 새로고침, Esc = 뒤로
uv run python apps/cluefin-desk/main.py 실행하여 앱 시작 확인
숫자키 1-5로 각 화면 전환 확인
각 화면에서 데이터 로딩 및 표시 확인
uv run pytest apps/cluefin-desk/tests/ -m "not integration" 단위 테스트 통과
uv run ruff check apps/cluefin-desk/ 린트 통과
If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Volumes/kgcrom-2tb/kgcrom/.REDACTED.jsonl
Assistant
I'll start by exploring the existing cluefin-desk codebase to understand the current structure before implementing the plan.
Assistant
Now let me explore the available API methods in cluefin-openapi to understand the data sources.
Assistant
Now let me read the key files I'll need to modify directly.
Assistant
Let me also read the existing widget files and test file.
Assistant
Now I have a thorough understanding of the entire codebase. This is a large implementation with many files. Let me create tasks to track progress and start implementing phase by phase.
Assistant
Starting with Phase 1a: Navigation bar + app.py refactoring + TCSS update.
Assistant
Now refactor app.py for 5-screen routing:
Assistant
Update settings to add DART auth key:
Assistant
Now update the TCSS with Bloomberg-style dark theme and all screen styles:
Assistant
Now I need to create all screens and widgets. Let me create them in parallel groups. First, add all the fetcher methods needed:
Assistant
Now expand the screener with new ranking methods:
Assistant
Now create all screens. Let me create them in parallel:
Assistant
Now update the Stock Detail screen with 4 tabs:
Assistant
Now create the Financial Analysis screen:
Assistant
Now update the tests and pyproject.toml. First let me update pyproject.toml to add optional cluefin-xbrl dependency:
Assistant
Now update the tests to accommodate the new screener changes:
Assistant
Now let me mark the completed tasks and run verification:
Assistant
Now run lint and tests in parallel:
Assistant
The linter moved the closure outside the except scope. Let me fix this:
Assistant
All 16 tests pass and lint is clean. Let me also run the full project test suite and formatting check:
Assistant
All checks pass. Here's a summary of everything implemented:
Implementation Summary
New Files Created (8)
File
Description
widgets/nav_bar.py
Bloomberg-style navigation bar with [1·MKT] [2·RANK] [3·THEME] [4·ETF] [5·INV] [?·HELP]
screens/market_overview.py
Screen 1: Sector performance table + Top Gainers/Losers panels
screens/theme_sector.py
Screen 3: Theme groups/stocks + Sector list with detail view
screens/etf_analysis.py
Screen 4: ETF full price table with NAV, disparity rate
screens/investor_flow.py
Screen 5: Foreign/Institutional net buy + Program trading + Sector investor flow
screens/financial_analysis.py
Screen 7: DART disclosures, major shareholders (requires DART_AUTH_KEY)
pyproject.toml
Added optional [xbrl] dependency group
Modified Files (7)
File
Changes
app.py
5-screen routing with action_switch_screen(), number key bindings 1-5, lazy DART client
config/settings.py
Added dart_auth_key setting
data/fetcher.py
Added 20+ new API methods: sector, theme, ETF, investor flow, stock detail trading data
data/screener.py
Added 5 new screener methods: get_top_losers, get_top_foreigner_net_buy, get_new_high_price, get_price_volatility, get_top_margin_ratio; added extra field to ScreeningItem
screens/screening.py
Expanded from 3 tabs to 8 tabs with NavBar integration
screens/stock_detail.py
Expanded to 4 tabs (차트/투자자/매매원/수급) + title bar + F key for financial screen
styles/app.tcss
Full Bloomberg-style theme with styles for all 7 screens
tests/unit/test_screener.py
Expanded from 6 to 16 tests covering all 8 screener methods
uv run python apps/cluefin-desk/main.py 실행하여 앱 시작 확인
숫자키 1-5로 각 화면 전환 확인
각 화면에서 데이터 로딩 및 표시 확인
uv run pytest apps/cluefin-desk/tests/ -m "not integration" 단위 테스트 통과
uv run ruff check apps/cluefin-desk/ 린트 통과
If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Volumes/kgcrom-2tb/kgcrom/.REDACTED.jsonl