Agent skill

Algo Rank Bayesian

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

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

MITAuto-check passed

Install Algo Rank Bayesian

skills CLI
$ npx skills add asgard-ai-platform/skills --skill algo-rank-bayesian -a claude-code

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

GitHub CLI
$ gh skill install asgard-ai-platform/skills algo-rank-bayesian --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-rank-bayesian .claude/skills/algo-rank-bayesian && 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-rank-bayesian
GitHub stars
242
Token cost
~1.1k tokens
SKILL.md length
456 words
Files
5 (incl. scripts, references)
Skills in repo
207
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 4 steps: Input Validation → Core Algorithm → Verification → …
  • The user needs to rank items with varying review counts
  • SKILL.md covers Overview, When to Use, Algorithm and Output Format, plus 4 more sections
  • Runs Python scripts from its folder; calls python

What it does

Algo Rank Bayesian is an agent skill from asgard-ai-platform/skills. Apply Bayesian averaging to rank items by combining observed ratings with prior expectations. Use this skill when the user needs to rank items with varying review counts, build a 'top rated' list that handles low-sample items fairly, or implement IMDB-style weighted rating — even if they say 'weighted average rating', 'IMDB formula', or 'ranking with prior'.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `examples/sample_input.json`, `references/imdb-formula.md` and `references/multi-dimensional.md`).

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 rank items with varying review counts
  • Build a top rated list that handles low-sample items fairly
  • Implement IMDB-style weighted rating — even if they say weighted average rating
  • Ranking with prior

Example prompts

  • “top rated”
  • “weighted average rating”
  • “IMDB formula”
  • “/algo-rank-bayesian”

Requirements

  • Python 3

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

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    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 Rank Bayesian loads about 1.1k tokens when it runs, and up to ~5.4k if it reads all its reference files. Until then it costs about 95 tokens; SKILL.md has 456 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~95
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
~5.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); the scripts in this folder are not scanned.

SKILL.md

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

Download SKILL.mdSave it as .claude/skills/algo-rank-bayesian/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
algo-rank-bayesian
description
Apply Bayesian averaging to rank items by combining observed ratings with prior expectations. Use this skill when the user needs to rank items with varying review counts, build a 'top rated' list that handles low-sample items fairly, or implement IMDB-style weighted rating — even if they say 'weighted average rating', 'IMDB formula', or 'ranking with prior'.
metadata.category
WP-44 排名演算法
metadata.tags
ranking, bayesian-average, rating, prior

Bayesian Average Rating

Overview

Bayesian average combines an item's observed average rating with a prior (global average), weighted by review count. Formula: BR = (C × m + Σrᵢ) / (C + n) where m=global mean, C=confidence parameter, n=item reviews, Σrᵢ=sum of item ratings. Items with few reviews are pulled toward the global mean.

When to Use

Trigger conditions:

  • Ranking items by continuous ratings (1-5 stars) with varying review counts
  • IMDB-style "Top 250" lists that balance quality and popularity
  • Any rating aggregation where new items shouldn't dominate with few high ratings

When NOT to use:

  • For binary (upvote/downvote) data (use Wilson Score instead)
  • When all items have similar review counts (simple average is sufficient)

Algorithm

IRON LAW: The Prior Protects Against Small-Sample Extremes
Without a prior, a single 5-star review makes an item "the best."
The Bayesian average adds C "phantom votes" at the global mean m,
shrinking small-sample items toward average. C controls shrinkage
strength: higher C = more conservative (more phantom votes).
Typical C = median review count across all items.
Phase 1: Input Validation

Compute: global mean rating (m) across all items, choose C (phantom vote count). Collect per item: review count (n), average rating, or sum of ratings. Gate: m computed, C selected, item data available.

Phase 2: Core Algorithm
  1. Global mean: m = Σ(all ratings) / Σ(all review counts)
  2. Bayesian average per item: BR = (C × m + n × avg_rating) / (C + n)
  3. Rank items by BR descending
  4. For items with n >> C, BR ≈ avg_rating (data dominates). For n << C, BR ≈ m (prior dominates).
Phase 3: Verification

Check: items with very few reviews should be near global mean. Items with many reviews should be near their actual average. Ranking is intuitive. Gate: Shrinkage behavior confirmed, top items have both high ratings AND sufficient reviews.

Phase 4: Output

Return ranked items with Bayesian scores.

Output Format

json
{
  "rankings": [{"item": "Movie_A", "bayesian_avg": 8.7, "raw_avg": 9.1, "reviews": 5000, "shrinkage": 0.04}],
  "metadata": {"global_mean": 6.8, "confidence_C": 500, "items_ranked": 10000}
}

Examples

Sample I/O

Input: m=7.0, C=100. Item A: avg=9.5, n=5. Item B: avg=8.5, n=500. Expected: BR_A = (100×7 + 5×9.5)/(105) = 7.12. BR_B = (100×7 + 500×8.5)/(600) = 8.25. B ranks higher.

Show full SKILL.md (184 more words)Show less
Edge Cases
InputExpectedWhy
n=0BR = m (global mean)No data, fully prior-driven
n=100000BR ≈ raw averageMassive sample overwhelms prior
All items same nEquivalent to simple average rankingUniform shrinkage, ordering preserved

