Agent skill

Algo SEO Tfidf

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

Implement TF-IDF scoring to measure term importance relative to a document corpus.

MITAuto-check passedBackend & APIs

Install Algo SEO Tfidf

skills CLI
$ npx skills add asgard-ai-platform/skills --skill algo-seo-tfidf -a claude-code

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

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

At a glance

Implement TF-IDF scoring to measure term importance relative to a document corpus.

  • Works in 4 steps: Input Validation → Core Algorithm → Verification → …
  • The user needs to rank documents by keyword relevance
  • 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 SEO Tfidf is an agent skill from asgard-ai-platform/skills. Implement TF-IDF scoring to measure term importance relative to a document corpus. Use this skill when the user needs to rank documents by keyword relevance, extract important terms from text, or build a basic search relevance engine — even if they say 'find relevant documents', 'keyword extraction', or 'term importance'.

Its SKILL.md is about 950 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/bm25-comparison.md` and `references/inverted-index.md`).

It sits in Backend & APIs, covering Search implementation. 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 documents by keyword relevance
  • Extract important terms from text
  • Build a basic search relevance engine — even if they say find relevant documents
  • Keyword extraction

Example prompts

  • “find relevant documents”
  • “keyword extraction”
  • “term importance”
  • “/algo-seo-tfidf”

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 SEO Tfidf loads about 953 tokens when it runs, and up to ~6.8k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 374 words of instructions outside code blocks.

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

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). 374 words, ~953 tokens.

Download SKILL.mdSave it as .claude/skills/algo-seo-tfidf/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
algo-seo-tfidf
description
Implement TF-IDF scoring to measure term importance relative to a document corpus. Use this skill when the user needs to rank documents by keyword relevance, extract important terms from text, or build a basic search relevance engine — even if they say 'find relevant documents', 'keyword extraction', or 'term importance'.
metadata.category
WP-35 SEO 演算法
metadata.tags
seo, tfidf, information-retrieval, text-analysis

TF-IDF

Overview

TF-IDF (Term Frequency–Inverse Document Frequency) scores term importance as TF(t,d) × IDF(t). High scores mean a term is frequent in a document but rare across the corpus. Computes in O(N × V) where N is documents and V is vocabulary size.

When to Use

Trigger conditions:

  • Ranking documents by keyword relevance
  • Extracting distinguishing terms from documents
  • Building lightweight search without ML models

When NOT to use:

  • When semantic similarity matters (use embeddings instead)
  • When you need ranking with link authority (combine with PageRank)

Algorithm

IRON LAW: TF-IDF Measures RELATIVE Importance
- A term with high TF but low IDF is common, NOT important
- TF-IDF = TF(t,d) × log(N / DF(t))
- A term appearing in ALL documents has IDF = 0 → score = 0
Phase 1: Input Validation

Tokenize documents, apply lowercasing, remove stop words. Build vocabulary. Gate: All documents tokenized, vocabulary size reasonable.

Phase 2: Core Algorithm
  1. Compute TF(t,d) for each term in each document (raw count, log-normalized, or boolean)
  2. Compute IDF(t) = log(N / DF(t)) where DF(t) = number of documents containing term t
  3. Compute TF-IDF(t,d) = TF(t,d) × IDF(t)
  4. Optionally L2-normalize document vectors for cosine similarity
Phase 3: Verification

Check: terms appearing in all documents have IDF ≈ 0. Rare terms have high IDF. Gate: Score distribution is reasonable; common words score low.

Phase 4: Output

Return scored terms per document or ranked documents per query.

Output Format

json
{
  "query_results": [{"document": "doc_id", "score": 0.73, "matching_terms": ["term1", "term2"]}],
  "metadata": {"corpus_size": 1000, "vocabulary_size": 5000, "tf_variant": "log_normalized"}
}

Examples

Sample I/O

Input: Corpus: ["the cat sat", "the dog sat", "the cat played"], Query: "cat" Expected: TF("cat", doc1)=1/3, DF("cat")=2, IDF=log(3/2)=0.405. TF-IDF(doc1)=0.135, TF-IDF(doc3)=0.135, TF-IDF(doc2)=0

Show full SKILL.md (161 more words)Show less
Edge Cases
InputExpectedWhy
Term in all docsScore = 0IDF = log(N/N) = 0
Term in one docHighest IDFlog(N/1) = log(N)
Empty documentAll scores = 0No terms to score

Gotchas

  • Stop words matter: Without stop word removal, "the", "is", "a" dominate TF but have zero IDF. Preprocess properly.
  • TF variant choice: Raw count, log(1+count), or boolean TF produce very different rankings. Log normalization prevents long documents from dominating.
  • IDF smoothing: Add 1 to denominator to avoid division by zero for unknown query terms: IDF = log(N / (DF+1)) + 1.
  • Not semantic: "car" and "automobile" are treated as completely different terms. TF-IDF has no concept of synonymy.
  • Corpus dependency: IDF values change when the corpus changes. Adding documents alters all scores.

Scripts

ScriptDescriptionUsage
scripts/tfidf.pyCompute TF-IDF vectors, top terms per document, and query scoringpython scripts/tfidf.py --help

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

References

  • For BM25 (improved TF-IDF), see references/bm25-comparison.md
  • For efficient inverted index implementation, see references/inverted-index.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-seo-tfidf of asgard-ai-platform/skills.

  • SKILL.md
  • examples/sample_input.json
  • references/bm25-comparison.md
  • references/inverted-index.md
  • scripts/tfidf.py

Open the folder on GitHubat commit 4e7f4f8

Compare with similar skills

Algo SEO Tfidf 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 SEO Tfidf compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Algo SEO Tfidf this skillasgard-ai-platform/skills242—~953Automated safety check: PassMIT
Firecrawl Search Integrationfirecrawl/firecrawl190k1 repos~1.1kAutomated safety check: PassISC
Product Full-Text Searchlobehub/lobehub83k—~4.1kAutomated safety check: PassCustom licence
Project Orchestratorthis-rs/project-orchestrator140—~2.6kAutomated safety check: PassCustom licence
Hackernewssigcli/sigcli293—~2kAutomated safety check: PassMIT
Create Skillxlanex6/nuxt-meilisearch123—~752Automated safety check: PassMIT

Similar skills

  • Firecrawl Search Integration

    firecrawl/firecrawl

    Guidance for adding Firecrawl's /search endpoint to product code and agent workflows when a feature starts from a query rather than a URL.

    190k GitHub starsUsed in 1 repo~1.1k tokens
    Backend & APIsAuto-check passed
  • Guides work on LobeHub's own product search: the shared search repository, provider choice, Elasticsearch mappings, change syncing and reindexing.

    83k GitHub stars~4.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Project Orchestrator

    this-rs/project-orchestrator

    AI agent orchestrator with Neo4j knowledge graph, Meilisearch search, and Tree-sitter parsing.

    140 GitHub stars~2.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Hackernews

    sigcli/sigcli

    Interact with Hacker News (news.ycombinator.com) — browse top, new, and best stories, read item details and comment threads, look up user profiles, and search posts via Algolia.

    293 GitHub stars~2k tokensUpdated 13 days ago
    Backend & APIsAuto-check passed
  • Create Skill

    xlanex6/nuxt-meilisearch

    Guide for creating effective skills following best practices.

    123 GitHub stars~752 tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • Foundatio Repositories

    exceptionless/Exceptionless

    Query, aggregate, patch, or paginate Exceptionless data through its Elasticsearch repository abstractions.

    2.5k GitHub stars~1.9k tokensUpdated 3 days ago
    Backend & APIsAuto-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

Categories

Questions about Algo SEO Tfidf

What does Algo SEO Tfidf do?

Implement TF-IDF scoring to measure term importance relative to a document corpus. Algo SEO Tfidf is an agent skill from asgard-ai-platform/skills. Implement TF-IDF scoring to measure term importance relative to a document corpus.

When should I use Algo SEO Tfidf?

Algo SEO Tfidf fits situations like: the user needs to rank documents by keyword relevance; extract important terms from text; build a basic search relevance engine — even if they say find relevant documents; keyword extraction.

How do I install Algo SEO Tfidf in Claude Code?

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

How do I install Algo SEO Tfidf in Codex?

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

Can I use Algo SEO Tfidf 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-seo-tfidf -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-seo-tfidf, .gemini/skills/algo-seo-tfidf, .github/skills/algo-seo-tfidf and .opencode/skills/algo-seo-tfidf in your project.

What does Algo SEO Tfidf need to run?

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

Does Algo SEO Tfidf 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 SEO Tfidf 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 SEO Tfidf use?

Algo SEO Tfidf 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 SEO Tfidf use?

About 953 tokens (SKILL.md is roughly 3.8k 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.8k tokens, read only when the agent opens those files.

What are the alternatives to Algo SEO Tfidf?

Skills that share tags, products or a category with Algo SEO Tfidf: Firecrawl Search Integration (firecrawl/firecrawl, 190k stars), Product Full-Text Search (lobehub/lobehub, 83k stars), Project Orchestrator (this-rs/project-orchestrator, 140 stars) and Hackernews (sigcli/sigcli, 293 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Algo SEO Tfidf?

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.