credo-checks
$
npx mdskill add TheBushidoCollective/han/credo-checksAnalyzes and resolves common Credo issues to improve Elixir code quality and consistency.
- Helps developers fix code style, design, readability, refactoring, and warning problems in Elixir projects.
- Integrates with Credo, a static analysis tool for Elixir, without requiring additional external tools or APIs.
- Decides recommendations by identifying specific Credo check categories and providing targeted fixes with code examples.
- Presents results through clear examples and explanations, such as showing before-and-after code snippets for common issues.
SKILL.md
.github/skills/credo-checksView on GitHub ↗
---
name: credo-checks
user-invocable: false
description: Use when understanding and fixing common Credo check issues for Elixir code quality and consistency.
allowed-tools: []
---
# Credo Checks
Understanding and fixing common Credo issues.
## Check Categories
### Consistency Checks
Ensure consistent code style across the project.
### Design Checks
Identify design issues and anti-patterns.
### Readability Checks
Improve code readability and maintainability.
### Refactoring Checks
Highlight refactoring opportunities.
### Warning Checks
Catch potential bugs and issues.
## Common Issues
### Module Documentation
```elixir
# Issue: Missing module documentation
defmodule MyModule do
end
# Fixed
@moduledoc """
This module handles user authentication.
"""
defmodule MyModule do
end
```
### Function Complexity
```elixir
# Issue: High cyclomatic complexity
def complex_function(x) do
if x > 10 do
if x < 20 do
if rem(x, 2) == 0 do
:even_mid
else
:odd_mid
end
else
:high
end
else
:low
end
end
# Fixed: Extract to separate functions
def classify_number(x) do
case {x > 10, x < 20, rem(x, 2) == 0} do
{false, _, _} -> :low
{true, false, _} -> :high
{true, true, true} -> :even_mid
{true, true, false} -> :odd_mid
end
end
```
### Pipe Chain
```elixir
# Issue: Single pipe
list |> Enum.map(&(&1 * 2))
# Fixed
Enum.map(list, &(&1 * 2))
```
### Unused Variables
```elixir
# Issue
def process({:ok, result}, _context) do
result
end
# Fixed: Prefix with underscore
def process({:ok, result}, _context) do
result
end
```
More from TheBushidoCollective/han
- absinthe-resolversUse when implementing GraphQL resolvers with Absinthe. Covers resolver patterns, dataloader integration, batching, and error handling.
- absinthe-schemaUse when designing GraphQL schemas with Absinthe. Covers type definitions, interfaces, unions, enums, and schema organization patterns.
- absinthe-subscriptionsUse when implementing real-time GraphQL subscriptions with Absinthe. Covers Phoenix channels, PubSub, and subscription patterns.
- act-docker-setupUse when configuring Docker environments for act, selecting runner images, managing container resources, or troubleshooting Docker-related issues with local GitHub Actions testing.
- act-local-testingUse when testing GitHub Actions workflows locally with act. Covers act CLI usage, Docker configuration, debugging workflows, and troubleshooting common issues when running workflows on your local machine.
- act-workflow-syntaxUse when creating or modifying GitHub Actions workflow files. Provides guidance on workflow syntax, triggers, jobs, steps, and expressions for creating valid GitHub Actions workflows that can be tested locally with act.
- ameba-configurationUse when configuring Ameba rules and settings for Crystal projects including .ameba.yml setup, rule management, severity levels, and code quality enforcement.
- ameba-custom-rulesUse when creating custom Ameba rules for Crystal code analysis including rule development, AST traversal, issue reporting, and rule testing.
- ameba-integrationUse when integrating Ameba into development workflows including CI/CD pipelines, pre-commit hooks, GitHub Actions, and automated code review processes.
- analyze-performanceAnalyze performance metrics and identify slow transactions in Sentry