Gotchas

  • C selection is subjective: Common choices: median review count, minimum reviews for "reliable" rating (IMDB uses top 25,000 voters with min votes). No universally correct value.
  • Rating scale matters: A 4.0 on a 5-point scale means something different than 4.0 on a 10-point scale. Normalize or use the same scale.
  • Category-specific priors: A 4.0 average in "horror movies" might be exceptional, while 4.0 in "Studio Ghibli" might be below average. Consider category-level priors.
  • Temporal bias: Old items accumulate reviews. Unless you weight recent reviews more, established items permanently dominate "top" lists.
  • Review gaming: Bayesian average doesn't prevent review manipulation — it only mitigates small-sample extremes. Pair with fraud detection.

Scripts

ScriptDescriptionUsage
scripts/bayesian_avg.pyRank items using Bayesian average to handle small-sample extremespython scripts/bayesian_avg.py --help

Run python scripts/bayesian_avg.py --verify to execute built-in sanity tests.

References

  • For IMDB weighted rating formula, see references/imdb-formula.md
  • For multi-dimensional Bayesian rating, see references/multi-dimensional.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 4 other files (scripts, references) in algo-rank-bayesian of asgard-ai-platform/skills.

  • SKILL.md
  • examples/sample_input.json
  • references/imdb-formula.md
  • references/multi-dimensional.md
  • scripts/bayesian_avg.py

Open the folder on GitHubat commit 4e7f4f8

Compare with similar skills

Algo Rank Bayesian 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 Rank Bayesian compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Algo Rank Bayesian this skillasgard-ai-platform/skills242—~1.1kAutomated safety check: PassMIT
Observability Designeralirezarezvani/claude-skills28k—~3.5kAutomated safety check: PassMIT
Langsmith ObservabilityOrchestra-Research/AI-Research-SKILLs13k2 repos~2.4kAutomated safety check: PassMIT
ObservabilityBuilderIO/agent-native7.1k—~7.3kAutomated safety check: PassNone
Frontend Observabilitysickn33/agentic-awesome-skills47k1 repos~5.1kAutomated safety check: PassMIT
Ebpf Observabilitysickn33/agentic-awesome-skills47k2 repos~3.3kAutomated safety check: NotesMIT

Similar skills

  • Observability Designer

    alirezarezvani/claude-skills

    Design production-ready observability strategies combining metrics, logs, and traces.

    28k GitHub stars~3.5k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Langsmith Observability

    Orchestra-Research/AI-Research-SKILLs

    LLM observability platform for tracing, evaluation, and monitoring.

    13k GitHub starsUsed in 2 repos~2.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Observability

    BuilderIO/agent-native

    Agent observability, evals, feedback, and experiments. An agent skill from BuilderIO/agent-native.

    7.1k GitHub stars~7.3k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Frontend Observability

    sickn33/agentic-awesome-skills

    A portable, framework-agnostic field-side observability system for any React or React Native app.

    47k GitHub starsUsed in 1 repo~5.1k tokens
    DevOps & CloudAuto-check passed
  • Ebpf Observability

    sickn33/agentic-awesome-skills

    Use eBPF for deep kernel-level observability — trace syscalls, network flows, and application behavior without code changes using Cilium, Tetragon, and bpftrace.

    47k GitHub starsUsed in 2 repos~3.3k tokens
    DevOps & CloudAuto-check: notes
  • Python Observability

    wshobson/agents

    Python observability patterns including structured logging, metrics, and distributed tracing.

    40k GitHub stars~1.8k tokensUpdated 6 days ago
    DevOps & CloudAuto-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 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
  • Algo Risk Altman Z

    asgard-ai-platform/skills

    Calculate Altman Z-Score to predict corporate bankruptcy probability from financial ratios.

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

Questions about Algo Rank Bayesian

What does Algo Rank Bayesian do?

Apply Bayesian averaging to rank items by combining observed ratings with prior expectations. Algo Rank Bayesian is an agent skill from asgard-ai-platform/skills. Apply Bayesian averaging to rank items by combining observed ratings with prior expectations.

When should I use Algo Rank Bayesian?

Algo Rank Bayesian fits situations like: the user needs to rank items with varying review counts; build a top rated list that handles low-sample items fairly; implement IMDB-style weighted rating — even if they say weighted average rating; ranking with prior.

How do I install Algo Rank Bayesian in Claude Code?

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

How do I install Algo Rank Bayesian in Codex?

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

Can I use Algo Rank Bayesian 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-rank-bayesian -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-rank-bayesian, .gemini/skills/algo-rank-bayesian, .github/skills/algo-rank-bayesian and .opencode/skills/algo-rank-bayesian in your project.

What does Algo Rank Bayesian need to run?

Going by SKILL.md and its folder, Algo Rank Bayesian needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Algo Rank Bayesian 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 Rank Bayesian 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Algo Rank Bayesian use?

Algo Rank Bayesian 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 Rank Bayesian 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 4.3k tokens, read only when the agent opens those files.

What are the alternatives to Algo Rank Bayesian?

Skills that share tags, products or a category with Algo Rank Bayesian: Observability Designer (alirezarezvani/claude-skills, 28k stars), Langsmith Observability (Orchestra-Research/AI-Research-SKILLs, 13k stars), Observability (BuilderIO/agent-native, 7.1k stars) and Frontend Observability (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Algo Rank Bayesian?

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.