Agent skill

Algo Risk Benford

by asgard-ai-platform in asgard-ai-platform/skills

Apply Benford's Law to detect anomalies in numerical datasets by analyzing first-digit frequency distributions.

MITAuto-check passedBusiness, Finance & HR

Install Algo Risk Benford

skills CLI
$ npx skills add asgard-ai-platform/skills --skill algo-risk-benford -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install asgard-ai-platform/skills algo-risk-benford --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/asgard-ai-platform/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/algo-risk-benford .claude/skills/algo-risk-benford && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
algo-risk-benford
GitHub stars
242
Token cost
~1.1k tokens
SKILL.md length
421 words
Files
4 (incl. references)
Skills in repo
207
Repo updated
First seen
Licence
MIT

At a glance

Apply Benford's Law to detect anomalies in numerical datasets by analyzing first-digit frequency distributions.

  • Works in 4 steps: Input Validation → Core Algorithm → Verification → …
  • The user needs to audit financial data for fraud indicators
  • SKILL.md covers Overview, When to Use, Algorithm and Output Format, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Algo Risk Benford is an agent skill from asgard-ai-platform/skills. Apply Benford's Law to detect anomalies in numerical datasets by analyzing first-digit frequency distributions. Use this skill when the user needs to audit financial data for fraud indicators, validate data integrity, or detect fabricated numbers — even if they say 'data manipulation detection', 'first digit test', or 'accounting fraud screening'.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `examples/sample_scenario.md`, `references/fraud-case-studies.md` and `references/higher-digit-tests.md`).

It sits in Business, Finance & HR, covering Accounting and bookkeeping, DataFrames and Anomaly detection. The repository describes itself as: 301 open-source coding agent skills across 22 domains — methodology, judgment & gotchas packaged as Claude Agent Skills for the Asgard AI Platform. The licence is MIT.

When your agent uses it

  • The user needs to audit financial data for fraud indicators
  • Validate data integrity
  • Detect fabricated numbers — even if they say data manipulation detection
  • First digit test

Example prompts

  • “data manipulation detection”
  • “first digit test”
  • “accounting fraud screening”
  • “/algo-risk-benford”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Input Validation
  2. Core Algorithm
  3. Verification
  4. Output

What it can do on your machine

Read from SKILL.md and the folder at commit 4e7f4f8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Algo Risk Benford loads about 1.1k tokens when it runs, and up to ~6.4k if it reads all its reference files. Until then it costs about 92 tokens; SKILL.md has 421 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~92
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from asgard-ai-platform/skills at commit 4e7f4f8, republished under its MIT licence (© asgard-ai-platform). 421 words, ~1,122 tokens.

Download SKILL.mdSave it as .claude/skills/algo-risk-benford/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
algo-risk-benford
description
Apply Benford's Law to detect anomalies in numerical datasets by analyzing first-digit frequency distributions. Use this skill when the user needs to audit financial data for fraud indicators, validate data integrity, or detect fabricated numbers — even if they say 'data manipulation detection', 'first digit test', or 'accounting fraud screening'.
metadata.category
WP-40 風險演算法
metadata.tags
risk, benfords-law, fraud-detection, data-audit

Benford's Law Analysis

Overview

Benford's Law predicts that in naturally occurring datasets, the leading digit d appears with probability P(d) = log₁₀(1 + 1/d). Digit 1 appears ~30.1% of the time, digit 9 only ~4.6%. Deviations from this distribution may indicate data fabrication or manipulation. Analysis runs in O(n).

When to Use

Trigger conditions:

  • Auditing financial data (expenses, invoices, tax returns) for manipulation
  • Screening large datasets for data integrity issues
  • Detecting fabricated or artificially rounded numbers

When NOT to use:

  • For assigned/sequential numbers (zip codes, phone numbers, IDs)
  • For datasets with constrained ranges (e.g., human ages, percentages)
  • For small datasets (< 500 records — insufficient statistical power)

Algorithm

IRON LAW: Benford's Law Applies to NATURALLY OCCURRING Data Spanning Orders of Magnitude
Data that doesn't span multiple orders of magnitude (e.g., temperatures
in Celsius, human heights) will NOT follow Benford's Law. Deviation from
Benford's in such data is EXPECTED, not suspicious. Always verify the
data type is appropriate before concluding fraud.
Phase 1: Input Validation

Extract leading digits from dataset. Filter: remove zeros, negatives (take absolute value), values < 10. Verify dataset spans multiple orders of magnitude. Gate: 500+ records, data spans at least 2 orders of magnitude.

Phase 2: Core Algorithm
  1. Extract first digit of each number
  2. Count frequency of each digit (1-9)
  3. Compare observed frequencies against Benford's expected: P(d) = log₁₀(1 + 1/d)
  4. Statistical tests: chi-squared test, MAD (Mean Absolute Deviation), KS test
Phase 3: Verification

MAD thresholds: < 0.006 (close conformity), 0.006-0.012 (acceptable), 0.012-0.015 (marginal), > 0.015 (non-conforming). Flag specific digits with large deviations. Gate: MAD computed, non-conforming digits identified.

Phase 4: Output

Return conformity assessment with digit-level analysis.

Output Format

json
{
  "conformity": "marginal",
  "mad": 0.013,
  "chi_squared": {"statistic": 18.5, "p_value": 0.018, "df": 8},
  "digit_analysis": [{"digit": 1, "observed_pct": 25.1, "expected_pct": 30.1, "deviation": -5.0}],
  "metadata": {"records": 5000, "dataset": "Q4 expense reports"}
}

Examples

Sample I/O

Input: 1000 invoice amounts from a company's AP ledger Expected: First digits should approximate 30.1%, 17.6%, 12.5%, 9.7%, 7.9%, 6.7%, 5.8%, 5.1%, 4.6%. MAD < 0.012 for legitimate data.

Show full SKILL.md (174 more words)Show less
Edge Cases
InputExpectedWhy
All amounts $90-$99Digit 9 dominatesConstrained range — Benford's doesn't apply
Round number spike (digit 1, 5)Flag for reviewMay indicate round-number estimation or threshold manipulation
Government budget dataTypically conforms wellLarge naturally-occurring financial datasets fit Benford's

Gotchas

  • Not proof of fraud: Non-conformity is a RED FLAG, not evidence. Many legitimate processes produce non-Benford distributions. Always investigate further.
  • Second-digit test: First digit test catches gross fabrication. Second-digit analysis catches more subtle manipulation (e.g., rounding to approval thresholds).
  • Combining datasets: Mixing datasets from different processes may artificially create or destroy Benford conformity. Analyze homogeneous datasets.
  • Approval thresholds: If expenses over $5,000 require VP approval, expect a spike of amounts just below $5,000 (digit 4 in the $4,9xx range). This is a behavioral pattern, flagged by second-digit analysis.
  • Sample size matters: Chi-squared test is sensitive to sample size. With 100K+ records, even trivial deviations become statistically significant. Use MAD as primary metric.

References

  • For second and third digit extensions, see references/higher-digit-tests.md
  • For case studies in fraud detection, see references/fraud-case-studies.md

© asgard-ai-platform, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in algo-risk-benford of asgard-ai-platform/skills.

  • SKILL.md
  • examples/sample_scenario.md
  • references/fraud-case-studies.md
  • references/higher-digit-tests.md

Open the folder on GitHubat commit 4e7f4f8

Compare with similar skills

Algo Risk Benford next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Algo Risk Benford compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Algo Risk Benford this skillasgard-ai-platform/skills242—~1.1kAutomated safety check: PassMIT
Analytics And Advisory IntelligenceLeoYeAI/openclaw-master-skills2.2k—~4.5kAutomated safety check: NotesMIT
Bio Proteomics Data ImportGPTomics/bioSkills1.2k1 repos~4.5kAutomated safety check: PassMIT
Finance Opsericosiu/ai-marketing-skills3.6k1 repos~1.4kAutomated safety check: PassMIT
Data Throughput Acceleratoraffaan-m/ECC277k1 repos~707Automated safety check: PassMIT
Funding Rate ArbitrageSuperior-Trade/superior-skills215—~1.9kAutomated safety check: PassMIT

