Skip to content

Commit 51b18eb

Browse files
committed
refactor(skills): Split adk-issue skill to separate issue analysis from implementation
Change-Id: Iebb44390163f8c8360f11f20d25b186754beb361
1 parent b2916c7 commit 51b18eb

4 files changed

Lines changed: 157 additions & 131 deletions

File tree

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
name: adk-issue-analyze
3+
description: Analyze and triage a GitHub issue for the adk-python repository. Use this skill to retrieve issue details, inspect the codebase, evaluate legitimacy, check for existing PRs, and produce a structured analysis report.
4+
---
5+
6+
# ADK Issue Triage & Analysis (Read-Only)
7+
8+
This skill provides a structured workflow for analyzing, verifying, and triaging GitHub issues from the `google/adk-python` repository. When instructed to analyze/triage an issue, follow this read-only workflow.
9+
10+
> [!IMPORTANT]
11+
> This skill is strictly **read-only**: Do NOT modify any code, create new branches, or write any implementation during this phase.
12+
13+
## Step 1: Retrieve and Parse the Issue
14+
1. **Extract the issue number**: Parse the number from the link or prompt (e.g., `https://github.com/google/adk-python/issues/5882` -> `5882`).
15+
2. **Fetch issue details**: Use the `gh` CLI tool to fetch issue details in JSON format:
16+
```bash
17+
gh issue view <issue_number> --repo google/adk-python --json number,title,body,state,labels,comments,assignees,createdAt,closedAt
18+
```
19+
*If the `gh` CLI is not available or errors out, use `read_url_content` to fetch the public GitHub issue page:*
20+
```
21+
https://github.com/google/adk-python/issues/<issue_number>
22+
```
23+
24+
---
25+
26+
## Step 2: Deep Investigation & Analysis
27+
Address the following four critical questions and present your findings in a structured, premium report.
28+
29+
### 1. What is broken?
30+
Explain the root cause of the issue or failure:
31+
- **Trace the execution flow**: Identify which components, classes, or functions are malfunctioning.
32+
- **Pinpoint the bug**: Detail why the system is behaving incorrectly and where the failure originates (e.g. incorrect logic, missing configuration, unhandled states).
33+
34+
### 2. Is the issue legitimate?
35+
Inspect the codebase to confirm if the issue represents a real problem:
36+
- **Examine the description**: Identify the component, class, function, or file referenced.
37+
- **Search the codebase**: Use `grep_search` to locate the relevant files/functions in the local workspace.
38+
- **Inspect the code**: Open the files using `view_file` to analyze the code's current logic.
39+
- **Verify the bug**:
40+
- Is the reported problem actually present in the code?
41+
- Does it produce the reported error or behavior under the current version (ADK 2.0)?
42+
- Is it a documentation typo, setup discrepancy, or a genuine code/logic bug?
43+
- **Document your code evidence**: Reference specific file paths and line ranges (using clickable markdown file links, e.g., `[skill_toolset.py](file:///path/to/file#L123)`) in your report.
44+
45+
### 3. Should we fix it?
46+
Formulate a recommendation on whether the issue should be addressed:
47+
- **Assess the impact**:
48+
- Does it break core functionality?
49+
- Does it affect standard developer workflows or introduce brittle workarounds?
50+
- Is it a high-priority bug or a low-impact cosmetic/feature request?
51+
- **Check alignment**:
52+
- Does the suggested solution align with `adk-architecture` and `adk-style`?
53+
- Is it consistent with Python idioms and Pydantic validation rules?
54+
- **Evaluate workarounds**: Is there a clean workaround, or is a core fix necessary?
55+
- **Final Recommendation**: Clearly declare whether we should fix it, along with the reasoning and estimated complexity/scope of the fix.
56+
57+
### 4. Is there a linked PR that fixes this issue?
58+
Search for any existing pull requests that attempt to resolve the issue:
59+
- **Search PRs**: Run `gh pr list --repo google/adk-python --search "<issue_number>"` to list pull requests mentioning the issue number in the branch name, title, or body.
60+
- **Verify the PR details**: If PRs are found, fetch their details:
61+
```bash
62+
gh pr view <pr_number> --repo google/adk-python --json number,title,state,url,body,author
63+
```
64+
- **Analyze progress**: Check if the PR is open, merged, or closed, and if it successfully fixes the issue according to the repository's testing patterns.
65+
- **Present the structured report**: Format and present your findings structured as a premium report following the **Report Template** below.
66+
- **Offer to create a fix**: If no existing PR is found, you MUST explicitly ask the user: "Would you like me to create and implement a fix for this issue in the workspace? (Note: The changes and tests will be created in a new branch but NOT committed, so you can review and iterate on them.)"
67+
68+
---
69+
70+
## Report Template
71+
72+
Present your final analysis as a high-quality markdown response using the following structure:
73+
74+
```markdown
75+
# GitHub Issue #<issue_number> Analysis: <Issue Title>
76+
77+
## Detailed Analysis
78+
79+
### 1. Root Cause Analysis ("What is broken?")
80+
- Explanation of the failure or bug (what is failing and why).
81+
- Pinpoint the exact file, function, or design component that is malfunctioning.
82+
83+
### 2. Legitimacy Analysis
84+
- **Status**: [Legitimate Bug / Feature Request / Duplicate / Invalid / Not Reproducible]
85+
- **Evidence**:
86+
- Code references: [filename.py](file:///absolute/path/to/file#L100-L120)
87+
- Analysis of code behavior and why the issue occurs.
88+
89+
### 3. Fix Recommendation
90+
- **Recommendation**: [Should Fix (High Priority) / Should Fix (Medium/Low Priority) / Won't Fix / Needs Discussion]
91+
- **Rationale**:
92+
- Impact on user experience, workflows, or architecture.
93+
- Implementation complexity and risk of side effects.
94+
95+
### 4. Existing Pull Requests
96+
- **Linked PR**: [None / Pull Request #<pr_number> - <PR Title> (<state>)]
97+
- **PR URL**: <PR URL>
98+
- **Analysis**: Brief summary of the PR's approach and status (e.g., "Fixes the bug by implementing X in Y, currently awaiting review").
99+
100+
---
101+
102+
## Executive Summary
103+
1. **What is broken?** [Brief explanation of the root cause or error]
104+
2. **Is the issue legitimate?** [Yes / No - brief explanation]
105+
3. **Should we fix it?** [Yes / No / Needs Discussion - priority & brief reasoning]
106+
4. **Is there a linked PR that fixes this issue?** [None / Yes, PR #<pr_number> - <state>]
107+
```
108+
109+
---
110+
111+
## Tips & Best Practices
112+
> [!TIP]
113+
> Always use explicit repository qualifiers (`--repo google/adk-python`) when running `gh` commands to avoid failures due to custom internal or local git remotes.
114+
115+
> [!IMPORTANT]
116+
> When presenting code files and lines, always use markdown file links that point directly to the files in the workspace. Make sure the link is clickable and formatted as `[filename.py](file:///absolute/path/to/file#L100-L120)` without surrounding backticks around the brackets.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: adk-issue-fix
3+
description: Implement a bug fix or feature for a GitHub issue in the adk-python repository. Use this skill after the triage/analysis is complete and approved. It creates a new branch, implements code changes, adds tests, and updates relevant documentation/samples.
4+
---
5+
6+
# ADK Issue Fix Implementation
7+
8+
This skill provides a structured workflow for implementing bug fixes or new features for GitHub issues in the `google/adk-python` repository. Only invoke/use this skill once the user has approved the fix.
9+
10+
## Implementation Steps
11+
12+
### 1. Base the Branch on Remote HEAD & Create Branch
13+
- **Do NOT commit the changes**: Leave them uncommitted in the workspace so the user can review and iterate on them.
14+
- **Base the branch on remote HEAD**: When creating the new branch, ensure it is based on the remote tracking branch HEAD (`origin/main`), not the current local branch. For example:
15+
```bash
16+
git checkout -b fix/<issue_number>-<desc> origin/main
17+
```
18+
19+
### 2. Implement the Fix
20+
- Modify the necessary source files implementing clean, robust logic following `adk-style` and `adk-architecture`.
21+
22+
### 3. Add or Update Unittests
23+
- Write comprehensive unit tests to verify the behavior and prevent regressions. Refer to the testing patterns in the testing guides.
24+
25+
### 4. Update Documentation & Samples
26+
- Update `/docs/design` and `/docs/guides` if applicable to the changes.
27+
- Update `/contributing/samples` if applicable to demonstrate the new capability or updated behavior.

.agents/skills/adk-issue/SKILL.md

Lines changed: 9 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,18 @@
11
---
22
name: adk-issue
3-
description: Analyze and triage GitHub issues for the adk-python repository. Use this skill when the user provides an issue number or link to investigate whether the issue is legitimate, whether it should be fixed, and if there is an existing PR addressing it. Triggers on "analyze issue", "issue #", "github issue", "github.com/google/adk-python/issues/".
3+
description: Orchestrate analyzing and triaging GitHub issues for the adk-python repository. Use this skill when a user provides a GitHub issue number or link. It coordinates triage analysis via `adk-issue-analyze` and implementation via `adk-issue-fix`. Triggers on "analyze issue", "issue #", "github issue", "github.com/google/adk-python/issues/".
44
---
55

6-
# ADK Issue Analyzer & Triager
6+
# ADK Issue Resolution Orchestrator
77

8-
This skill provides a structured workflow for analyzing, verifying, and triaging GitHub issues from the `google/adk-python` repository. When a user provides a GitHub issue number or link, use this skill to perform deep investigation and report your findings.
9-
10-
> [!IMPORTANT]
11-
> ## CRITICAL EXECUTION RULE: STOP AFTER STEP 2
12-
> * **Phase 1 (Triage & Report) is strictly read-only**: Do NOT modify any code, create new branches, or write any implementation in your first response.
13-
> * **STOP and ask**: You must present the analysis report first and explicitly ask the user:
14-
> > "Would you like me to create and implement a fix for this issue in the workspace? (Note: The changes and tests will be created in a new branch but NOT committed, so you can review and iterate on them.)"
15-
> * **Wait for Approval**: Only proceed with Phase 2 (Step 3: Implementation) in a subsequent turn *after* the user explicitly approves the recommendation.
8+
This skill orchestrates the analysis, triage, and resolution of GitHub issues for the `google/adk-python` repository. When a user provides a GitHub issue number or link, follow this two-phase workflow by delegating/calling the specific sub-skills:
169

1710
## Phase 1: Triage and Analysis (Read-Only)
18-
19-
### Step 1: Retrieve and Parse the Issue
20-
1. **Extract the issue number**: Parse the number from the link or prompt (e.g., `https://github.com/google/adk-python/issues/5882` -> `5882`).
21-
2. **Fetch issue details**: Use the `gh` CLI tool to fetch issue details in JSON format:
22-
```bash
23-
gh issue view <issue_number> --repo google/adk-python --json number,title,body,state,labels,comments,assignees,createdAt,closedAt
24-
```
25-
*If the `gh` CLI is not available or errors out, use `read_url_content` to fetch the public GitHub issue page:*
26-
```
27-
https://github.com/google/adk-python/issues/<issue_number>
28-
```
29-
30-
---
31-
32-
### Step 2: Deep Investigation & Analysis
33-
Address the following four critical questions and present your findings in a structured, premium report.
34-
35-
#### 1. What is broken?
36-
Explain the root cause of the issue or failure:
37-
- **Trace the execution flow**: Identify which components, classes, or functions are malfunctioning.
38-
- **Pinpoint the bug**: Detail why the system is behaving incorrectly and where the failure originates (e.g. incorrect logic, missing configuration, unhandled states).
39-
40-
#### 2. Is the issue legitimate?
41-
Inspect the codebase to confirm if the issue represents a real problem:
42-
- **Examine the description**: Identify the component, class, function, or file referenced.
43-
- **Search the codebase**: Use `grep_search` to locate the relevant files/functions in the local workspace.
44-
- **Inspect the code**: Open the files using `view_file` to analyze the code's current logic.
45-
- **Verify the bug**:
46-
- Is the reported problem actually present in the code?
47-
- Does it produce the reported error or behavior under the current version (ADK 2.0)?
48-
- Is it a documentation typo, setup discrepancy, or a genuine code/logic bug?
49-
- **Document your code evidence**: Reference specific file paths and line ranges (using clickable markdown file links, e.g., `[skill_toolset.py](file:///path/to/file#L123)`) in your report.
50-
51-
#### 3. Should we fix it?
52-
Formulate a recommendation on whether the issue should be addressed:
53-
- **Assess the impact**:
54-
- Does it break core functionality?
55-
- Does it affect standard developer workflows or introduce brittle workarounds?
56-
- Is it a high-priority bug or a low-impact cosmetic/feature request?
57-
- **Check alignment**:
58-
- Does the suggested solution align with `adk-architecture` and `adk-style`?
59-
- Is it consistent with Python idioms and Pydantic validation rules?
60-
- **Evaluate workarounds**: Is there a clean workaround, or is a core fix necessary?
61-
- **Final Recommendation**: Clearly declare whether we should fix it, along with the reasoning and estimated complexity/scope of the fix.
62-
63-
#### 4. Is there a linked PR that fixes this issue?
64-
Search for any existing pull requests that attempt to resolve the issue:
65-
- **Search PRs**: Run `gh pr list --repo google/adk-python --search "<issue_number>"` to list pull requests mentioning the issue number in the branch name, title, or body.
66-
- **Verify the PR details**: If PRs are found, fetch their details:
67-
```bash
68-
gh pr view <pr_number> --repo google/adk-python --json number,title,state,url,body,author
69-
```
70-
- **Analyze progress**: Check if the PR is open, merged, or closed, and if it successfully fixes the issue according to the repository's testing patterns.
71-
- **Present the structured report**: Format and present your findings structured as a premium report following the **Report Template** below.
72-
- **Offer to create a fix**: If no existing PR is found, you MUST explicitly ask the user: "Would you like me to create and implement a fix for this issue in the workspace? (Note: The changes and tests will be created in a new branch but NOT committed, so you can review and iterate on them.)"
73-
74-
---
11+
1. **Delegate to `adk-issue-analyze`**: Follow the instructions in the `adk-issue-analyze` skill (located at `.agents/skills/adk-issue-analyze/SKILL.md`) to fetch the issue, inspect the codebase, evaluate legitimacy, search for existing PRs, and present a structured analysis report.
12+
2. **CRITICAL**: Do NOT modify any code, create new branches, or write any implementation yet.
13+
3. **Ask for Approval**: Present the report and explicitly ask the user:
14+
> "Would you like me to create and implement a fix for this issue in the workspace? (Note: The changes and tests will be created in a new branch but NOT committed, so you can review and iterate on them.)"
15+
4. **Wait for Approval**: Do not proceed to Phase 2 until the user explicitly approves.
7516

7617
## Phase 2: Implementation (After User Approval)
77-
78-
### Step 3: Propose and Implement Fix
79-
Once the user has approved the implementation of the fix in the workspace, follow these rules:
80-
- **Do NOT commit the changes**: Leave them uncommitted in the workspace so the user can review and iterate on them.
81-
- **Base the branch on remote HEAD**: When creating the new branch, ensure it is based on the remote tracking branch HEAD (`origin/main`), not the current local branch. For example:
82-
```bash
83-
git checkout -b fix/<issue_number>-<desc> origin/main
84-
```
85-
- **Follow these implementation steps**:
86-
1. **Create the fix**: Modify the necessary source files implementing clean, robust logic following `adk-style` and `adk-architecture`.
87-
2. **Add or update unittests**: Write comprehensive unit tests to verify the behavior and prevent regressions.
88-
3. **Update documentation**: Update `/docs/design` and `/docs/guides` if applicable to the changes.
89-
4. **Update samples**: Update `/contributing/samples` if applicable to demonstrate the new capability or updated behavior.
90-
91-
---
92-
93-
## Report Template
94-
95-
Present your final analysis as a high-quality markdown response using the following structure:
96-
97-
```markdown
98-
# GitHub Issue #<issue_number> Analysis: <Issue Title>
99-
100-
## Detailed Analysis
101-
102-
### 1. Root Cause Analysis ("What is broken?")
103-
- Explanation of the failure or bug (what is failing and why).
104-
- Pinpoint the exact file, function, or design component that is malfunctioning.
105-
106-
### 2. Legitimacy Analysis
107-
- **Status**: [Legitimate Bug / Feature Request / Duplicate / Invalid / Not Reproducible]
108-
- **Evidence**:
109-
- Code references: [filename.py](file:///absolute/path/to/file#L100-L120)
110-
- Analysis of code behavior and why the issue occurs.
111-
112-
### 3. Fix Recommendation
113-
- **Recommendation**: [Should Fix (High Priority) / Should Fix (Medium/Low Priority) / Won't Fix / Needs Discussion]
114-
- **Rationale**:
115-
- Impact on user experience, workflows, or architecture.
116-
- Implementation complexity and risk of side effects.
117-
118-
### 4. Existing Pull Requests
119-
- **Linked PR**: [None / Pull Request #<pr_number> - <PR Title> (<state>)]
120-
- **PR URL**: <PR URL>
121-
- **Analysis**: Brief summary of the PR's approach and status (e.g., "Fixes the bug by implementing X in Y, currently awaiting review").
122-
123-
---
124-
125-
## Executive Summary
126-
1. **What is broken?** [Brief explanation of the root cause or error]
127-
2. **Is the issue legitimate?** [Yes / No - brief explanation]
128-
3. **Should we fix it?** [Yes / No / Needs Discussion - priority & brief reasoning]
129-
4. **Is there a linked PR that fixes this issue?** [None / Yes, PR #<pr_number> - <state>]
130-
```
131-
132-
---
133-
134-
## Tips & Best Practices
135-
> [!TIP]
136-
> Always use explicit repository qualifiers (`--repo google/adk-python`) when running `gh` commands to avoid failures due to custom internal or local git remotes.
137-
138-
> [!IMPORTANT]
139-
> When presenting code files and lines, always use markdown file links that point directly to the files in the workspace. Make sure the link is clickable and formatted as `[filename.py](file:///absolute/path/to/file#L100-L120)` without surrounding backticks around the brackets.
18+
1. **Delegate to `adk-issue-fix`**: Once the user approves, follow the instructions in the `adk-issue-fix` skill (located at `.agents/skills/adk-issue-fix/SKILL.md`) to create the branch, implement the fix, add/update tests, update docs, and update samples.

