Communitygithub.com

알림 설정

Telegram, Discord, Slack 알림 통합을 자연어로 구성합니다.

알림 설정란 무엇인가요?

이 스킬은 사용자가 Telegram, Discord, Slack과 같은 인기 있는 메시징 플랫폼을 통해 OMC(Oh My Claude Code) 알림 통합을 구성할 수 있도록 도와줍니다. 사용자의 자연어 요청을 기반으로 적절한 제공자를 자동으로 감지하여, '텔레그램'이라는 단어가 포함되면 Telegram 설정으로, '디스코드'는 Discord, '슬랙'은 Slack으로 라우팅합니다. 각 제공자에 대해 기존 설정을 확인하고, 봇 토큰이나 웹훅 URL, 채팅 ID 등을 수집하며, 이벤트별 알림(on/off)과 메시지 형식을 구성합니다. 모든 설정은 `~/.claude/.omc-config.json` 파일에 저장되며, 테스트 알림 전송 기능을 제공합니다. 이 스킬은 Claude Code 환경에서 AskUserQuestion 도구를 사용하여 대화형으로 작동하며, CLI 명령어를 통해 재구성할 수 있습니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Yeachan-Heo/oh-my-claudecode/tree/main/skills/configure-notifications

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

알림 설정은(는) 무엇을 하나요?

OMC 알림 통합을 설정하여 세션이 종료되거나, 입력이 필요하거나, 백그라운드 작업이 완료될 때 알림을 받을 수 있습니다.

라우팅

사용자의 요청이나 인수에 따라 제공자를 감지합니다:

  • 트리거나 인수에 "telegram"이 포함된 경우 → Telegram 섹션을 따릅니다.
  • 트리거나 인수에 "discord"가 포함된 경우 → Discord 섹션을 따릅니다.
  • 트리거나 인수에 "slack"이 포함된 경우 → Slack 섹션을 따릅니다.
  • 제공자가 지정되지 않은 경우, AskUserQuestion을 사용합니다:

질문: "어떤 알림 서비스를 설정하시겠습니까?"

옵션:

  1. Telegram - 봇 토큰 + 채팅 ID. 모바일과 데스크톱에서 작동합니다.
  2. Discord - 웹훅 또는 봇 토큰 + 채널 ID.
  3. Slack - 수신 웹훅 URL.

Telegram 설정

Telegram 알림을 설정하여 OMC가 세션 종료, 입력 필요, 백그라운드 작업 완료 시 메시지를 보낼 수 있도록 합니다.

이 스킬의 작동 방식

이 스킬은 대화형 자연어 구성 스킬입니다. AskUserQuestion으로 질문을 하며 사용자를 설정 과정으로 안내합니다. 결과는 ${CLAUDE_CONFIG_DIR:-~/.claude}/.omc-config.json에 기록됩니다.

1단계: 기존 설정 확인

CONFIG_FILE="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.omc-config.json"

if [ -f "$CONFIG_FILE" ]; then
  HAS_TELEGRAM=$(jq -r '.notifications.telegram.enabled // false' "$CONFIG_FILE" 2>/dev/null)
  CHAT_ID=$(jq -r '.notifications.telegram.chatId // empty' "$CONFIG_FILE" 2>/dev/null)
  PARSE_MODE=$(jq -r '.notifications.telegram.parseMode // "Markdown"' "$CONFIG_FILE" 2>/dev/null)

  if [ "$HAS_TELEGRAM" = "true" ]; then
    echo "EXISTING_CONFIG=true"
    echo "CHAT_ID=$CHAT_ID"
    echo "PARSE_MODE=$PARSE_MODE"
  else
    echo "EXISTING_CONFIG=false"
  fi
else
  echo "NO_CONFIG_FILE"
fi

기존 설정이 발견되면 현재 구성 상태를 사용자에게 보여주고 업데이트 또는 재구성할 것인지 묻습니다.

2단계: Telegram 봇 생성

봇이 없는 경우 사용자에게 생성 과정을 안내합니다:

