Communitygithub.com

aiagentwithdhruv/skills

Gmail 이메일을 Action Required, Waiting On, Reference 카테고리로 자동 분류합니다. 사용자가 이메일 라벨링, 받은편지함 정리, 이메일 분류 또는 Gmail 정리를 요청할 때 사용하세요.

skills란 무엇인가요?

이 스킬은 Gmail 받은편지함에서 이메일을 가져와 Action Required, Waiting On, Reference 세 가지 카테고리로 분류한 후 Gmail API를 통해 라벨을 일괄 적용합니다. 병렬 서브에이전트(subagent)를 활용하여 분류 성능을 최적화하며, 기본적으로 10개의 서브에이전트가 동시에 작업을 수행합니다. 이 과정은 fetch(이메일 수집), split(청크 분할), classify(병렬 분류), merge(병합), apply(라벨 적용)의 5단계로 구성됩니다. 100개의 이메일을 약 30초 만에 처리할 수 있으며, 분류가 병목 지점이므로 병렬 처리를 통해 1.8배의 속도 향상을 얻을 수 있습니다. 이 스킬은 Claude Code 환경에서 사용하도록 설계되었으며, Gmail OAuth 인증을 통해 계정을 등록하고 사용합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aiagentwithdhruv/skills/tree/HEAD/gmail-label

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

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

문서

Gmail 자동 라벨링

목표

받은편지함 이메일을 가져와 병렬 서브에이전트를 통해 Action Required / Waiting On / Reference로 분류하고, Gmail API를 통해 라벨을 일괄 적용합니다.

스크립트

  • ./scripts/gmail_label_fetch.py - 이메일 요약을 컴팩트 JSON으로 가져오기
  • ./scripts/gmail_label_split.py - 이메일을 N개의 청크로 분할 (병렬 분류용)
  • ./scripts/gmail_label_merge.py - 분류된 청크를 단일 labels.json으로 병합
  • ./scripts/gmail_label_apply.py - 라벨 분류 결과를 일괄 적용

서브에이전트

  • email-classifier — .claude/agents/email-classifier.md에 정의됨
  • 모델: Sonnet 4.5 (빠르고 비용 효율적인 분류)
  • 각 서브에이전트는 하나의 청크를 읽고, 하나의 분류 결과 파일을 작성합니다.

흐름 (병렬 — 기본값)

1단계: 이메일 가져오기

python3 .claude/skills/gmail-label/scripts/gmail_label_fetch.py \
  --account ACCOUNT --query "in:inbox" --limit 100 --output .tmp/emails.json

2단계: 청크 분할

python3 .claude/skills/gmail-label/scripts/gmail_label_split.py \
  --input .tmp/emails.json --chunks 10 --output-dir .tmp/chunks

3단계: 병렬 분류 (10개 서브에이전트 실행)

10개의 email-classifier 서브에이전트를 백그라운드에서 실행합니다 (청크당 하나씩). 각 서브에이전트는:

  • .tmp/chunks/chunk_N.json 읽기
  • 각 이메일 분류
  • .tmp/chunks/classified_N.json 쓰기

Task 도구를 run_in_background: true 및 model: "sonnet"와 함께 사용하세요. 진정한 병렬 처리를 위해 단일 메시지에서 10개 전부를 실행하세요:

청크 0-9 각각에 대해 다음 Task를 실행:
  subagent_type: "email-classifier"
  model: "sonnet"
  run_in_background: true
  prompt: "/absolute/path/.tmp/chunks/chunk_N.json 읽고 각 이메일 분류 후 결과를 /absolute/path/.tmp/chunks/classified_N.json에 쓰기"

중요: 서브에이전트 결과를 읽기 위해 TaskOutput을 사용하지 마세요. 서브에이전트는 결과를 파일에 씁니다 — 메인 에이전트가 분류 데이터를 볼 필요가 전혀 없습니다. TaskOutput을 읽으면 컨텍스트 윈도우가 넘쳐 대량 배치(500개 이상 이메일)에서 "프롬프트가 너무 깁니다" 오류가 발생합니다.

대신 파일 존재 여부를 폴링하세요:

# 모든 분류 파일이 존재할 때까지 대기 (120초 후 타임아웃)
for i in $(seq 0 9); do
  while [ ! -f ".tmp/chunks/classified_$i.json" ]; do sleep 2; done
done

그런 다음 바로 4단계(병합)로 진행합니다.

4단계: 분류 결과 병합

python3 .claude/skills/gmail-label/scripts/gmail_label_merge.py \
  --input-dir .tmp/chunks --output .tmp/labels.json

5단계: 라벨 적용

python3 .claude/skills/gmail-label/scripts/gmail_label_apply.py \
  --account ACCOUNT --input .tmp/labels.json

분류 기준

