Skip to content

Commit 502ab18

Browse files
committed
CLID-473: subagent to generate weekly reports
Signed-off-by: Alex Guidi <[email protected]>
1 parent 68bc257 commit 502ab18

File tree

5 files changed

+774
-0
lines changed

5 files changed

+774
-0
lines changed

.claude-plugin/marketplace.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
"name": "hcp",
7979
"source": "./plugins/hcp",
8080
"description": "Generate HyperShift cluster creation commands via hcp CLI from natural language descriptions"
81+
},
82+
{
83+
"name": "report-writer",
84+
"source": "./plugins/report-writer",
85+
"description": "An agent plugin to generate reports"
8186
}
8287
]
8388
}

docs/data.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,14 @@
534534
}
535535
],
536536
"has_readme": true
537+
},
538+
{
539+
"name": "report-writer",
540+
"description": "An agent plugin to generate reports",
541+
"version": "0.0.1",
542+
"commands": [],
543+
"skills": [],
544+
"has_readme": true
537545
}
538546
]
539547
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "report-writer",
3+
"description": "A agent plugin to generate reports",
4+
"version": "0.0.1",
5+
"author": {
6+
"name": "github.com/aguidirh"
7+
}
8+
}

plugins/report-writer/README.md

Lines changed: 332 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,332 @@
1+
# Report Writer Plugin
2+
3+
An intelligent agent plugin that generates comprehensive weekly team activity reports by systematically collecting and analyzing data from Atlassian Jira. This plugin automates the tedious process of gathering sprint data, tracking issue changes, and producing detailed activity summaries.
4+
5+
> **Status**: Work in Progress - Actively reducing hallucinations and improving data accuracy
6+
7+
## Overview
8+
9+
The Report Writer agent follows a rigorous 5-step workflow to ensure complete data capture and accuracy:
10+
11+
1. **Parse Parameters** - Extract project, component, date range, and optional notes
12+
2. **Discover Board** - Identify the correct Jira agile board for the project
13+
3. **Find Sprint** - Locate the sprint that overlaps with the target reporting week
14+
4. **Fetch Issue Keys** - Retrieve all issues in the sprint (with optional component filtering)
15+
5. **Collect Complete Data** - Fetch full issue details including changelogs and comments
16+
17+
The agent generates structured reports that include:
18+
- Sprint summary metrics
19+
- Issues with activity during the reporting period
20+
- Team member contributions
21+
- PR activity and status transitions
22+
- Custom notes and context
23+
24+
## Features
25+
26+
-**Accurate Week Calculation** - Uses Monday-Sunday format with configurable week offsets
27+
-**Activity Filtering** - Only includes issues with activity during the target week
28+
-**Complete Data Collection** - Fetches full issue history including changelogs and comments
29+
-**Component Filtering** - Generate reports for specific components within a project
30+
-**Data Preservation** - Saves complete JSON data file for audit and analysis
31+
-**Batch Processing** - Efficient parallel fetching of issue data
32+
-**Verification Steps** - Validates data completeness before report generation
33+
34+
## Prerequisites
35+
36+
- Claude Code installed
37+
- Jira MCP server configured and running
38+
39+
## Setup
40+
41+
### Option 1: Using npx (Recommended for Atlassian Cloud)
42+
43+
```bash
44+
# Add the Atlassian MCP server
45+
claude mcp add atlassian npx @modelcontextprotocol/server-atlassian
46+
```
47+
48+
Configure your Jira credentials according to the [Atlassian MCP documentation](https://github.com/modelcontextprotocol/servers/tree/main/src/atlassian).
49+
50+
**Required tokens:**
51+
- **JIRA API TOKEN**: Generate at https://id.atlassian.com/manage-profile/security/api-tokens
52+
53+
### Option 2: Using External Server (Recommended for Jira Data Center)
54+
55+
Connect Claude to an already running Jira MCP Server:
56+
57+
```bash
58+
# Add the Atlassian MCP server via SSE transport
59+
claude mcp add --transport sse atlassian http https://127.0.0.1:8080/sse
60+
```
61+
62+
### Option 3: Running Jira MCP Server with Podman/Docker
63+
64+
Start the Atlassian MCP server in a container:
65+
66+
```bash
67+
# Start the server with podman
68+
podman run -i --rm -p 8080:8080 \
69+
-e "JIRA_URL=https://issues.redhat.com" \
70+
-e "JIRA_USERNAME=your-username" \
71+
-e "JIRA_API_TOKEN=your-api-token" \
72+
-e "JIRA_PERSONAL_TOKEN=your-personal-token" \
73+
-e "JIRA_SSL_VERIFY=true" \
74+
ghcr.io/sooperset/mcp-atlassian:latest \
75+
--transport sse --port 8080 -vv
76+
77+
# Or with docker
78+
docker run -i --rm -p 8080:8080 \
79+
-e "JIRA_URL=https://issues.redhat.com" \
80+
-e "JIRA_USERNAME=your-username" \
81+
-e "JIRA_API_TOKEN=your-api-token" \
82+
-e "JIRA_PERSONAL_TOKEN=your-personal-token" \
83+
-e "JIRA_SSL_VERIFY=true" \
84+
ghcr.io/sooperset/mcp-atlassian:latest \
85+
--transport sse --port 8080 -vv
86+
```
87+
88+
**Required tokens:**
89+
- **JIRA PERSONAL TOKEN**: Generate at https://issues.redhat.com/secure/ViewProfile.jspa?selectedTab=com.atlassian.pats.pats-plugin:jira-user-personal-access-tokens
90+
- **JIRA API TOKEN**: For Atlassian Cloud compatibility
91+
92+
## Usage
93+
94+
### Basic Usage
95+
96+
Generate a report for the previous week (Monday-Sunday):
97+
98+
```
99+
Can you generate a weekly report for the last week for the project CLID?
100+
```
101+
102+
### With Component Filter
103+
104+
Generate a report for a specific component:
105+
106+
```
107+
Can you generate a weekly report for the last week for the project CLID and component oc-mirror?
108+
```
109+
110+
### Custom Week Offset
111+
112+
Generate a report for the current week:
113+
114+
```
115+
Generate a weekly report for this week (week-offset 0) for project CLID
116+
```
117+
118+
Generate a report for two weeks ago:
119+
120+
```
121+
Generate a report for project CLID with week-offset -2
122+
```
123+
124+
### With Custom Notes
125+
126+
Include additional context in the report:
127+
128+
```
129+
Generate a sprint report for CLID Sprint 278 and include these notes:
130+
- Major milestone: Feature X completed
131+
- Blockers resolved: Infrastructure access granted
132+
- Next sprint focus: Performance optimization
133+
```
134+
135+
## Parameters
136+
137+
The agent supports the following parameters (specified in natural language):
138+
139+
| Parameter | Description | Default | Example |
140+
|-----------|-------------|---------|---------|
141+
| `--project` | Project key (REQUIRED) | None | `CLID` |
142+
| `--component` | Component filter (optional) | None | `oc-mirror` |
143+
| `--week-offset` | Weeks back from current week | `-1` | `0` (this week), `-1` (last week), `-2` (two weeks ago) |
144+
| `--notes` | Manual notes to include | None | Custom text |
145+
| `--slack-file` | Path to Slack standup file | None | `/path/to/standup.txt` |
146+
147+
## Output Format
148+
149+
### Report Structure
150+
151+
The generated report includes:
152+
153+
1. **Header**
154+
- Project name and sprint name
155+
- Date range (Monday-Sunday format)
156+
- Component filter (if applied)
157+
158+
2. **Summary Metrics**
159+
- Total issues in sprint
160+
- Issues with activity during report week
161+
- Activity breakdown by type
162+
163+
3. **Issues with Activity** (grouped by activity type)
164+
- Issues closed during the week
165+
- Issues with status transitions
166+
- Issues with significant comments
167+
- Issues with PR activity
168+
- Issues added to or removed from sprint
169+
170+
4. **Team Member Contributions**
171+
- Activity summary per team member
172+
173+
5. **PR Activity**
174+
- PRs created, updated, or merged during the week
175+
176+
6. **Additional Notes**
177+
- Custom notes from `--notes` or `--slack-file`
178+
179+
### Data File
180+
181+
The agent creates a comprehensive JSON data file at `/tmp/jira-issues-{timestamp}.json` containing:
182+
183+
- Complete issue data for all issues in the sprint
184+
- Full changelogs and comment history
185+
- All custom fields and metadata
186+
187+
This file can be used for:
188+
- Audit trails
189+
- Custom analysis
190+
- Debugging report generation
191+
- Historical reference
192+
193+
**Example output:**
194+
```
195+
════════════════════════════════════════════════════════════
196+
DATA FILE CREATED
197+
════════════════════════════════════════════════════════════
198+
File Path: /tmp/jira-issues-20251029-143022.json
199+
Issues Saved: 15/15
200+
File Size: 127 KB
201+
Contains Changelogs: ✓ Yes
202+
Contains Comments: ✓ Yes
203+
════════════════════════════════════════════════════════════
204+
```
205+
206+
## How It Works
207+
208+
### Week Calculation
209+
210+
The agent uses **Monday-Sunday** week format exclusively:
211+
212+
- **week-offset = -1** (default): Previous Monday-Sunday
213+
- **week-offset = 0**: Current Monday-Sunday
214+
- **week-offset = -2**: Two weeks ago Monday-Sunday
215+
216+
**Example:** If today is Thursday, Oct 30, 2025:
217+
- Current week: Monday Oct 27 - Sunday Nov 2
218+
- Last week (offset -1): Monday Oct 20 - Sunday Oct 26
219+
220+
### Activity Filtering
221+
222+
The report **only includes issues with activity during the target week**:
223+
224+
- Status transitions (using changelog timestamps)
225+
- Field changes (assignee, priority, labels, etc.)
226+
- Comments added
227+
- PR activity
228+
- Sprint assignments
229+
230+
Issues completed before the report week are fetched for context but excluded from the final report.
231+
232+
### Data Collection Process
233+
234+
1. **Issue Discovery**: Uses JQL to find all issues in the target sprint
235+
2. **Batch Fetching**: Retrieves issues in parallel batches of 5
236+
3. **Complete Data**: Fetches all fields with `fields="*all"` and `expand="changelog"`
237+
4. **Verification**: Validates data completeness before report generation
238+
5. **Filtering**: Analyzes changelogs to identify activity within the target week
239+
240+
## Troubleshooting
241+
242+
### No boards found for project
243+
244+
**Problem:** The agent can't find an agile board for your project.
245+
246+
**Solution:** Verify that:
247+
- Your project has an agile board configured in Jira
248+
- You have permissions to access the board
249+
- The project key is correct
250+
251+
### Sprint not found for date range
252+
253+
**Problem:** No sprint overlaps with the target week.
254+
255+
**Solution:**
256+
- Check if your team uses sprints in Jira
257+
- Verify the project follows an agile methodology
258+
- Try a different week offset
259+
- Confirm sprint dates in Jira
260+
261+
### Missing changelogs in data
262+
263+
**Problem:** The data file doesn't contain changelogs.
264+
265+
**Solution:** This indicates a bug in the agent. The agent should automatically retry with the correct parameters. If the issue persists, please report it.
266+
267+
### Empty report
268+
269+
**Problem:** Report shows no activity for the week.
270+
271+
**Solution:**
272+
- Verify the week offset is correct
273+
- Check if there was actual activity in Jira during that week
274+
- Ensure component filter isn't too restrictive
275+
- Review the data file to confirm issues were fetched
276+
277+
### API rate limiting
278+
279+
**Problem:** Jira MCP server returns rate limiting errors.
280+
281+
**Solution:**
282+
- The agent will automatically reduce batch size
283+
- Implement exponential backoff
284+
- Contact your Jira administrator if limits are too restrictive
285+
286+
## Examples
287+
288+
### Example 1: Basic Weekly Report
289+
290+
**Input:**
291+
```
292+
Generate a weekly report for last week for project CLID
293+
```
294+
295+
**Output:**
296+
- Report covering Monday-Sunday of previous week
297+
- All issues with activity during that week
298+
- Team contributions summary
299+
- Data file at `/tmp/jira-issues-{timestamp}.json`
300+
301+
### Example 2: Component-Filtered Report
302+
303+
**Input:**
304+
```
305+
Generate a report for the oc-mirror component from last week's sprint in CLID
306+
```
307+
308+
**Output:**
309+
- Report filtered to oc-mirror component only
310+
- Activity for issues tagged with oc-mirror
311+
- Component-specific metrics
312+
313+
### Example 3: Custom Week with Notes
314+
315+
**Input:**
316+
```
317+
Generate a sprint report for CLID for this week and include notes about the architecture review meeting
318+
```
319+
320+
**Output:**
321+
- Report for current week (Monday-Sunday)
322+
- Includes custom notes section
323+
- Full activity breakdown
324+
325+
## Best Practices
326+
327+
1. **Run reports consistently** - Generate reports on the same day each week (e.g., Monday mornings)
328+
2. **Review data files** - Keep the JSON files for historical analysis
329+
3. **Use component filters** - For large projects, generate component-specific reports
330+
4. **Add context with notes** - Include standup notes or meeting highlights
331+
5. **Verify date ranges** - Double-check the week offset produces the correct date range
332+
6. **Archive reports** - Save generated reports for sprint retrospectives

0 commit comments

Comments
 (0)