Launch daily-work-writer agent to generate work logs with interactive input collection
Generates work logs by analyzing git commits or conversation context with interactive project and date selection.
/plugin marketplace add Bae-ChangHyun/cc-plugins-bch/plugin install docs@cc-plugins-bch# Check current config for default path
cat ~/.config/claude-code/docs_config.json 2>/dev/null || echo "NO_CONFIG"
# Get current directory
pwd
Store these values:
{config_base_path}: From config file or "docs"{current_directory}: Current working directory{current_project_name}: basename of current directoryUse AskUserQuestion:
Question: "어떤 프로젝트의 업무일지를 작성할까요?"
Header: "프로젝트"
Options:
- label: "{current_directory}", description: "현재 디렉토리 기반으로 git 커밋 분석"
- label: "대화 기반", description: "특정 프로젝트 경로 없이 대화 내용으로 작성"
multiSelect: false
NOTE:
Use AskUserQuestion:
Question: "업무일지를 어디에 저장할까요?"
Header: "출력 경로"
Options:
- label: "{config_base_path}/daily_work/", description: "설정된 기본 경로 사용"
- label: "{current_directory}/docs/daily_work/", description: "현재 프로젝트 내 docs 폴더"
multiSelect: false
NOTE:
SKIP this step if "대화 기반" was selected in Step 1.
First, analyze the project to determine date options:
# Get the most recent log date from output directory
ls -1 {output_path}/{project_name}/*.md 2>/dev/null | sort -r | head -1
# Get the first commit date
git -C {project_path} log --all --reverse --format="%ad" --date=short | head -1
# Get total commit count from last log date to today (for distribution decision)
git -C {project_path} log --all --since="{last_log_date}" --until="today" --oneline | wc -l
Store these values:
{last_log_date}: Date from most recent log file (or "없음" if no logs exist){first_commit_date}: Date of the first commit in the repository{commit_count}: Total commits in the potential date rangeUse AskUserQuestion:
Question: "어느 기간의 업무일지를 작성할까요?"
Header: "날짜 범위"
Options:
- label: "오늘만", description: "오늘 날짜의 커밋만 분석하여 업무일지 작성"
- label: "마지막 이후", description: "마지막 로그({last_log_date}) 이후부터 오늘까지 (Recommended)"
- label: "전체", description: "첫 커밋({first_commit_date})부터 오늘까지 전체 기록 생성"
multiSelect: false
NOTE:
Based on selection:
start_date = today, end_date = todaystart_date = day after last_log_date (or first_commit_date if no logs), end_date = todaystart_date = first_commit_date, end_date = todayAfter determining date range, check if distribution is needed:
# Count commits in the selected date range
git -C {project_path} log --all --since="{start_date}" --until="{end_date}" --oneline | wc -l
# Count unique dates with commits
git -C {project_path} log --all --since="{start_date}" --until="{end_date}" --format="%ad" --date=short | sort -u | wc -l
THRESHOLD: 50 commits or 7+ unique dates → Distribute to multiple agents
If distribution is needed:
Example distribution for 30 days of commits:
After collecting all inputs, use the Task tool with subagent_type='worklog-writer'.
Prompt format for agent:
프로젝트 경로: [selected_project_path or "대화 기반"]
프로젝트 이름: [project_name]
출력 경로: [selected_output_path]
날짜 범위: [start_date] ~ [end_date]
패딩 범위: [padding_start] ~ [padding_end]
추가 컨텍스트: $ARGUMENTS
When distributing work, launch multiple Task tools in parallel (in a single message):
# Agent 1
프로젝트 경로: /home/user/myproject
프로젝트 이름: myproject
출력 경로: ~/Documents/docs/daily_work/
날짜 범위: 2025-01-01 ~ 2025-01-07
패딩 범위: 2024-12-31 ~ 2025-01-08
추가 컨텍스트: [context]
# Agent 2
프로젝트 경로: /home/user/myproject
프로젝트 이름: myproject
출력 경로: ~/Documents/docs/daily_work/
날짜 범위: 2025-01-08 ~ 2025-01-14
패딩 범위: 2025-01-07 ~ 2025-01-15
추가 컨텍스트: [context]
IMPORTANT: Launch all agents in parallel using multiple Task tool calls in a single response message.
Path Resolution:
{output_path}/{project_name}/YYYY-MM-DD.md
~/Documents/docs/daily_work/myproject/2025-01-07.mdExample 1: Today only
User: /worklog
→ Pre-check: config 읽기, pwd 확인 (/home/user/myproject)
→ AskUserQuestion: 프로젝트?
User: /home/user/myproject
→ AskUserQuestion: 출력 경로?
User: ~/Documents/docs/daily_work/
→ Analyze: 마지막 로그 2025-01-05, 첫 커밋 2024-12-01
→ AskUserQuestion: 날짜 범위?
User: 오늘만
→ Task: worklog-writer
프로젝트 경로: /home/user/myproject
프로젝트 이름: myproject
출력 경로: ~/Documents/docs/daily_work/
날짜 범위: 2025-01-08 ~ 2025-01-08
패딩 범위: 2025-01-07 ~ 2025-01-09
Example 2: Since last log (small)
User: /worklog
→ AskUserQuestion: 프로젝트? → /home/user/myproject
→ AskUserQuestion: 출력 경로? → 기본 경로
→ Analyze: 마지막 로그 2025-01-05, 커밋 수 15개
→ AskUserQuestion: 날짜 범위?
User: 마지막 이후
→ Single Task (15 commits < 50 threshold)
날짜 범위: 2025-01-06 ~ 2025-01-08
패딩 범위: 2025-01-05 ~ 2025-01-09
Example 3: Full history (large - needs distribution)
User: /worklog
→ AskUserQuestion: 프로젝트? → /home/user/myproject
→ AskUserQuestion: 출력 경로? → 기본 경로
→ Analyze: 첫 커밋 2024-12-01, 커밋 수 120개, 30일
→ AskUserQuestion: 날짜 범위?
User: 전체
→ Distribution needed (120 commits > 50 threshold)
→ Split into 5 agents (7 days each):
→ Task 1: worklog-writer (Dec 1-7, padding: Nov 30 - Dec 8)
→ Task 2: worklog-writer (Dec 8-14, padding: Dec 7 - Dec 15)
→ Task 3: worklog-writer (Dec 15-21, padding: Dec 14 - Dec 22)
→ Task 4: worklog-writer (Dec 22-28, padding: Dec 21 - Dec 29)
→ Task 5: worklog-writer (Dec 29 - Jan 8, padding: Dec 28 - Jan 9)
(All 5 agents launched in parallel)
Example 4: Conversation-based (날짜 범위 선택 생략)
User: /worklog 오늘 회의 내용 정리
→ AskUserQuestion: 프로젝트?
User: 대화 기반
→ AskUserQuestion: 출력 경로?
User: 기본 경로
→ Task: worklog-writer (날짜 범위 선택 SKIP)
프로젝트 경로: 대화 기반
프로젝트 이름: general
출력 경로: ~/Documents/docs/daily_work/
추가 컨텍스트: 오늘 회의 내용 정리
Example 5: Custom date range
User: /worklog
→ AskUserQuestion: 날짜 범위?
User: Other → "2025-01-01 ~ 2025-01-03"
→ Task: worklog-writer
날짜 범위: 2025-01-01 ~ 2025-01-03
패딩 범위: 2024-12-31 ~ 2025-01-04