Action Required:

  • 확인이 필요한 보안 알림
  • 만료 기한이 있는 신용카드/도메인 갱신
  • 질문을 하는 Slack @멘션
  • 인사해야 할 새 팀원 (Slack 가입 알림)
  • 응답이 필요한 클라이언트 이메일
  • 비즈니스 등록정보 업데이트 (Google Business Profile, Bing Places)
  • Stripe 조치 필요 알림

Waiting On:

  • 답변을 기다리는 아웃바운드 영업 이메일
  • 해결을 기다리는 지원 티켓
  • 발송 후 응답 대기 중인 제안서

Reference:

  • 마케팅 뉴스레터 (DigitalMarketer 등)
  • 자선/비영리 뉴스레터 (RAPS 등)
  • Google Business Profile 실적 보고서
  • 프로모션 제안 (Blinkist, 세일 등)
  • 플랫폼 업데이트 알림 (Google Play, Apify 등)
  • 확인 코드 (이미 사용됨)
  • 부동산 뉴스레터 (Westbank 등)
  • 게임 계정 이메일 (Riot Games 등)
  • 정보성 보안 알림 (2FA 활성화 등)
  • 건강 권고
  • 법률/정책 업데이트 알림

계정 레지스트리

계정은 워크스페이스 루트의 gmail_accounts.json에 저장됩니다. 각 계정에는 다음이 필요합니다:

  • email - Gmail 주소
  • token_file - OAuth 토큰 경로

새 계정 추가

python3 .claude/skills/gmail-inbox/scripts/gmail_multi_auth.py --account ACCOUNT_NAME --email EMAIL

성능

  • 직렬 흐름: 100개 이메일에 약 36초 (가져오기 1초 + 분류 34초 + 적용 1초)
  • 병렬 흐름: 100개 이메일에 약 30초 (분류 19초 + 병합 1초 미만 + 적용 약 10초)
  • 분류가 병목 지점이며, 10개의 병렬 서브에이전트로 34초에서 19초로 단축 (약 1.8배 속도 향상)
  • 에이전트 시작 오버헤드(약 4초 지연)가 이론적 이득을 제한함
  • 적용 단계는 Gmail API 스로틀링으로 인해 변동될 수 있음

스키마

입력

이름유형필수설명
accountstring예레지스트리의 Gmail 계정 이름
querystring아니오Gmail 검색어 (기본값: 'in:inbox')
limitinteger아니오분류할 최대 이메일 수 (기본값: 100)
chunksinteger아니오병렬 분류 청크 수 (기본값: 10)

출력

이름유형설명
labels_appliedobject카테고리별 개수: Action Required, Waiting On, Reference

자격 증명

이름출처
credentials.json파일
token_*.json파일 (자동 생성)

함께 사용 가능한 스킬

이 스킬과 함께 사용하기 좋은 스킬: gmail-inbox

비용

분류에 Claude Sonnet API 사용

Individual skills in this repo

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

aiagentwithdhruv/skills

Add new Modal webhooks for event-driven execution. Use when user asks to create a webhook, add an endpoint, or set up event triggers.

aiagentwithdhruv/skills

Answer Euron Gen AI Bootcamp doubts instantly. Covers Euri API setup across all frameworks (Python, LangChain, OpenAI SDK, TypeScript, n8n, curl), MCP server setup, common errors, model recommendations, and token limits. Use when someone in the bootcamp asks a question.

aiagentwithdhruv/skills

Manage emails across multiple Gmail accounts with unified tooling. Use when user asks to check email, read inbox, label emails, archive messages, or manage Gmail across accounts.

aiagentwithdhruv/skills

Scrape Google Maps for B2B leads with deep website enrichment and contact extraction. Use when user asks to find local businesses, scrape Google Maps, generate contractor lists, or build local service business databases.

aiagentwithdhruv/skills

Run Claude orchestrator locally with Cloudflare tunneling. Use when user asks to run locally, start local server, or test webhooks locally.

aiagentwithdhruv/skills

MCP server for AI-powered macOS control — apps, display, audio, files, screenshots, clipboard

aiagentwithdhruv/skills

Deploy execution scripts to Modal cloud. Use when user asks to deploy to Modal, push code to cloud, or update Modal functions.

aiagentwithdhruv/skills

Scrape and verify business leads using Apify, classify with LLM, enrich emails, and save to Google Sheets. Use when user asks to find leads, scrape businesses, generate prospect lists, or build lead databases for any industry or location.

aiagentwithdhruv/skills

Query Skool community content using RAG pipeline with vector search. Use when user asks to search Skool knowledge, find community answers, or query Skool content.

aiagentwithdhruv/skills

Scrape Upwork jobs and generate personalized proposals with cover letters. Use when user asks to find Upwork jobs, create Upwork proposals, or apply to Upwork listings.

관련 스킬