-
Notifications
You must be signed in to change notification settings - Fork 3
[refactor] Header 컴포넌트 UI/비즈니스 로직 분리 #1394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop-fe
Are you sure you want to change the base?
Changes from all commits
44a4033
614130c
11ffe4b
3026814
9af707b
f3ad2e1
7ebfabc
a850d1e
99251c8
4841af8
1beb95b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,5 @@ | |
|
|
||
| dailyNote/ | ||
|
|
||
| .omc/ | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,18 @@ | ||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||
| # PostCompact hook: CLAUDE.md 핵심 컨텍스트를 압축 후 재주입 | ||||||||||||||||||
| CLAUDE_MD="/Users/seokyoung-won/Desktop/moadong/frontend/CLAUDE.md" | ||||||||||||||||||
|
|
||||||||||||||||||
| if [ ! -f "$CLAUDE_MD" ]; then | ||||||||||||||||||
| exit 0 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| # 아키텍처 개요 섹션만 추출 (너무 많은 토큰 방지) | ||||||||||||||||||
| CONTEXT=$(awk '/^## 아키텍처 개요/,/^## [^아]/' "$CLAUDE_MD" | head -60) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아키텍처 섹션 종료 조건이 불안정합니다 Line 10의 종료 패턴( 제안 패치-CONTEXT=$(awk '/^## 아키텍처 개요/,/^## [^아]/' "$CLAUDE_MD" | head -60)
+CONTEXT=$(
+ awk '
+ /^## 아키텍처 개요$/ { in_section=1; print; next }
+ /^## / && in_section { exit }
+ in_section { print }
+ ' "$CLAUDE_MD" | head -60
+)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| if [ -z "$CONTEXT" ]; then | ||||||||||||||||||
| exit 0 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| CONTEXT_JSON=$(printf '%s' "$CONTEXT" | jq -Rs .) | ||||||||||||||||||
|
|
||||||||||||||||||
| printf '{"hookSpecificOutput":{"hookEventName":"PostCompact","additionalContext":%s}}' "$CONTEXT_JSON" | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||||||||||
| #!/usr/bin/env bash | ||||||||||||||
| # Hook: Stop | ||||||||||||||
| # On session end: stages all changes, generates a conventional commit message | ||||||||||||||
| # via Claude headless mode (claude -p), commits, and logs to CHANGELOG. | ||||||||||||||
| # Falls back to a generic WIP message if claude -p fails. | ||||||||||||||
|
|
||||||||||||||
| set -euo pipefail | ||||||||||||||
|
|
||||||||||||||
| # Resolve the git repo root (worktree-safe) | ||||||||||||||
| REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) || REPO_ROOT="$CLAUDE_PROJECT_DIR" | ||||||||||||||
| cd "$REPO_ROOT" || exit 0 | ||||||||||||||
|
Comment on lines
+10
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 10은 제안 패치-REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) || REPO_ROOT="$CLAUDE_PROJECT_DIR"
-cd "$REPO_ROOT" || exit 0
+REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+REPO_ROOT="${REPO_ROOT:-${CLAUDE_PROJECT_DIR:-}}"
+[ -n "$REPO_ROOT" ] || exit 0
+cd "$REPO_ROOT" || exit 0📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| # Stage all changes | ||||||||||||||
| git add -A 2>/dev/null || true | ||||||||||||||
|
|
||||||||||||||
|
Comment on lines
+13
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 세션 종료 시 Line 13-15는 추적되지 않은 파일/실수로 생성된 파일까지 포함할 수 있어 사고 위험이 큽니다. 최소 제안 패치-# Stage all changes
-git add -A 2>/dev/null || true
+# Stage tracked changes only (safer default)
+git add -u 2>/dev/null || true📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| # Exit if nothing to commit | ||||||||||||||
| if git diff-index --quiet HEAD 2>/dev/null; then | ||||||||||||||
| exit 0 | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| # Extract diff for commit message generation (truncated to 2000 lines) | ||||||||||||||
| DIFF=$(git diff --cached 2>/dev/null | head -2000) | ||||||||||||||
|
|
||||||||||||||
| # Generate commit message via Claude headless mode | ||||||||||||||
| COMMIT_MSG="" | ||||||||||||||
| if command -v claude &>/dev/null; then | ||||||||||||||
| COMMIT_MSG=$(echo "$DIFF" | claude -p \ | ||||||||||||||
| "You are a commit message generator. Based on the following git diff, write a single commit message. | ||||||||||||||
| Rules: | ||||||||||||||
| - First line MUST start with 'WIP(scope): short summary' (max 72 chars) | ||||||||||||||
| - Always use 'WIP' as the type prefix, never feat/fix/refactor/etc. | ||||||||||||||
| - If needed, add a blank line then bullet points for details | ||||||||||||||
| - Be concise and specific | ||||||||||||||
| - Output ONLY the commit message, nothing else" 2>/dev/null) || true | ||||||||||||||
|
Comment on lines
+27
to
+34
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. staged diff 전체를 외부 도구로 전송하는 동작은 민감정보 유출 위험이 있습니다 Line 27-34는 코드/비밀값이 포함된 diff를 그대로 전송할 수 있습니다. 기본 비활성화(옵트인) 또는 민감패턴 마스킹이 필요합니다. 🤖 Prompt for AI Agents |
||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| # Fallback if claude -p failed or returned empty | ||||||||||||||
| if [ -z "$COMMIT_MSG" ]; then | ||||||||||||||
| FILE_COUNT=$(git diff --cached --name-only | wc -l | tr -d ' ') | ||||||||||||||
| COMMIT_MSG="wip: update $FILE_COUNT files" | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| # Commit using -F - to safely handle special characters | ||||||||||||||
| echo "$COMMIT_MSG" | git commit -F - --no-verify 2>/dev/null || true | ||||||||||||||
|
|
||||||||||||||
| # Update CHANGELOG if it exists | ||||||||||||||
| CHANGELOG="$REPO_ROOT/docs/CHANGELOG.md" | ||||||||||||||
| if [ -f "$CHANGELOG" ]; then | ||||||||||||||
| TIMESTAMP=$(date '+%Y-%m-%d %H:%M') | ||||||||||||||
| FIRST_LINE=$(echo "$COMMIT_MSG" | head -1) | ||||||||||||||
|
|
||||||||||||||
| if grep -q '## \[Unreleased\]' "$CHANGELOG"; then | ||||||||||||||
| sed -i '' "/## \[Unreleased\]/a\\ | ||||||||||||||
| - $TIMESTAMP: $FIRST_LINE" "$CHANGELOG" 2>/dev/null || \ | ||||||||||||||
| sed -i "/## \[Unreleased\]/a\\- $TIMESTAMP: $FIRST_LINE" "$CHANGELOG" 2>/dev/null || true | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| git add "$CHANGELOG" 2>/dev/null || true | ||||||||||||||
| if ! git diff-index --quiet HEAD 2>/dev/null; then | ||||||||||||||
| git commit -m "docs: auto-update changelog" --no-verify 2>/dev/null || true | ||||||||||||||
| fi | ||||||||||||||
| fi | ||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,46 @@ | ||||||
| { | ||||||
| "hooks": { | ||||||
| "PostToolUse": [ | ||||||
| { | ||||||
| "matcher": "Write|Edit", | ||||||
| "hooks": [ | ||||||
| { | ||||||
| "type": "command", | ||||||
| "command": "jq -r '.tool_input.file_path // empty' | { read -r f; [ -n \"$f\" ] && cd /Users/seokyoung-won/Desktop/moadong/frontend && npx prettier --write \"$f\" --ignore-unknown 2>/dev/null; } || true", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 9는 입력 경로를 바로 prettier에 전달합니다. 제안 패치(개념)-"command": "jq -r '.tool_input.file_path // empty' | { read -r f; [ -n \"$f\" ] && cd /Users/seokyoung-won/Desktop/moadong/frontend && npx prettier --write \"$f\" --ignore-unknown 2>/dev/null; } || true",
+"command": "jq -r '.tool_input.file_path // empty' | { read -r f; root=\"${CLAUDE_PROJECT_DIR:-$(pwd)}\"; [ -n \"$f\" ] || exit 0; abs=\"$(realpath \"$f\" 2>/dev/null || true)\"; case \"$abs\" in \"$root\"/*) cd \"$root\" && npx prettier --write \"$abs\" --ignore-unknown 2>/dev/null ;; esac; } || true",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "statusMessage": "Formatting..." | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| ], | ||||||
| "Stop": [ | ||||||
| { | ||||||
| "hooks": [ | ||||||
| { | ||||||
| "type": "command", | ||||||
| "command": "/Users/seokyoung-won/Desktop/moadong/frontend/.claude/hooks/stop.sh" | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| ], | ||||||
| "Notification": [ | ||||||
| { | ||||||
| "hooks": [ | ||||||
| { | ||||||
| "type": "command", | ||||||
| "command": "osascript -e 'display notification \"Claude가 입력을 기다리고 있어요\" with title \"Claude Code\" sound name \"Ping\"'" | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| ], | ||||||
| "PostCompact": [ | ||||||
| { | ||||||
| "hooks": [ | ||||||
| { | ||||||
| "type": "command", | ||||||
| "command": "/Users/seokyoung-won/Desktop/moadong/frontend/.claude/hooks/post-compact.sh" | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
절대경로 하드코딩으로 훅이 다른 환경에서 동작하지 않습니다
Line 3의 사용자 로컬 절대경로는 다른 개발자/CI에서 즉시 깨집니다. 스크립트 위치 기준 상대경로(또는 환경변수 우선)로 바꿔주세요.
제안 패치
🤖 Prompt for AI Agents