Generate a structured work daily report based on git commit records.
Steps
Step 1: Parse the date parameter
Determine the query date based on user input:
- No parameter: defaults totoday
- Specific date format:
05-13→ May 13 of the current year;2026-05-13→ May 13, 2026 - Natural language:
昨天→ today minus 1 day;前天→ today minus 2 days
Convert the parsed result into a specific YYYY-MM-DD format date, recorded as $DATE. The next day is recorded as $NEXT_DATE。
Step 2: Prompt the user to confirm the daily report format
Show the user the default daily report format template, and ask the user to confirm or modify it:
## {YYYYMMDD}-工作日报&明日计划
### 今天工作总结
1. {按功能模块归类的工作内容,每条用中文顿号或逗号连接相关细节}
### 明日计划
1.
Ask the user: "The above is the default daily report format. Do you need to modify it? Directly confirming will use this format to generate the daily report."
Wait for the user's reply before continuing.
Step 3: Query git commit records
Execute the following command to get the commit records for the specified date:
# 获取提交列表(含完整 hash、时间、消息)
git log --since="$DATE 00:00:00" --until="$NEXT_DATE 00:00:00" --author="$(git config user.name)" --format="%H %ai %s" --all
For each commit hash, view its file change scope for categorization:
# 查看单个提交的变更文件统计
git diff-tree --no-commit-id --stat -r <hash>
Step 4: Intelligent categorization and filtering
Perform categorization based on the commit records:
Filtering rules(the following commits are not included in the daily report):
chore: record journaltype pure management recordschore(task): archivetype archive operations- Merge commit (commits whose message starts with
Merge) - Other commits with clearly no business significance
Categorization rules(determined based on changed file paths and commit message):
aieda-ui/or frontend-related paths → Frontendapi-server/oragent-worker/→ Backendpush-gateway/ortool-gateway/→ Gateway/Infrastructuredocker、nginx, deployment-related → Deployment/Operationsdocs、README, documentation-related → Documentationtrellis, task management-related → Project Management- When uncertain, determine based on the scope in the commit message
Merging rules:
- Multiple related commits in the same module are merged into one work item
- When merging, connect details with enumeration commas or commas
- Keep each description concise but with complete information
Step 5: Generate the daily report
Generate the daily report according to the format confirmed by the user, noting:
- The date format in the date title is
YYYYMMDD(e.g.,20260513) - The work summary numbering uses the standard markdown numbering format:
1.2.3. - Each work item is categorized by module, and related commits are merged in the description
- Leave the tomorrow's plan section blank, keeping only
1.for the user to fill in themselves - If there are no commits for the day, output the prompt: "No commit records were found for the day."
Output the generated daily report directly so the user can copy and use it.
Notes
- Only query commits from the current git user (
--authorfilter) - The query scope covers all branches (
--all) - The daily report content uses Chinese
- The work summary description should focus on "what was done" rather than technical details