"algo-seo-tfidf"

"algo-seo-tfidf" is a skill for Claude Code from charlieviettq/awesome-agent-skill. It costs 71 tokens per session (992 once invoked), scanned A, a copy of algo-seo-tfidf, MIT.

A text-ranking method that measures how important a word is in one document compared with a collection of documents. TF-IDF gives more weight to words that are frequent in one document but uncommon across the collection.

In plain words
What is it for?
Use it to rank documents by keyword relevance, extract notable terms, or build a basic search system.
Why use it?
It provides a simple way to find distinguishing terms without a machine-learning model. It also avoids treating words found everywhere as useful search clues.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to rank documents by keyword relevance, extract notable terms, or build a basic search system.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/charlieviettq/awesome-agent-skill/algo-seo-tfidf
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add charlieviettq/awesome-agent-skill --skill algo-seo-tfidf
Clone the repo
git clone --depth 1 https://github.com/charlieviettq/awesome-agent-skill

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for "algo-seo-tfidf"

README.md
[![agentmods](https://agentmods.dev/badge/skills/charlieviettq/awesome-agent-skill/algo-seo-tfidf/github.svg)](https://agentmods.dev/skills/charlieviettq/awesome-agent-skill/algo-seo-tfidf)
Your own site
<a href="https://agentmods.dev/skills/charlieviettq/awesome-agent-skill/algo-seo-tfidf"><img src="https://agentmods.dev/badge/skills/charlieviettq/awesome-agent-skill/algo-seo-tfidf/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for "algo-seo-tfidf"

Your own site · 80×15
<a href="https://agentmods.dev/skills/charlieviettq/awesome-agent-skill/algo-seo-tfidf"><img src="https://agentmods.dev/badge/skills/charlieviettq/awesome-agent-skill/algo-seo-tfidf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 992 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00071 $0.00992
Opus 5 $0.00036 $0.00496
Sonnet 5 $0.00014 $0.00198
Haiku 4.5 $0.00007 $0.00099

Measured 9d ago against content hash db8c35f01dea, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

"algo-seo-tfidf" scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/tfidf.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

94% identical to algo-seo-tfidf — 8 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/skills/algo-seo-tfidf/SKILL.md · 92 lines

How it starts

The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

{
  "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

Read the full file on GitHub · 92 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 92 lines · 71 tokens per session scan A db8c35f01dea

Subscribe to this mod's changes

"algo-seo-tfidf" is a skill published in the GitHub repository charlieviettq/awesome-agent-skill (25 stars, last pushed 1mo ago), licensed MIT. It adds 71 tokens to every session and 992 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to algo-seo-tfidf, differing in 8 lines, and is treated as a copy.