Skip to content

Create Prompt-Driven_AI_Collaboration_Service.md#114

Open
zootyducky wants to merge 1 commit intomainfrom
ducky_ai_idea
Open

Create Prompt-Driven_AI_Collaboration_Service.md#114
zootyducky wants to merge 1 commit intomainfrom
ducky_ai_idea

Conversation

@zootyducky
Copy link
Contributor

No description provided.

@mossland
Copy link
Contributor

🔍 Initial Review – Prompt‑Driven AI Collaboration Service

(English version first, Korean version follows)


1. Clarity & Scope

Great high‑level description! I understand the service goal and the broad technical stack.
To make the spec “developer‑ready”, we still need concrete details on:

  1. Trigger & UX inside GitHub
    • Does the AI respond as a review comment, a Check‑Run, or both?
    • How does a user opt‑in (special PR label, config file, slash‑command)?
    • What does an iterative conversation look like from the author’s side (threaded comments, single summary edit, etc.)?

  2. Prompt & Context Management
    • Where will prompt templates and conversation history be stored (Firestore, repo‑local YAML, other)?
    • Will organisations be able to customise prompts per repo/team?

  3. Security / Compliance
    • What permission scopes will the GitHub App request (read‑only code, issues, PRs)?
    • How long will proposal text be retained in your DB? Any encryption or on‑prem option for enterprises?
    • Plan for EU data‑residency / GDPR?

  4. System Architecture
    • Beyond Firebase Functions, will you need a job queue (e.g., Cloud Tasks) to avoid function timeouts on long LLM calls?
    • Expected peak throughput (PRs/day) for MVP, and throttling strategy to manage OpenAI rate limits?
    • Do we need a small caching / embedding layer to reduce token usage on repeated context?

  5. Cost & Timeline
    • Current 3–4 week MVP: What is included—installation flow, single prompt round‑trip, minimal dashboard?
    • Rough request volume assumptions that support the “moderate” cost label?
    • Any KPI for a pilot (e.g., % decrease in review cycles, time saved)?

  6. Monetisation
    • Planned price points (seat‑based vs repo‑based vs usage‑based)?
    • Will there be a free tier or OSS discount?
    • Billing and usage analytics—own system or Stripe + Stripe Metered Billing?

  7. Competitors / Differentiators
    • Have you looked at “ReviewGPT”, “Sweep AI”, or “ChatGPT PR reviewer” GitHub Apps?
    • Key differentiator beyond “conversational” might be prompt library management or domain‑specific review modes—worth spelling out.

  8. Team & Resourcing
    • To deliver the MVP in ~1 month, which roles do you need simultaneously (backend, GitHub App dev, front‑end for dashboard, designer for branding)?
    • Any expected need for iOS/Android dev during MVP? (Probably not, but please confirm.)


2. Suggested Next Steps

  1. Provide a user flow diagram covering install → first PR comment → author response → AI follow‑up.
  2. Fill out a simple cost model spreadsheet: tokens/PR, PRs/team/day, OpenAI $/1K tokens, margin.
  3. Draft GitHub App permission list and data‑retention policy.
  4. Outline the MVP backlog with 2‑week sprints and acceptance criteria.

3. Questions to Proceed

Please answer (or rough‑estimate) the following so we can freeze the MVP scope and assign tasks:

  1. Preferred user interaction model (comment vs Check‑Run vs both)?
  2. Storage choice for prompt templates and conversation context?
  3. Peak daily PR volume you want to support in pilot?
  4. Minimum enterprise security/compliance requirements you must meet on day 1?
  5. Pricing model you’d like to test first?

Thanks! Looking forward to your clarifications. 🙌


🔍 초기 리뷰 – 프롬프트 기반 AI 협업 서비스


1. 명확성 & 범위

