원클릭으로
ingest
library/inbox/에 넣은 외부 참조 소스 파일(PDF, DOCX 등)을 자동으로 Markdown 변환, frontmatter 생성, 폴더 배치, 인덱스 업데이트까지 원스텝으로 처리한다. /ingest로 트리거.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
library/inbox/에 넣은 외부 참조 소스 파일(PDF, DOCX 등)을 자동으로 Markdown 변환, frontmatter 생성, 폴더 배치, 인덱스 업데이트까지 원스텝으로 처리한다. /ingest로 트리거.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | ingest |
| description | library/inbox/에 넣은 외부 참조 소스 파일(PDF, DOCX 등)을 자동으로 Markdown 변환, frontmatter 생성, 폴더 배치, 인덱스 업데이트까지 원스텝으로 처리한다. /ingest로 트리거. |
contract-review/library/inbox/에 참조 소스 파일을 넣고 /ingest를 실행하면 자동으로 처리한다.
참고: 이 스킬은 참조 소스(법령, 판례, 해설, 샘플 양식 등)를 Markdown으로 변환·구조화한다. 계약서 템플릿/선례 ingestion은 기존 10단계 파이프라인(ingestion-agent)을 사용한다.
/ingest — inbox 전체 처리library/inbox/ 에 파일 드롭
│
├─ Step 1: 파일 스캔
├─ Step 2: Markdown 변환
├─ Step 3: Frontmatter 생성 + sources/ 배치
└─ Step 4: 인덱스 업데이트
Executable implementation:
python3 .claude/skills/ingest/scripts/source_ingest.py <source-file> \
--source-id <id> \
--jurisdiction KR \
--source-type statute \
--authority-level primary_law
python3 .claude/skills/ingest/scripts/validate_source_registry.py \
contract-review/library/sources/source-registry.json
inbox/ 내 모든 파일을 Glob으로 탐색 (inbox/raw/ 포함)
지원 포맷: .pdf, .docx, .pptx, .xlsx, .html, .md, .txt
비지원: .hwp, .hwpx → 유저에게 "PDF/DOCX 변환 후 다시 넣어주세요" 안내
.gitkeep, _processed/, _failed/, sidecars/ 내 파일은 제외계약서 템플릿 vs 참조 소스 구분:
"이 파일은 참조 소스(법령/판례/해설)인가요, 아니면 계약서 템플릿인가요?"
| 입력 포맷 | 변환 방법 |
|---|---|
.pdf | mcp__markitdown__convert_to_markdown (uri: file:///절대경로) |
.docx | mcp__markitdown__convert_to_markdown |
.pptx, .xlsx, .html | mcp__markitdown__convert_to_markdown |
.md, .txt | 변환 불필요, 그대로 사용 |
변환 실패 시: 해당 파일을 library/inbox/_failed/로 이동 + 유저에게 실패 사유 안내
변환된 .md 파일에 YAML frontmatter를 자동 생성한다.
---
# === 식별 정보 ===
source_id: "{category}-{slug}" # 예: "statute-commercial-code-capital-increase"
slug: "{자동 생성}"
title_kr: "{문서에서 추출한 제목}"
title_en: "{영문 제목 있으면 추출, 없으면 빈값}"
document_type: "{statute | enforcement_decree | regulation | guideline | decision | precedent | newsletter | commentary | article | paper | sample_form | other}"
# === 소스 정보 ===
publisher: "{발행 기관/로펌/저널명}"
author: "{저자명 (추출 가능한 경우)}"
published_date: "{발행일 (추출 가능한 경우)}"
source_url: "{URL (추출 가능한 경우)}"
original_format: "{pdf | docx | ...}"
ingested_at: "{처리 시각 ISO 8601}"
# === 검색 메타 ===
keywords: ["{내용 기반 키워드 5-10개}"]
topics: ["{주제 분류}"]
relevant_statutes: ["{인용된 법조문 목록, 예: 상법 제418조, 자본시장법 제9조}"]
contract_families_relevant: ["{관련 계약 유형: ssa, sha, safe, spa, license 등}"]
char_count: {글자수}
---
핵심 필드 추출 로직:
# 헤딩 또는 문서 최상단 볼드 텍스트저장 위치: library/sources/{slug}.md
-2, -3 접미사원본 파일: library/inbox/_processed/로 이동 (삭제하지 않음)
처리 완료 후 library/sources/source-registry.json을 업데이트한다.
source-registry.json 엔트리 구조:
{
"source_id": "statute-commercial-code-capital-increase",
"title_kr": "상법 제418조 (신주의 발행)",
"document_type": "statute",
"path": "sources/commercial-code-capital-increase.md",
"contract_families_relevant": ["ssa", "spa"],
"keywords": ["신주발행", "주주배정", "제3자배정"],
"ingested_at": "2026-03-25T10:00:00+09:00"
}
기존 source-registry.json이 없으면 새로 생성한다.
Validation rules:
source_id is a hard failure.last_checked is a warning in validate_source_registry.py and must be surfaced in review metadata when cited.source_id values so stale-source warnings can be traced.모든 파일 처리 후 요약 리포트를 출력한다:
Ingest 완료
처리: N개 파일
성공: X건 (파일명 → sources/)
실패: Y건 (_failed/로 이동)
원본: library/inbox/_processed/ 로 이동
| 상황 | 대응 |
|---|---|
| inbox 비어있음 | "inbox가 비어 있습니다" 안내 |
| 미지원 포맷 (.hwp 등) | 해당 파일 스킵 + "PDF/DOCX로 변환 필요" 안내 |
| markitdown 변환 실패 | _failed/로 이동 + 실패 사유 안내 |
| 파일명 중복 | slug에 -2, -3 접미사 |
| frontmatter 추출 실패 | 빈 값으로 생성 + 유저 검토 권고 |
_processed/로 이동library/sources/에 있는 동일 slug 파일은 덮어쓰지 않음