ai-cli-edit automates code refactoring via CLI, integrating with AI coding tools like Claude Code, OpenCode, and VSCode Copilot. It benefits developers and operations teams by streamlining codebase maintenance, reducing manual effort, and improving consistency. The tool connects to existing codebases and CI/CD pipelines, enabling automated refactoring tasks.
git clone https://github.com/istarkov/ai-cli-edit.gitai-cli-edit automates code refactoring via CLI, integrating with AI coding tools like Claude Code, OpenCode, and VSCode Copilot. It benefits developers and operations teams by streamlining codebase maintenance, reducing manual effort, and improving consistency. The tool connects to existing codebases and CI/CD pipelines, enabling automated refactoring tasks.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/istarkov/ai-cli-editCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Refactor the following code snippet to improve readability and performance. The code is from [COMPANY]'s [PROJECT_NAME] repository. Focus on [SPECIFIC_ISSUE] and ensure the changes align with [INDUSTRY] standards. Provide the refactored code and a brief explanation of the improvements.
# Code Refactoring Report
## Original Code
```python
def calculate_discount(price, discount_rate):
if discount_rate > 0:
return price * (1 - discount_rate)
else:
return price
```
## Refactored Code
```python
def apply_discount(price: float, discount_rate: float) -> float:
"""
Apply a discount to the given price.
Args:
price: The original price.
discount_rate: The discount rate (0 <= discount_rate <= 1).
Returns:
The discounted price.
"""
return price * (1 - discount_rate) if discount_rate > 0 else price
```
## Improvements
- **Type Hints**: Added type hints for better code clarity and IDE support.
- **Docstring**: Included a detailed docstring explaining the function's purpose and parameters.
- **Simplified Logic**: Simplified the conditional logic into a single line for better readability.
- **Naming**: Renamed the function to better reflect its purpose.
## Recommendations
- Consider adding input validation to ensure `discount_rate` is within the valid range (0 <= discount_rate <= 1).
- Unit tests should be updated to reflect the new function signature.Cloud ETL platform for non-technical data integration
IronCalc is a spreadsheet engine and ecosystem
Business communication and collaboration hub
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan