| name | narrative-write |
| description | 콘텐츠 저작 워크플로우 — 4개 파이프라인(파생/신규/수정/연쇄) 통합 + QTSP 품질 게이트. Use when the user says "글 쓰자", "블로그 작성", or "콘텐츠 저작".
|
| context | main |
| allowed-tools | ["Read","Write","Edit","Glob","Grep","Agent","Bash"] |
| argument-hint | <topic_id|item_id> [--pipeline derived|new|revise|cascade] |
| spec-version | 2 |
Narrative Write
Domain: narrative
Version: 1.0.0
WHY
콘텐츠 저작은 "초안 → 편집 → 검토"를 반복하는 구조적 작업이다. 편집 과정에서 QTSP 7항목 품질 게이트가 없으면 주관적 판단에 의존하게 되고, 품질 기준이 세션마다 흔들린다. 이 워크플로우는 4개 파이프라인(파생/신규/수정/연쇄)을 하나의 흐름으로 통합하여, 파이프라인 유형에 따라 컨텍스트 로드를 분기하고, QTSP 기반 편집 게이트로 일관된 품질을 보장한다. 서사 빈틈이 감지되면 인터뷰어 에이전트가 사용자에게 확인하여, 꾸며낸 서사 없이 실제 소재를 확보한다.
KNOWLEDGE REFS
| 참조 | 역할 | 로드 시점 |
|---|
workspace/squads/narrative/vault/knowledge/quality-standards.md | QTSP 7항목 품질 기준 | Step 5 (edit) |
workspace/squads/narrative/vault/knowledge/pipelines.md | 4개 파이프라인 정의 (파생/신규/수정/연쇄) | Step 1 (brief) |
workspace/squads/narrative/policies/writing-principles.md | 저작 원칙 7개 | Step 3 (draft), Step 5 (edit) |
workspace/squads/narrative/vault/knowledge/distribution-strategy.md | 채널별 톤·길이 기준 | Step 3 (draft), Step 5 (edit) |
vault/user/_meta/writing-profile.md | W1~W10 사용자 저작 성향 | Step 3 (draft), Step 5 (edit) |
STATE
pipeline_type: string
target_id: string
channel: string
content_data: object
draft_text: string
edited_text: string
qtsp_score: object
interview_needed: boolean
STEPS
Step 1: Brief (메인 컨텍스트 -- 사용자 대화)
목적: 저작 브리프를 수집하고 파이프라인 유형을 확정한다.
- Pre-flight 로드: pipelines.md, writing-profile.md (W1~W10 중 이번 글에서 주의할 항목 식별)
- 필수 정보 수집 (대화 -- 아래 확인될 때까지 다음 단계 진입 불가):
topic_id 또는 item_id: content.json에서 대상 식별
pipeline: 파생(derived) / 신규(new) / 수정(revise) / 연쇄(cascade)
channel: 채널 유형 (blog / sns / article / source / book)
- 파이프라인 판단:
--pipeline 인자 제공 시 그대로 사용
derived_from 지정 → 파생
item_id + 기존 version → 수정
topic_id만 → 신규
- source 변경 감지 → 연쇄
CONVERSATION PROTOCOL:
- 사용자가 이미 맥락을 제공했으면 추론 후 확인만
- 설문지 나열 금지 -- 자연스러운 대화로 필수 정보 수집
JUDGMENT:
- 필수 필드 미충족 → 해당 필드 재질문 (다음 단계 차단)
- 파이프라인 판단 불가 → 사용자에게 선택지 제시
Step 2: Load Context (자동)
목적: content.json에서 대상을 로드하고 파이프라인별 추가 컨텍스트를 준비한다.
- content.json 로드:
workspace/squads/narrative/data/content.json에서 topic/item 조회
- 파이프라인별 분기:
- 파생: source article 로드 (derived_from 경로) + 원본 섹션 구조 파악
- 신규: topic의
_meta.md 로드 + 빈 draft 준비
- 수정: 기존 version 로드 (현재 콘텐츠 전문)
- 연쇄: source 변경 내역 로드 + 영향받는 items 목록 표시
- 채널별 톤 확인: distribution-strategy.md에서 해당 채널 기준 로드
Step 3: Draft (메인 컨텍스트 -- 사용자 대화)
목적: 사용자가 초안을 작성하거나 AI 보조로 드래프팅한다.
- Writing Pre-flight: writing-profile.md W1~W10 중 이번 글에 해당하는 항목 확인
- 저작 원칙 로드: writing-principles.md 7개 원칙 적용
- 초안 작성: 사용자 직접 작성 또는 AI 보조 (채널별 톤·길이 준수)
- 파이프라인별:
- 파생: 원본 섹션 기반 독립 hook + 독립 CTA
- 신규: 자유 구조
- 수정: 기존 구조 유지하며 개선
- 연쇄: source 변경 반영 + 영향 범위 표시
CONVERSATION PROTOCOL:
- 사용자가 초안을 직접 붙여넣으면 즉시 Step 5로 진행 가능
- AI 보조 드래프팅 시 채널별 output-style 적용
Step 4: Interview (에이전트 위임 -- 조건부)
목적: 서사 빈틈을 발견하고 사용자에게 질문하여 실제 소재를 확보한다.
- Interviewer 에이전트 위임:
workspace/squads/narrative/agents/interviewer.md
- 전달: 현재 초안, 서사 빈틈이 의심되는 지점
- 에이전트 반환: questions (질문 목록) + gap_source (빈틈의 원천 -- 근거 부족 / 맥락 부족 / 감정 누락)
- 사용자 답변 수집: 인터뷰어 질문을 사용자에게 전달
- 답변 반영: 사용자 답변을 초안에 통합 → draft로 loop-back
트리거 조건: edit 단계에서 interview_needed: true 반환 시, 또는 draft 단계에서 근거 없는 주장이 감지될 때
Step 5: Edit (에이전트 위임)
목적: QTSP 7항목을 평가하고 편집 제안을 생성한다.
- Editor 에이전트 위임:
workspace/squads/narrative/agents/editor.md
- 전달: 초안 전문, 채널 유형, writing-profile.md, quality-standards.md, writing-principles.md
- 에이전트 반환:
edited_text: 편집된 텍스트
qtsp_score: 7항목 각각의 점수 (1~5) + 총점
edit_notes: 항목별 편집 사유
interview_needed: 서사 빈틈 감지 여부 (boolean)
- Post-generation 체크리스트 (자동 검증):
- W3(도치) 위반 점검
- W8(문장 리듬) 위반 점검
- W9(축약어) 위반 점검
- W10(체감 예시) 위반 점검
- "~니다" 3회 이상 연속 여부
- 도치형 훅 존재 여부
- 결론-먼저 패턴 존재 여부
Step 6: Review (메인 컨텍스트 -- 사용자 판단)
목적: 편집 결과와 QTSP 스코어를 사용자가 확인하고 승인/반려한다.
- 편집 결과 제시: edited_text + qtsp_score + edit_notes
- QTSP 스코어 요약: 7항목 점수 테이블 + 총점
- 사용자 판단 수집
JUDGMENT:
qtsp total < 3.5 또는 any item < 2 → draft로 loop-back (품질 미달)
interview_needed: true → interview 노드로 분기
- 사용자 승인 → finalize로 진행
- override: 사용자가 QTSP 스코어를 인지한 상태에서 명시적으로 진행을 요청하면 스코어 무관하게 finalize 진행 가능
Step 7: Finalize (자동)
목적: content.json을 업데이트하고 status 전이를 완료한다.
- content.json 업데이트:
workspace/squads/narrative/data/content.json
- status 전이:
draft → review → source-ready (or published)
version++
updated_at 갱신
- 파생 콘텐츠:
derived_from 관계 기록
- registry.json 업데이트: 발행물 인덱스 갱신 (해당 시)
JUDGMENT
- 필수 필드(topic_id/item_id, pipeline, channel) 미충족 → 해당 필드 재질문 (다음 단계 차단)
qtsp total < 3.5 또는 any item < 2 → draft로 loop-back (품질 미달)
interview_needed: true → interview 노드로 분기
- 사용자가 QTSP 스코어를 인지한 상태에서 명시적으로 진행을 요청하면 → override 허용
AGENT DELEGATION
| Step | Agent | 전달 컨텍스트 | 반환 |
|---|
| Step 4 | Interviewer (workspace/squads/narrative/agents/interviewer.md) | 초안, 서사 빈틈 지점 | questions, gap_source |
| Step 5 | Editor (workspace/squads/narrative/agents/editor.md) | 초안, 채널, writing-profile, quality-standards, writing-principles | edited_text, qtsp_score, edit_notes, interview_needed |
FLOW
flowchart TD
brief{brief} --> load-context[load-context]
load-context --> draft{draft}
draft --> edit[[edit]]
edit --> review{review}
review -->|qtsp < 3.5 or item < 2| draft
review -->|interview needed| interview[[interview]]
review -->|승인 or override| finalize[finalize]
interview --> draft
nodes:
- id: brief
type: human
entry: true
summary: "저작 브리프 수집 — 파이프라인 유형 판단 (파생/신규/수정/연쇄)"
input: [topic_id or item_id, pipeline-hint, channel]
output: [pipeline-type, target-id, channel]
postcondition:
- "pipeline_type이 확정됨 (derived|new|revise|cascade)"
- "target_id가 content.json에서 유효한 식별자임"
- "channel이 확정됨"
judgment:
- condition: "필수 필드 미충족 (topic_id/item_id, pipeline, channel)"
next: brief
type: gate
- id: load-context
type: auto
summary: "content.json에서 대상 로드 + 파이프라인별 컨텍스트 준비"
input: [pipeline-type, target-id]
output: [content-data, channel-tone, source-article]
postcondition:
- "content_data가 로드됨"
- "채널별 톤·길이 기준이 확인됨"
side_effects:
- reads: workspace/squads/narrative/data/content.json
- reads: workspace/squads/narrative/vault/knowledge/distribution-strategy.md
- id: draft
type: human
summary: "초안 작성 — 사용자 직접 또는 AI 보조 드래프팅"
input: [content-data, channel-tone, writing-profile, writing-principles]
output: [draft-text]
postcondition:
- "draft_text가 존재함"
- "채널별 톤·길이 기준에 부합"
- id: interview
type: agent
agent: workspace/squads/narrative/agents/interviewer.md
summary: "서사 빈틈 질문 — 꾸며내지 않고 사용자에게 확인"
input: [draft-text, gap-points]
output: [questions, gap_source]
postcondition:
- "빈틈 질문 목록이 생성됨"
- "사용자 답변이 수집됨"
- id: edit
type: agent
agent: workspace/squads/narrative/agents/editor.md
summary: "QTSP 7항목 평가 + 편집 제안"
input: [draft-text, channel, writing-profile, quality-standards, writing-principles]
output: [edited_text, qtsp_score, edit_notes, interview_needed]
postcondition:
- "edited_text가 생성됨"
- "qtsp_score 7항목이 모두 채워짐"
- "interview_needed 판단이 완료됨"
side_effects:
- reads: vault/user/_meta/writing-profile.md
- reads: workspace/squads/narrative/vault/knowledge/quality-standards.md
- id: review
type: human
summary: "편집 결과 + QTSP 스코어 확인 — 승인/반려/인터뷰 분기"
input: [edited_text, qtsp_score, edit_notes, interview_needed]
postcondition:
- "사용자 판단이 확정됨 (승인|반려|인터뷰)"
judgment:
- condition: "qtsp total < 3.5 or any item < 2"
next: draft
type: loop-back
max_iterations: 3
- condition: "interview_needed: true"
next: interview
type: loop-back
max_iterations: 2
- condition: "사용자 승인"
next: finalize
- condition: "사용자 override (스코어 인지 후 명시적 진행 요청)"
next: finalize
type: override
- id: finalize
type: auto
summary: "content.json 업데이트 — status 전이, version++, updated_at"
input: [edited_text, target-id, pipeline-type]
postcondition:
- "content.json의 status가 전이됨"
- "version이 증가됨"
side_effects:
- updates: workspace/squads/narrative/data/content.json
checkpoint: true
checkpoint_evidence: "content.json에 갱신된 status와 version이 존재"
edges:
- from: brief → to: load-context
- from: load-context → to: draft
- from: draft → to: edit
- from: edit → to: review
- from: review → to: finalize
- from: review → to: draft
- from: review → to: interview
- from: interview → to: draft
REFERENCES
- Squad:
workspace/squads/narrative/README.md
- Editor:
workspace/squads/narrative/agents/editor.md
- Interviewer:
workspace/squads/narrative/agents/interviewer.md
- QTSP:
workspace/squads/narrative/vault/knowledge/quality-standards.md
- Pipelines:
workspace/squads/narrative/vault/knowledge/pipelines.md
- Writing Principles:
workspace/squads/narrative/policies/writing-principles.md
- Distribution Strategy:
workspace/squads/narrative/vault/knowledge/distribution-strategy.md
- Writing Profile:
vault/user/_meta/writing-profile.md
- Output Styles:
output-styles/narrative-*.md
- Content Data:
workspace/squads/narrative/data/content.json