Repository navigation
feat(portfolio): Slack 사진 업로드 → 포트폴리오 초안 자동 등록 봇 - #49
Merged
Hidden character warning
The head ref may contain hidden characters: "brekarta-stack/\ud3ec\ud2b8\ud3f4\ub9ac\uc624-\uc790\ub3d9-\uc5c5\ub85c\ub4dc-\ubd07-\ub9cc\ub4e4\uae30"
Merged
Conversation
- POST /api/slack/events: Slack Events API receiver (signature check, respond 200 then process in after(), retry-reason aware, host allowlist) - POST /api/portfolio/intake: webhook-secret endpoint shared by the bot and the CLI; GET probe reports which env vars are missing - Filename rule "고객명-YYMMDD-명칭 (n).jpg" groups photos into one case; Claude writes title/summary/description/alts (JSON schema output); saved as a draft (published=false), same key appends to the draft, published cases are refused unless publish is explicit - Claim-first placeholder row + partial update on finalize so concurrent per-photo Slack messages do not create duplicate drafts or clobber admin edits; unique index migration for the intake key - scripts/portfolio-intake.mjs for trial runs and manual batches - docs/portfolio-intake-bot.md + Slack app manifest; 36 tests Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…uest - finalize: optimistic lock on updated_at with re-read and retry, so two concurrent per-photo uploads no longer drop each other's images - discard a claimed placeholder only if it is still empty (another request may have filled it in the meantime) - process at most 3 groups per request so generation stays within the 300s function limit; extra groups are reported, not silently dropped - tests for both paths (38 total) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…자동-업로드-봇-만들기 # Conflicts: # package-lock.json # src/app/api/admin/migrate/route.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
무엇
Slack 채널에 완성품 사진을 올리면(파일명
고객명-YYMMDD-명칭 (n).jpg) 파일명에서 고객·제작 시기·명칭을 읽고, Claude 가 사진을 보고 제목·요약·본문·alt 를 써서 비공개 초안으로 등록한다. 결과는 그 메시지 스레드에 답글(어드민 편집 링크)로 달린다. 공개는 사람이 어드민에서 켠다.구조
POST /api/slack/events— Slack Events API 수신. 서명 검증 → 3초 안에 200 →after()로 처리. 재전송은 사유(http_timeout)로 구분.POST /api/portfolio/intake—x-webhook-secret인증(blog/publish 와 같은 패턴). 봇과 CLI 가 같이 쓰는 뒷단.GET ?probe=1로 설정 상태 확인.src/lib/portfolio-intake.ts순수 규칙(파싱·묶기·프롬프트·규격화),portfolio-intake-flow.ts의존성 주입 흐름(테스트 대상),portfolio-intake-run.ts실제 구현(sharp·Supabase·Claude).airtable_id = intake:<키>). 동시 요청 대비 "자리 먼저 잡기" + 부분 갱신, 유니크 인덱스 마이그레이션 동봉.scripts/portfolio-intake.mjs— 시험 운전·수동 등록용 CLI.배포 후 필요한 것 (코드만으로는 동작하지 않음)
Vercel production env:
PORTFOLIO_INTAKE_SECRET,ANTHROPIC_API_KEY,SLACK_SIGNING_SECRET,SLACK_BOT_TOKEN(선택SLACK_PORTFOLIO_CHANNEL_ID). Slack 앱은docs/slack-portfolio-bot-manifest.json으로 생성. 절차 전체는docs/portfolio-intake-bot.md.검증
npm test277건 통과(신규 36건: 파일명 파싱, 묶기, 규격화, 흐름(가짜 의존성), Slack 서명·필터·허용 호스트, sharp 실처리, CLI 청크)tsc --noEmit, eslint,next build(더미 env) 통과🤖 Generated with Claude Code