|
|
||
|---|---|---|
| .claude/skills | ||
| .env.example | ||
| .gitignore | ||
| AGENTS.md | ||
| README.md | ||
| example.py | ||
| pyproject.toml | ||
README.md
Report Generation Skills Experiment
This repository contains AI skills for automated report generation. Currently includes weekly project report generators that transform time tracking data into formatted management reports.
Available Skills
📊 Week Report Generator (week_report_gen)
Automatically generates weekly project reports (項目週報) from exported Excel time tracking data.
📦 Week Work Package Log (week_work_package_log)
Fetches and displays time entries grouped by work packages for specified date ranges via OpenProject API. Provides detailed analysis of work package time logging patterns with user, project, and activity information.
Key Features:
- 🌳 Hierarchical Display: Shows project and work package relationships in tree format
- 📊 Completion Tracking: Displays work package completion percentages with intelligent calculation
- 📝 Time Analysis: Detailed breakdown of time entries by user, activity, and comments
- 📊 Multiple Output Formats: Tree view for human reading, JSON for data integration
Completion Calculation Logic:
- Closed/Rejected work packages: Automatically marked as 100%
- Explicit completion: Uses percentageDone or derivedPercentageDone from OpenProject
- Recursive calculation: Parent work packages derive completion from children averages
- No-info handling: Leaf nodes default to 0%, parents calculate from children
🚀 Week Report Generator from JSON (week_report_gen_from_json)
New Enhanced Version: Automatically generates weekly project reports directly from OpenProject API data via JSON format. Features intelligent cell merging, hierarchical project structure recognition, automatic progress tracking, and streamlined workflow.
Progress Auto-Fill Logic:
- 🔍 When C column (子項目名稱) contains work_package: Automatically fills D column (進度) with work package completion percentage
- 📋 When C column is empty or "-": Automatically fills D column with E column work item completion percentage
- ⚙️ Smart Integration: Seamlessly integrates with
week_work_package_logcompletion tracking system
Key Advantages:
- 🔄 Direct API Integration: No manual Excel export required
- 🎯 Smart Cell Merging: Automatic B/C/D column merging for cleaner presentation
- 📊 Hierarchical Structure: Proper project → sub-project → task organization
- 📈 Automatic Progress Tracking: Auto-fills D column (進度) with work package completion percentages
- ⚡ Automated Workflow: From data fetch to formatted report in one command
- 🎨 Professional Layout: Enhanced visual grouping and formatting
Getting Started
Prerequisites
# Create virtual environment and install dependencies
uv sync
# Verify OpenProject API connection
uv run --env-file .env python -c 'import os; print(os.getenv("OPENPROJECT_TOKEN"))'
Usage Examples
Original Excel-based Generator
uv run --env-file .env python .claude\skills\week_report_gen\generate_report.py "temp\cost-report-2026-01-16-T-16-22-3620260116-7-1r1n4h.xls" "temp\項目週報-智能控制組-20260119.xlsx"
Work Package Analysis
# Tree view with completion percentages
uv run --env-file .env python .claude\skills\week_work_package_log\work_package_logger.py "2026-01-22" "2026-01-22" --format tree
# JSON output for data integration
uv run --env-file .env python .claude\skills\week_work_package_log\work_package_logger.py "2026-01-22" "2026-01-22" --format json
# Both formats
uv run --env-file .env python .claude\skills\week_work_package_log\work_package_logger.py "2026-01-22" "2026-01-22" --format both
New JSON-based Generator (Recommended)
# Generate report for specific date range
uv run --env-file .env python .claude\skills\week_report_gen_from_json\generate_report.py "2026-01-20" "2026-01-22" "temp\週報-智能控制組-20260123.xlsx"
# Generate report for current week (default)
uv run --env-file .env python .claude\skills\week_report_gen_from_json\generate_report.py
# Use existing JSON data file
uv run --env-file .env python .claude\skills\week_report_gen_from_json\generate_report.py "data.json" "output.xlsx"