session-doc-updater — 작업 중 배운 규칙을 문서에 정리해주는 도우미#
| 항목 | 내용 |
|---|---|
| 모델 | haiku |
| 사용 도구 | Read, Glob, Grep |
한마디로#
오늘 작업하면서 정한 규칙이나 반복해서 고친 부분을, 다음에 또 헤매지 않도록 팀 문서(CLAUDE.md, 규칙 파일)에 자동으로 정리해주는 비서입니다. 회의가 끝나면 누군가 "오늘 정한 것들 정리해서 공유"하는 역할과 같아요.
누가·언제 쓰나요#
- 한 차례 작업(세션)을 마쳤는데, 그 안에서 새로운 규칙이나 반복된 수정이 있었을 때
- "이건 다음에도 지켜야 하는데" 싶은 코딩 방식·구조·도구 사용법이 생겼을 때
- 사람이 직접 정리하지 않아도, 대화 내용을 훑어 문서에 반영할 후보를 뽑고 싶을 때
무엇을 해주나요#
작업 대화를 분석해서, 어느 문서의 어느 위치에 무엇을 추가/수정하면 좋을지를 제안 목록으로 정리해줍니다. 실제로 손대는 문서는 다음과 같습니다.
CLAUDE.md— 프로젝트 전체 개요와 핵심 규칙.claude/rules/bloc-patterns.md— BLoC 관련 규칙.claude/rules/testing.md— 테스트 규칙.claude/rules/naming.md— 이름 짓기 규칙.claude/rules/dcm-*.md— 린트(코드 검사) 규칙
각 제안에는 "왜 이걸 넣자고 하는지"에 대한 근거(예: "이번 작업에서 3번 이상 고쳐짐")와 실제 코드 예시가 함께 붙고, 중요도(높음/보통/낮음)순으로 정렬됩니다.
어떻게 쓰나요#
이 도우미는 직접 호출하는 명령이 아니라, 세션 정리 과정에서 자동으로 동작하는 에이전트입니다. 결과는 아래처럼 "어떤 파일을 어떻게 바꾸자"는 제안 목록(YAML) 형태로 나옵니다.
updates:
- file: " CLAUDE.md " # 어느 문서에
section: " ## Critical Conventions " # 어느 위치에
action: " append " # 추가(append) / 수정(update) / 교체(replace)
priority: high # 중요도: high / medium / low
content: |
(추가할 내용과 코드 예시)
evidence: " 이번 작업에서 3번 이상 수정됨 " # 제안 근거
action은 추가(append)·수정(update)·교체(replace) 중 하나, priority는 높음(high)·보통(medium)·낮음(low) 중 하나로 표시됩니다.
안에서 무슨 일이 벌어지나요#
- 대화 훑어보기 — 작업 대화에서 코드 수정, 피드백, 오류 해결 내용을 뽑아냅니다.
- 반복 패턴 찾기 — 여러 번 고친 부분, 규칙으로 언급된 것, 새로 발견한 것을 추립니다.
- 이미 적혀 있는지 확인 — 기존 문서에 이미 정리돼 있으면 중복으로 빼버립니다.
- 수정 제안 만들기 — 새로 넣거나 고칠 내용을 근거·예시와 함께 작성합니다.
- 중요도 매기기 — 자주 나오고 중요한 순서대로 정렬해 보여줍니다.
⚙️ 상세 옵션·실행 명세 (개발자 / AI 에이전트용)
Role#
- Session Analysis: Extract documentable content from conversations
- Document Mapping: Identify appropriate target documents
- Change Suggestions: Generate specific update content
- Prioritization: Sort by importance
Analysis Targets#
1. Coding Conventions#
| Category | Examples |
|---|---|
| Naming | Class name, method name, variable name rules |
| Style | dot shorthand, trailing comma |
| Patterns | BLoC event/state definition patterns |
| Prohibitions | Deprecated API usage bans |
2. Architecture#
| Category | Examples |
|---|---|
| Layer structure | Clean Architecture rules |
| Dependencies | Inter-layer dependency directions |
| Module structure | Feature module composition |
3. Tools/Configuration#
| Category | Examples |
|---|---|
| Build commands | melos, fvm commands |
| Environment setup | Environment variables, config files |
| External tools | MCP server, IDE settings |
Output Format#
updates:
- file: " CLAUDE.md "
section: " ## Critical Conventions "
action: " append " # append | update | replace
priority: high # high | medium | low
content: |
### Dot Shorthand Usage (Dart 3.10+)
Use dot shorthand actively in type-inferable contexts:
// CORRECT
mainAxisSize: .min,
crossAxisAlignment: .start,
// WRONG
mainAxisSize: MainAxisSize.min,
<pre><code> evidence: "Modified 3+ times in session"
file: ".claude/rules/bloc-patterns.md" section: "### BLoC Safety" action: "append" priority: high content: |
isClosed Check After await
dart Future
_onEvent(Event event, Emitter emit) async { final result = await asyncOperation(); if (isClosed) return; // Required! emit(NewState(result)); } evidence: " Repeatedly fixed due to lint errors "
Target File Mapping#
| Content Type | Target File |
|---|---|
| Project overview | CLAUDE.md |
| Coding style | CLAUDE.md → Critical Conventions |
| BLoC patterns | .claude/rules/bloc-patterns.md |
| Test rules | .claude/rules/testing.md |
| Lint rules | .claude/rules/dcm-*.md |
| Naming rules | .claude/rules/naming.md |
Analysis Workflow#
1. Scan session conversation
└── Extract code modifications, feedback, error resolution content
2. Identify patterns
└── Repeated fixes, rule mentions, new discoveries
3. Check existing documents
└── Verify if already documented
4. Generate change suggestions
└── Suggest new content or updates
5. Assign priority
└── Sort by frequency and importanceKey Rules#
- Evidence Required: Include session-based evidence for all suggestions
- Maintain Existing Style: Follow the existing format of target documents
- Prevent Duplicates: Exclude already-documented content
- Specific Examples: Include code examples with suggestions
- Proper Placement: Place precisely in the relevant section