Generate production-ready SOP documents from Stage 2 extraction results, with a verification loop that tests each SOP against real conversations. **Language:** Auto-detects Korean (한국어) or Japanese (日本語) from user input.
Generate SOP documents from Stage 2 results, then verify each SOP by testing it against real conversations to catch gaps and improve quality.
Language: Detect the language from the user's first message and respond in that language throughout. Support Korean (한국어) and Japanese (日本語). Default to Korean if language is unclear.
Input: Stage 2 results (patterns.json with sop_topic_map, faq.json, patterns_enriched.json)
Output: SOP files (.sop.md) in results/{company}/03_sop/
Key Change from Previous Version: Instead of spending tokens on elaborate format constraints, this version invests tokens in a verification loop — generate the SOP, then test it against real conversations to find and fix gaps.
results/{company}/02_extraction)"customer_support", "troubleshooting", or "sales"Read all Stage 2 outputs:
patterns.json — patterns + sop_topic_map (authoritative topic plan)faq.json — FAQ pairs by SOP topicpatterns_enriched.json — full conversation transcripts per clusterConstraints:
sop_topic_map exactly — one SOP per topic, no additions or removalstemplates/HT_template.md and templates/TS_template.mdBefore writing any SOP, mine patterns_enriched.json for actionable details per topic.
Extract from agent messages:
Extract from customer messages:
Extraction Guardrails:
For each topic in sop_topic_map, generate one SOP file.
File naming: HT_{여정단계}_{주제}.sop.md or TS_{여정단계}_{주제}.sop.md
Template: Follow templates/HT_template.md for HT, templates/TS_template.md for TS. Do NOT use Overview/Parameters/Steps/Examples structure.
Each Case under 해결책 안내 MUST include:
{placeholder} + <!-- TODO --> if not foundFor TS SOPs: Follow non-destructive order (least → most invasive steps), with confirmation checkpoint after each step.
Constraints:
results/{company}/03_sop/ (or 03_sop_v2/ if already exists)This is the key quality improvement step. After generating each SOP, test it against 3-5 real conversations from that topic's enriched data.
Process per SOP:
patterns_enriched.json that belong to this topic (prefer diverse scenarios). E.g., Case 4개 → 8건, Case 2개 → 4건.Conversation ID: {id}
Customer issue: "취소하고 싶은데 수수료가 얼마인가요?"
SOP coverage: ⚠️ Partial — SOP mentions 취소 방법 but doesn't cover 수수료 안내
Missing: 지역별 취소수수료 차이 설명, 바우처에서 확인하는 방법
Constraints:
extraction_summary.mdExpected Output per SOP:
✅ SOP 검증 완료: HT_예약전_차량검색.sop.md
테스트 대화: 5건
완전 커버: 3건 (60%)
부분 커버: 2건 (40%) → Case 3에 수수료 안내 추가, Step 2에 앱 경로 보강
미커버: 0건
After all SOPs are generated and verified:
metadata.json with version, source files, statistics, verification resultsextraction_summary.md with SOP list and verification coverageOutput Summary:
✅ Stage 3 완료: {N}개 SOP 생성 + 검증
저장 위치: results/{company}/03_sop/
검증 결과:
총 테스트 대화: {M}건
평균 커버율: {X}%
보강된 SOP: {Y}개
| Issue | Solution |
|---|---|
| Cases too generic ("확인해 주세요") | Re-read enriched conversations, extract actual agent messages near-verbatim |
| Cases describe technical causes, not customer scenarios | Rewrite from customer perspective: "고객이 [X]를 하려 하나 [Y] 상태라 불가한 경우" |
| Verification shows >50% gaps | Topic may need more data — go back to Stage 2 and increase samples for that cluster |
| No internal tool paths in data | Use {placeholder} + <!-- TODO --> — never invent URLs |
HT_template.md, TS_template.md) define structure — this SKILL focuses on content quality and verification