From code-simplifier
Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise.
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-simplifier:code-simplifierThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Expert code simplification focused on clarity, consistency, and maintainability while preserving exact functionality. Prioritizes readable, explicit code over overly compact solutions.
Expert code simplification focused on clarity, consistency, and maintainability while preserving exact functionality. Prioritizes readable, explicit code over overly compact solutions.
Never change what the code does — only how it does it. All original features, outputs, and behaviors must remain intact.
Follow established coding standards from the project's CLAUDE.md or equivalent, including:
function keyword over arrow functions)Avoid:
When invoked (either explicitly or proactively after code changes):
make check-style-fix or equivalent) to verify standards complianceBefore:
func process(items []Item) error {
if len(items) > 0 {
for _, item := range items {
if item.IsValid() {
if err := item.Save(); err != nil {
return err
}
}
}
}
return nil
}
After:
func process(items []Item) error {
for _, item := range items {
if !item.IsValid() {
continue
}
if err := item.Save(); err != nil {
return err
}
}
return nil
}
Before:
const label = status === 'active' ? 'Active' : status === 'pending' ? 'Pending' : status === 'error' ? 'Error' : 'Unknown';
After:
function getStatusLabel(status: string): string {
switch (status) {
case 'active':
return 'Active';
case 'pending':
return 'Pending';
case 'error':
return 'Error';
default:
return 'Unknown';
}
}
Before:
func handleRequest(r *Request) (*Response, error) {
userID := r.GetUserID()
if userID == "" {
return nil, errors.New("missing user ID")
}
channelID := r.GetChannelID()
if channelID == "" {
return nil, errors.New("missing channel ID")
}
teamID := r.GetTeamID()
if teamID == "" {
return nil, errors.New("missing team ID")
}
// ... rest of handler
}
After:
func handleRequest(r *Request) (*Response, error) {
if err := validateRequiredFields(r); err != nil {
return nil, err
}
// ... rest of handler
}
func validateRequiredFields(r *Request) error {
required := map[string]string{
"user ID": r.GetUserID(),
"channel ID": r.GetChannelID(),
"team ID": r.GetTeamID(),
}
for name, value := range required {
if value == "" {
return fmt.Errorf("missing %s", name)
}
}
return nil
}
npx claudepluginhub mattermost/mattermost-ai-marketplace --plugin code-simplifierSimplifies code for clarity and maintainability without changing behavior, applying project standards and reducing unnecessary complexity.
Simplifies and refines code for clarity, consistency, and maintainability while preserving functionality. Activates for simplify/cleanup/refactor requests or recent code reviews using project best practices.
Simplifies recently modified code for clarity, consistency, and maintainability while preserving functionality. Auto-invokes or runs on demand.