Add Skill: code-review-agent #25
@@ -0,0 +1,76 @@
|
|||||||
|
---
|
||||||
|
name: code-review-agent
|
||||||
|
version: 1.0.0
|
||||||
|
description: Automate code review process using a multi-step workflow with human-in-the-loop
|
||||||
|
approval.
|
||||||
|
inputs:
|
||||||
|
- Repository diff or code changeset (string)
|
||||||
|
- User ID (string)
|
||||||
|
steps:
|
||||||
|
- 'Step 1: Build the code review graph using `build_graph()` from `agentkit.workflow.code_review.graph`'
|
||||||
|
- 'Step 2: Invoke the graph with initial parameters including the repository diff
|
||||||
|
and user ID, and set thread_id as a configurable parameter'
|
||||||
|
- 'Step 3: The graph processes the input through various steps until completion or
|
||||||
|
human approval is needed'
|
||||||
|
outputs:
|
||||||
|
- Review result (dictionary containing messages, issues, etc.)
|
||||||
|
tags: []
|
||||||
|
metadata:
|
||||||
|
source_repo: https://github.com/itszhaoziyan-n/AgentKit.git
|
||||||
|
extracted_at: ''
|
||||||
|
confidence: 0.95
|
||||||
|
---
|
||||||
|
|
||||||
|
# code-review-agent
|
||||||
|
|
||||||
|
Automate code review process using a multi-step workflow with human-in-the-loop approval.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
**Dependencies:**
|
||||||
|
|
||||||
|
```text
|
||||||
|
pip install langgraph>=0.3 langchain-core>=0.3 langchain-anthropic>=0.3 langfuse>=2.0 mcp[server]>=1.24,<2.0 langchain-mcp-adapters>=0.1 tenacity>=9.0
|
||||||
|
```
|
||||||
|
|
||||||
|
**Setup steps:**
|
||||||
|
|
||||||
|
1. cp .env.example .env
|
||||||
|
1. docker compose up -d
|
||||||
|
1. pip install -e '.[dev]'
|
||||||
|
|
||||||
|
## Key Files
|
||||||
|
|
||||||
|
- `agentkit/workflow/code_review/graph.py - Defines the code review graph and its invocation method.`
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
1. Step 1: Build the code review graph using `build_graph()` from `agentkit.workflow.code_review.graph`
|
||||||
|
2. Step 2: Invoke the graph with initial parameters including the repository diff and user ID, and set thread_id as a configurable parameter
|
||||||
|
3. Step 3: The graph processes the input through various steps until completion or human approval is needed
|
||||||
|
|
||||||
|
## Implementation Details
|
||||||
|
|
||||||
|
```python
|
||||||
|
graph = build_graph()
|
||||||
|
thread_id = str(uuid.uuid4())
|
||||||
|
result = graph.invoke(...)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- Repository diff or code changeset (string)
|
||||||
|
- User ID (string)
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
- Review result (dictionary containing messages, issues, etc.)
|
||||||
|
|
||||||
|
## Failure Modes
|
||||||
|
|
||||||
|
- Specific failure scenario with mitigation: If the graph invocation fails due to an unexpected state, it will halt and require manual intervention.
|
||||||
|
|
||||||
|
## Source
|
||||||
|
|
||||||
|
Extracted from: [https://github.com/itszhaoziyan-n/AgentKit.git](https://github.com/itszhaoziyan-n/AgentKit.git)
|
||||||
|
Confidence: 0.95
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Commands: code-review-agent
|
||||||
|
|
||||||
|
## Available Commands
|
||||||
|
|
||||||
|
- `/skill code-review-agent` — Load this skill
|
||||||
|
- `/run code-review-agent` — Execute workflow
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Examples: code-review-agent
|
||||||
|
|
||||||
|
## Usage Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
# How to use this skill
|
||||||
|
# Inputs: Repository diff or code changeset (string), User ID (string)
|
||||||
|
# Process: Step 1: Build the code review graph using `build_graph()` from `agentkit.workflow.code_review.graph` → Step 2: Invoke the graph with initial parameters including the repository diff and user ID, and set thread_id as a configurable parameter → Step 3: The graph processes the input through various steps until completion or human approval is needed
|
||||||
|
# Outputs: Review result (dictionary containing messages, issues, etc.)
|
||||||
|
```
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "code-review-agent",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"goal": "Automate code review process using a multi-step workflow with human-in-the-loop approval.",
|
||||||
|
"inputs": [
|
||||||
|
"Repository diff or code changeset (string)",
|
||||||
|
"User ID (string)"
|
||||||
|
],
|
||||||
|
"steps": [
|
||||||
|
"Step 1: Build the code review graph using `build_graph()` from `agentkit.workflow.code_review.graph`",
|
||||||
|
"Step 2: Invoke the graph with initial parameters including the repository diff and user ID, and set thread_id as a configurable parameter",
|
||||||
|
"Step 3: The graph processes the input through various steps until completion or human approval is needed"
|
||||||
|
],
|
||||||
|
"outputs": [
|
||||||
|
"Review result (dictionary containing messages, issues, etc.)"
|
||||||
|
],
|
||||||
|
"failure_modes": [
|
||||||
|
"Specific failure scenario with mitigation: If the graph invocation fails due to an unexpected state, it will halt and require manual intervention."
|
||||||
|
],
|
||||||
|
"confidence": 0.95,
|
||||||
|
"explanation": "This workflow is reusable for any code review process that requires a multi-step analysis with human-in-the-loop approval.",
|
||||||
|
"source_repo": "https://github.com/itszhaoziyan-n/AgentKit.git",
|
||||||
|
"score": 1.0
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Tests: code-review-agent
|
||||||
|
|
||||||
|
## Test Checklist
|
||||||
|
|
||||||
|
- [ ] Workflow has at least 3 steps
|
||||||
|
- [ ] All inputs are defined
|
||||||
|
- [ ] All outputs are defined
|
||||||
|
- [ ] Failure modes are documented
|
||||||
|
- [ ] Skill can be loaded without errors
|
||||||
Reference in New Issue
Block a user