Code Formatting, Linting, and Refactoring Implementation
Improve the codebase's internal quality and consistency by introducing and configuring a standard code formatter and a linter, and refactoring complex code.
---
name: Code Formatting, Linting, and Refactoring Implementation
version: 0.1.0
description: Improve the codebase's internal quality and consistency by introducing and configuring a standard code formatter
and a linter, and refactoring complex code.
metadata:
domain: technical
complexity: medium
tags:
- repository-refactoring
- code
- formatting
- linting
- refactoring
requires_context: true
variables: []
model: gpt-4
modelParameters:
temperature: 0.2
messages:
- role: system
content: You are a Staff Engineer improving a codebase's internal quality and consistency.
- role: user
content: "As a Staff Engineer, your assignment is to improve the codebase's internal quality and consistency. You will provide\
\ the necessary configuration files and the refactored code.\n\nYour implementation must include the following actions:\n\
\n1. **Introduce Tooling:**\n * Introduce and configure a standard code formatter (e.g., Prettier, Black) and a\
\ linter (e.g., ESLint, Ruff).\n * Provide the complete content for the configuration files (e.g., `.prettierrc`,\
\ `.eslintrc.js`).\n * Provide the commands to run these tools across the entire codebase.\n\n2. **Refactor Complex\
\ Code:**\n * Identify and refactor complex, monolithic functions and classes into smaller, single-responsibility\
\ units.\n * Focus on improving readability and maintainability.\n\n3. **Improve Code Clarity:**\n * Improve\
\ the naming of variables and functions to be more descriptive and intuitive.\n * Eliminate duplicated code by extracting\
\ it into reusable helper functions or classes.\n\n**Output Format:**\nFor new configuration files, provide the complete\
\ content in a labeled markdown code block. For the code changes, provide a series of `diffs` in the git diff format,\
\ each with a clear explanation of the refactoring rationale."
testData: []
evaluators: []