AI Agents in Action: Managing GitHub Issues with KaibanJS
When managing large-scale projects on GitHub, keeping track of issues and their evolving statuses can be daunting. This is where the synergy of KaibanJS and the GitHub Issues Tool shines, providing developers and teams with a structured and automated way to gather, analyze, and report on GitHub issues efficiently.
In this article, we explore a practical use case combining KaibanJS with the GitHub Issues Tool to generate detailed markdown reports on repository issues. This workflow highlights the capabilities of KaibanJS agents and tools in simplifying complex tasks while offering actionable insights.
Try it in the Kaiban Board! Want to see this tool in action? Check out our interactive Kaiban Board! Try it now!
The Power of GitHub Issues Tool
The GitHub Issues Tool integrates seamlessly with GitHub’s API, enabling users to:
- Fetch open issues from any public repository with ease.
- Handle large datasets via automatic pagination.
- Retrieve structured data, including labels, assignees, and metadata.
- Enhance performance with flexible authentication, supporting up to 5,000 requests per hour when using a personal access token.
This tool forms the foundation of our use case, where it acts as the primary source of issue collection for subsequent analysis and reporting.
The Use Case: Automating Issue Analysis and Reporting
In this scenario, we developed a workflow using KaibanJS to:
- Collect Issues: Gather the latest GitHub issues from a specified repository.
- Generate Reports: Analyze the collected data and produce a detailed markdown report containing:
- A summary of key metrics.
- An overview table of issues.
- Detailed analysis of high-priority issues.
- Actionable recommendations for improvement.
Implementation
This workflow consists of two agents and two tasks, each playing a distinct role:
Agent: Luna
- Role: Issue Collector
- Goal: Efficiently gather and organize GitHub issues.
- Tools: GitHub Issues Tool
Task: Issue Collection
- Description: Retrieve the last 10 issues from a specified repository, including details such as title, labels, assignees, status, and timestamps.
- Expected Output: A structured list of issues with metadata.
Agent: Atlas
- Role: Report Generator
- Goal: Analyze issues and create a comprehensive markdown report.
Task: Report Generation
- Description: Use the collected issue data to create a detailed report with:
- Metrics like total issues, most common labels, and outstanding high-priority issues.
- A table summarizing each issue’s key details.
- Recommendations for improvement based on patterns and trends.
- Expected Output: A well-formatted markdown report.
Code Overview
Below is a high-level look at how this use case was implemented:
import { Agent, Task, Team } from 'kaibanjs';
import { GithubIssues } from '@kaibanjs/tools';
// Define GitHub tool
const githubTool = new GithubIssues({
limit: 10 // Fetch the last 10 issues
});
// Define agents and tasks
const issueCollector = new Agent({
name: 'Luna',
role: 'Issue Collector',
goal: 'Gather and organize GitHub issues efficiently',
tools: [githubTool]
});
const reportGenerator = new Agent({
name: 'Atlas',
role: 'Report Generator',
goal: 'Analyze issues and generate a detailed markdown report'
});
const issueCollectionTask = new Task({
description: `Collect GitHub issues and organize their metadata.`,
agent: issueCollector
});
const generateReportTask = new Task({
description: `Generate a detailed markdown report based on collected issues.`,
agent: reportGenerator,
action: async (context) => {
const { issues } = context.data;
// Report generation logic here
}
});
// Create and start the team workflow
const team = new Team({
name: 'GitHub Issue Analysis Team',
agents: [issueCollector, reportGenerator],
tasks: [issueCollectionTask, generateReportTask],
inputs: { repository: 'https://github.com/user/repo' }
});
team.start();
Results: The Markdown Report
The output of this workflow is a markdown report containing:
Summary:
- Total issues analyzed.
- Most common labels, formatted and distinct.
- Number of issues resolved this week.
- High-priority issues requiring immediate attention.
Issues Overview:
- A table summarizing issue ID, title, labels, assignee, and status.
Detailed Analysis:
- Highlights of high-priority issues with actionable recommendations.
Insights and Recommendations:
- Suggestions for improving triage processes, documentation, and testing strategies.
Why This Matters
By combining KaibanJS with the GitHub Issues Tool, teams can:
- Automate repetitive tasks like issue collection and reporting.
- Gain actionable insights into repository health and priorities.
- Improve efficiency in managing open-source or private projects.
This use case demonstrates how KaibanJS empowers developers to build multi-agent workflows that simplify complex processes and deliver tangible value.
Try It Yourself
Ready to explore the potential of KaibanJS? Start building your own multi-agent systems and leverage tools like GitHub Issues to revolutionize your workflows. For more details, visit: