| name | stage3-sop-generation |
| description | This SOP guides the generation of a production-ready Agent SOP document from extracted patterns and FAQs. This is **Stage 3** (final stage) of the Userchat-to-SOP pipeline, performed entirely by the AI agent using natural language composition. **Language:** Auto-detects Korean (ํ๊ตญ์ด) or Japanese (ๆฅๆฌ่ช) from user input. **Stage Flow:** - **Input**: Stage 2 extraction results (JSON files with patterns, FAQs, strategies) - **Process**: LLM composition of Agent SOP following standard format - **Output**: Agent SOP document (.sop.md) ready for deployment **Key Capabilities:** - Generate Agent SOP in standardized format (RFC 2119 compliant) - Transform extracted patterns into parameterized workflows - Create constraint-based steps with MUST/SHOULD/MAY keywords - Include examples and troubleshooting sections - Ensure reusability across different customer support scenarios |
Stage 3: Agent SOP Generation
Overview
This SOP guides the generation of a production-ready Agent SOP document from extracted patterns and FAQs. This is Stage 3 (final stage) of the Userchat-to-SOP pipeline, performed entirely by the AI agent using natural language composition.
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.
Stage Flow:
- Input: Stage 2 extraction results (JSON files with patterns, FAQs, strategies)
- Process: LLM composition of Agent SOP following standard format
- Output: Agent SOP document (.sop.md) ready for deployment
Key Capabilities:
- Generate Agent SOP in standardized format (RFC 2119 compliant)
- Transform extracted patterns into parameterized workflows
- Create constraint-based steps with MUST/SHOULD/MAY keywords
- Include examples and troubleshooting sections
- Ensure reusability across different customer support scenarios
Parameters
Required
Optional
Steps
1. Load and Analyze Extraction Results
Read all Stage 2 outputs to understand extracted patterns and strategies.
Constraints:
- You MUST read the SOP templates BEFORE generating any SOP file:
templates/HT_template.md: HT SOP ๊ตฌ์กฐ ๊ธฐ์ค (๋ชฉ์ /์ฃผ์์ฌํญ/๋ด์ฉ/ํค์ค๋งค๋/์์ค์ปฌ๋ ์ด์
)
templates/TS_template.md: TS SOP ๊ตฌ์กฐ ๊ธฐ์ค (๋ชฉ์ /์ฃผ์์ฌํญ/๋ฌธ์ ํด๊ฒฐํ๋ก์ธ์ค/ํค์ค๋งค๋/์์ค์ปฌ๋ ์ด์
)
- ์์ฑํ๋ ๋ชจ๋ SOP๋ ๋ฐ๋์ ์ด ํ
ํ๋ฆฟ ๊ตฌ์กฐ๋ฅผ ๋ฐ๋ผ์ผ ํ๋ค
- You MUST read all JSON files from Stage 2:
patterns.json: Patterns per cluster + sop_topic_map (authoritative SOP plan from Stage 2)
faq.json: FAQ pairs (organized by SOP topic)
response_strategies.json: Response strategies per SOP topic
keywords.json: Keyword taxonomy
extraction_summary.md: Summary and automation opportunities
- You MUST read enriched patterns (required, not optional):
6.
patterns_enriched.json: Patterns with 20 real conversation transcripts per cluster
- Contains full conversation
turns (not summaries)
- Contains tone-and-manner samples per cluster
- Read the actual
turns in each conversation to extract real customer expressions, agent response templates, and troubleshooting steps
- You MUST verify JSON structure is valid
- You MUST follow
sop_topic_map from patterns.json โ this is the authoritative plan from Stage 2
- DO NOT re-classify clusters or redefine SOP topics
- DO NOT add or remove topics beyond what the map specifies
- Each topic in the map becomes exactly one SOP file
- You SHOULD identify which patterns will become SOP steps
- You MAY skip low-frequency patterns within a topic (< 2%), but NOT the topic itself
Reading Process:
Read results/{company}/02_extraction/patterns.json
Read results/{company}/02_extraction/faq.json
Read results/{company}/02_extraction/response_strategies.json
Read results/{company}/02_extraction/keywords.json
Read results/{company}/02_extraction/extraction_summary.md
Read results/{company}/02_extraction/patterns_enriched.json
Analysis Checklist:
2. Design SOP Structure (from sop_topic_map)
Read the sop_topic_map from patterns.json and use it as the definitive SOP plan. Do NOT redesign the topic structure.
Using sop_topic_map (ํ์):
Stage 2 Step 3์์ ์ด๋ฏธ ํด๋ฌ์คํฐ๋ฅผ ๋ถ์ํ๊ณ SOP ํ ํฝ์ ์ ์ํ๋ค. Stage 3์ ์ด ๋งต์ ๊ทธ๋๋ก ๋ฐ๋ฅธ๋ค.
sop_topic_map์์ ๊ฐ์ ธ์ฌ ์ ๋ณด:
- topic_id โ SOP ํ์ผ๋ช
- title โ SOP ์ ๋ชฉ
- type (HT/TS) โ ์ฌ์ฉํ ํ
ํ๋ฆฟ
- journey_stage โ ํ์ผ๋ช
์ ๋์ฌ
- source_clusters โ ์ด๋ค ํด๋ฌ์คํฐ/๋ํ๋ฅผ ์ฐธ๊ณ ํ ์ง
- key_patterns โ SOP ๋ด์ฉ์ ํต์ฌ ํจํด
SOP ํ์ผ๋ช
๊ท์น:
HT_{์ฌ์ ๋จ๊ณ}_{์ฃผ์ }.sop.md โ ์ ๋ณด ์๋ด ์ค์ฌ
TS_{์ฌ์ ๋จ๊ณ}_{์ฃผ์ }.sop.md โ ๋ฌธ์ ํด๊ฒฐ ์ค์ฌ
์์:
HT_๊ตฌ๋งค์ _์ ํ๊ฒฌ์ ์๋ด.sop.md
TS_์ฌ์ฉ์ค_ํ๋์จ์ด๋ถ๋๋ฐ์๋ฆฌ.sop.md
Constraints:
- You MUST follow
sop_topic_map exactly โ one SOP per topic, no additions or removals
- You MUST follow
templates/HT_template.md for HT SOPs and templates/TS_template.md for TS SOPs
- You MUST NOT use Overview/Parameters/Steps/Examples ๊ตฌ์กฐ โ ํ
ํ๋ฆฟ์ ์๋ ์น์
์ ์ถ๊ฐํ์ง ๋ง ๊ฒ
- You MUST NOT redesign the topic structure or re-classify clusters (already done in Stage 2)
- You MUST read enriched conversations for each topic's
source_clusters when writing that SOP
- You SHOULD include all sections defined in the template (๋ชฉ์ , ์ฃผ์์ฌํญ, ๋ด์ฉ/๋ฌธ์ ํด๊ฒฐํ๋ก์ธ์ค, ํค์ค๋งค๋, ์์ค์ปฌ๋ ์ด์
, ๊ด๋ จSOP)
- You SHOULD add cross-references between related SOPs (๊ด๋ จ SOP ์น์
)
- You MAY merge similar patterns into single ์ผ์ด์ค under ํด๊ฒฐ์ฑ
์๋ด
- You MUST ensure each SOP has a clear, single responsibility
Design Decisions:
-
Step Granularity:
- Group related patterns: "์ถฉ์ _AS", "๋ฐฐํฐ๋ฆฌ_AS" โ single Case under ํด๊ฒฐ์ฑ
์๋ด
- Keep distinct scenarios separate: each Case should represent a clearly different customer situation
-
Constraint Levels:
- MUST: Critical business rules (warranty verification, PII handling)
- SHOULD: Best practices (check history first)
- MAY: Optional enhancements (offer related products)
3. Extract Concrete Details from Enriched Conversations
Before writing any SOP, mine the enriched conversation data for concrete, actionable details.
Constraints:
- You MUST read
patterns_enriched.json โ each cluster's sample_conversations โ turns
- You MUST extract the following from actual manager (agent) messages in turns:
- Internal tool URLs/paths โ e.g.,
biz-crm.dmz.channel.io/accounts/{accountId}?tab=settings
- Step-by-step instructions agents actually gave โ copy near-verbatim, don't paraphrase
- Warning messages agents sent โ e.g., "๊ตฌ๊ธ ๋ก๊ทธ์ธ ๋ฒํผ์ผ๋ก ๋ค์ ์ ์ํ์๋ฉด ์ฌ์ฐ๋๋ฉ๋๋ค"
- Specific UI navigation paths โ e.g., "์ข์ธก ํ๋จ ํ๋กํ ์ด๋ฏธ์ง ํด๋ฆญ > [๊ณ์ ์ค์ ]"
- Conditional branches agents used โ e.g., "๋น๋ฐ๋ฒํธ๋ฅผ ์ค์ ํ ์ ์๋ ๊ฒฝ์ฐ โ ๋น๋ฐ๋ฒํธ ์ฐพ๊ธฐ ์๋ด"
- You MUST also extract from user messages:
- Common customer expressions โ how customers describe the problem in their own words
- Frequently asked follow-up questions
- You MUST use
tone_and_manner_samples for the ํค์ค๋งค๋ section
- You SHOULD create a per-topic extraction note before writing each SOP:
Topic: Setting_Account_๊ตฌ๊ธ์ฐ๋ํด์
Source clusters: [3, 7]
Extracted from conversations:
- Admin URL: biz-crm.dmz.channel.io/accounts/{accountId}?tab=settings
- Agent instruction: "๋ก๊ทธ์ธ ํ๋ฉด์์ '๊ตฌ๊ธ ๋ก๊ทธ์ธ' ๋ฒํผ์ด ์๋, ์ด๋ฉ์ผ ์
๋ ฅ๋์ ๊ธฐ์กด ์ด๋ฉ์ผ ์ฃผ์๋ฅผ ์ง์ ์
๋ ฅ"
- Warning: "๊ตฌ๊ธ ๋ก๊ทธ์ธ ๋ฒํผ์ผ๋ก ๋ค์ ์ ์ํ๋ฉด ์ฌ์ฐ๋๋จ"
- UI path: "์ข์ธก ํ๋จ ํ๋กํ ์ด๋ฏธ์ง ํด๋ฆญ > [๊ณ์ ์ค์ ] > '๋ก๊ทธ์ธ ๊ณ์ '"
- Customer expression: "์ด๋ฉ์ผ ๋ณ๊ฒฝ์ด ์ ๋ผ์", "๊ตฌ๊ธ ๋ก๊ทธ์ธ ํด์ ํด์ฃผ์ธ์"
- Condition: "๋น๋ฐ๋ฒํธ ๋ฏธ์ค์ โ ๋น๋ฐ๋ฒํธ ์ฐพ๊ธฐ ์๋ด"
Why this matters:
- Without concrete details, SOPs become generic (e.g., "๋ด๋ถ ์ด๋๋ฏผ์์ ํ์ธ" instead of actual URL)
- The enriched data contains real agent responses โ use them as the foundation, not as mere reference
โ ๏ธ Extraction Guardrails (๋ฐ๋์ ์ค์):
-
์์ธ ์กฐ์น vs ํ์ค ์ ์ฐจ ๊ตฌ๋ถ: ๋ํ์์ ์๋ด์์ด ์ํํ ์กฐ์น๊ฐ ํ์ค ์ ์ฐจ์ธ์ง ๋น์/์์ธ ์กฐ์น์ธ์ง ํ๋จํด์ผ ํ๋ค. ๋ค์ ํจํด์ ์์ธ ์กฐ์น์ผ ๊ฐ๋ฅ์ฑ์ด ๋์ผ๋ฏ๋ก SOP์ ํ์ค Step์ผ๋ก ํฌํจํ์ง ์๋๋ค:
- ๋ณด์ ์ธ์ฆ ์ ๋ณด(์ธ์ฆ์ฝ๋, OTP ๋ฑ)๋ฅผ ์ฑํ
/๋ฌธ์๋ก ์ง์ ์ ๋ฌํ๋ ํ์
- ๋ด๋ถ ์์คํ
์ ์ฐํํ๋ ์์ ์กฐ์น (์: ์๋ ์ฐจ๋จ ํด์ ํ ์ฌ์ฐจ๋จ ๋ฐ์)
- ์๋ด์์ด "ํ ๋ฒ๋ง ๋ ์๋ํด๋ณด๊ณ " ๋ฑ์ ์ํ์ฐฉ์ค๋ฅผ ๋ฐ๋ณตํ๋ ๊ตฌ๊ฐ
- ์์ค์ปฌ๋ ์ด์
ํ Tier2๊ฐ ์ฒ๋ฆฌํ ํน์ ์กฐ์น
โ ์ด๋ฐ ์กฐ์น๊ฐ ๋ํ์ ์๋๋ผ๋ SOP์๋ ์์ค์ปฌ๋ ์ด์
์กฐ๊ฑด์ผ๋ก๋ง ๊ธฐ์ฌํ๋ค.
-
FAQ ๋ฌธ๊ตฌ์ ๊ณผ์ ์ผ๋ฐํ ๊ธ์ง: FAQ์ "์ธ์ผ์ฆํ์ ๋ฌธ์", "๊ธฐ์ ํ์ ํ์ธ" ๋ฑ์ ํํ์ด ์๋ค๊ณ ํด์ ํด๋น ํ ํฝ์ ๋ชจ๋ Case๋ฅผ ์์ค์ปฌ๋ ์ด์
์ผ๋ก ์ฒ๋ฆฌํ์ง ์๋๋ค.
- FAQ์ ์์ค์ปฌ๋ ์ด์
๋ฌธ๊ตฌ๋ ํด๋น FAQ ์ง๋ฌธ์ ๋งฅ๋ฝ์๋ง ์ ์ฉํ๋ค.
- ๊ฐ์ ํ ํฝ ๋ด์์๋ CXํ์ด ์ง์ ์ฒ๋ฆฌ ๊ฐ๋ฅํ Case์ ์์ค์ปฌ๋ ์ด์
์ด ํ์ํ Case๋ฅผ ๋ถ๋ฆฌํ๋ค.
- ์์ค์ปฌ๋ ์ด์
๊ธฐ์ค์ด ๋ถ๋ช
ํํ ๊ฒฝ์ฐ,
<!-- TODO: ์์ค์ปฌ๋ ์ด์
๊ธฐ์ค ํ์ธ ํ์ --> ์ฃผ์์ ๋จ๊ธด๋ค.
-
๋ฌธ์ ์ ํ ํผ์ฌ ๋ฐฉ์ง: ํ๋์ Case ์์ ์๋ก ๋ค๋ฅธ ๋ฌธ์ ์ ํ์ Step์ด ์์ด์ง ์๋๋ก ํ๋ค.
- ๊ฐ Case๋ ํ๋์ ๊ณ ๊ฐ ์๋๋ฆฌ์ค๋ง ๋ค๋ค์ผ ํ๋ค.
- ๋ํ ์๋ฌธ์์ ์ฌ๋ฌ ์ด์๊ฐ ์ฐ์์ผ๋ก ๋ฐ์ํ ๊ฒฝ์ฐ, ๊ฐ ์ด์๋ฅผ ๋ณ๋ Case๋ก ๋ถ๋ฆฌํ๋ค.
- Case ๊ฐ ์ฐธ์กฐ("Case N ์ฐธ์กฐ")๋ก ์ฐ๊ฒฐํ๋, Step์ ํผํฉํ์ง ์๋๋ค.
4. Write SOP Content (ํด๊ฒฐ์ฑ
์๋ด โ Case-by-Case)
This is the most critical step. Each SOP's ํด๊ฒฐ์ฑ
์๋ด section must contain Case-by-Case breakdowns with production-ready detail.
Constraints:
- You MUST follow the template structure exactly:
- HT SOPs โ
templates/HT_template.md (๋ชฉ์ โ ์ฃผ์์ฌํญ โ ๋ด์ฉ โ ํค์ค๋งค๋ โ ์์ค์ปฌ๋ ์ด์
)
- TS SOPs โ
templates/TS_template.md (๋ชฉ์ โ ์ฃผ์์ฌํญ โ ๋ฌธ์ ํด๊ฒฐํ๋ก์ธ์ค โ ํค์ค๋งค๋ โ ์์ค์ปฌ๋ ์ด์
)
- You MUST NOT use Overview/Parameters/Steps/Examples structure โ that is for Agent Skills, not SOP documents
- For TS SOPs: You MUST follow the ๋นํ๊ดด์ ์์ (Non-Destructive Order) principle
- Order troubleshooting steps from least to most invasive
- Include "โ
ํด๊ฒฐ๋์๋์ง ํ์ธ" checkpoint after each troubleshooting step
- Reference: See
templates/TS_template.md for detailed guidance
Case Quality Requirements (MUST follow for every Case)
Each Case under ํด๊ฒฐ์ฑ
์๋ด MUST include ALL of the following elements:
| # | Required Element | Bad Example (generic) | Good Example (production-ready) |
|---|
| 1 | Case ํค๋ with ๋น๋ | Case 1: ์ธ์ฆ์ฝ๋ ๋ฏธ์์ (๋น๋: ๋์) | Case 1: ๋ก๊ทธ์ธ ์ด๋ฉ์ผ/๊ณ์ ๋ณ๊ฒฝ์ ์ํ ํด์ (๋น๋: ๋์ โ ์ ์ฒด์ 66.7%) |
| 2 | ์ฃผ์ ์ํฉ ์์ | ์ฃผ์ ์์ธ: ์ด๋ฉ์ผ ์์ ๊ฑฐ๋ถ | ์ฃผ์ ์ํฉ: ๊ณ ๊ฐ์ด ๊ณ์ ์ค์ ์์ ๋ก๊ทธ์ธ ์ด๋ฉ์ผ์ ๋ณ๊ฒฝํ๋ ค ํ๋, ๊ตฌ๊ธ ์ฐ๋ ์ํ๋ผ ์ด๋ฉ์ผ์ด ์ ๊ฒจ์์ด ์์ ์ด ๋ถ๊ฐํ ๊ฒฝ์ฐ |
| 3 | Step๋ณ ์๋ด ๋ฉํธ (๋ธ๋ก ์ธ์ฉ) | "์ด๋ฉ์ผ์ ํ์ธํด ์ฃผ์ธ์" | 3์ค ์ด์์ ๊ตฌ์ฒด์ ์๋ด + ๋ฒํธ ๋งค๊ธด ์ ์ฐจ (์๋ ์์ ์ฐธ์กฐ) |
| 4 | ๋ด๋ถ ๋๊ตฌ ๊ฒฝ๋ก | ๋ด๋ถ ์ด๋๋ฏผ์์ ํ์ธ | **๊ฒฝ๋ก:** biz-crm.dmz.channel.io/accounts/{accountId}?tab=settings |
| 5 | UI ๋ค๋น๊ฒ์ด์
๊ฒฝ๋ก | ์ค์ ์์ ๋ณ๊ฒฝ | ์ข์ธก ํ๋จ ํ๋กํ ์ด๋ฏธ์ง ํด๋ฆญ > **[๊ณ์ ์ค์ ]** > **'๋ก๊ทธ์ธ ๊ณ์ '** ํญ๋ชฉ |
| 6 | ์กฐ๊ฑด ๋ถ๊ธฐ (IF/THEN) | (์์) | ๋ณ๊ฒฝ์ด ์ ๋๋ ๊ฒฝ์ฐ, ๊ตฌ๊ธ ์ฌ์ฐ๋ ์ฌ๋ถ๋ฅผ ํ์ธํ๊ณ Step 2๋ถํฐ ๋ค์ ์งํ |
| 7 | โ ๏ธ ๊ฒฝ๊ณ /์ฃผ์ ๋ฌธ๊ตฌ | (์์) | โ ๏ธ **์ค์:** '๊ตฌ๊ธ ๋ก๊ทธ์ธ' ๋ฒํผ์ผ๋ก ๋ค์ ๋ก๊ทธ์ธํ์๋ฉด ๊ตฌ๊ธ ์ฐ๋์ด ์ฌ์ค์ ๋ฉ๋๋ค |
| 8 | ์๋ฃ ํ์ธ Step | (์์) | "์ด๋ฉ์ผ ๋ณ๊ฒฝ์ด ์ ์์ ์ผ๋ก ์๋ฃ๋์
จ๋์? ํ์ธ ํ ๋ฒ๋ง ๋ถํ๋๋ฆฝ๋๋ค." |
| 9 | Case ๊ฐ ์ฐธ์กฐ | (์์) | Case 1์ Step 2~4์ ๋์ผํ๊ฒ ์ฒ๋ฆฌํ๋ค |
Step ์๋ด ๋ฉํธ ์์ฑ ๊ธฐ์ค
๊ฐ Step์ ์๋ด ๋ฉํธ๋ ๋ธ๋ก ์ธ์ฉ(>) ํ์์ผ๋ก, ๊ณ ๊ฐ์๊ฒ ๋ณด๋ด๋ ์ค์ ๋ฉ์์ง ์์ค์ผ๋ก ์์ฑํ๋ค:
**Step 3. ์ฌ๋ก๊ทธ์ธ ์๋ด**
> "๊ตฌ๊ธ ์ฐ๋ ํด์ ๊ฐ ์๋ฃ๋์์ต๋๋ค. ์๋ ์์๋๋ก ์งํํด ์ฃผ์ธ์.
>
> 1. ํ์ฌ ์ฑ๋ํก์์ **๋ก๊ทธ์์**ํด ์ฃผ์ธ์.
> 2. ๋ก๊ทธ์ธ ํ๋ฉด์์ **'๊ตฌ๊ธ ๋ก๊ทธ์ธ' ๋ฒํผ์ด ์๋**, ์ด๋ฉ์ผ ์
๋ ฅ๋์ ๊ธฐ์กด ์ด๋ฉ์ผ ์ฃผ์๋ฅผ ์ง์ ์
๋ ฅํ์ฌ ๋ก๊ทธ์ธํด ์ฃผ์ธ์.
> 3. ๋ก๊ทธ์ธ ํ ์ข์ธก ํ๋จ ํ๋กํ ์ด๋ฏธ์ง ํด๋ฆญ > **[๊ณ์ ์ค์ ]** > **'๋ก๊ทธ์ธ ๊ณ์ '** ํญ๋ชฉ์์ ์ํ์๋ ์ด๋ฉ์ผ๋ก ๋ณ๊ฒฝํด ์ฃผ์ธ์.
>
> โ ๏ธ **์ค์:** '๊ตฌ๊ธ ๋ก๊ทธ์ธ' ๋ฒํผ์ผ๋ก ๋ค์ ๋ก๊ทธ์ธํ์๋ฉด ๊ตฌ๊ธ ์ฐ๋์ด ์ฌ์ค์ ๋์ด ์ด๋ฉ์ผ ๋ณ๊ฒฝ์ด ๋ค์ ๋ถ๊ฐ๋ฅํด์ง๋๋ค. ๋ฐ๋์ ์ด๋ฉ์ผ์ ์ง์ ์
๋ ฅํ๋ ๋ฐฉ์์ผ๋ก ๋ก๊ทธ์ธํด ์ฃผ์ธ์."
Where do these details come from?
- ๋ด๋ถ ๋๊ตฌ ๊ฒฝ๋ก, UI ๊ฒฝ๋ก:
patterns_enriched.json โ sample_conversations โ manager turns์์ ์ถ์ถ
- ์๋ด ๋ฉํธ: ์ค์ ์๋ด์์ด ๋ณด๋ธ ๋ฉ์์ง๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ฌ๊ตฌ์ฑ (near-verbatim, not paraphrased)
- ์กฐ๊ฑด ๋ถ๊ธฐ: ๋ํ์์ ์๋ด์์ด "~์ธ ๊ฒฝ์ฐ", "~ํ์
จ๋ค๋ฉด" ๋ฑ์ผ๋ก ๋ถ๊ธฐํ ํจํด ์ถ์ถ
- ๊ฒฝ๊ณ ๋ฌธ๊ตฌ: ์๋ด์์ด "์ฃผ์", "์ค์", "๊ผญ" ๋ฑ์ ํค์๋์ ํจ๊ป ๋ณด๋ธ ๋ฉ์์ง์์ ์ถ์ถ
- ๋น๋ ๋ฐ์ดํฐ:
patterns.json์ cluster_size์ ํจํด ๋น์จ์์ ๊ณ์ฐ
Enriched Data ๋ฏธ๋ณด์ ์ (๋ด๋ถ ๋๊ตฌ ๊ฒฝ๋ก ๋ฑ์ด ๋ํ์ ์๋ ๊ฒฝ์ฐ)
๋ํ ๋ฐ์ดํฐ์์ ๊ตฌ์ฒด์ ์ธ ๋ด๋ถ ๋๊ตฌ ๊ฒฝ๋ก๋ ์ด๋๋ฏผ URL์ด ๋ฐ๊ฒฌ๋์ง ์๋ ๊ฒฝ์ฐ:
{๋ด๋ถ_๋๊ตฌ_๊ฒฝ๋ก} ๊ฐ์ ํ๋ ์ด์คํ๋๋ฅผ ์ฌ์ฉํ๊ณ ์ฃผ์์ผ๋ก ํ์: <!-- TODO: ๋ด๋ถ ์ด๋๋ฏผ ๊ฒฝ๋ก ํ์ธ ํ์ -->
- ์ ๋๋ก ์์์ URL์ด๋ ๊ฒฝ๋ก๋ฅผ ์ง์ด๋ด์ง ์๋๋ค
- ์๋ด ๋ฉํธ, ์กฐ๊ฑด ๋ถ๊ธฐ, ๊ฒฝ๊ณ ๋ฌธ๊ตฌ๋ ๋ํ ๋ฐ์ดํฐ์์ ํญ์ ์ถ์ถ ๊ฐ๋ฅํ๋ฏ๋ก ๋ฐ๋์ ํฌํจํ๋ค
5. Write ํค์ค๋งค๋ Section
Extract tone and manner from enriched data and write the section.
Constraints:
- You MUST use
tone_and_manner_samples from patterns_enriched.json as the foundation
- You MUST include: ์ธ์ฌ๋ง, ๊ณต๊ฐ ํํ, ๋ง๋ฌด๋ฆฌ ์ธ์ฌ, ๊ธ์ง ํํ
- You MUST use actual agent messages from the data, not generic templates
- You SHOULD include ๊ธ์ง ํํ with ๋์ฒด ํํ pairs (table format)
Process:
- Read
tone_and_manner_samples for the topic's source clusters
- Group by category: greeting, empathy, closing, proactive, informative
- Select 2-3 best examples per category
- Identify negative patterns from conversations (agent responses that caused re-inquiry or escalation)
- Create ๊ธ์ง/๋์ฒด ํํ pairs
6. Write ์์ค์ปฌ๋ ์ด์
Section
Constraints:
- You MUST include an escalation table with: ์ํฉ, ์์ค์ปฌ๋ ์ด์
๋์, ์ ๋ฌ ์ ๋ณด, ์์ ์๋ต ์๊ฐ
- You MUST include ์์ค์ปฌ๋ ์ด์
์ ๊ณ ๊ฐ ์๋ด ๋ฉํธ (from actual agent messages)
- You SHOULD include ์์ค์ปฌ๋ ์ด์
์์ฒญ ์์ (๋ด๋ถ์ฉ) if internal tool paths are available
- Escalation targets MUST be extracted from actual conversations (not invented)
8. Save Agent SOP Documents
Write all SOP files to the output directory. Each SOP is a separate file.
Constraints:
- You MUST name files using the customer journey convention:
- HT SOP:
HT_{์ฌ์ ๋จ๊ณ}_{์ฃผ์ }.sop.md
- TS SOP:
TS_{์ฌ์ ๋จ๊ณ}_{์ฃผ์ }.sop.md
- You MUST use
.sop.md extension (Agent SOP convention)
- You MUST save all generated SOPs to the same output directory
- You MUST use versioned directory if previous SOPs exist:
- First run:
results/{company}/03_sop/
- Second run (if 03_sop/ exists):
results/{company}/03_sop_v2/
- Third run:
results/{company}/03_sop_v3/ (etc.)
- You MUST NOT overwrite existing SOP files โ use versioned directory
- You SHOULD validate each SOP after saving
- You MUST create output directory if needed
File Creation (multiple SOPs):
Write results/{company}/03_sop/HT_{topic1}.sop.md
Write results/{company}/03_sop/TS_{topic2}.sop.md
Write results/{company}/03_sop/HT_{topic3}.sop.md
Post-Save Validation (per file):
๊ตฌ์กฐ ์ฒดํฌ:
Case ํ์ง ์ฒดํฌ (ํด๊ฒฐ์ฑ
์๋ด์ ๊ฐ Case๋ณ):
๋ฐ์ดํฐ ๊ธฐ๋ฐ ์ฒดํฌ:
Output Summary (์๋ฃ ํ ์ถ๋ ฅ):
โ
Stage 3 ์๋ฃ: {N}๊ฐ SOP ์์ฑ
์ ์ฅ ์์น: results/{company}/03_sop/
์์ฑ๋ ํ์ผ:
HT_๊ตฌ๋งคํ_๋ฐ์ฐ์ฒ์์ .sop.md
HT_USIM๋ฐฐ์ก_์ผ๋ฐ๋ฌธ์.sop.md
TS_ํ์ง_๋ฐ์ดํฐ์ฐ๊ฒฐ๋ถ๋.sop.md
...
9. Generate Metadata
Create metadata file with SOP information.
Constraints:
- You MUST create
metadata.json alongside SOP file
- You MUST include: version, generated date, source files, statistics
- You SHOULD include: author, review status, deployment target
- You MAY include: quality score, test results
Metadata Structure:
{
"sop_title": "Channel Corp. Customer Support Assistant",
"company": "Channel Corp.",
"version": "1.0.0",
"generated_at": "2024-01-28T19:00:00Z",
"last_updated_at": "2024-01-28T19:00:00Z",
"generated_by": "Claude Sonnet 4.5 (Stage 3 Pipeline)",
"source_files": [
"results/{company}/01_clustering/{company}_clustered.xlsx",
"results/{company}/01_clustering/{company}_tags.xlsx",
"results/{company}/02_extraction/patterns.json",
"results/{company}/02_extraction/faq.json"
],
"statistics": {
"total_clusters": 10,
"patterns_extracted": 37,
"faq_pairs": 52,
"sop_steps": 5,
"sop_examples": 3,
"word_count": 4250
},
"coverage": {
"inquiry_types": ["a_s_request", "delivery_inquiry", "product_question", "order_change", "complaint"],
"top_categories": ["A/S", "๋ฐฐ์ก", "์ผ๋ฐ_์๋ด"],
"automation_ready": ["delivery_inquiry", "product_question"]
},
"quality": {
"rfc_2119_compliant": true,
"all_sections_present": true,
"examples_validated": true
},
"deployment": {
"status": "ready",
"target_platform": "Claude Skills / MCP Server",
"review_required": true,
"reviewer": "Customer Support Manager"
},
"notes": "Generated from 1,645 customer support chat records. Covers 5 major inquiry categories with 52 pre-built response templates."
}
File Creation:
Write results/{company}/03_sop/metadata.json
Examples
Example 1: SOP Generation (Channel Corp.)
Input:
- extraction_output_dir:
results/{company}/02_extraction
- company: "Channel Corp."
- sop_title: "Channel Corp. Customer Support Assistant"
- sop_type: "customer_support"
Execution Time: ~5 minutes
Output:
03_sop/ ๋๋ ํ ๋ฆฌ์ 10-15๊ฐ SOP ํ์ผ
metadata.json
Example 2: Concise Troubleshooting SOP (Channel Corp.)
Input:
- extraction_output_dir:
results/{company}/02_extraction
- company: "Channel Corp."
- sop_title: "Channel Corp. Hardware Troubleshooting Guide"
- sop_type: "troubleshooting"
- detail_level: "concise"
Execution Time: ~3-4 minutes
Output:
{company}_troubleshooting.sop.md (600 lines)
- Focus on A/S and technical issues only
- Minimal examples, core workflows only
Output Format
File 1: {company}_support.sop.md
SOP document following HT/TS template structure.
TS SOP Structure (๋ฌธ์ ํด๊ฒฐ):
# {SOP Title}
## ๋ฉํ๋ฐ์ดํฐ
| ํญ๋ชฉ | ๋ด์ฉ |
|------|------|
| SOP ID | {ID} |
| ๋ถ๋ฅ | {๋ถ๋ฅ} |
...
## 1. ๋ชฉ์
## 2. ์ฃผ์์ฌํญ
## 3. ๋ฌธ์ ํด๊ฒฐ ํ๋ก์ธ์ค
### 3-1. ์ฒ๋ฆฌ ํ๋ฆ ๊ฐ์
### 3-2. ๋ฌธ์ ์ํฉ ํ์ธ
### 3-3. ํด๊ฒฐ์ฑ
์๋ด
#### Case 1: {์๋๋ฆฌ์ค} (๋น๋: ๋์ โ ์ ์ฒด์ XX%)
**Step 1~N** with ๋ธ๋ก ์ธ์ฉ ์๋ด ๋ฉํธ, ๋ด๋ถ ๋๊ตฌ ๊ฒฝ๋ก, ์กฐ๊ฑด ๋ถ๊ธฐ, ์๋ฃ ํ์ธ
#### Case 2: ...
## 4. ํค์ค๋งค๋
## 5. ํด๊ฒฐ์ด ์๋๋ฉด (์์ค์ปฌ๋ ์ด์
)
## 6. ๊ด๋ จ SOP
## 7. ๋ฐ์ดํฐ ๋ถ์ ์ ๋ณด
HT SOP Structure (์ ๋ณด ์๋ด):
# {SOP Title}
## ๋ฉํ๋ฐ์ดํฐ
## 1. ๋ชฉ์
## 2. ์ฃผ์์ฌํญ
## 3. ๋ด์ฉ
### (์ฃผ์ ๋ณ Case ๊ตฌ์กฐ โ ๋์ผํ ๋ํ
์ผ ์๊ตฌ์ฌํญ ์ ์ฉ)
## 4. ํค์ค๋งค๋
## 5. ํด๊ฒฐ์ด ์๋๋ฉด (์์ค์ปฌ๋ ์ด์
)
## 6. ๊ด๋ จ SOP
## 7. ๋ฐ์ดํฐ ๋ถ์ ์ ๋ณด
File 2: metadata.json
SOP metadata and statistics.
Fields:
- sop_title, company, version
- generated_at, generated_by
- source_files
- statistics (clusters, patterns, FAQ count, steps, examples)
- coverage (inquiry types, categories, automation ready)
- quality (RFC compliance, section completeness)
- deployment (status, target platform, review status)
Troubleshooting
Issue 1: Generated SOP Cases are too generic
Symptom: Cases lack specificity โ "๋ด๋ถ ์ด๋๋ฏผ์์ ํ์ธ", no UI paths, no concrete agent messages
Solution:
- Re-read
patterns_enriched.json โ sample_conversations โ manager turns
- Extract actual URLs, UI paths, agent response templates from the conversations
- If not found in data, use
{placeholder} + <!-- TODO --> โ never invent details
Issue 2: Cases use "์ฃผ์ ์์ธ" instead of "์ฃผ์ ์ํฉ"
Symptom: Case descriptions list technical causes rather than customer scenarios
Solution:
- Rewrite from customer's perspective: "๊ณ ๊ฐ์ด [X]๋ฅผ ํ๋ ค ํ๋, [Y] ์ํ๋ผ [Z]๊ฐ ๋ถ๊ฐํ ๊ฒฝ์ฐ"
- Extract customer expressions from user turns in enriched data
- Technical causes go into the Step's internal notes, not the Case header
Issue 3: Missing validation steps and conditional branches
Symptom: Cases are linear (Step 1 โ 2 โ 3 โ done) without confirmation or branching
Solution:
- Add "์๋ฃ ํ์ธ" step after each major action: "~๋์
จ๋์?"
- Add conditional branches: "์ ๋๋ ๊ฒฝ์ฐ โ [๋ค๋ฅธ ์กฐ์น]" or "โ Step N๋ถํฐ ๋ค์ ์งํ"
- Add โ ๏ธ warnings where re-occurrence is likely (e.g., ์ฌ์ฐ๋, ์ฌ๋ฐ ๊ฐ๋ฅ์ฑ)
Related Documentation
- Agent SOP Format:
rules/agent-sop-format.md
- HT/TS Templates:
templates/HT_template.md, templates/TS_template.md (SOP structure reference)
- Stage 2:
agent-sops/stage2-extraction.sop.md (Prerequisite)
- RFC 2119: https://datatracker.ietf.org/doc/html/rfc2119
Notes
RFC 2119 Keywords
Use these keywords correctly in Constraints:
- MUST / MUST NOT: Absolute requirement or prohibition
- SHOULD / SHOULD NOT: Recommended but not required
- MAY: Optional, at discretion
Example:
**Constraints:**
- You MUST verify warranty before promising free repair (business critical)
- You SHOULD check customer history before responding (best practice)
- You MAY offer related product suggestions (optional enhancement)
- You MUST NOT promise specific repair timeframes (liability risk)
SOP Reusability
The generated SOP should be reusable across:
- Different customer support agents (human)
- AI assistants (Claude Skills, MCP tools)
- Chatbots and automated systems
- Multi-channel support (chat, email, phone)
Design for reusability:
- Use parameterized workflows (not hardcoded values)
- Provide clear decision logic (IF/THEN)
- Include examples for common scenarios
- Document edge cases in Troubleshooting
Execution Strategy
๋ฉ์ธ ์์ด์ ํธ์์ ์์ฐจ ์ฒ๋ฆฌ (๊ถ์ฅ)
์ฌ๋ฃ(patterns, FAQ)๊ฐ ์ด๋ฏธ ์ค๋น๋์ด ์์ผ๋ฏ๋ก, subagent ๋ณ๋ ฌ ์ฒ๋ฆฌ์ ์์ฐจ ์ฒ๋ฆฌ์ ์๊ฐ ์ฐจ์ด๊ฐ ๊ฑฐ์ ์์ต๋๋ค. ์์ฐจ ์ฒ๋ฆฌ๊ฐ ๋ ์์ ์ ์ด๊ณ ๋๋ฒ๊น
์ด ์ฝ์ต๋๋ค.
Critical Constraints:
- You MUST generate SOP documents using LLM (Claude) directly
- You MUST NOT use Python scripts to auto-generate SOP files
- You MUST NOT use automated template generators or boilerplate tools
- You MUST write each SOP through natural language composition
- You SHOULD process each SOP sequentially in main agent
- You MAY use subagent if needed, but sequential processing is preferred
Why No Python Auto-generation:
- โ Python cannot understand nuanced customer expressions
- โ Template-based generation produces generic, low-quality SOPs
- โ
LLM composition ensures context-aware, company-specific content
- โ
Natural language understanding captures tone and intent
Recommended Approach:
- ์์ฐจ SOP ์์ฑ - ๋ฉ์ธ ์์ด์ ํธ์์ ํ๋์ฉ ์์ฑ
- LLM ์ง์ ์์ฑ - Python ์คํฌ๋ฆฝํธ ์์ด Claude๊ฐ ์ง์ ์์ฑ
- ์ฌ๋ฃ ํ์ฉ - patterns_enriched.json, faq.json์์ ๋ด์ฉ ์ถ์ถ
- ๊ฐ SOP ์๋ฃ ํ ํ์ผ ์ ์ฅ โ ๋ค์ SOP ์งํ
Efficiency Tips:
- โ
patterns_enriched.json ์ฌ์ฉ (clustered.xlsx ์ฌ๋ก๋ ๋ถํ์)
- โ
์์ฐจ ์ฒ๋ฆฌ๋ก ์์ ์ฑ ํ๋ณด
- โ Python ์๋ ์์ฑ ์คํฌ๋ฆฝํธ ์ฌ์ฉ ๊ธ์ง
- ์๊ฐ ์ฐจ์ด ๊ฑฐ์ ์์ (์ฌ๋ฃ๊ฐ ์ค๋น๋์ด ์์ผ๋ฏ๋ก)
Quality Checklist
Before finalizing each SOP:
Deployment Readiness
After SOP generation:
- Review: Customer support manager validates accuracy
- Test: Pilot with small team, collect feedback
- Refine: Update based on testing results
- Deploy: Roll out via Claude Skills, MCP server, or training docs
- Monitor: Track usage metrics, identify gaps
- Iterate: Update SOP based on new patterns (quarterly)
Metrics to Track:
- First-contact resolution rate
- Average response time
- Escalation rate
- Customer satisfaction score
- Agent feedback on SOP usability