Skip to content

Commit 81accb1

Browse files
authored
feat: add custom github-issue-triage skill with local dashboard (a2ui-project#1758)
## Summary This change introduces a custom `a2ui-issue-triage` developer skill to automate the triage of GitHub issues in the A2UI repository. It provides a complete workflow and local web-based dashboard for oncall engineers to review, refine, and bulk-apply AI-suggested priorities, labels, assignees, and responses. Additionally, it integrates all developer skills unit tests into the GitHub Actions CI pipeline. ## Changes * **Custom `a2ui-issue-triage` Developer Skill (`.agents/skills/a2ui-issue-triage/`)**: * `SKILL.md`: Outlines the 4-step triage workflow (fetch, analyze/suggest, dashboard, apply). * `references/triage_criteria.md`: Defines authorative classification rules for priorities (`P0`-`P3`), components, and response templates. * `scripts/fetch_issues.py`: Retrieves open repository issues lacking priority labels via the GitHub CLI. * `scripts/suggest_triage.py`: Generates initial triage recommendations (priority, component labels, suggested assignee, draft response) using heuristics. * `scripts/launch_dashboard.py` & `assets/triage_dashboard.html`: Implements a local HTTP server and rich web dashboard to allow interactive review and refinement of suggestions. * `scripts/apply_triage.py`: Bulk-applies approved triage decisions (labels, assignments, comments, closing status) to GitHub. * **Test Coverage**: * Added unit tests next to their respective scripts: `test_apply_triage.py`, `test_fetch_issues.py`, `test_launch_dashboard.py`, and `test_suggest_triage.py`. * **Dynamic Skills Test Runner**: * `scripts/run_skills_tests.py`: Automatically discovers and executes unit tests for all developer skills under `.agents/skills/` in clean, isolated subprocesses. * **CI/CD Integration (`.github/workflows/python_ci.yml`)**: * Added a new `skills` job running the dynamic test runner. * Configured workflow path triggers to run the job on any changes to `.agents/skills/**` or `scripts/run_skills_tests.py`. * **Custom `natural-writing` Skill (`.agents/skills/natural-writing/`)**: * `SKILL.md`: Formulates guidelines and rules for writing natural, clear, and factual descriptions. ## Impact & Risks * **No Production Code Impact**: These changes are purely developer-facing tools and repository CI automation. They do not affect the compiled production code of the A2UI library or its SDKs. * **GitHub CLI Dependency**: The fetch and apply scripts rely on a working local installation of the GitHub CLI (`gh`) authenticated with repository write access. ## Testing * **Unit Tests**: * Created 31 unit tests covering all scripts, achieving high code coverage. * All tests pass locally and are integrated to run automatically in CI. * To run the tests locally, run: `python3 scripts/run_skills_tests.py` from the repository root.
1 parent 3115be0 commit 81accb1

16 files changed

Lines changed: 3894 additions & 1 deletion

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# GitHub issue triage
2+
3+
This developer skill automates the triage of GitHub issues in the A2UI repository. It fetches open issues that do not have a priority label, analyzes them, and opens a local web dashboard where you can review, edit, and apply the recommendations.
4+
5+
## How to prompt the agent
6+
7+
To start the triage workflow, ask the agent to run an issue triage skill: "Let's triage some issues on A2UI!". You can also ask the agent to run the skill directly: "Run the a2ui-issue-triage skill."
8+
9+
### Recommended prompt
10+
11+
> Triage the first 10 unprioritized issues in the repository.
12+
13+
### Guidelines for the prompt
14+
15+
- Specify a different count if needed. You can ask the agent to triage a specific number of issues (for example, 5 or 10). If you do not specify a number, the agent defaults to 10.
16+
- Limit the number of issues. We recommend triaging at most 10 issues at a time. The agent spawns parallel subagents to analyze each issue. Triaging more than 10 issues at once can make the process slow and difficult to manage.
17+
- Target specific issues. You can also ask the agent to triage specific issues if you want to focus on a particular set of issues, or only issues with specific attributes (labels, authors, milestone, etc.).
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
name: a2ui-issue-triage
3+
description: Automates the triage of GitHub issues in the A2UI repository. Helps the oncall engineer by fetching untriaged issues, generating AI-suggested priorities, assignees, and responses, launching a local review dashboard, and bulk-applying approved decisions to GitHub. Use when tasked with triaging new GitHub issues or managing the repository backlog.
4+
---
5+
6+
# A2UI GitHub Issue Triage Skill
7+
8+
This skill guides the process of fetching, analyzing, reviewing, and applying triage decisions to GitHub issues in the A2UI repository using a local interactive dashboard.
9+
10+
> [!IMPORTANT]
11+
> **WRITING GUIDELINES**
12+
> When drafting replies, explanations, or any prose, refer to the [natural-writing](../natural-writing/SKILL.md) skill to ensure clarity, accuracy, and tone.
13+
14+
---
15+
16+
## Workflow
17+
18+
Follow these steps to triage new or backlog issues:
19+
20+
### Step 1: Fetch Untriaged Issues
21+
22+
Use the fetch script to retrieve all open issues lacking a priority label (`P0`, `P1`, `P2`, `P3`, `P4`) in the A2UI repository.
23+
24+
1. Run the fetch script to download the issues to a raw JSON file in your conversation-specific scratch directory:
25+
`python3 .agents/skills/a2ui-issue-triage/scripts/fetch_issues.py --repo "gspencergoog/a2ui" --output-file "<appDataDir>/brain/<conversation-id>/scratch/raw_issues.json"`
26+
27+
---
28+
29+
### Step 2: Analyze and Suggest Triage
30+
31+
Process the raw issues and generate recommended triage fields based on the project's triage criteria.
32+
33+
1. Read the triage criteria reference document: [triage_criteria.md](references/triage_criteria.md).
34+
2. For each issue in `raw_issues.json`, evaluate its description and comments to determine:
35+
- **Priority**: `P0` (Urgent), `P1` (High), `P2` (Medium), `P3` (Low), or `None`.
36+
- **Assignee**: Recommended owner based on the affected component or area.
37+
- **Action**: `investigate`, `assign_and_fix`, `needs_info`, `close_duplicate`, `close_invalid`, or `close_resolved`.
38+
- **Labels**: Applicable repository labels (e.g. `type: bug`, `component: lit renderer`).
39+
- **Reply**: A polite, structured draft response addressing the author.
40+
3. If an issue is a potential duplicate, perform at most three targeted GitHub searches to find matching canonical issues before suggesting `close_duplicate`.
41+
4. **Natively Orchestrate Subagents**: Instead of running a Python script to spawn subagents (which can fail due to local workstation gRPC credential policies), the parent agent should natively orchestrate the parallel evaluations:
42+
- Load the first N issues (defaulting to 10, or as requested) from `raw_issues.json`.
43+
- Call the `invoke_subagent` tool in parallel for those issues. Prompt each subagent to analyze its assigned issue against the guidelines in [triage_criteria.md](references/triage_criteria.md) and return a structured JSON block containing `priority`, `action`, `labels`, and `reply`.
44+
- Once all subagents report back, compile their recommendations into the standard schema:
45+
- Map component labels to suggested assignees using git log history if necessary, and include a short sentence in `assignee_reason` explaining why they were chosen (e.g., "Suggesting gspencer because they recently modified related code").
46+
- Inject `total_issues_count` (preserving the total count from the raw issues JSON).
47+
- Save the final compiled payload to `issues_to_triage.json` in the scratch directory.
48+
49+
---
50+
51+
### Step 3: Launch Review Dashboard
52+
53+
Launch the interactive web dashboard to allow the oncall engineer to review and refine the suggested triages.
54+
55+
1. Start the local server as a background task, pointing it to your scratch directory:
56+
`python3 .agents/skills/a2ui-issue-triage/scripts/launch_dashboard.py --data-file "<appDataDir>/brain/<conversation-id>/scratch/issues_to_triage.json" --output-file "<appDataDir>/brain/<conversation-id>/scratch/triage_decisions.json"`
57+
Set `WaitMsBeforeAsync` to `1000` so the server runs in the background.
58+
2. **Wait for Completion**: Stop calling tools and go idle. The launcher will automatically open the browser for the user and block until they click "Apply Triages" or "Abort". Once the user acts, the background task will complete, and you will receive a notification with the exit status.
59+
3. **Verify Exit Status**:
60+
- If the task exited with status `0` (approved), proceed to apply the decisions.
61+
- If the task exited with a non-zero status (abort), don't modify any issues. You MUST STOP and ask the user for further instructions.
62+
63+
---
64+
65+
### Step 4: Apply Decisions to GitHub
66+
67+
Once the dashboard task exits successfully, **Execute Approved Decisions**: Run the apply script to update the approved labels, assignees, and comments on GitHub:
68+
69+
`python3 .agents/skills/a2ui-issue-triage/scripts/apply_triage.py --decisions-file "<appDataDir>/brain/<conversation-id>/scratch/triage_decisions.json"`
70+
71+
---
72+
73+
## Bundled Resources
74+
75+
- **[triage_criteria.md](references/triage_criteria.md)**: Authoritative guide for classifying issues, assigning priorities, and drafting response messages.
76+
- **`scripts/fetch_issues.py`**: Script to query open, untriaged issues via the GitHub CLI.
77+
- **`scripts/suggest_triage.py`**: Helper script to generate initial triage suggestions.
78+
- **`scripts/launch_dashboard.py`**: Local HTTP server that opens the interactive web dashboard in the user's browser.
79+
- **`assets/triage_dashboard.html`**: HTML/CSS/JS template for the triage review interface.
80+
- **`scripts/apply_triage.py`**: Script to apply finalized triage decisions to GitHub.

0 commit comments

Comments
 (0)