Telegram 알림을 설정하려면 Telegram 봇 토큰과 채팅 ID가 필요합니다.

봇 생성 (없는 경우):
1. Telegram을 열고 @BotFather를 검색하세요.
2. /newbot 명령어를 보내세요.
3. 이름을 선택하세요 (예: "My OMC Notifier").
4. 사용자 이름을 선택하세요 (예: "my_omc_bot").
5. BotFather가 다음과 같은 토큰을 제공합니다: 123456789:ABCdefGHIjklMNOpqrsTUVwxyz

채팅 ID 얻기:
1. 새 봇과 대화를 시작하세요 (/start 명령어 전송).
2. 다음 주소를 방문하세요: https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
3. "chat":{"id":YOUR_CHAT_ID} 부분을 찾으세요.
   - 개인 채팅 ID는 양수입니다 (예: 123456789).
   - 그룹 채팅 ID는 음수입니다 (예: -1001234567890).

3단계: 봇 토큰 수집

AskUserQuestion을 사용합니다:

질문: "Telegram 봇 토큰을 붙여넣으세요 (@BotFather에서 받은 토큰)"

사용자는 "기타" 필드에 토큰을 입력합니다.

유효성 검사:

  • 다음 패턴과 일치해야 합니다: digits:alphanumeric (예: 123456789:ABCdefGHI...)
  • 유효하지 않은 경우, 형식을 설명하고 다시 질문합니다.

4단계: 채팅 ID 수집

AskUserQuestion을 사용합니다:

질문: "Telegram 채팅 ID를 붙여넣으세요 (getUpdates API에서 얻은 숫자)"

사용자는 "기타" 필드에 채팅 ID를 입력합니다.

유효성 검사:

  • 숫자여야 합니다 (개인은 양수, 그룹은 음수).
  • 유효하지 않은 경우, 찾는 방법을 도와줍니다:
# 사용자가 채팅 ID를 찾을 수 있도록 도움
BOT_TOKEN="USER_PROVIDED_TOKEN"
echo "최근 메시지를 가져와 채팅 ID를 찾는 중..."
curl -s "https://api.telegram.org/bot${BOT_TOKEN}/getUpdates" | jq '.result[-1].message.chat.id // .result[-1].message.from.id // "메시지를 찾을 수 없습니다 - 먼저 봇에게 /start를 보내세요"'

5단계: 파싱 모드 선택

AskUserQuestion을 사용합니다:

질문: "어떤 메시지 형식을 선호하시나요?"

옵션:

  1. Markdown (권장) - Markdown 구문으로 굵게, 기울임, 코드 블록 사용
  2. HTML - HTML 태그로 굵게, 기울임, 코드 사용

6단계: 이벤트 구성

multiSelect와 함께 AskUserQuestion을 사용합니다:

질문: "어떤 이벤트가 Telegram 알림을 트리거해야 하나요?"

옵션 (multiSelect: true):

  1. 세션 종료 (권장) - Claude 세션이 종료될 때
  2. 입력 필요 - Claude가 사용자의 응답을 기다릴 때 (장시간 실행 작업에 유용)
  3. 세션 시작 - 새 세션이 시작될 때
  4. 세션 지속 - 영구 모드가 세션을 유지할 때

기본 선택: session-end + ask-user-question.

7단계: 설정 파일 쓰기

기존 설정을 읽고 새 Telegram 설정을 병합한 후 다시 씁니다:

CONFIG_FILE="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.omc-config.json"
mkdir -p "$(dirname "$CONFIG_FILE")"

if [ -f "$CONFIG_FILE" ]; then
  EXISTING=$(cat "$CONFIG_FILE")
else
  EXISTING='{}'
fi

# BOT_TOKEN, CHAT_ID, PARSE_MODE는 사용자로부터 수집됩니다.
echo "$EXISTING" | jq \
  --arg token "$BOT_TOKEN" \
  --arg chatId "$CHAT_ID" \
  --arg parseMode "$PARSE_MODE" \
  '.notifications = (.notifications // {enabled: true}) |
   .notifications.enabled = true |
   .notifications.telegram = {
     enabled: true,
     botToken: $token,
     chatId: $chatId,
     parseMode: $parseMode
   }' > "$CONFIG_FILE"