Similar skills

  • Analytics And Advisory Intelligence

    LeoYeAI/openclaw-master-skills

    Cross-client analytics for Greek accounting firms. An agent skill from LeoYeAI/openclaw-master-skills.

    2.2k GitHub stars~4.5k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check: notes
  • Bio Proteomics Data Import

    GPTomics/bioSkills

    Loads mass-spectrometry data into Python/R and strips the search engine's bookkeeping before any number is trusted -- removes decoys (REV/Reverse), contaminants (CON/Potential contaminant)…

    1.2k GitHub starsUsed in 1 repo~4.5k tokens
    Business, Finance & HRAuto-check passed
  • Finance Ops

    ericosiu/ai-marketing-skills

    AI-powered financial analysis suite. An agent skill from ericosiu/ai-marketing-skills.

    3.6k GitHub starsUsed in 1 repo~1.4k tokens
    Business, Finance & HRAuto-check passed
  • Diagnose and accelerate large data movement — ingestion, backfill, export, ETL, warehouse loading, manifest catch-up, and table synchronization — by isolating the true bottleneck, benchmarking…

    277k GitHub starsUsed in 1 repo~707 tokens
    Business, Finance & HRAuto-check passed
  • Funding Rate Arbitrage

    Superior-Trade/superior-skills

    A skill your agent uses when writing a funding-rate-driven perp strategy on Superior Trade — anything described as funding harvest, funding arbitrage, funding rate carry, negative funding, paid to…

    215 GitHub stars~1.9k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Large File Kpi Analysis

    MichaelYang-lyx/AIDABench

    根据数据量自动选择读取策略(大文件转Parquet),提取关键指标进行单位一致性验证与排序分析,并输出可下载的结果表格。

    111 GitHub starsUsed in 1 repo~502 tokens
    Business, Finance & HRAuto-check passed

More from asgard-ai-platform/skills

All 207 skills in this repo
  • Algo Ecom Bm25

    asgard-ai-platform/skills

    Implement BM25 ranking function for e-commerce product search relevance scoring.

    242 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Mfg Cpk

    asgard-ai-platform/skills

    Calculate Cpk process capability index to assess whether a process meets specification requirements.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Price Elasticity

    asgard-ai-platform/skills

    Calculate price elasticity of demand to quantify how price changes affect sales volume.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Bayesian

    asgard-ai-platform/skills

    Apply Bayesian averaging to rank items by combining observed ratings with prior expectations.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Elo

    asgard-ai-platform/skills

    Implement Elo rating system to rank items or players from pairwise comparison outcomes.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Wilson

    asgard-ai-platform/skills

    Calculate Wilson Score confidence intervals for ranking items by positive proportion with sample size correction.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed

Questions about Algo Risk Benford

What does Algo Risk Benford do?

Apply Benford's Law to detect anomalies in numerical datasets by analyzing first-digit frequency distributions. Algo Risk Benford is an agent skill from asgard-ai-platform/skills. Apply Benford's Law to detect anomalies in numerical datasets by analyzing first-digit frequency distributions.

When should I use Algo Risk Benford?

Algo Risk Benford fits situations like: the user needs to audit financial data for fraud indicators; validate data integrity; detect fabricated numbers — even if they say data manipulation detection; first digit test.

How do I install Algo Risk Benford in Claude Code?

Run `npx skills add asgard-ai-platform/skills --skill algo-risk-benford -a claude-code`. Or copy the skill folder (algo-risk-benford in asgard-ai-platform/skills) into .claude/skills/algo-risk-benford in your project. Claude Code loads it when a task matches its description.

How do I install Algo Risk Benford in Codex?

Run `npx skills add asgard-ai-platform/skills --skill algo-risk-benford -a codex`. Or copy the skill folder (algo-risk-benford in asgard-ai-platform/skills) into .agents/skills/algo-risk-benford in your project. Codex loads it when a task matches its description.

Can I use Algo Risk Benford in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add asgard-ai-platform/skills --skill algo-risk-benford -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/algo-risk-benford, .gemini/skills/algo-risk-benford, .github/skills/algo-risk-benford and .opencode/skills/algo-risk-benford in your project.

What does Algo Risk Benford need to run?

SKILL.md names no scripts, command-line tools or credentials: Algo Risk Benford is instructions for the agent only.

Does Algo Risk Benford access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Algo Risk Benford safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Algo Risk Benford use?

Algo Risk Benford is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Algo Risk Benford use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.3k tokens, read only when the agent opens those files.

What are the alternatives to Algo Risk Benford?

Skills that share tags, products or a category with Algo Risk Benford: Analytics And Advisory Intelligence (LeoYeAI/openclaw-master-skills, 2.2k stars), Bio Proteomics Data Import (GPTomics/bioSkills, 1.2k stars), Finance Ops (ericosiu/ai-marketing-skills, 3.6k stars) and Data Throughput Accelerator (affaan-m/ECC, 277k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Algo Risk Benford?

asgard-ai-platform (a GitHub organization) maintains it in asgard-ai-platform/skills, which has 242 GitHub stars. The repository holds 207 skills in this directory. The repository was last updated on June 6, 2026.

Source: asgard-ai-platform/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.