Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 17:51:54 +08:00
commit e6d46bb0c3
4 changed files with 203 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
{
"name": "coderabbit-fix-flow",
"description": "Systematic workflow for processing CodeRabbit code review feedback with MCP-powered analysis and fixes",
"version": "1.0.0",
"author": {
"name": "AlchemistStudios",
"email": "tunahorse@users.noreply.github.com"
},
"skills": [
"./skills"
]
}

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# coderabbit-fix-flow
Systematic workflow for processing CodeRabbit code review feedback with MCP-powered analysis and fixes

45
plugin.lock.json Normal file
View File

@@ -0,0 +1,45 @@
{
"$schema": "internal://schemas/plugin.lock.v1.json",
"pluginId": "gh:alchemiststudiosDOTai/coderabbit-fix-flow-plugin:",
"normalized": {
"repo": null,
"ref": "refs/tags/v20251128.0",
"commit": "51549fab9d7a26de02c821479b259c12997079c7",
"treeHash": "5492539881b8f46a11768799df4d9d3b76ad158ff3892da72d75d0d6d6839cfb",
"generatedAt": "2025-11-28T10:13:07.565048Z",
"toolVersion": "publish_plugins.py@0.2.0"
},
"origin": {
"remote": "git@github.com:zhongweili/42plugin-data.git",
"branch": "master",
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
},
"manifest": {
"name": "coderabbit-fix-flow",
"description": "Systematic workflow for processing CodeRabbit code review feedback with MCP-powered analysis and fixes",
"version": "1.0.0"
},
"content": {
"files": [
{
"path": "README.md",
"sha256": "6df771b85231c856e09a826268658a0d56fa6a8094c8cf90b3e09e475c77a290"
},
{
"path": ".claude-plugin/plugin.json",
"sha256": "64b4617bfb269a14d1821a4dc10a33bf6a053fa5399042cbbfa89b9e62e4c075"
},
{
"path": "skills/coderabbit-fix-flow/SKILL.md",
"sha256": "72f0e25e98277481beb743f2c6c73f8a6715b89db1d36fd319d26d316e93bdef"
}
],
"dirSha256": "5492539881b8f46a11768799df4d9d3b76ad158ff3892da72d75d0d6d6839cfb"
},
"security": {
"scannedAt": null,
"scannerVersion": null,
"flags": []
}
}

View File

@@ -0,0 +1,143 @@
---
name: coderabbit-fix-flow
description: This skill should be used when CodeRabbit code review feedback needs to be processed and fixed systematically. Use after running `coderabbit --plain` to automatically save feedback, analyze issues using MCP tools, and implement minimal code fixes with proper planning.
---
# CodeRabbit Fix Flow
## Overview
This skill automates the workflow of processing CodeRabbit code review feedback by saving the review output to a timestamped document, then using MCP tools (sequential thinking and Exa context) to analyze and implement fixes with minimal code changes.
## When to Use
Use this skill immediately after running `coderabbit --plain` or when you have CodeRabbit feedback that needs systematic processing. The skill handles type safety issues, code style violations, and other CodeRabbit-identified problems.
## Workflow
### Step 1: Execute CodeRabbit Review
Run the CodeRabbit review command in plain text mode:
```bash
coderabbit --plain
```
### Step 2: Save Feedback Document
Save the CodeRabbit output to a timestamped QA document:
- Create file: `memory-bank/qa/coderabbit/cr-qa-{timestamp}.md`
- Include the full CodeRabbit output in the document
- Add YAML front matter with metadata:
```yaml
---
title: "CodeRabbit QA Review - {timestamp}"
link: "cr-qa-{timestamp}"
type: "qa"
tags:
- code-review
- coderabbit
- type-safety
created_at: "{timestamp}"
updated_at: "{timestamp}"
uuid: "{generate-uuid}"
---
```
### Step 3: Analyze Issues with Sequential Thinking
Use the sequential thinking MCP tool to analyze all identified issues:
1. **Categorize issues** by type (type safety, performance, style, security)
2. **Prioritize fixes** (critical runtime issues first, then documentation)
3. **Plan minimal changes** to achieve the fixes
4. **Identify dependencies** between issues
### Step 4: Get Best Practices Context
Use the Exa code context MCP tool to research current best practices for each issue type:
- For type issues: "TypeScript type guards runtime validation best practices"
- For Python type issues: "Python type annotations Optional None best practices"
- For performance: "Performance optimization best practices [language]"
- For security: "Security vulnerability fixes [language]"
### Step 5: Implement Fixes Systematically
Execute the fixes following the sequential thinking plan:
1. **Create TodoWrite list** tracking all issues
2. **Mark each issue** as in_progress → completed
3. **Apply minimal code changes** using best practices from Exa context
4. **Verify fixes** address the root cause identified by CodeRabbit
### Step 6: Validate and Document
Run validation as appropriate:
- TypeScript: `npm run build` or `tsc --noEmit`
- Python: `mypy` or `ruff check`
- JavaScript: `npm run lint` or biome
Document the fixes in the QA document with:
- What was fixed
- How it was fixed
- Validation results
## Issue Type Patterns
### Type Safety Issues
- Use proper type guards instead of assertions
- Apply Optional/Union types for nullable fields
- Implement runtime validation where needed
### Code Style Issues
- Follow language-specific style guides
- Use linting tools to verify fixes
- Maintain consistency with existing codebase
### Performance Issues
- Research current optimization patterns
- Implement minimal impactful changes
- Measure before/after when possible
### Security Issues
- Understand the vulnerability context
- Apply security best practices
- Ensure fixes don't break functionality
## Examples
### Type Safety Fix Pattern
```typescript
// Before (unsafe)
const data = response as ResearchDataShape;
// After (safe)
const data = isResearchDataShape(response) ? response : {} as ResearchDataShape;
```
### Python Type Annotation Fix Pattern
```python
# Before (incorrect)
timestamp: float = None
metadata: dict[str, Any] = None
# After (correct)
timestamp: float | None = None
metadata: dict[str, Any] | None = None
```
## MCP Tool Usage
### Sequential Thinking Tool
Use for:
- Breaking down complex issues into steps
- Planning fix order and dependencies
- Analyzing multiple issues systematically
### Exa Code Context Tool
Use for:
- Getting current best practices
- Understanding language-specific patterns
- Finding optimal implementation approaches
## Resources
This skill doesn't require bundled resources as it relies on MCP tools for context and the existing codebase for implementation.