서비스 목표와 대략적 기술 스택은 잘 이해했습니다.
개발팀이 바로 착수하려면 다음 세부 사항이 필요합니다.

  1. GitHub 내 트리거 & UX
    • AI 응답 형태: 리뷰 코멘트? Check‑Run? 둘 다?
    • 사용자는 어떻게 옵트인하나요? (특정 PR 라벨, 설정 파일, 슬래시 커맨드 등)
    • 작성자와 AI 간 반복 대화는 어떤 UI로 보이나요? (스레드 코멘트, 요약 업데이트 등)

  2. 프롬프트 & 컨텍스트 관리
    • 프롬프트 템플릿과 대화 히스토리는 어디에 저장하나요? (Firestore, 레포 YAML 등)
    • 조직별/레포별 커스터마이징이 가능한가요?

  3. 보안 / 컴플라이언스
    • GitHub App 권한 범위(읽기 전용 코드, PR 등)는?
    • 제안서 데이터 보관 기간과 암호화 방식? 온프렘 옵션?
    • EU 데이터 거주 요구 또는 GDPR 대응 계획?

  4. 시스템 아키텍처
    • LLM 호출 지연을 대비해 Cloud Tasks 같은 큐가 필요한가요?
    • MVP 예상 피크 처리량(PR/일)과 OpenAI 레이트 리밋 대응 전략?
    • 토큰 사용량 절감을 위한 캐싱/임베딩 계층 고려?

  5. 비용 & 일정
    • 3–4주 MVP에 포함되는 기능 범위? (설치 플로우, 1회 프롬프트 왕복, 미니 대시보드 등)
    • “중간 수준” 비용이라 정의한 요청량 가정치?
    • 파일럿 KPI(리뷰 사이클 감소율, 시간 절감 등)는?

  6. 수익화
    • 가격 책정 방식(인당, 레포당, 사용량 기반) 구체 예시?
    • 프리 티어나 오픈소스 할인 제공 여부?
    • 과금/사용량 분석—자체 구축 vs Stripe Metered Billing?

  7. 경쟁/차별화
    • “ReviewGPT”, “Sweep AI” 등 유사 GitHub App 분석 여부?
    • 차별점: 대화형 뿐 아니라 프롬프트 라이브러리 관리, 도메인 특화 리뷰 모드 등 명시 필요.

  8. 팀 리소스
    • 1개월 MVP에 필요한 역할(백엔드, GitHub App 개발, 대시보드 프론트, 브랜드 디자이너) 동시 투입 가능?
    • MVP 단계에서 모바일(iOS/Android) 리소스가 필요한지 확인 부탁.


2. 제안되는 다음 단계

  1. 설치 → 첫 PR 코멘트 → 작성자 응답 → AI 후속 질문까지의 유저 플로우 다이어그램 작성.
  2. 토큰/PR, PR/팀/일, OpenAI 단가 등을 포함한 간단한 비용 모델 스프레드시트 작성.
  3. GitHub App 권한 목록 및 데이터 보존 정책 초안.
  4. 2주 스프린트 기준 MVP 백로그와 완료 기준 정의.

3. 진행을 위한 질문

아래 항목을 답변(또는 추정)해주시면 MVP 범위를 확정하고 역할 배분이 가능합니다.

  1. 선호하는 사용자 인터랙션 방식(코멘트, Check‑Run, 둘 다)?
  2. 프롬프트 템플릿/대화 컨텍스트 저장 위치?
  3. 파일럿 단계에서 지원하고 싶은 일일 최대 PR 수?
  4. Day 1에 반드시 충족해야 하는 보안/컴플라이언스 요구사항?
  5. 우선 시험해보고 싶은 가격 모델?

확인 후 추가 논의 기대하겠습니다. 🙌

@zootyducky
Copy link
Contributor Author

GitHub 내 트리거 & UX
• AI 응답 형태: PullRequest에 comment 형식으로
• 사용자는 어떻게 옵트인하나요? (특정 PR 라벨, 설정 파일, 슬래시 커맨드 등) - Hackathon 레포지토리에 AI_Idea_Notes 폴더안에 .md파일을 작성하고 풀리퀘스트를 날리면, 시스템이 판단
• 작성자와 AI 간 반복 대화는 어떤 UI로 보이나요? (스레드 코멘트, 요약 업데이트 등) - Pull Request comment로 커뮤니케이션

