Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
thebushidocollective avatar

Credo Custom Checks

  • 1 installs
  • 186 repo stars
  • Updated July 19, 2026
  • thebushidocollective/han

Create custom Credo checks for project-specific Elixir code quality rules, such as detecting hardcoded secrets.

About

Covers writing custom Credo checks in Elixir for project-specific rules, walking the AST to flag issues. A developer uses it when built-in Credo checks do not cover a needed rule.

  • Custom Credo.Check implementation
  • AST traversal to flag issues

Credo Custom Checks by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #984 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/thebushidocollective/han --skill credo-custom-checks

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars186
Last updatedJuly 19, 2026
Repositorythebushidocollective/han

What it does

Create custom Credo checks for project-specific Elixir code quality rules, such as detecting hardcoded secrets.

Files

SKILL.mdMarkdownGitHub ↗

Credo Custom Checks

Creating custom Credo checks for project-specific rules.

Creating a Custom Check

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

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

Related skills

Code Review & Qualitybackendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.