yy-create-report
Description
This skill automatically reads the commit records of the specified or default Git account within the specified time range, categorizes and summarizes them by type, and generates a structured work report. It supports specifying any account via parameters; if no account is specified, it defaults to the Git account configured on the current computer.
Usage Scenarios
- Users say "Generate work report", "Write work report", "Summarize work", "Generate work summary"
- Users request "Generate this week/last week's work report"
- Users request "Generate a work report for a specified date range"
- Users request "Generate a work report for the xxx account"
Should not trigger:
- Users only query Git commit records without mentioning reports
- Users request to directly execute
- Users request to submit code
Operation Steps
1. Get Current Git Account Information
bash
git config user.name
git config user.email
If Git user information is not configured, prompt the user to configure it first.
2. Parse Specified Account Parameters
Check if the user input contains specified account information, supporting the following formats:
Account: zhangsan@example.com
If the user does not specify an account, use
obtained in Step 1 as the default account.
The final determined account value will be used for the
parameter in Step 4.
3. Determine Date Range
- This week: From Monday of this week to today
- Last week: From Monday to Sunday of last week
- Custom: According to the date range specified by the user
If the user does not specify a date range, it defaults to querying this week (from Monday of this week to today).
4. Read Git Commit Records
bash
git log --since="YYYY-MM-DD" --until="YYYY-MM-DD" --author="Username" --pretty=format:"%h | %ad | %s" --date=short --no-merges
Parameter Explanation:
- : Start date
- : End date
- : Only count commits from the specified author (source: the account determined in Step 2, defaults to the current Git account)
- : Exclude merge commits
5. Categorization and Summarization
Categorize based on commit message keywords:
- Feature Development: feat, add, feature
- Code Optimization: refactor, optimize, adjust, improve
- Bug Fixes: fix, bug, hotfix, resolve
- Configuration Related: config, chore, dependency, build
- Documentation Updates: docs, readme
- Others: Uncategorizable commits
Note: Merge similar commit contents and output in Chinese.
6. Output Structured Work Report
Output in the following format:
markdown
## Work Report Title (Date Range)
**Suggested MR Title:** Briefly describe the core work content
### I. Feature Development
1. Feature 1
2. Feature 2
### II. Code Optimization
1. Optimization Item 1
### III. Bug Fixes
1. Fix Item 1
### IV. Configuration Related
- Configuration Item 1
### V. Documentation Updates
- Documentation Item 1
### VI. Others
- Other Work
Output Examples
With Commit Records
markdown
## This Week's Work Report (2024-01-15 ~ 2024-01-19)
**Suggested MR Title:** Implemented user login, personal center and message notification features
### I. Feature Development
1. **User Login Feature** - Implemented JWT-based user authentication with Token refresh support
2. **Personal Center Page** - Added user profile editing and avatar upload features
3. **Message Notification System** - Implemented WebSocket real-time message push
### II. Code Optimization
1. Optimized API request interceptor to reduce duplicate code
2. Refactored state management module to improve performance
### III. Bug Fixes
1. Fixed layout misalignment issue when iOS soft keyboard pops up
2. Fixed abnormal display of some components in dark mode
### IV. Configuration Related
- Updated dependency package versions (vue@3.4, vite@5.0)
- Configured CI/CD automation process
### V. Documentation Updates
- Updated API interface documentation
### VI. Others
- Participated in 3 code reviews
Without Commit Records
markdown
## This Week's Work Report (2024-01-15 ~ 2024-01-19)
**Suggested MR Title:** No Commit Records
No commit records this week.
Possible reasons:
- Haven't started new tasks yet
- Work content is meeting/document related
- Changes haven't been submitted yet
- Submitted author does not match the current Git account
Notes
- Use forward slashes as path separators; wrap paths containing spaces in quotes
- If there are no commits in the specified time range, prompt the user "No commit records available"
- Keep the format clean and neat
- If the project is not in a Git repository, prompt the user
- By default, count the commit records of the current Git account; other accounts can be specified via parameters (supports username or email)
- After outputting, ask the user if they need to adjust the format or add content
Acceptance Checklist
After executing the skill, check:
- The report title includes the correct date range
- Categorization is accurate (Feature Development, Code Optimization, Bug Fixes, etc.)
- Commit contents have merged similar items with no duplicates
- The suggested MR title concisely summarizes the core work
- Output is in Chinese with a clean and neat format