프롬프트 & 컨텍스트 관리
• 프롬프트 템플릿과 대화 히스토리는 어디에 저장하나요? (Firestore, 레포 YAML 등) - pr 별로 firebase realtime database에 저장
• 조직별/레포별 커스터마이징이 가능한가요? - 일단은 커스터마이징은 신경안쓰고 이 레포지토리에만 적용

보안 / 컴플라이언스
• GitHub App 권한 범위(읽기 전용 코드, PR 등)는? - 이 깃헙 레포지토리에만 한정, Github Personal Access Key에 권한 설정으로 권한 지정할 에정

시스템 아키텍처
• LLM 호출 지연을 대비해 Cloud Tasks 같은 큐가 필요한가요? - 필요없음
• MVP 예상 피크 처리량(PR/일)과 OpenAI 레이트 리밋 대응 전략? - 일단은 지금 레포지토리에 사용량이 많지 않아서 빠르게 개발하는것을 목표로
• 토큰 사용량 절감을 위한 캐싱/임베딩 계층 고려? - 추후 고려

비용 & 일정
• 3–4주 MVP에 포함되는 기능 범위? (설치 플로우, 1회 프롬프트 왕복, 미니 대시보드 등) - 대쉬보드도 없고 그냥 깃헙 pr에 리뷰다는 정도

수익화
지금은 생각안함

경쟁/차별화
• “ReviewGPT”, “Sweep AI” 등 유사 GitHub App 분석 여부? - 다른 앱을 테스트해보지 않아서 잘 모르겠음.
• 차별점: 대화형 뿐 아니라 프롬프트 라이브러리 관리, 도메인 특화 리뷰 모드 등 명시 필요. - 생각해보지 않았음

팀 리소스
• 1개월 MVP에 필요한 역할(백엔드, GitHub App 개발, 대시보드 프론트, 브랜드 디자이너) 동시 투입 가능? - 디자인 딱히 필요없음, 개발자 1명
• MVP 단계에서 모바일(iOS/Android) 리소스가 필요한지 확인 부탁. - 필요없음

선호하는 사용자 인터랙션 방식(코멘트, Check‑Run, 둘 다)? 풀리퀘스트 코멘트
프롬프트 템플릿/대화 컨텍스트 저장 위치? firebase realtime database에 대화 컨텍스트 저장, 프롬프트는 cloudfunction에서 static하게 관리
파일럿 단계에서 지원하고 싶은 일일 최대 PR 수? 최대 20개 정도
Day 1에 반드시 충족해야 하는 보안/컴플라이언스 요구사항? firebase function을 gihub webhook으로 트리거하는데, 이때 github webhook을 secret으로 검증
우선 시험해보고 싶은 가격 모델? o3-2025-04-16 모델 사용할 예정 (open AI)

@mossland
Copy link
Contributor

💬 Follow‑up Review – Narrowed MVP scope

(English version first, Korean version follows)


1. What’s now clear

✅ PR‑comment–only UX with an opt‑in rule: “any PR containing a .md file under AI_Idea_Notes/”.
✅ Conversation context saved per‑PR in Firebase Realtime DB; prompt templates kept statically in Cloud Functions code.
✅ Single‑repo pilot, ≤ 20 PRs/day, no dashboard, 1 developer, 3‑4 week window.
✅ GitHub Webhook secured with a shared secret; a Personal Access Token (PAT) used to post comments.

Great—this sharply limits the initial blast radius and lets us move fast.
Below are the last few items we still need before development can start.