사용자가 모든 이벤트를 선택하지 않은 경우 이벤트별 설정 추가:

선택되지 않은 각 이벤트에 대해 비활성화합니다:

# 예시: session-start가 선택되지 않은 경우 비활성화
echo "$(cat "$CONFIG_FILE")" | jq \
  '.notifications.events = (.notifications.events // {}) |
   .notifications.events["session-start"] = {enabled: false}' > "$CONFIG_FILE"

8단계: 설정 테스트

설정을 기록한 후, 테스트 알림 전송을 제안합니다:

AskUserQuestion을 사용합니다:

질문: "설정을 확인하기 위해 테스트 알림을 보낼까요?"

옵션:

  1. 네, 지금 테스트합니다 (권장) - Telegram 채팅으로 테스트 메시지 전송
  2. 아니요, 나중에 테스트하겠습니다 - 테스트 건너뛰기

테스트하는 경우:

BOT_TOKEN="USER_PROVIDED_TOKEN"
CHAT_ID="USER_PROVIDED_CHAT_ID"
PARSE_MODE="Markdown"

RESPONSE=$(curl -s -w "\n%{http_code}" \
  "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
  -d "chat_id=${CHAT_ID}" \
  -d "parse_mode=${PARSE_MODE}" \
  -d "text=OMC test notification - Telegram is configured!")

HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | head -1)

if [ "$HTTP_CODE" = "200" ]; then
  echo "테스트 알림이 성공적으로 전송되었습니다!"
else
  echo "실패 (HTTP $HTTP_CODE):"
  echo "$BODY" | jq -r '.description // "알 수 없는 오류"' 2>/dev/null || echo "$BODY"
fi

성공 또는 실패를 보고합니다. 일반적인 문제:

  • 401 Unauthorized: 봇 토큰이 잘못되었습니다.
  • 400 Bad Request: chat not found: 채팅 ID가 잘못되었거나 사용자가 봇에게 /start를 보내지 않았습니다.
  • Network error: api.telegram.org에 대한 연결을 확인하세요.

9단계: 확인

최종 설정 요약을 표시합니다:

Telegram 알림이 구성되었습니다!

  봇:        @your_bot_username
  채팅 ID:    123456789
  형식:     Markdown
  이벤트:     session-end, ask-user-question

설정이 저장됨: ~/.claude/.omc-config.json

환경 변수로도 설정할 수 있습니다:
  OMC_TELEGRAM_BOT_TOKEN=123456789:ABCdefGHI...
  OMC_TELEGRAM_CHAT_ID=123456789

재구성: /oh-my-claudecode:configure-notifications telegram
Discord 구성: /oh-my-claudecode:configure-notifications discord
Slack 구성: /oh-my-claudecode:configure-notifications slack

환경 변수 대안

사용자는 셸 프로필에 환경 변수를 설정하여 이 마법사를 건너뛸 수 있습니다:

export OMC_TELEGRAM_BOT_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
export OMC_TELEGRAM_CHAT_ID="123456789"

환경 변수는 .omc-config.json 없이도 알림 시스템에서 자동으로 감지됩니다.


Discord 설정

Discord 알림을 설정하여 OMC가 세션 종료, 입력 필요, 백그라운드 작업 완료 시 알림을 보낼 수 있도록 합니다.

이 스킬의 작동 방식

이 스킬은 대화형 자연어 구성 스킬입니다. AskUserQuestion으로 질문을 하며 사용자를 설정 과정으로 안내합니다. 결과는 ${CLAUDE_CONFIG_DIR:-~/.claude}/.omc-config.json에 기록됩니다.

1단계: 기존 설정 확인

CONFIG_FILE="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.omc-config.json"

if [ -f "$CONFIG_FILE" ]; then
  # 기존 discord 설정 확인
  HAS_DISCORD=$(jq -r '.notifications.discord.enabled // false' "$CONFIG_FILE" 2>/dev/null)
  HAS_DISCORD_BOT=$(jq -r '.notifications["discord-bot"].enabled // false' "$CONFIG_FILE" 2>/dev/null)
  WEBHOOK_URL=$(jq -r '.notifications.discord.webhookUrl // empty' "$CONFIG_FILE" 2>/dev/null)
  MENTION=$(jq -r '.notifications.discord.mention // empty' "$CONFIG_FILE" 2>/dev/null)

  if [ "$HAS_DISCORD" = "true" ] || [ "$HAS_DISCORD_BOT" = "true" ]; then
    echo "EXISTING_CONFIG=true"
    echo "WEBHOOK_CONFIGURED=$HAS_DISCORD"
    echo "BOT_CONFIGURED=$HAS_DISCORD_BOT"
    [ -n "$WEBHOOK_URL" ] && echo "WEBHOOK_URL=$WEBHOOK_URL"
    [ -n "$MENTION" ] && echo "MENTION=$MENTION"
  else
    echo "EXISTING_CONFIG=false"
  fi
else
  echo "NO_CONFIG_FILE"
fi

기존 설정이 발견되면 현재 구성 상태를 사용자에게 보여주고 업데이트 또는 재구성할 것인지 묻습니다.

2단계: Discord 방법 선택

AskUserQuestion을 사용합니다:

질문: "Discord 알림을 어떻게 보내시겠습니까?"

옵션:

  1. 웹훅 (권장) - Discord 채널에 웹훅을 생성합니다. 간단하며 봇이 필요 없습니다. URL만 붙여넣으면 됩니다.
  2. 봇 API - Discord 봇 토큰 + 채널 ID를 사용합니다. 더 유연하며 봇 애플리케이션이 필요합니다.

3A단계: 웹훅 설정

사용자가 웹훅을 선택한 경우:

AskUserQuestion을 사용합니다:

질문: "Discord 웹훅 URL을 붙여넣으세요. 생성 방법: 서버 설정 > 연동 > 웹훅 > 새 웹훅 > URL 복사"

사용자는 "기타" 필드에 웹훅 URL을 입력합니다.

유효성 검사:

  • https://discord.com/api/webhooks/ 또는 https://discordapp.com/api/webhooks/로 시작해야 합니다.
  • 유효하지 않은 경우, 형식을 설명하고 다시 질문합니다.

3B단계: 봇 API 설정

사용자가 봇 API를 선택한 경우:

두 가지 질문을 합니다:

  1. "Discord 봇 토큰을 붙여넣으세요" - discord.com/developers > 내 앱 > 봇 > 토큰
  2. "채널 ID를 붙여넣으세요" - 채널 우클릭 > 채널 ID 복사 (개발자 모드 필요)

4단계: 멘션 (사용자 태그) 구성

AskUserQuestion을 사용합니다:

질문: "알림에서 누군가를 멘션(태그)하시겠습니까?"

옵션:

  1. 네, 사용자 멘션 - Discord 사용자 ID로 특정 사용자 태그
  2. 네, 역할 멘션 - 역할 ID로 역할 태그
  3. 멘션 없음 - 아무도 태그하지 않고 메시지만 게시

사용자 멘션을 원하는 경우:

질문: "멘션할 Discord 사용자 ID는 무엇인가요? (사용자 우클릭 > 사용자 ID 복사, 개발자 모드 필요)"

멘션 형식: <@USER_ID> (예: <@1465264645320474637>)

역할 멘션을 원하는 경우:

질문: "멘션할 Discord 역할 ID는 무엇인가요? (서버 설정 > 역할 > 역할 우클릭 > 역할 ID 복사)"

멘션 형식: <@&ROLE_ID> (예: <@&123456789>)

5단계: 이벤트 구성

multiSelect와 함께 AskUserQuestion을 사용합니다:

질문: "어떤 이벤트가 Discord 알림을 트리거해야 하나요?"

