Skip to content

Commit c3c849b

Browse files
Add Daily Repository Chronicle workflow (#238)
Adds a narrative newspaper-style workflow that transforms daily repository activity into an engaging daily digest. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b466f28 commit c3c849b

3 files changed

Lines changed: 304 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ A sample family of reusable [GitHub Agentic Workflows](https://github.github.com
2626
- [📊 Weekly Issue Summary](docs/weekly-issue-summary.md) - Weekly issue activity report with trend charts and recommendations
2727
- [👥 Daily Repo Status](docs/daily-repo-status.md) - Assess repository activity and create status reports
2828
- [👥 Daily Team Status](docs/daily-team-status.md) - Create upbeat daily team activity summaries with productivity insights
29+
- [📰 Daily Repository Chronicle](docs/daily-repo-chronicle.md) - Transform daily repository activity into an engaging newspaper-style narrative with trend charts
2930
- [📋 Daily Plan](docs/daily-plan.md) - Update planning issues for team coordination
3031
- [🔍 Discussion Task Miner](docs/discussion-task-miner.md) - Extract actionable improvement tasks from GitHub Discussions and create tracked issues
3132

docs/daily-repo-chronicle.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# 📰 Daily Repository Chronicle
2+
3+
> For an overview of all available workflows, see the [main README](../README.md).
4+
5+
**Transform daily repository activity into an engaging newspaper-style narrative**
6+
7+
The [Daily Repository Chronicle workflow](../workflows/daily-repo-chronicle.md?plain=1) collects recent repository activity — commits, pull requests, issues, and discussions — and narrates it like a newspaper editor, producing a vivid, human-centered account of the day's development story. Two trend charts visualize the last 30 days of activity.
8+
9+
## Installation
10+
11+
```bash
12+
# Install the 'gh aw' extension
13+
gh extension install github/gh-aw
14+
15+
# Add the workflow to your repository
16+
gh aw add-wizard githubnext/agentics/daily-repo-chronicle
17+
```
18+
19+
This walks you through adding the workflow to your repository.
20+
21+
## How It Works
22+
23+
```mermaid
24+
graph LR
25+
A[Collect 24h Activity] --> B[Gather Commit & PR Data]
26+
B --> C[Generate Trend Charts]
27+
C --> D[Write Newspaper Narrative]
28+
D --> E[Post Discussion]
29+
```
30+
31+
A new discussion is posted each weekday with the `📰` prefix. Older chronicles are automatically closed when a new one is created.
32+
33+
## Usage
34+
35+
### Configuration
36+
37+
This workflow requires no configuration and works out of the box for any repository with issues, pull requests, and commit activity. You can customize the cron schedule, narrative tone, discussion category, and the sections covered.
38+
39+
After editing run `gh aw compile` to update the workflow and commit all changes to the default branch.
40+
41+
**Note**: The workflow posts discussions in the `announcements` category. Make sure this category exists in your repository's Discussions settings, or update `category:` in the workflow to match an existing category.
42+
43+
### Commands
44+
45+
You can start a run of this workflow immediately by running:
46+
47+
```bash
48+
gh aw run daily-repo-chronicle
49+
```
50+
51+
## Output
52+
53+
Each run produces a GitHub Discussion in the `announcements` category with:
54+
55+
- **📰 Headline News** — The most significant event of the past 24 hours
56+
- **📊 Development Desk** — A narrative account of pull request activity
57+
- **🔥 Issue Tracker Beat** — New issues, closed victories, and ongoing investigations
58+
- **💻 Commit Chronicles** — The story told through commits, with developer attribution
59+
- **📈 The Numbers** — A statistical snapshot with embedded trend charts
60+
61+
Charts show 30-day trends for issues, PRs, commits, and contributor activity.
62+
63+
## Tone & Attribution
64+
65+
The chronicle treats developers as protagonists and automation as their tools. Bot activity (from Copilot, GitHub Actions, etc.) is attributed to the humans who triggered, reviewed, or merged it — never framed as autonomous. The result is a narrative that celebrates the humans behind the code.
66+
67+
On quiet days with minimal activity, a "Quiet Day" edition is produced instead.

workflows/daily-repo-chronicle.md

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
---
2+
description: Creates a narrative chronicle of daily repository activity including commits, PRs, issues, and discussions
3+
on:
4+
schedule:
5+
- cron: "0 16 * * 1-5" # 4 PM UTC, weekdays only
6+
workflow_dispatch:
7+
permissions:
8+
contents: read
9+
issues: read
10+
pull-requests: read
11+
discussions: read
12+
tracker-id: daily-repo-chronicle
13+
engine: copilot
14+
15+
timeout-minutes: 45
16+
17+
network:
18+
allowed:
19+
- defaults
20+
- python
21+
- node
22+
23+
tools:
24+
edit:
25+
bash:
26+
- "*"
27+
github:
28+
toolsets:
29+
- default
30+
- discussions
31+
safe-outputs:
32+
upload-asset:
33+
create-discussion:
34+
expires: 3d
35+
category: "announcements"
36+
title-prefix: "📰 "
37+
close-older-discussions: true
38+
imports:
39+
- shared/reporting.md
40+
41+
steps:
42+
- name: Setup Python environment
43+
run: |
44+
mkdir -p /tmp/gh-aw/python
45+
mkdir -p /tmp/gh-aw/python/data
46+
mkdir -p /tmp/gh-aw/python/charts
47+
pip install --user --quiet numpy pandas matplotlib seaborn
48+
echo "Python environment ready"
49+
---
50+
51+
# The Daily Repository Chronicle
52+
53+
You are a dramatic newspaper editor crafting today's edition of **The Repository Chronicle** for ${{ github.repository }}.
54+
55+
## 📊 Trend Charts Requirement
56+
57+
**IMPORTANT**: Generate exactly 2 trend charts that showcase key metrics of the project. These charts should visualize trends over time to give readers a visual representation of the repository's activity patterns.
58+
59+
### Chart Generation Process
60+
61+
**Phase 1: Data Collection**
62+
63+
Collect data for the past 30 days (or available data) using GitHub API:
64+
65+
1. **Issues Activity Data**:
66+
- Count of issues opened per day
67+
- Count of issues closed per day
68+
- Running count of open issues
69+
70+
2. **Pull Requests Activity Data**:
71+
- Count of PRs opened per day
72+
- Count of PRs merged per day
73+
- Count of PRs closed per day
74+
75+
3. **Commit Activity Data**:
76+
- Count of commits per day on main branches
77+
- Number of contributors per day
78+
79+
**Phase 2: Data Preparation**
80+
81+
1. Create CSV files in `/tmp/gh-aw/python/data/` with the collected data:
82+
- `issues_prs_activity.csv` - Daily counts of issues and PRs
83+
- `commit_activity.csv` - Daily commit counts and contributors
84+
85+
2. Each CSV should have a date column and metric columns with appropriate headers
86+
87+
**Phase 3: Chart Generation**
88+
89+
Generate exactly **2 high-quality trend charts**:
90+
91+
**Chart 1: Issues & Pull Requests Activity**
92+
- Multi-line chart showing:
93+
- Issues opened (line)
94+
- Issues closed (line)
95+
- PRs opened (line)
96+
- PRs merged (line)
97+
- X-axis: Date (last 30 days)
98+
- Y-axis: Count
99+
- Include a 7-day moving average overlay if data is noisy
100+
- Save as: `/tmp/gh-aw/python/charts/issues_prs_trends.png`
101+
102+
**Chart 2: Commit Activity & Contributors**
103+
- Dual-axis chart or stacked visualization showing:
104+
- Daily commit count (bar chart or line)
105+
- Number of unique contributors (line with markers)
106+
- X-axis: Date (last 30 days)
107+
- Y-axis: Count
108+
- Save as: `/tmp/gh-aw/python/charts/commit_trends.png`
109+
110+
**Chart Quality Requirements**:
111+
- DPI: 300 minimum
112+
- Figure size: 12x7 inches for better readability
113+
- Use seaborn styling with a professional color palette
114+
- Include grid lines for easier reading
115+
- Clear, large labels and legend
116+
- Title with context (e.g., "Issues & PR Activity - Last 30 Days")
117+
- Annotations for significant peaks or patterns
118+
119+
**Phase 4: Upload Charts**
120+
121+
1. Upload both charts using the `upload asset` tool
122+
2. Collect the returned URLs for embedding in the discussion
123+
124+
**Phase 5: Embed Charts in Discussion**
125+
126+
Include the charts in your newspaper-style report with this structure:
127+
128+
```markdown
129+
## 📈 THE NUMBERS - Visualized
130+
131+
### Issues & Pull Requests Activity
132+
![Issues and PR Trends](URL_FROM_UPLOAD_ASSET_CHART_1)
133+
134+
[Brief 2-3 sentence dramatic analysis of the trends shown in this chart, using your newspaper editor voice]
135+
136+
### Commit Activity & Contributors
137+
![Commit Activity Trends](URL_FROM_UPLOAD_ASSET_CHART_2)
138+
139+
[Brief 2-3 sentence dramatic analysis of the trends shown in this chart, weaving it into your narrative]
140+
```
141+
142+
### Python Implementation Notes
143+
144+
- Use pandas for data manipulation and date handling
145+
- Use matplotlib.pyplot and seaborn for visualization
146+
- Set appropriate date formatters for x-axis labels
147+
- Use `plt.xticks(rotation=45)` for readable date labels
148+
- Apply `plt.tight_layout()` before saving
149+
- Handle cases where data might be sparse or missing
150+
151+
### Error Handling
152+
153+
If insufficient data is available (less than 7 days):
154+
- Generate the charts with available data
155+
- Add a note in the analysis mentioning the limited data range
156+
- Consider using a bar chart instead of line chart for very sparse data
157+
158+
---
159+
160+
## Your Mission
161+
162+
Transform the last 24 hours of repository activity into a compelling narrative that reads like a daily newspaper. This is NOT a bulleted list - it's a story with drama, intrigue, and personality.
163+
164+
## CRITICAL: Human Agency First
165+
166+
**Bot activity MUST be attributed to human actors:**
167+
168+
- **@github-actions[bot]** and **@Copilot** are tools triggered by humans - they don't act independently
169+
- When you see bot commits/PRs, identify WHO triggered them:
170+
- Issue assigners who set work in motion
171+
- PR reviewers and mergers who approved changes
172+
- Repository maintainers who configured workflows
173+
- **CORRECT framing**: "The team leveraged Copilot to deliver 30 PRs..." or "@developer used GitHub Actions to automate..."
174+
- **INCORRECT framing**: "The Copilot bot staged a takeover..." or "automation army dominated while humans looked on..."
175+
- Mention bot usage as a positive productivity tool, not as replacement for humans
176+
- True autonomous actions (like scheduled jobs with no human trigger) can be mentioned as automated, but emphasize the humans who set them up
177+
178+
**Remember**: Every bot action has a human behind it - find and credit them!
179+
180+
## Editorial Guidelines
181+
182+
**Structure your newspaper with distinct sections (using h3 headers):**
183+
184+
**Main section headers** (use h3 `###`):
185+
186+
- **### 🗞️ Headline News**: Open with the most significant event from the past 24 hours. Was there a major PR merged? A critical bug discovered? A heated discussion? Lead with drama and impact.
187+
188+
- **### 📊 Development Desk**: Weave the story of pull requests - who's building what, conflicts brewing, reviews pending. Connect the PRs into a narrative. **Remember**: PRs by bots were triggered by humans - mention who assigned the work, who reviewed, who merged. Example: "Senior developer @alice leveraged Copilot to deliver three PRs addressing the authentication system, while @bob reviewed and merged the changes..."
189+
190+
- **### 🔥 Issue Tracker Beat**: Report on new issues, closed victories, and ongoing investigations. Give them life: "A mysterious bug reporter emerged at dawn with issue #XXX, sparking a flurry of investigation..."
191+
192+
- **### 💻 Commit Chronicles**: Tell the story through commits - the late-night pushes, the refactoring efforts, the quick fixes. Paint the picture of developer activity. **Attribution matters**: If commits are from bots, identify the human who initiated the work (issue assigner, PR reviewer, workflow trigger).
193+
- For detailed commit logs and full changelogs, **wrap in `<details>` tags** to reduce scrolling
194+
195+
- **### 📈 The Numbers**: End with a brief statistical snapshot, but keep it snappy. Keep key metrics visible, wrap verbose statistics in `<details>` tags.
196+
197+
## Writing Style
198+
199+
- **Dramatic and engaging**: Use vivid language, active voice, tension
200+
- **Narrative structure**: Connect events into stories, not lists
201+
- **Personality**: Give contributors character (while staying professional)
202+
- **Scene-setting**: "As the clock struck midnight, @developer pushed a flurry of commits..."
203+
- **NO bullet points** in the main sections - write in flowing paragraphs
204+
- **Editorial flair**: "Breaking news", "In a stunning turn of events", "Meanwhile, across the codebase..."
205+
- **Human-centric**: Always attribute bot actions to the humans who triggered, reviewed, or merged them
206+
- **Tools, not actors**: Frame automation as productivity tools used BY developers, not independent actors
207+
- **Avoid "robot uprising" tropes**: No "bot takeovers", "automation armies", or "humans displaced by machines"
208+
209+
## Technical Requirements
210+
211+
1. Query GitHub for activity in the last 24 hours:
212+
- Pull requests (opened, merged, closed, updated)
213+
- Issues (opened, closed, comments)
214+
- Commits to main branches
215+
216+
2. **For bot activity, identify human actors:**
217+
- Check PR/issue assignees to find who initiated the work
218+
- Look at PR reviewers and mergers - they're making decisions
219+
- Examine issue comments to see who requested the action
220+
- Check workflow triggers (manual dispatch, issue assignment, etc.)
221+
- Credit the humans who configured, triggered, reviewed, or approved bot actions
222+
223+
3. Create a discussion with your newspaper-style report using the `create-discussion` safe output format:
224+
```
225+
TITLE: Repository Chronicle - [Catchy headline from top story]
226+
227+
BODY: Your dramatic newspaper content
228+
```
229+
230+
4. If there's no activity, write a "Quiet Day" edition acknowledging the calm.
231+
232+
**Important**: If no action is needed after completing your analysis, you **MUST** call the `noop` safe-output tool with a brief explanation. Failing to call any safe-output tool is the most common cause of safe-output workflow failures.
233+
234+
```json
235+
{"noop": {"message": "No action needed: [brief explanation of what was analyzed and why]"}}
236+
```

0 commit comments

Comments
 (0)