원클릭으로
split-youtube-chapters
// YouTube 콘텐츠의 챕터별 하위페이지 구조를 readings.ts에 생성하고, 전체 번역 파일에서 챕터별 번역 파일을 자동 생성합니다. 사용: /split-youtube-chapters week1/deep-dive-llms
// YouTube 콘텐츠의 챕터별 하위페이지 구조를 readings.ts에 생성하고, 전체 번역 파일에서 챕터별 번역 파일을 자동 생성합니다. 사용: /split-youtube-chapters week1/deep-dive-llms
코드 수정 완료 후 conventional commit 형식의 커밋 메시지를 자동 생성하고 사용자 확인 후 커밋합니다. 사용자가 커밋해줘 또는 /commit 요청 시 사용.
readings.ts의 요약 필드가 원본 kr 마크다운과 비교하여 잘 작성되었는지 평가합니다. 이슈별로 개선사항을 제안하고 사용자 컨펌 후 readings.ts를 수정합니다. 사용: /eval-summary week1 또는 /eval-summary week1/slug
나노바나나 프롬프트의 정확성을 한글 번역본과 비교하여 검증하고, WebSearch로 팩트체크한 후 이슈별로 사용자 확인을 거쳐 수정합니다. 사용: /improve-prompt week1/deep-dive-llms/tokenization
Reading 원문에서 나노바나나 프로용 치트시트 프롬프트를 생성합니다. 3단계 에이전트 파이프라인(분석→구조설계→프롬프트생성)으로 콘텐츠 유형에 맞는 프롬프트 생성. 사용: /nanobanana week1/slug
나노바나나에서 생성된 치트시트 이미지를 public에 복사하고 readings.ts에 cheatsheetImage 필드를 추가합니다. 사용: /publish-cheatsheet week1/slug
나노바나나 치트시트 이미지를 Gemini Vision으로 분석하여 해당 kr md 파일의 내용과 일치하는지 검증합니다. 기술적/문맥적 오류, 잘못된 텍스트/그래프/그림을 찾아냅니다. 사용: /review-cheatsheet week1/slug/chapter
| name | split-youtube-chapters |
| description | YouTube 콘텐츠의 챕터별 하위페이지 구조를 readings.ts에 생성하고, 전체 번역 파일에서 챕터별 번역 파일을 자동 생성합니다. 사용: /split-youtube-chapters week1/deep-dive-llms |
| arguments | [{"name":"path","description":"week/slug 형식의 YouTube 콘텐츠 경로\n예: week1/deep-dive-llms\n","required":true},{"name":"overwrite","description":"기존 챕터 파일 덮어쓰기 (기본: 건너뜀)\n--overwrite 옵션으로 사용\n","required":false},{"name":"skip-files","description":"readings.ts만 업데이트하고 챕터 파일 생성 건너뜀\n--skip-files 옵션으로 사용\n","required":false}] |
YouTube 콘텐츠를 챕터별 하위페이지 구조로 변환합니다.
/split-youtube-chapters <week/slug>
/split-youtube-chapters week1/deep-dive-llms
docs/week{N}/{slug}/eng/index.md - 챕터 구조가 포함된 YouTube 콘텐츠 원본docs/week{N}/{slug}/kr/index.md - 전체 번역 파일 (챕터 파일 생성 시 필요)src/content/readings.ts 수정:
isParent: true + children 배열로 변환docs/week{N}/{slug}/kr/{childSlug}.md - 챕터별 번역 파일 (N개)'week1/deep-dive-llms': {
slug: 'deep-dive-llms',
week: 1,
title: 'Deep Dive into LLMs like ChatGPT',
titleKr: 'ChatGPT 같은 LLM 심층 분석',
author: 'Andrej Karpathy',
readTime: '약 3시간 31분',
sourceUrl: 'https://www.youtube.com/watch?v=7xTGNNLPyMI',
sourceTitle: 'YouTube - Deep Dive into LLMs like ChatGPT',
published: true,
sections: [
{ title: '1. Introduction (0:00)', content: '...' },
{ title: '2. Pretraining Data (1:00)', content: '...' },
// ... 24개 섹션
],
keyTakeaways: [...]
}
'week1/deep-dive-llms': {
slug: 'deep-dive-llms',
week: 1,
title: 'Deep Dive into LLMs like ChatGPT',
titleKr: 'ChatGPT 같은 LLM 심층 분석',
author: 'Andrej Karpathy',
readTime: '약 3시간 31분',
sourceUrl: 'https://www.youtube.com/watch?v=7xTGNNLPyMI',
sourceTitle: 'YouTube - Deep Dive into LLMs like ChatGPT',
published: true,
isParent: true,
// 부모 페이지의 sections는 개요 정보
sections: [
{
title: '개요',
content: 'Andrej Karpathy의 LLM 심층 분석 강의입니다...',
}
],
// YouTube 전용 필드 유지
contentType: 'youtube',
duration: '3:31:05',
totalChapters: 24,
tldr: '...',
learningGoals: [...],
chapterSummaries: [...],
// 챕터별 자식 페이지
children: [
{
slug: 'introduction',
title: '1. Introduction',
titleKr: '1. 소개',
sourceUrl: 'https://www.youtube.com/watch?v=7xTGNNLPyMI&t=0s',
published: true, // 번역 파일 있으면 true
hasMarkdown: true, // 마크다운 동적 로딩 활성화
},
{
slug: 'pretraining-data',
title: '2. Pretraining Data',
titleKr: '2. 사전학습 데이터',
sourceUrl: 'https://www.youtube.com/watch?v=7xTGNNLPyMI&t=60s',
published: true,
hasMarkdown: true,
},
// ... 24개 챕터
]
}
1. docs/week{N}/{slug}/eng/index.md 파일 읽기
2. 파일이 없으면 에러: "원본 파일을 찾을 수 없습니다."
3. 프론트매터에서 메타데이터 추출:
- source_url
- chapters (또는 본문에서 파싱)
원본 마크다운의 Table of Contents 또는 h2 섹션에서 챕터 추출:
## Table of Contents
1. [Introduction](#1-introduction) (0:00)
2. [Pretraining Data (Internet)](#2-pretraining-data-internet) (1:00)
3. [Tokenization](#3-tokenization) (7:47)
...
각 챕터에서 추출할 정보:
| 영어 제목 | slug |
|---|---|
| Introduction | introduction |
| Pretraining Data (Internet) | pretraining-data |
| Tokenization | tokenization |
| Neural Network I/O | neural-network-io |
| GPT-2: Training and Inference | gpt2-training-inference |
| Llama 3.1 Base Model Inference | llama-31-base-model |
| Hallucinations, Tool Use, Knowledge/Working Memory | hallucinations-tool-use |
| Reinforcement Learning from Human Feedback (RLHF) | rlhf |
slug 생성 규칙:
-로 변환- 제거| 영어 제목 | titleKr |
|---|---|
| Introduction | 소개 |
| Pretraining Data | 사전학습 데이터 |
| Tokenization | 토큰화 |
| Neural Network I/O | 신경망 입출력 |
| Inference | 추론 |
| Reinforcement Learning | 강화학습 |
| RLHF | RLHF (인간 피드백 강화학습) |
한국어 번역 규칙:
타임스탬프 "1:20:32" → 초 단위 변환 → 4832초
YouTube URL: {sourceUrl}&t=4832s
isParent: truesections: 개요 정보로 대체 (기존 섹션 제거)children: 챕터별 ChildReading 배열 추가// 기존 sections 대체
sections: [
{
title: '개요',
content: `${author}의 ${titleKr} 강의입니다. 총 ${totalChapters}개의 챕터로 구성되어 있으며, 약 ${duration} 분량입니다.`,
}
],
// children 추가
// 번역 파일이 있으면 published: true, hasMarkdown: true
// 번역 파일이 없으면 published: false, hasMarkdown: false
children: [
{
slug: 'introduction',
title: '1. Introduction',
titleKr: '1. 소개',
sourceUrl: 'https://www.youtube.com/watch?v=...&t=0s',
published: true, // 번역 파일 있으면 true
hasMarkdown: true, // 번역 파일 있으면 true
},
// ...
]
readings.ts 업데이트 완료 후 다음 단계로 진행합니다.
전체 번역 파일에서 각 챕터를 분리하여 개별 파일로 생성합니다.
파일 경로: docs/week{N}/{slug}/kr/index.md
파일이 없으면:
⚠ 전체 번역 파일이 없습니다.
→ 챕터별 파일 생성 건너뜀
→ readings.ts 업데이트만 완료
<!-- SUMMARY_START -->
## TL;DR
...
## 챕터별 요약
### 1. 소개 (0:00)
요약 텍스트...
**핵심 포인트:**
- 포인트1
- 포인트2
---
### 2. 사전학습 데이터 - 인터넷 (1:00)
...
<!-- SUMMARY_END -->
파싱 정규식:
챕터 헤더: /^### (\d+)\.\s*(.+?)\s*\((\d+:\d+(?::\d+)?)\)/gm
그룹: [1]=번호, [2]=한국어 제목, [3]=타임스탬프
핵심 포인트: /\*\*핵심 (?:포인트|개념):\*\*\n((?:- .+\n?)+)/g
추출 데이터:
number: 챕터 번호titleKr: 한국어 제목 (번호 제외)timestamp: 타임스탬프summary: 요약 텍스트keyPoints: 핵심 포인트 배열<!-- FULL_TRANSLATION_START -->
## 전체 번역
### 1. 소개
**요약**: ChatGPT와 같은...
[0:00] 안녕하세요, 여러분...
[0:30] 이 영상을 통해...
### 2. 사전학습 데이터 - 인터넷
**요약**: LLM 사전학습의...
[1:00] 도구를 준비하고...
<!-- FULL_TRANSLATION_END -->
파싱 정규식:
챕터 구분: /^### (\d+)\.\s*(.+?)$/gm
타임스탬프 라인: /^\[(\d+:\d+(?::\d+)?)\]\s*(.+)$/gm
추출 데이터:
number: 챕터 번호fullTranslation: 타임스탬프가 포함된 전체 번역 텍스트SUMMARY와 FULL_TRANSLATION에서 추출한 데이터를 챕터 번호로 매칭:
interface ChapterData {
number: number;
titleKr: string; // SUMMARY에서
timestamp: string; // SUMMARY에서
summary: string; // SUMMARY에서
keyPoints: string[]; // SUMMARY에서
fullTranslation: string; // FULL_TRANSLATION에서
}
각 챕터에 대해 파일 생성:
출력 경로: docs/week{N}/{parentSlug}/kr/{childSlug}.md
디렉토리 생성: docs/week{N}/{parentSlug}/kr/ 디렉토리가 없으면 생성
파일 형식:
---
title: "{N}. {English Title}"
titleKr: "{N}. {한국어 제목}"
chapter: {N}
timestamp: "{타임스탬프}"
sourceUrl: "{YouTube URL}&t={초}s"
translatedAt: "{YYYY-MM-DD}"
---
# {N}. {한국어 제목}
[영상 바로가기 ({타임스탬프})]({sourceUrl})
## 요약
{요약 텍스트}
**핵심 개념:**
{핵심 포인트 목록}
---
## 전체 번역
{타임스탬프 포함 번역 텍스트}
파일이 이미 존재하는 경우:
--overwrite 옵션: 덮어쓰기
기본: 건너뜀 (⚠ 표시)
챕터 파일 생성 결과를 확인합니다:
부분 성공 시:
✓ 챕터별 번역 파일 생성
- 20개 파일 생성
⚠ 4개 파일 건너뜀 (이미 존재):
- introduction.md
- tokenization.md
전체 번역 파일 없음:
⚠ 전체 번역 파일이 없습니다: docs/week1/kr/deep-dive-llms.md
챕터별 번역 파일 생성을 건너뜁니다.
readings.ts 업데이트만 완료합니다.
(children의 published: false, hasMarkdown: false)
다음 단계:
/translate-reading week1/deep-dive-llms 실행 후 다시 실행하세요.
## Table of Contents
1. [Introduction](#1-introduction) (0:00)
2. [Pretraining Data (Internet)](#2-pretraining-data-internet) (1:00)
정규식:
/^(\d+)\.\s*\[(.+?)\]\(#.+?\)\s*\((\d+:\d+(?::\d+)?)\)/gm
그룹:
## 1. Introduction
**요약**: ChatGPT와 같은...
[0:00] hi everyone...
정규식:
/^## (\d+)\.\s*(.+?)$/gm
| 상황 | 처리 |
|---|---|
| 원본 파일 없음 | /fetch-reading 실행 안내 |
| 챕터 구조 파싱 실패 | 수동 입력 안내 |
| readings.ts에 항목 없음 | 먼저 /upload-reading 필요 |
| 이미 isParent=true | 기존 children 덮어쓰기 확인 |
| 전체 번역 파일 없음 | 경고 출력, readings.ts만 업데이트 |
| SUMMARY 섹션 없음 | 경고 출력, 파일 생성 건너뜀 |
| 챕터 수 불일치 | 매칭되는 것만 생성, 경고 표시 |
| 챕터 파일 이미 존재 | 기본: 건너뜀 / --overwrite: 덮어쓰기 |
챕터 파일이 생성되면 웹에서 동적 로딩이 가능하도록 public 디렉토리에 복사합니다.
# 디렉토리 생성
mkdir -p public/readings/week{N}/{parentSlug}/
# 챕터 파일 복사
cp docs/week{N}/{parentSlug}/kr/*.md public/readings/week{N}/{parentSlug}/
출력 예시:
✓ public 디렉토리 동기화 완료
- 경로: public/readings/week1/deep-dive-llms/
- 파일: 24개
readings.ts의 모든 children에 hasMarkdown: true와 published: true를 설정합니다.
// Step 6에서 생성한 children 업데이트
children: [
{
slug: 'introduction',
title: '1. Introduction',
titleKr: '1. 소개',
sourceUrl: 'https://www.youtube.com/watch?v=...&t=0s',
published: true, // ← 변경
hasMarkdown: true, // ← 추가
},
// ...
]
주의: 번역 파일이 없어서 챕터 파일을 생성하지 않은 경우, hasMarkdown: false로 유지합니다.
✓ YouTube 콘텐츠를 챕터별 하위페이지로 변환 완료
원본: week1/deep-dive-llms
챕터: 24개
readings.ts 업데이트:
- isParent: true 추가
- children: 24개 ChildReading 추가
- hasMarkdown: true (모든 children)
챕터별 번역 파일 생성:
✓ docs/week1/deep-dive-llms/kr/introduction.md
✓ docs/week1/deep-dive-llms/kr/pretraining-data.md
... (24개 파일)
public 디렉토리 동기화:
✓ public/readings/week1/deep-dive-llms/ (24개 파일)
다음 단계:
pnpm dev → /readings/week1/deep-dive-llms
/readings/week{N}/{parentSlug}/{childSlug}fetch(/readings/week1/{slug}/{childSlug}.md)