Skip to content

Commit 45c34b8

Browse files
Add Discussion Task Miner workflow (#224)
1 parent 98104b0 commit 45c34b8

3 files changed

Lines changed: 303 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
- [👥 Daily Repo Status](docs/daily-repo-status.md) - Assess repository activity and create status reports
2727
- [👥 Daily Team Status](docs/daily-team-status.md) - Create upbeat daily team activity summaries with productivity insights
2828
- [📋 Daily Plan](docs/daily-plan.md) - Update planning issues for team coordination
29+
- [🔍 Discussion Task Miner](docs/discussion-task-miner.md) - Extract actionable improvement tasks from GitHub Discussions and create tracked issues
2930

3031
### Dependency Management Workflows
3132

docs/discussion-task-miner.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# 🔍 Discussion Task Miner
2+
3+
> For an overview of all available workflows, see the [main README](../README.md).
4+
5+
**Automatically extract actionable tasks from GitHub Discussions and create trackable issues**
6+
7+
The [Discussion Task Miner workflow](../workflows/discussion-task-miner.md?plain=1) runs daily to scan recent GitHub Discussions for actionable improvement opportunities. It identifies concrete, well-scoped tasks and converts them into GitHub issues (up to 5 per run), bridging the gap between discussion insights and tracked work items.
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/discussion-task-miner
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[Scan Recent Discussions] --> B[Extract Action Items]
26+
B --> C[Filter & Prioritize]
27+
C --> D{High Value?}
28+
D -->|Yes| E[Create GitHub Issue]
29+
D -->|No| F[Skip]
30+
E --> G[Update Memory]
31+
F --> G
32+
```
33+
34+
The workflow reads discussions from the last 7 days, analyzes their content for recommendations, action items, and improvement suggestions, then converts the top findings into focused, actionable GitHub issues. It uses repo-memory to avoid re-processing the same discussions across runs.
35+
36+
## Prerequisites
37+
38+
GitHub Discussions must be enabled for your repository. The workflow works best in repositories that generate discussion content from other agentic workflows (such as analysis reports, quality audits, or review summaries), though it can also mine any human-authored discussions containing improvement suggestions.
39+
40+
## Examples
41+
42+
Based on usage in the gh-aw repository: **57% merge rate** (60 merged PRs out of 105 proposed through a discussion → issue → PR causal chain). The workflow demonstrates how insights buried in discussions can be surfaced as trackable work—a verified example chain: [Discussion #13934](https://github.com/github/gh-aw/discussions/13934)[Issue #14084](https://github.com/github/gh-aw/issues/14084)[PR #14129](https://github.com/github/gh-aw/pull/14129).
43+
44+
## Usage
45+
46+
### Configuration
47+
48+
The workflow is configured to:
49+
- Run daily
50+
- Create max 5 issues per run
51+
- Auto-expire issues after 1 day if not addressed
52+
- Use repo-memory to track processed discussions and avoid duplicates
53+
54+
To customize which types of tasks to extract, edit the "Focus Areas" and "Task Extraction Criteria" sections in the workflow file. After editing, run `gh aw compile` to update the workflow and commit all changes to the default branch.
55+
56+
### Pairing with Other Workflows
57+
58+
This workflow pairs especially well with other analysis workflows that post findings as discussions:
59+
- [Daily Accessibility Review](daily-accessibility-review.md)
60+
- [Daily Adhoc QA](daily-qa.md)
61+
- [Daily Malicious Code Scan](daily-malicious-code-scan.md)
62+
- [Daily Performance Improver](daily-perf-improver.md)
63+
64+
## Learn More
65+
66+
- [GitHub Agentic Workflows Documentation](https://github.github.io/gh-aw/)
67+
- [Blog: Agentic Workflow Campaigns & Multi-Phase Workflows](https://github.github.io/gh-aw/blog/2026-01-13-meet-the-workflows-campaigns/)

workflows/discussion-task-miner.md

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
---
2+
name: Discussion Task Miner
3+
description: Scans recent GitHub Discussions to extract actionable improvement tasks and create trackable GitHub issues
4+
on:
5+
schedule: daily
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
discussions: read
11+
issues: read
12+
pull-requests: read
13+
14+
tracker-id: discussion-task-miner
15+
timeout-minutes: 20
16+
engine: copilot
17+
strict: true
18+
19+
network:
20+
allowed:
21+
- defaults
22+
23+
safe-outputs:
24+
create-issue:
25+
title-prefix: "[task-miner] "
26+
labels: [automated-analysis]
27+
max: 5
28+
group: true
29+
expires: 1d
30+
messages:
31+
footer: "> 🔍 *Task mining by [{workflow_name}]({run_url})*"
32+
run-started: "🔍 Discussion Task Miner starting! [{workflow_name}]({run_url}) is scanning discussions for actionable tasks..."
33+
run-success: "✅ Task mining complete! [{workflow_name}]({run_url}) has identified actionable tasks from recent discussions. 📊"
34+
run-failure: "⚠️ Task mining interrupted! [{workflow_name}]({run_url}) {status}. Please review the logs..."
35+
36+
tools:
37+
cache-memory: true
38+
github:
39+
lockdown: true
40+
toolsets: [default, discussions]
41+
bash:
42+
- "jq *"
43+
- "cat *"
44+
- "date *"
45+
46+
imports:
47+
- shared/reporting.md
48+
---
49+
50+
# Discussion Task Miner
51+
52+
You are a task mining agent that analyzes recent GitHub Discussions to discover actionable improvement opportunities.
53+
54+
## Mission
55+
56+
Scan recent GitHub Discussions to identify and extract specific, actionable tasks that improve the repository. Convert these discoveries into trackable GitHub issues.
57+
58+
## Objectives
59+
60+
1. **Mine Discussions**: Analyze recent discussions (last 7 days)
61+
2. **Extract Tasks**: Identify concrete, actionable improvements
62+
3. **Create Issues**: Convert high-value tasks into GitHub issues
63+
4. **Track Progress**: Maintain memory of processed discussions to avoid duplicates
64+
65+
## Task Extraction Criteria
66+
67+
Focus on extracting tasks that meet **ALL** these criteria:
68+
69+
### Quality Criteria
70+
-**Specific**: Task has clear scope and acceptance criteria
71+
-**Actionable**: Can be completed by a developer or AI agent
72+
-**Valuable**: Improves the repository in a meaningful way
73+
-**Scoped**: Can be completed in 1-3 days of work
74+
-**Independent**: Doesn't require completing other tasks first
75+
76+
### Focus Areas
77+
- **Code Quality**: Simplify complex code, reduce duplication, improve structure
78+
- **Testing**: Add missing tests, improve test coverage, fix flaky tests
79+
- **Documentation**: Add or improve documentation, examples, guides
80+
- **Performance**: Optimize slow operations, reduce resource usage
81+
- **Security**: Fix vulnerabilities, improve security practices
82+
- **Maintainability**: Improve code organization, naming, patterns
83+
- **Technical Debt**: Address TODOs, deprecated APIs, workarounds
84+
- **Tooling**: Improve linters, formatters, build scripts, CI/CD
85+
86+
### Exclude These
87+
- ❌ Vague suggestions without clear scope ("improve code")
88+
- ❌ Already tracked in existing issues
89+
- ❌ Feature requests or new functionality
90+
- ❌ Bug reports (those go through normal bug triage)
91+
- ❌ Tasks requiring architectural decisions
92+
- ❌ Tasks requiring human judgment or business decisions
93+
94+
## Workflow Steps
95+
96+
### Step 1: Load Memory
97+
98+
Check cache-memory for previously processed discussions. The cache memory stores a JSON object with this structure:
99+
100+
```json
101+
{
102+
"last_run": "2026-03-01",
103+
"discussions_processed": [
104+
{"id": 1234, "title": "...", "processed_at": "2026-03-01T10:00:00Z"}
105+
],
106+
"extracted_tasks": [
107+
{
108+
"source_discussion": 1234,
109+
"issue_number": 5678,
110+
"title": "...",
111+
"created_at": "2026-03-01T10:00:00Z",
112+
"status": "created"
113+
}
114+
]
115+
}
116+
```
117+
118+
This helps avoid re-processing the same discussions and creating duplicate issues.
119+
120+
### Step 2: Query Recent Discussions
121+
122+
Use GitHub tools to fetch recent discussions from the last 7 days. Look for discussions with titles or content that contain actionable insights, such as:
123+
- Analysis reports and audit findings
124+
- Code review observations
125+
- Performance or quality assessments
126+
- Recommendations sections in any discussion
127+
- Any discussion mentioning "should", "could", "improve", "fix", "refactor", "add"
128+
129+
Limit to the 20-30 most recent discussions for efficiency.
130+
131+
### Step 3: Analyze Discussion Content
132+
133+
For each discussion, extract the full content including:
134+
- Title and body
135+
- All comments
136+
- Look for sections like:
137+
- "Recommendations"
138+
- "Action Items"
139+
- "Improvements Needed"
140+
- "Issues Found"
141+
- "Technical Debt"
142+
- "Refactoring Opportunities"
143+
- "TODOs" or "Next Steps"
144+
145+
**Analysis approach:**
146+
1. Read the discussion content carefully
147+
2. Identify mentions of concrete improvement opportunities
148+
3. Extract specific tasks with clear descriptions
149+
4. Note the file paths, components, or areas mentioned
150+
5. Assess impact and feasibility
151+
152+
### Step 4: Filter and Prioritize Tasks
153+
154+
From all identified tasks, select the **top 3-5 highest-value tasks** based on:
155+
1. **Impact**: How much does this improve the repository?
156+
2. **Effort**: Is it achievable in 1-3 days?
157+
3. **Clarity**: Is the task well-defined?
158+
4. **Uniqueness**: Haven't we already created an issue for this?
159+
160+
**Deduplication:**
161+
- Check processed-discussions.json to avoid re-extracting from same discussion
162+
- Check extracted-tasks.json to avoid creating duplicate issues
163+
- Search existing GitHub issues to ensure task isn't already tracked
164+
165+
### Step 5: Create GitHub Issues
166+
167+
For each selected task, use the `create-issue` safe output with a clear title and body. Format issues to include:
168+
169+
- **Description**: What needs to be done and why
170+
- **Suggested Changes**: Specific actions to take
171+
- **Files Affected**: Relevant files or components (if known)
172+
- **Success Criteria**: How to know when done
173+
- **Source**: Link to the source discussion
174+
- **Priority**: High/Medium/Low
175+
176+
**Issue formatting guidelines:**
177+
- Use clear, descriptive titles (50-80 characters)
178+
- Include acceptance criteria
179+
- Link back to source discussion
180+
- Add appropriate priority (High/Medium/Low)
181+
182+
### Step 6: Update Memory
183+
184+
Save progress to cache-memory using the JSON structure:
185+
186+
```json
187+
{
188+
"last_run": "<today's date>",
189+
"discussions_processed": [
190+
{"id": 1234, "title": "...", "processed_at": "<timestamp>"}
191+
],
192+
"extracted_tasks": [
193+
{
194+
"source_discussion": 1234,
195+
"issue_number": 5678,
196+
"title": "...",
197+
"created_at": "<timestamp>",
198+
"status": "created"
199+
}
200+
]
201+
}
202+
```
203+
204+
Merge with the existing cache-memory data to preserve historical tracking of processed discussions and extracted tasks.
205+
206+
## Output Requirements
207+
208+
### Issue Creation
209+
- Create **3-5 issues maximum** per run
210+
- Each issue expires after 1 day if not addressed
211+
- All issues tagged with `automated-analysis`
212+
- Issues include clear acceptance criteria
213+
214+
### Memory Tracking
215+
- Always update cache-memory after each run to avoid duplicates
216+
- Maintain extracted tasks in cache-memory for historical tracking
217+
218+
### Quality Standards
219+
- Only create issues for high-value, actionable tasks
220+
- Ensure each issue is specific and well-scoped
221+
- Link back to source discussions for context
222+
223+
## Important Notes
224+
225+
- **Be selective** - only the highest-value tasks make the cut
226+
- **Avoid duplicates** - check memory and existing issues before creating
227+
- **Clear scope** - tasks should be completable in 1-3 days
228+
- **Actionable** - someone should be able to start immediately
229+
- **Source attribution** - always link to the original discussion
230+
231+
**Important**: If no discussions are found or no actionable tasks are identified, you **MUST** call the `noop` safe-output tool with a brief explanation.
232+
233+
```json
234+
{"noop": {"message": "No action needed: [brief explanation of what was analyzed and why no tasks were extracted]"}}
235+
```

0 commit comments

Comments
 (0)