AGENTS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ For all matters regarding ADK development, please use the appropriate skill:
1616
- Read `.agents/skills/adk-sample-creator/SKILL.md` for full instructions.
1717
- **`adk-review`**: Use this skill to review local changes for errors, style compliance, unintended outcomes, and to check if associated design docs, guides, samples, or tests need updates.
1818
- Read `.agents/skills/adk-review/SKILL.md` for full instructions.
19-
- **`adk-issue`**: Use this skill when analyzing and triaging GitHub issues for the adk-python repository to verify legitimacy, recommend fixes, and check for existing PRs.
19+
- **`adk-issue`**: Use this skill when analyzing, triaging, and resolving GitHub issues for the adk-python repository. It orchestrates the process by delegating to `adk-issue-analyze` and `adk-issue-fix`.
2020
- Read `.agents/skills/adk-issue/SKILL.md` for full instructions.
21+
- **`adk-issue-analyze`**: Use this skill to fetch, inspect, and analyze a GitHub issue to verify legitimacy, existing PRs, and recommend a fix in a structured report.
22+
- Read `.agents/skills/adk-issue-analyze/SKILL.md` for full instructions.
23+
- **`adk-issue-fix`**: Use this skill to implement the code changes, unit tests, and documentation updates for an approved GitHub issue fix.
24+
- Read `.agents/skills/adk-issue-fix/SKILL.md` for full instructions.
2125
- **`adk-pr-triage`**: Use this skill when triaging and analyzing GitHub pull requests (PRs) to evaluate their objectives, legitimacy, value, and alignment with ADK's architectural, styling, and testing principles.
2226
- Read `.agents/skills/adk-pr-triage/SKILL.md` for full instructions.
2327

0 commit comments

Comments
 (0)