Skip to content
Back to skills

Credo Custom Checks

ASecurity

Use when creating custom Credo checks for project-specific code quality rules and standards in Elixir.

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
developmentgo

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill credo-custom-checks --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Credo Custom Checks?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Credo Custom Checks
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-credo-custom-checks/badge)](https://www.skillsdirectory.com/skills/majiayu000-credo-custom-checks)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: credo-custom-checks
description: Use when creating custom Credo checks for project-specific code quality rules and standards in Elixir.
allowed-tools: []
---

# Credo Custom Checks

Creating custom Credo checks for project-specific rules.

## Creating a Custom Check

```elixir
defmodule MyApp.Credo.Check.NoHardcodedSecrets do
  use Credo.Check,
    category: :warning,
    base_priority: :high,
    explanations: [
      check: """
      Detects hardcoded secrets in code.
      """
    ]

  @impl true
  def run(%SourceFile{} = source_file, params) do
    issue_meta = IssueMeta.for(source_file, params)

    Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta))
  end

  defp traverse(
         {:@, _, [{:secret_key, _, [value]}]} = ast,
         issues,
         issue_meta
       )
       when is_binary(value) do
    new_issue = issue_for(issue_meta, value)
    {ast, [new_issue | issues]}
  end

  defp traverse(ast, issues, _issue_meta) do
    {ast, issues}
  end

  defp issue_for(issue_meta, value) do
    format_issue(
      issue_meta,
      message: "Hardcoded secret found: #{String.slice(value, 0..5)}...",
      trigger: value
    )
  end
end
```

## Using Custom Checks

```elixir
# .credo.exs
%{
  configs: [
    %{
      name: "default",
      requires: ["./lib/my_app/credo/check/*.ex"],
      checks: %{
        enabled: [
          {MyApp.Credo.Check.NoHardcodedSecrets, []}
        ]
      }
    }
  ]
}
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.