옵션 (multiSelect: true):

  1. 세션 종료 (권장) - Claude 세션이 종료될 때
  2. 입력 필요 - Claude가 사용자의 응답을 기다릴 때 (장시간 실행 작업에 유용)
  3. 세션 시작 - 새 세션이 시작될 때
  4. 세션 지속 - 영구 모드가 세션을 유지할 때

기본 선택: session-end + ask-user-question.

6단계: 선택적 사용자 이름 재정의

AskUserQuestion을 사용합니다:

질문: "봇 표시 이름을 지정하시겠습니까? (Discord에서 웹훅 발신자 이름으로 표시됨)"

옵션:

  1. OMC (기본값) - "OMC"로 표시
  2. Claude Code - "Claude Code"로 표시
  3. 사용자 지정 - 사용자 지정 이름 입력

7단계: 설정 파일 쓰기

기존 설정을 읽고 새 Discord 설정을 병합한 후 다시 씁니다:

CONFIG_FILE="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.omc-config.json"
mkdir -p "$(dirname "$CONFIG_FILE")"

if [ -f "$CONFIG_FILE" ]; then
  EXISTING=$(cat "$CONFIG_FILE")
else
  EXISTING='{}'
fi

웹훅 방법의 경우:

수집된 값으로 notifications 객체를 구성하고 jq를 사용하여 .omc-config.json에 병합합니다:

# WEBHOOK_URL, MENTION, USERNAME은 사용자로부터 수집됩니다.
# EVENTS는 활성화된 이벤트 목록입니다.

echo "$EXISTING" | jq \
  --arg url "$WEBHOOK_URL" \
  --arg mention "$MENTION" \
  --arg username "$USERNAME" \
  '.notifications = (.notifications // {enabled: true}) |
   .notifications.enabled = true |
   .notifications.discord = {
     enabled: true,
     webhookUrl: $url,
     mention: (if $mention == "" then null else $mention end),
     username: (if $username == "" then null else $username end)
   }' > "$CONFIG_FILE"

봇 API 방법의 경우:

echo "$EXISTING" | jq \
  --arg token "$BOT_TOKEN" \
  --arg channel "$CHANNEL_ID" \
  --arg mention "$MENTION" \
  '.notifications = (.notifications // {enabled: true}) |
   .notifications.enabled = true |
   .notifications["discord-bot"] = {
     enabled: true,
     botToken: $token,
     channelId: $channel,
     mention: (if $mention == "" then null else $mention end)
   }' > "$CONFIG_FILE"

사용자가 모든 이벤트를 선택하지 않은 경우 이벤트별 설정 추가:

선택되지 않은 각 이벤트에 대해 비활성화합니다:

# 예시: session-start가 선택되지 않은 경우 비활성화
echo "$(cat "$CONFIG_FILE")" | jq \
  '.notifications.events = (.notifications.events // {}) |
   .notifications.events["session-start"] = {enabled: false}' > "$CONFIG_FILE"

8단계: 설정 테스트

설정을 기록한 후, 테스트 알림 전송을 제안합니다:

AskUserQuestion을 사용합니다:

질문: "설정을 확인하기 위해 테스트 알림을 보낼까요?"

옵션:

  1. 네, 지금 테스트합니다 (권장) - Discord 채널로 테스트 메시지 전송
  2. 아니요, 나중에 테스트하겠습니다 - 테스트 건너뛰기

테스트하는 경우:

# 웹훅의 경우:
curl -s -o /dev/null -w "%{http_code}" \
  -H "Content-Type: application/json" \
  -d "{\"content\": \"${MENTION:+$MENTION\n}OMC test notification - Discord is configured!\"}" \
  "$WEBHOOK_URL"

성공 또는 실패를 보고합니다. 일반적인 문제:

  • 404 Not Found: 웹훅 URL이 잘못되었거나 웹훅이 삭제되었습니다.
  • 401 Unauthorized: 봇 토큰이 잘못되었습니다.
  • 400 Bad Request: 봇에 필요한 권한이 없습니다.

9단계: 확인

최종 설정 요약을 표시합니다:

Discord 알림이 구성되었습니다!

  방법:       웹훅
  웹훅 URL:   https://discord.com/api/webhooks/...
  멘션:       @user
  이벤트:     session-end, ask-user-question

설정이 저장됨: ~/.claude/.omc-config.json

환경 변수로도 설정할 수 있습니다:
  OMC_DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...
  OMC_DISCORD_BOT_TOKEN=...
  OMC_DISCORD_CHANNEL_ID=...

재구성: /oh-my-claudecode:configure-notifications discord
Telegram 구성: /oh-my-claudecode:configure-notifications telegram
Slack 구성: /oh-my-claudecode:configure-notifications slack

환경 변수 대안

사용자는 셸 프로필에 환경 변수를 설정하여 이 마법사를 건너뛸 수 있습니다:

export OMC_DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/..."
export OMC_DISCORD_BOT_TOKEN="..."
export OMC_DISCORD_CHANNEL_ID="..."
export OMC_DISCORD_MENTION="@user"

환경 변수는 .omc-config.json 없이도 알림 시스템에서 자동으로 감지됩니다.


Slack 설정

Slack 알림을 설정하여 OMC가 세션 종료, 입력 필요, 백그라운드 작업 완료 시 알림을 보낼 수 있도록 합니다.

이 스킬의 작동 방식

이 스킬은 대화형 자연어 구성 스킬입니다. AskUserQuestion으로 질문을 하며 사용자를 설정 과정으로 안내합니다. 결과는 ${CLAUDE_CONFIG_DIR:-~/.claude}/.omc-config.json에 기록됩니다.

1단계: 기존 설정 확인

CONFIG_FILE="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.omc-config.json"

if [ -f "$CONFIG_FILE" ]; then
  # 기존 slack 설정 확인
  HAS_SLACK=$(jq -r '.notifications.slack.enabled // false' "$CONFIG_FILE" 2>/dev/null)
  WEBHOOK_URL=$(jq -r '.notifications.slack.webhookUrl // empty' "$CONFIG_FILE" 2>/dev/null)

  if [ "$HAS_SLACK" = "true" ]; then
    echo "EXISTING_CONFIG=true"
    [ -n "$WEBHOOK_URL" ] && echo "WEBHOOK_URL=$WEBHOOK_URL"
  else
    echo "EXISTING_CONFIG=false"
  fi
else
  echo "NO_CONFIG_FILE"
fi

기존 설정이 발견되면 현재 구성 상태를 사용자에게 보여주고 업데이트 또는 재구성할 것인지 묻습니다.

2단계: Slack 웹훅 수집

AskUserQuestion을 사용합니다:

질문: "Slack 수신 웹훅 URL을 붙여넣으세요. 생성 방법: api.slack.com/apps > 새 앱 만들기 > Incoming Webhooks > 활성화 > 새 웹훅 추가 > URL 복사"

사용자는 "기타" 필드에 웹훅 URL을 입력합니다.

유효성 검사:

  • URL은 https://hooks.slack.com/services/로 시작해야 합니다.
  • 간단히 핑하여 유효성을 확인할 수 있습니다:
curl -s -o /dev/null -w "%{http_code}" -X POST \
  "$WEBHOOK_URL" \
  -H 'Content-Type: application/json' \
  -d '{"text":"Slack webhook URL validation"}'
  • 200 OK이면 URL이 유효합니다.
  • 그렇지 않으면 형식을 설명하고 다시 질문합니다.

3단계: 채널 이름 (선택 사항)

AskUserQuestion을 사용합니다:

질문: "Slack 메시지에 채널 이름을 표시하시겠습니까?"

옵션:

  1. 예 - 메시지가 전송되는 채널 이름 포함
  2. 아니요 (권장) - 채널 정보 없이 메시지만 표시

4단계: 이벤트 구성

multiSelect와 함께 AskUserQuestion을 사용합니다:

질문: "어떤 이벤트가 Slack 알림을 트리거해야 하나요?"

옵션 (multiSelect: true):

  1. 세션 종료 (권장) - Claude 세션이 종료될 때
  2. 입력 필요 - Claude가 사용자의 응답을 기다릴 때 (장시간 실행 작업에 유용)
  3. 세션 시작 - 새 세션이 시작될 때
  4. 세션 지속 - 영구 모드가 세션을 유지할 때

기본 선택: session-end + ask-user-question.

5단계: 설정 파일 쓰기

기존 설정을 읽고 새 Slack 설정을 병합한 후 다시 씁니다:

CONFIG_FILE="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.omc-config.json"
mkdir -p "$(dirname "$CONFIG_FILE")"

if [ -f "$CONFIG_FILE" ]; then
  EXISTING=$(cat "$CONFIG_FILE")
else
  EXISTING='{}'
fi

# WEBHOOK_URL, SHOW_CHANNEL은 사용자로부터 수집됩니다.
echo "$EXISTING" | jq \
  --arg url "$WEBHOOK_URL" \
  --arg showChannel "$SHOW_CHANNEL" \
  '.notifications = (.notifications // {enabled: true}) |
   .notifications.enabled = true |
   .notifications.slack = {
     enabled: true,
     webhookUrl: $url,
     showChannel: ($showChannel == "true")
   }' > "$CONFIG_FILE"

사용자가 모든 이벤트를 선택하지 않은 경우 이벤트별 설정 추가:

선택되지 않은 각 이벤트에 대해 비활성화합니다:

# 예시: session-start가 선택되지 않은 경우 비활성화
echo "$(cat "$CONFIG_FILE")" | jq \
  '.notifications.events = (.notifications.events // {}) |
   .notifications.events["session-start"] = {enabled: false}' > "$CONFIG_FILE"

6단계: 설정 테스트

설정을 기록한 후, 테스트 알림 전송을 제안합니다:

AskUserQuestion을 사용합니다:

질문: "설정을 확인하기 위해 테스트 알림을 보낼까요?"

옵션:

  1. 네, 지금 테스트합니다 (권장) - Slack 채널로 테스트 메시지 전송
  2. 아니요, 나중에 테스트하겠습니다 - 테스트 건너뛰기

테스트하는 경우:

# Slack 웹훅 URL로 테스트
echo "Slack 설정 테스트 중..."

RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
  "$WEBHOOK_URL" \
  -H 'Content-Type: application/json' \
  -d '{"text":"OMC test notification - Slack is configured!"}')

HTTP_CODE=$(echo "$RESPONSE" | tail -1)

if [ "$HTTP_CODE" = "200" ]; then
  echo "테스트 알림이 성공적으로 전송되었습니다!"
else
  echo "실패 (HTTP $HTTP_CODE)"
  echo "웹훅 URL이 올바른지 확인하고 Slack 앱 설정에서 웹훅이 활성화되어 있는지 확인하세요."
fi

성공 또는 실패를 보고합니다.

7단계: 확인

최종 설정 요약을 표시합니다:

Slack 알림이 구성되었습니다!

  웹훅 URL:   https://hooks.slack.com/services/T00/B00/xxx
  이벤트:     session-end, ask-user-question

설정이 저장됨: ~/.claude/.omc-config.json

환경 변수로도 설정할 수 있습니다:
  OMC_SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T00/B00/xxx

재구성: /oh-my-claudecode:configure-notifications slack
Telegram 구성: /oh-my-claudecode:configure-notifications telegram
Discord 구성: /oh-my-claudecode:configure-notifications discord

환경 변수 대안

사용자는 셸 프로필에 환경 변수를 설정하여 이 마법사를 건너뛸 수 있습니다:

export OMC_SLACK_WEBHOOK_URL="https://hooks.slack.com/services/T00/B00/xxx"

환경 변수는 .omc-config.json 없이도 알림 시스템에서 자동으로 감지됩니다.


명령어

  • /oh-my-claudecode:configure-notifications - 전체 설정 마법사 실행
  • /oh-my-claudecode:configure-notifications telegram - Telegram 설정 마법사 실행
  • /oh-my-claudecode:configure-notifications discord - Discord 설정 마법사 실행
  • /oh-my-claudecode:configure-notifications slack - Slack 설정 마법사 실행

전체 구성 파일 예시

아래는 구성된 모든 알림 제공자를 포함하는 .omc-config.json 파일의 예시입니다:

{
  "notifications": {
    "enabled": true,
    "events": {
      "session-end": {"enabled": true},
      "ask-user-question": {"enabled": true},
      "session-start": {"enabled": false},
      "session-continue": {"enabled": false}
    },
    "telegram": {
      "enabled": true,
      "botToken": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
      "chatId": "123456789",
      "parseMode": "Markdown"
    },
    "discord": {
      "enabled": true,
      "webhookUrl": "https://discord.com/api/webhooks/...",
      "mention": "@user",
      "username": "Claude Code"
    },
    "slack": {
      "enabled": true,
      "webhookUrl": "https://hooks.slack.com/services/T00/B00/xxx",
      "showChannel": false
    }
  }
}

이 파일은 ~/.claude/ 디렉토리에 위치하며, 모든 알림 설정의 중앙 저장소 역할을 합니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

agent-doc-discipline

Writing-time discipline for documents agents consume (the five surfaces, specs, tickets, .omc/skills/) — every rule checkable and carrying a why, steps before reference, one meaning in one home, no restating what the environment already says. Mandatory at drydock seed generation and the launch C5 sediment pass; opt-in for any other agent-facing doc edit. The companion of minimal-code-discipline: that one disciplines code, this one disciplines papers.

ai-slop-cleaner

Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode

ask

Process-first advisor routing for Claude, Codex, Gemini, Antigravity, Grok, or Cursor via `omc ask`, with artifact capture and no raw CLI assembly

ask-navigator

Shipyard

autopilot

Full autonomous execution from idea to working code

autoresearch

Stateful single-mission improvement loop with strict evaluator contract, markdown decision logs, and max-runtime stop behavior

cancel

Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state

debug

Diagnose the current OMC session or repo state using logs, traces, state, and focused reproduction

deepinit

Deep codebase initialization with hierarchical AGENTS.md documentation

deep-interview

Socratic deep interview with mathematical ambiguity gating before explicit execution approval

drydock

Lay the keel of the shipyard harness in any repo — the 4-pillar shared environment (Context, Rules, Tools, Standards) across 5 surfaces (CLAUDE.md, skills, design-system, mcp/cli, shared context) so that every human and agent inherits the same design language and anyone can ship. Run once per repo; re-run with --check to audit drift.

execute

Carry an approved task through to working, verified code

external-context

Invoke parallel document-specialist agents for external web searches and documentation lookup

graph

Deterministic orchestration graph runtime - declarative DAG pipelines with journal-based crash recovery

harbor

Harbor intake for external work — the captain only handles unresolved decisions. Sweeps incoming issues and PRs, verifies every claim before disposition, reuses every decision already made, and hands the maintainer a docket whose pending items each carry one question with options, recommendation, impact and evidence. Agent-autonomous for facts and for actions covered by standing authorization; signed for every new judgment. Never merges.

hud

Configure HUD display options (layout, presets, display elements)

launch

Shipyard

loft

Loft the shape before cutting steel — answer a design question that prose cannot settle by building a throwaway artifact: a pure logic module in a clickable shell, or structurally different UI variants behind one route. The captain reacts to the artifact; the answer folds into the decision; the artifact never docks. Use when a design question stalls in words, when a navigator map carries a loft ticket, or when a spec discussion reaches

minimal-code-discipline

YAGNI-ladder coding discipline for writing changes — existence-first, reuse before writing, dependency ladder, shortest correct diff, with non-negotiables that must never be minimized away

omc-doctor

Diagnose and fix oh-my-claudecode installation issues

관련 스킬