2. Remaining “developer‑blocking” gaps

  1. Event Flow Specification
    We need an explicit, step‑by‑step sequence diagram or bullet list:
    a. PR opened/updated ➜ GitHub fires webhook ➜ Cloud Function X validates secret ➜ reads changed files ➜ decides if .md exists under AI_Idea_Notes/ ➜ …
    b. At which points do we read/write Firebase?
    c. How do we detect the author’s follow‑up reply vs a new PR update?

  2. Firebase Realtime DB Schema
    A small JSON skeleton is enough, e.g.:

    /conversations/{pr_id}: {
      repo: "",
      pr_number: 0,
      history: [ {role:"user", msg:""}, {role:"assistant", msg:""} ],
      last_ts: 0
    }

    • Please confirm/adjust keys, especially anything you want for rate‑limit or status flags.

  3. Prompt Template Versioning
    Static in code is fine, but:
    • Should we keep them in /prompts/*.txt and bundle at deploy?
    • Do we expect multiple 'modes' later (idea review vs security review)? If yes, add a small enum now so migration is trivial.

  4. Secrets & Deployment
    • Where will the PAT live? (firebase functions:config:set github.token="…")
    • Any rotation strategy or is manual replacement OK for pilot?
    • Node runtime version & memory/timeout settings for the function.

  5. Error / Rate‑limit Handling
    Even with 20 PRs/day, OpenAI or GitHub could throttle.
    • Minimal retry/back‑off policy? (Exponential backoff 3 attempts?)
    • Log to Firebase Log + optional Slack DM to maintainer on failure?

  6. Local Dev & Unit Tests
    • Will we use firebase emulators:start + nock to stub GitHub?
    • Bare‑minimum test cases you want (signature validation, prompt build, comment post)?

  7. Milestone Breakdown (3–4 weeks)
    Suggest splitting into:
    • W1: repo setup, GitHub webhook, secret validation, dry‑run echo bot.
    • W2: OpenAI prompt engine, Firebase schema, initial comment generation.
    • W3: conversation reply detection, context stitching, basic retries.
    • W4: polish, README, PAT setup doc, internal QA on 5–10 sample PRs.
    Please tweak if you prefer another order.


3. Quick Questions to close the spec

(Answer in one‑liners is fine.)

  1. Exact JSON schema for the conversation node—ok to copy the sample above?
  2. Any wording/brand you want the bot to use for its GitHub username & comment header?
  3. Node.js runtime version you prefer (18 LTS by default)?
  4. Who gets notified on fatal errors—email, Slack, none?
  5. Minimum logging level you require (info, error, etc.)?

Once we confirm these, we can open tasks/issues and start coding. 🚀


💬 추가 리뷰 – MVP 범위 확정 직전


1. 현재까지 명확해진 사항

✅ PR 코멘트 전용 UX, 옵트인 규칙: AI_Idea_Notes/ 하위 .md 파일이 포함된 PR.
✅ PR별 대화 컨텍스트는 Firebase Realtime DB 저장, 프롬프트는 Cloud Functions 코드에 정적 관리.
✅ 단일 레포, 일일 최대 20 PR, 대시보드 없음, 1명 개발, 3–4주 일정.
✅ GitHub Webhook은 시크릿 검증, 코멘트 작성은 PAT 사용.

이제 정말 세부 사양만 확정하면 바로 개발에 착수할 수 있습니다.


2. 아직 필요한 개발 필수 정보

  1. 이벤트 플로우 상세
    • PR 열림/업데이트 → 웹훅 → 시크릿 검증 → 변경 파일 확인 → .md 존재 여부 → …
    • 어떤 시점에 Firebase 읽기/쓰기?
    • 작성자 후속 댓글과 새로운 PR 업데이트를 어떻게 구분?

  2. Firebase Realtime DB 스키마
    예시:

    /conversations/{pr_id}: {
      repo: "",
      pr_number: 0,
      history: [ {role:"user", msg:""}, {role:"assistant", msg:""} ],
      last_ts: 0
    }

    • 키/필드 수정이 필요하면 알려주세요.

  3. 프롬프트 템플릿 버전 관리
    /prompts/*.txt 식으로 코드에 포함 예정 → OK?
    • 차후 다중 모드(아이디어 리뷰, 보안 리뷰 등) 가능성을 고려해 enum 필드 추가 여부?

  4. 시크릿 & 배포
    • PAT 저장 위치(firebase functions:config) 확인.
    • 파일럿 단계에서 수동 교체만으로 충분한지?
    • 함수의 Node 런타임 버전, 메모리/타임아웃 설정.

  5. 오류 / 레이트리밋 대응
    • 최소한의 재시도(지수 백오프 3회 등) 정책 필요.
    • 실패 시 Firebase Log + Slack 알림 여부?

  6. 로컬 개발 & 단위 테스트
    firebase emulators:start + nock으로 GitHub 목킹 사용?
    • 필수 테스트 케이스(시그니처 검증, 프롬프트 생성, 코멘트 발행) 정의.

  7. 마일스톤(3–4주) 제안
    • 1주차: 레포 설정, 웹훅, 시크릿 검증, 에코 봇.
    • 2주차: OpenAI 연동, Firebase 스키마, 첫 코멘트 생성.
    • 3주차: 대화 이어쓰기, 컨텍스트 관리, 재시도 로직.
    • 4주차: 문서화, PAT 설정 가이드, 샘플 PR 5–10개 QA.
    원하시는 순서/내용으로 조정 가능합니다.


3. 사양 확정을 위한 빠른 질문

(간단히 한 줄씩 답주시면 됩니다.)

  1. 대화 노드 JSON 스키마—위 예시 그대로 사용해도 될까요?
  2. 봇 GitHub 사용자명 및 코멘트 헤더 문구 지정할 것 있나요?
  3. Node.js 런타임 버전(18 LTS 기본) 문제 없나요?
  4. 치명적 오류 발생 시 알림 방법(이메일, Slack, 없음)?
  5. 원하는 최소 로그 레벨(info, error 등)?

이 5가지만 확인되면 이슈를 생성하고 개발에 착수하겠습니다. 🚀

@zootyducky
Copy link
Contributor Author

  1. 대화 노드 JSON 스키마—위 예시 그대로 사용해도 될까요?
    아니오. 구현을 이미 어느정도 완료했는데,
interface IChat {
"role": "user" | "system",
"content": string
}

const chatData: Array<IChat> = db.ref(...)...

이런식으로 저장중

  1. 봇 GitHub 사용자명 및 코멘트 헤더 문구 지정할 것 있나요?
    없음. 레포지토리 소유자 PAT 사용해서 레포 소유자 사용자명으로 코멘트할예정.
    PAT는 google secret manager로 관리하고, cloudfunction에서 secret으로 사용

  2. Node.js 런타임 버전(18 LTS 기본) 문제 없나요?
    cloudfunction v2 사용할 것이라 Node20 사용중

  3. 치명적 오류 발생 시 알림 방법(이메일, Slack, 없음)?
    일단은 없음.

  4. 원하는 최소 로그 레벨(info, error 등)?
    info, error 정도. cloudfunctions에서 제공하는 기본기능사용

@mossland
Copy link
Contributor

🔄 Second-Round Review – Spec almost ready

(English first, Korean follows)


1. Confirmed Updates

• Chat history will be stored as an Array<IChat> where
role ∈ { "user", "system" } and content : string.
• Comments will be posted with the repo owner’s PAT (kept in Google Secret Manager).
• Cloud Functions v2 on Node 20.
• No external error alerting for now; rely on default Cloud Functions logs (info, error).

Great—we are down to “last-mile” details.


2. Remaining blocking items (tiny but important)

  1. Role set may be incomplete
    ‑ Current schema has only "user" & "system".
    ‑ We will definitely need an "assistant" role to reconstruct past replies.
    ➜ Can we extend the enum to "user" | "assistant" | "system" now?
    (Even if you don’t use "assistant" immediately, adding it avoids a breaking migration.)

  2. Event / State flow (single page is enough)
    We still need a bullet-level or sequence-diagram description, e.g.:

    PR event → validate secret → list changed files  
            ↳ if no *.md in AI_Idea_Notes → exit  
            ↳ else:
                 · fetch /conversations/{pr_id} (if any)  
                 · append new 'user' node (file diff or author reply)  
                 · call OpenAI → receive 'assistant' text  
                 · push 'assistant' node to Firebase  
                 · POST comment to PR  
    

    Please confirm / tweak so dev can copy-paste into code comments.

  3. “Reply vs PR update” detection rule
    • Are we treating every new comment by the PR author as a new user message?
    • Or only comments that tag the bot (@AI-Bot) ?
    A one-sentence rule prevents ambiguity later.

  4. Rate limit & retry (minimal)
    We can survive without fancy queues, but we still need:
    • One exponential back-off loop (3 attempts) on OpenAI 429/5xx.
    • A cooldownUntil field in Firebase so we don’t hammer the same PR repeatedly if it’s failing.
    Is that acceptable?

  5. Unit test & emulator plan
    • OK to limit to signature verification + OpenAI call stub + comment post?
    • Any objection to using firebase emulators + octokit/rest mock (nock) ?


3. Tiny follow-ups (yes/no answers welcome)

  1. Add "assistant" role to IChat?
  2. Exact rule for “this is a new user message”:
    a) any author comment, b) only @bot, c) diff-based only, d) other?
  3. Accept simple 3-attempt exponential back-off?
  4. OK with the minimal unit-test set above?
  5. Time-out / memory settings for the function (default 1 GB / 60 s OK?)

Once we lock these, we can open GitHub issues and hand work to the developer. 🚀


🔄 2차 리뷰 – 거의 마무리 단계


1. 확정된 사항

• 채팅 히스토리는 Array<IChat> 형태(role = "user" | "system", content : string).
• 코멘트는 레포 소유자 PAT으로 작성(Secret Manager 보관).
• Cloud Functions v2, Node 20.
• 외부 알림 없음, 기본 로그(info, error) 사용.

좋습니다. 이제 정말 세부 몇 가지만 남았습니다.


2. 남은 필수 세부 항목

  1. role 확장 필요
    "assistant" 항목이 빠져 있으면 과거 봇 답변을 복원하기 어렵습니다.
    ‑ 지금 미리 "assistant"까지 넣어두면 추후 마이그레이션을 피할 수 있습니다.

  2. 이벤트 / 상태 플로우 문서
    코드 주석으로 바로 넣을 수 있도록 순서도 or 글머리표 한 장만 작성 부탁드립니다.

  3. “작성자 댓글 vs PR 업데이트” 판별 규칙
    • PR 작성자의 모든 댓글을 ‘user 메시지’로 볼 것인가,
    • 아니면 @AI-Bot 식으로 멘션한 것만 처리할 것인가?
    명확히 해두어야 로직 구현이 깔끔합니다.

  4. 레이트 리밋 & 재시도
    • OpenAI 429/5xx 시 3회 지수 백오프 → 실패 시 cooldownUntil 저장 (예: 15 분).
    괜찮을까요?

  5. 단위 테스트 & 에뮬레이터
    시그니처 검증 + OpenAI 스텁 + 코멘트 POST 정도로 최소화 OK?
    firebase emulators + nock 사용 예정.


3. 빠른 확인 질문 (간단히 답 주시면 됩니다)

  1. IChat"assistant" role 추가할까요?
  2. “새로운 user 메시지” 규칙:
    a) 작성자 댓글 전부, b) @bot 멘션 시, c) diff 기반, d) 기타?
  3. 3회 지수 백오프 방식 수용 가능?
  4. 위 최소 단위 테스트 범위 OK?
  5. 함수 타임아웃/메모리 기본값(1 GB / 60 초) 괜찮나요?

이 항목들이 확정되면 이슈를 발행하고 바로 개발에 들어가겠습니다. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants