Skip to content

[Enhancement] 챌린지 루틴 생성 AI 프롬포트 개선#139

Merged
ssyoung02 merged 5 commits intodevelopfrom
137-feature/improve-challenge-prompt
Jan 22, 2026
Merged

[Enhancement] 챌린지 루틴 생성 AI 프롬포트 개선#139
ssyoung02 merged 5 commits intodevelopfrom
137-feature/improve-challenge-prompt

Conversation

@ssyoung02
Copy link
Contributor

🛠 Related issue 🛠

✏️ Work Description ✏️

  • 챌린지 루틴 생성 AI 프롬포트 개선

📸 Screenshot 📸

설명 사진
N/A N/A

😅 Uncompleted Tasks 😅

📢 To Reviewers 📢

@ssyoung02 ssyoung02 requested a review from Kimgyuilli January 22, 2026 13:51
@ssyoung02 ssyoung02 self-assigned this Jan 22, 2026
@ssyoung02 ssyoung02 linked an issue Jan 22, 2026 that may be closed by this pull request
@ssyoung02 ssyoung02 added the 우선순위: P2 일정 여유 시 처리, 개선 사항 및 minor 버그 label Jan 22, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

챌린지 프롬프트 템플릿을 상세화하고 OpenAI 기본 모델을 변경했습니다. Java 프롬프트 파일은 7일 챌린지 지향의 엄격한 JSON 출력 템플릿과 내부 검증 규칙으로 대체되었고, 설정 파일에서 기본 모델을 gpt-4.1-mini로 변경했습니다.

Changes

코호트 / 파일(들) 변경 사항 요약
프롬프트 템플릿 개선
src/main/java/com/sopt/cherrish/domain/challenge/recommendation/infrastructure/prompt/ChallengePromptTemplate.java
기존 간단 한국어 프롬프트를 7일 챌린지용 상세 템플릿으로 교체: 앱 컨텍스트 추가, 카테고리 처리, 금지 용어 및 구성 규칙(6개 루틴, 제목/요약 구성 등), 내부 검증 단계 및 JSON 전용 출력 요구로 제약 강화
OpenAI 설정 변경
src/main/resources/application-openai.yaml
기본 OpenAI 모델 환경변수 값을 gpt-3.5-turbo에서 gpt-4.1-mini로 변경

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

🔨 Refactor

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 AI 프롬포트 개선이라는 주요 변경사항을 명확하게 요약하고 있으며, 코드 변경의 핵심 목적을 잘 나타냅니다.
Description check ✅ Passed PR 설명이 관련 이슈(#137)를 명시하고 챌린지 루틴 생성 AI 프롬포트 개선이라는 변경사항과 일관성이 있습니다.
Linked Issues check ✅ Passed PR의 코드 변경(프롬포트 개선 및 모델 업그레이드)이 이슈 #137의 '챌린지 프롬포트 개선' 목표를 충족합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 프롬포트 개선 목표와 관련이 있으며, 추가적인 범위 외 변경사항은 발견되지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 137-feature/improve-challenge-prompt

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In
`@src/main/java/com/sopt/cherrish/domain/challenge/recommendation/infrastructure/prompt/ChallengePromptTemplate.java`:
- Around line 42-45: The prompt in ChallengePromptTemplate currently forbids the
standalone token "주", which overly blocks valid words (e.g., 주름, 주기); update the
forbidden-frequency rules to use concrete patterns instead of the single
character: replace "주" with explicit patterns like "주 1회", "주간", or
numeric/phrasing patterns (e.g., "주\\s*\\d+회", "주간") or regex equivalents so
only intended weekly-frequency phrases are matched; edit the frequency list in
ChallengePromptTemplate (the 1) 빈도 entry) to use those specific patterns/regexes
and ensure other frequency tokens (매일, 일일, N회/N번, 항상, 매번) remain unchanged.
- Around line 49-51: ChallengePromptTemplate에 포함된 JSON 예시에서 중괄호가 이중으로 들어가 JSON
파서가 실패할 수 있으니 템플릿 내 해당 JSON 블록(현재 "{{\n  \"routines\": [...] \n}}" 형태)을 단일 중괄호로
바꿔 JSON을 유효하게 만드세요; ChallengePromptTemplate 클래스 내부의 템플릿 문자열 상수나 메서드(예: prompt
템플릿을 반환하는 변수/메서드)를 찾아 "{{"와 "}}"를 각각 "{"와 "}"로 수정하면 됩니다.
- Around line 18-40: The examples in ChallengePromptTemplate (class
ChallengePromptTemplate) contradict the forbidden/format rules: remove or
replace any forbidden items (e.g., "샤워", "PDRN", "괄사", "닦토", English/외래어 like
"폰") and non-standard terms with compliant Korean equivalents (e.g., "샤워 후" →
remove or replace with allowed everyday action, "PDRN 마스크팩" → "보습 마스크팩", "괄사" →
"페이스 마사지", "폰" → "휴대폰"), ensure each example routine is an action-oriented
Korean sentence ≤20 characters and denotes a daily action (no "주 N회"), and
update all category examples in ChallengePromptTemplate.java to follow these
constraints so examples no longer conflict with the "[절대 금지]" and "[작성 규칙]"
sections.

Copy link
Contributor

@Kimgyuilli Kimgyuilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@ssyoung02 ssyoung02 merged commit ed8eae0 into develop Jan 22, 2026
2 checks passed
@Kimgyuilli Kimgyuilli added the 도메인: 챌린지🏆 챌린지 관련 기능 작업 label Feb 20, 2026
@Kimgyuilli Kimgyuilli changed the title [Refactor] 챌린지 루틴 생성 AI 프롬포트 개선 [Enhancement] 챌린지 루틴 생성 AI 프롬포트 개선 Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

담당: 서영 🦊 서영 담당 작업 도메인: 챌린지🏆 챌린지 관련 기능 작업 우선순위: P2 일정 여유 시 처리, 개선 사항 및 minor 버그

Projects

None yet

Development

Successfully merging this pull request may close these issues.

챌린지 프롬포트 개선

2 participants