Logo: Wikipedia Categories

Wikipedia Categories

Communautéit
fuzheado
wikipedia-categories

Understand and work with Wikipedia's category system — category trees, the three tests for valid categories (Verifiable/Neutral/Defining), topic vs set categories, sort keys and DEFAULTSORT, querying via API, overcategorization rules, and category maintenance workflows

Iwwersiicht

Editeurfuzheado
RepositoryWikipedia-AI-Skills
Skill-Nummwikipedia-categories
Stären
27
Forks
10
Matgeliwwert Dateien
5
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    fuzheado huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Wikipedia Categories an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikipedia-categories
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fuzheado/Wikipedia-AI-Skills.git /tmp/Wikipedia-AI-Skills
mkdir -p .claude/skills
cp -r /tmp/Wikipedia-AI-Skills/.claude/skills/wikipedia-categories .claude/skills/wikipedia-categories
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Wikipedia Categories an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Wikipedia Categories automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Wikipedia Categories net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

⚠️ User-Agent required: The API examples below hit Wikimedia endpoints. All requests must include a descriptive User-Agent header. See the wikimedia-api-access skill for the correct format.

📖 Prerequisites: For general page structure (infoboxes, templates, navboxes), see wikipedia-page-anatomy. For bulk Pywikibot category operations, see pywikibot. This skill covers the policy rules and query patterns that sit between those two.


SOP: How Categories Work

Categories are a namespace (Category:) in MediaWiki. Adding [[Category:Name]] to a page's wikitext adds it to that category. Every category has a category page that is itself a page in the Category namespace.

The Category Tree

Categories form a directed acyclic graph (a tree, not a tag cloud). Each category page lists [[Category:ParentCategory]] to link it upward:

Category:Science
  └─ Category:Physics
       ├─ Category:Physicists
       │    ├─ Albert Einstein (article)
       │    ├─ Category:American physicists
       │    └─ ...
       └─ Category:Physical phenomena
            └─ ...

Key rule: A category is a container in a hierarchy, not an arbitrary label. Do not add categories as if they are tags.

What a Category Page Displays

A category page shows three groups, in this order:

  1. Subcategories — other categories in this category
  2. Pages — articles and other pages (excluding subcategories and files)
  3. Files — images and other media

Each group is paginated at 200 items. Use the API for more.

Category Redirects

A category redirect uses {{Category redirect|Target}} — this is not a #REDIRECT wikitext redirect. It soft-redirects: any page categorized in the old category appears as categorized in the target instead.

wikitext
{{Category redirect|Physics}}

Hidden Categories

A category marked with __HIDDENCAT__ or {{Hidden category}} does not appear in the visible category bar on articles. Used for maintenance tracking (e.g., Category:Articles with unsourced statements). Hidden categories are shown to logged-in users who enable "Show hidden categories" in preferences.

Detect via API:

action=query&prop=categories&titles=Albert_Einstein&clshow=hidden&format=json

Wikipedia vs. Commons Categories

These are independent systems. Wikipedia categories organize articles; Commons categories organize media files. A Wikipedia article may link to a Commons category via {{Commons category|Name}}, but the two trees are separate.


SOP: The Three Tests for Valid Categories

This is the most important section. Before creating a category or adding a page to one, check all three. If any fails, the category is likely invalid.

1. Verifiable (WP:CATV)

It must be clear from verifiable information in the article why the page belongs in the category. If the article does not contain information that justifies the category, use {{Unreferenced category}} or remove the category.

Check: Can a reader see, from the article text, why this article is in this category?

2. Neutral (WP:CATPOV)

Categories appear on article pages without annotations or citations. They must be uncontroversial. If a category's topic is likely to spark controversy, use a list article instead (which can be annotated and referenced).

Check: Would a reasonable person disagree that this article belongs here?

Examples of non-neutral categories:

  • Category:Criminals for someone not convicted of a crime
  • Category:Controversial politicians (subjective judgment)
  • Category:Failed companies ("failed" is a subjective label)

3. Defining (WP:CATDEF)

A defining characteristic is one that reliable sources commonly and consistently refer to when describing the topic. Nationality, occupation, genre, geographic location — these are typically defining. Eye color, favorite food, zodiac sign — these are typically trivial.

Check: Would reliable sources consistently describe the topic using this characteristic? Would it be appropriate to mention in the lead section?

Decision flow:

Is the characteristic mentioned in reliable sources?
  ├─ No  → ❌ Not verifiable, do not categorize
  └─ Yes → Is it central to how sources describe the topic?
       ├─ Yes → ✅ Defining — likely valid category
       └─ No  → Is it completely trivial (eye color, favorite food)?
            ├─ Yes → ❌ Trivial, do not categorize (WP:TRIVIALCAT)
            └─ No  → May be acceptable as non-defining supplementary category
                      (e.g., "Deaths from sepsis" for a painter)

SOP: Topic vs. Set Categories

Topic Categories (Singular)

Named after the topic itself. Contains articles about the topic and its subtopics.

NameExample members
Category:FranceFrance (main article), History of France, Geography of France, French cuisine
Category:OperaOpera (main article), History of opera, Opera houses, List of operas

Set Categories (Plural)

Named after a class of things. Contains articles that are members of that class.

NameExample members
Category:Cities in FranceParis, Lyon, Marseille (each is a city in France)
Category:OperasThe Magic Flute, Carmen, La Traviata (each is an opera)

Important: Some topics have both a topic category (singular) and a set category (plural) with similar names. Be careful which one to use when categorizing an article.

Eponymous Categories

An eponymous category is named after its main article (e.g., Category:Albert Einstein for the article Albert Einstein).

Rules:

  • Only create if enough directly related articles or subcategories exist
  • The eponymous category should appear first in the article's category list
  • The eponymous category should have only the article's categories that are relevant to the category's content — do NOT copy all of the article's categories onto the category page
  • The article itself is placed in the eponymous category (yes, it categorizes itself)

SOP: Assigning Categories to Articles

Placement

Per MOS:CATEGORY and MOS:ORDER, categories go at the end of the wikitext, before any stub templates:

wikitext
== References ==
{{reflist}}

[[Category:1879 births]]
[[Category:People from Ulm]]
{{Germany-scientist-stub}}

The "Most Specific" Rule

Place articles in the most specific category that applies, not both the parent and the child.

❌ Wrong✅ Correct
Albert Einstein in both Category:Physicists AND Category:German physicistsAlbert Einstein in Category:German physicists only
Paris in both Category:Cities in France AND Category:Capitals in EuropeParis in Category:Capitals in Europe (more specific)

How Many Categories?

Normally 3–8 categories per article. More than 10 is unusual.

Sort Keys

Sort keys control where the page appears in the category listing:

wikitext
[[Category:Category name|Sort key]]

The sort key is not visible to readers — it only affects ordering.

Common conventions:

Article typeSort keyExample
Biography{{DEFAULTSORT:LastName, FirstName}}{{DEFAULTSORT:Einstein, Albert}}
Work (book, film, song){{DEFAULTSORT:Title, The}}{{DEFAULTSORT:Matrix, The}}
InstitutionTrailing space sorts before letters`[[Category:MIT
ListStrip "List of" prefix`[[Category:Lists of countries

Use {{DEFAULTSORT:key}} to set a default sort key for all categories on the page. Individual [[Category:Name|key]] overrides the default for that specific category.

wikitext
{{DEFAULTSORT:Einstein, Albert}}
[[Category:1879 births]]             ← sorted as "Einstein, Albert"
[[Category:People from Ulm]]         ← sorted as "Einstein, Albert"
[[Category:Swiss physicists]]        ← sorted as "Einstein, Albert"
[[Category:20th-century physicists]] ← sorted as "Einstein, Albert"

DEFAULTSORT conflicts: If multiple {{DEFAULTSORT}} tags appear on the rendered page, the last one wins — but they are tracked in Category:Pages with DEFAULTSORT conflicts. A DEFAULTSORT from a template is overridden by any DEFAULTSORT later on the page.

Category Descriptions

A category page should, at minimum, make clear what belongs in it. For ambiguous or large categories, add a description:

wikitext
{{Category main article|Physicist}}

This category is for articles about notable physicists, including 
subcategories for physicists by nationality, century, and specialization.

[[Category:Science]]
[[Category:People by occupation]]

Useful templates:

  • {{Category main article|Article}} — links to the main article
  • {{Category see also|Other category}} — links to related categories
  • {{Set category}} — marks a category as a set category (not a topic category)
  • {{Category TOC}} — adds A–Z table of contents for large categories
  • {{Large category TOC}} — 5-band per-letter TOC for very large categories
  • {{Automatic category TOC}} — auto-selects TOC based on member count

SOP: Finding and Querying Categories

What Categories Does an Article Belong To?

GET https://en.wikipedia.org/w/api.php?action=query&prop=categories&titles=Albert_Einstein&format=json

Key parameters:

ParameterPurpose
cllimitMax results (default 10, max 500)
clshow=!hiddenVisible categories only
clshow=hiddenHidden categories only
clprop=sortkeyInclude sort key information

What's in a Category?

Use list=categorymembers:

GET https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics&format=json

Key parameters:

ParameterPurpose
cmtitleCategory name (required, must include Category: prefix)
cmtype=pageArticles only
cmtype=subcatSubcategories only
cmtype=fileFiles only (default: all three)
`cmtype=pagesubcat`
cmlimitMax results (default 10, max 500)
cmprop=titlePage title only
`cmprop=titlesortkey
cmnamespace=0Main namespace only
cmcontinuePagination token for next page

Pagination: Results include a cmcontinue token when there are more pages. Append it to get the next batch:

GET https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics&cmlimit=500&cmcontinue=page|1234|NextPageTitle&format=json

Category Hierarchy (Recursive Tree)

Use the CategoryTree extension:

GET https://en.wikipedia.org/w/api.php?action=categorytree&category=Physics&format=json

The response is in $.categorytree["*"] and contains HTML (not JSON-structured data). The HTML uses <div> elements with these classes:

ClassPurpose
CategoryTreeSectionWraps one category and its children
CategoryTreeItemThe category name/link itself
CategoryTreeChildrenWraps nested subcategories (may be collapsed)
CategoryTreeBulletExpand/collapse toggle icon

⚠️ Parsing gotcha: This is <div>-based HTML, not <li>/<ul> lists. Nested sections are sibling <div class="CategoryTreeSection"> elements inside <div class="CategoryTreeChildren">. Collapsed children use style="display:none" on the children div. Any parser must track all <div> tags for correct nesting — omitting unrelated divs (like CategoryTreeItem) will break </div> balancing. See scripts/category-tree.sh for a working parser.

Trade-off vs. list=categorymembers: action=categorytree makes a single API call regardless of depth (fast, one round-trip) but returns pre-rendered HTML rather than structured JSON. The HTML classes (CategoryTreeSection, CategoryTreeItem, etc.) are CSS hooks for the extension's own UI, not a stable public API — they could change across MediaWiki versions.

For more data-rich access (page IDs, namespaces, sort keys, timestamps), use list=categorymembers with cmtype=subcat recursively. This returns clean JSON at the cost of N sequential API calls for depth N.

ApproachCallsResponse formatData per node
action=categorytree1Pre-rendered HTMLLink text only
list=categorymembers (recursive)NStructured JSONID, title, ns, sortkey, timestamp

The options parameter is a JSON object:

OptionValuesDefaultDescription
mode"categories", "pages", "all", "parents""categories"What to show: just subcats, pages+subcats, everything, or parent categories
depthinteger1How many levels deep to recurse
namespacesarray of integers[]Restrict to specific namespaces (mode must not be categories)

Examples:

# Subcategory tree, 3 levels deep
action=categorytree&category=Physics&options={"mode":"categories","depth":3}

# All pages in the tree (articles + subcategories), 2 levels deep
action=categorytree&category=Physics&options={"mode":"pages","depth":2}

# Parent categories of Physics (go upward, not downward)
action=categorytree&category=Physics&options={"mode":"parents"}

Search Operator: incategory:

The search box supports incategory:"CategoryName" to find articles in a specific category. Pipe-separated categories are union queries:

incategory:"Suspension bridges|Bridges in New York City"

This returns all articles in EITHER category. Note: does not include subcategories.

⚠️ Escape inner double quotes. Category names may legitimately contain " (e.g. Commons: Collections of the musée départemental Albert-Kahn, mission "1923 - Suisse Allemande - Frédéric Gadmer (28 septembre-7 octobre)" — autochrome missions use quoted date ranges). An unescaped inner quote terminates incategory:"…" early and the query silently returns zero results forever — while prop=categoryinfo still reports the file counts, so a tool can show "198 files" over an empty feed. Escape " as \" in any generated query. See wikimedia-search-cirrussearch Guardrail 11 for the full signature and fix.

External Tools

PetScan (https://petscan.wmflabs.org/) — category intersection and data extraction tool. Useful for:

Use caseHow
Find articles in multiple categories simultaneouslySet multiple category sources with intersection mode
Find pages in one category but NOT in anotherSet negative category filter
Filter by template presenceAdd a template filter (e.g., only pages with {{WikiProject Physics}})
Filter by namespace, page size, redirect statusBuilt-in filters
Export as CSV, JSON, or Wiki tableOutput format selector

Web UI: https://petscan.wmflabs.org/

Special Pages

PagePurpose
Special:CategoriesAlphabetical list of all categories with member counts
Special:AllPages/Category:List all existing category pages (even empty ones)
Special:CategoryTreeInteractive tree browser
Special:TrackingCategoriesBuilt-in MediaWiki tracking categories

SOP: Category Maintenance

Creating a New Category

  1. Add [[Category:ParentCategory]] to the category page to place it in the tree
  2. Add a category description (see "Category Descriptions" above)
  3. Add a TOC template if the category will be large
  4. For eponymous categories, add {{Category main article|ArticleName}}

Finding the Right Place in the Tree

Before creating a category, verify one doesn't already exist with the same or overlapping scope:

  • Check categories on similar articles
  • Search existing category names
  • Navigate the parent tree: e.g., for "Mexican painters", check Category:People by nationality → Category:Mexican people → Category:Mexican artists → Category:Mexican painters

Renaming / Moving Categories

Do NOT move categories with a simple #REDIRECT. Use Wikipedia:Categories for discussion (CFD) for contested renames, which leaves behind a {{Category redirect}}:

wikitext
{{Category redirect|NewCategoryName}}

The category_redirect template ensures that any page categorized in the old name appears as if categorized in the target. The Pywikibot script category_redirect can then fix the underlying category tags.

Populating Categories via Templates

For maintenance categories (e.g., Category:Articles with unsourced statements), use <includeonly> tags in a template:

wikitext
<includeonly>[[Category:Articles with unsourced statements]]</includeonly>

Caveat: Template-based categorization is delayed — changes only appear after the job queue processes affected pages (can be hours in busy periods). A null edit to a specific page forces immediate recaching.

Diffusing Overpopulated Categories

When a category exceeds roughly 200 members, consider diffusing into subcategories:

Before:                       After:
Category:Writers (1,200)      Category:Writers
                                ├─ Category:Writers by nationality
                                │    ├─ Category:American writers
                                │    ├─ Category:French writers
                                │    └─ ...
                                └─ Category:Writers by genre
                                     ├─ Category:Novelists
                                     ├─ Category:Poets
                                     └─ ...

Diffusion should follow defining characteristics — nationality and genre are typical, eye color is not. See the overcategorization reference for what NOT to do.


SOP: Evaluating a Category or Categorization

When asked to evaluate whether a category is valid or whether an article belongs in a category, follow this checklist:

□ Verify: Does the article content justify the category?
   (If not → flag as unverifiable)

□ Neutral: Is the category name neutral and uncontroversial?
   (If not → suggest a list article instead)

□ Defining: Is this a characteristic that reliable sources consistently mention?
   (If not → check WP:TRIVIALCAT, flag as non-defining)

□ Specific: Is this the most specific category available?
   (If not → suggest the more specific one, don't double-categorize)

□ Type: Is it the right type (topic=singular, set=plural)?
   (If wrong → suggest correct name form)

□ Overcategorization: Does the category violate any OC rules?
   (Check: subjective, arbitrary, narrow, by opinion, by performance)

Comparison: All Category Access Methods

This table covers every way to access category data, from lightweight API calls through Pywikibot and external tools. Use it to pick the right approach for your task.

Quick Decision Guide

TaskBest methodWhy
Quick CLI tree of subcategoriesaction=categorytree1 call, built-in recursion
Get all articles in a category with metadatalist=categorymembersClean JSON, page IDs, sort keys
Traverse deep category hierarchy programmaticallyPywikibot cat.subcategories(recurse=True)Handles pagination + recursion automatically
Intersection of multiple categoriesPetScanBuilt-in AND/OR/NOT, filter by template/namespace
Category member counts onlyprop=categoryinfo1 call, no pagination needed
Find what categories an article belongs toprop=categoriesInverse direction
Find all categories matching a prefixlist=allcategoriesDiscover categories by name
Bulk edit/move/redirect categoriesPywikibot category.py scriptBuilt for mass operations
Cross-wiki category analysisWDQS (SPARQL)Recursive across all Wikimedia wikis
Manual browsingSpecial:CategoryTreeInteractive, no coding

Detailed Comparison

Action API — query modules
ModuleDirectionReturnsRecursive?Calls for depth N
list=categorymembersCategory → membersJSON: page IDs, titles, ns, sort keys, timestamp, typeManualN
prop=categoriesArticle → categoriesJSON: category titles, sort keys, hidden statusNo1
prop=categoryinfoCategory → countsJSON: page count, subcat count, file count, sizeNo1
list=allcategoriesWhole wiki → categoriesJSON: category names, member countsNo1 (paginated)
action=categorytreeCategory → tree (HTML)Pre-rendered HTML with <div> elementsBuilt-in (depth param)1

list=categorymembers key parameters:

ParameterPurpose
`cmtype=pagesubcat
cmnamespace=0Filter by namespace
`cmprop=titlesortkey
`cmsort=sortkeytimestamp`
`cmdir=ascdesc`
cmstart / cmendTimestamp range (requires cmsort=timestamp)
cmcontinuePagination token (next 500)
generator=categorymembersUse as generator to feed other query props

Generator pattern (fetch members + page content in one call):

GET /w/api.php?action=query&generator=categorymembers&gcmtitle=Category:Physics
  &prop=extracts|info&exintro&inprop=url&format=json

This is more efficient than fetching members first, then fetching each page's content separately.

Pywikibot

Pywikibot wraps the Action API with automatic pagination, rate limiting, and recursion. Its page generators are the recommended way to do anything beyond one-shot API calls.

GeneratorCLI flagPython methodRecursive?
Pages in a category-cat:Physicspagegenerators.CategorizedPageGenerator(cat)recurse=True
Pages including subcategories-catr:PhysicsSame with recurse=TrueYes (int for depth)
Subcategories only-subcats:Physicscat.subcategories()recurse=True
Subcategories recursively-subcatsr:PhysicsSame with recurse=TrueYes (int for depth)
All members (pages + subcats + files)-cat:Physics (includes all)cat.members()recurse=True

Programmatic usage:

python
import pywikibot
from pywikibot import pagegenerators

site = pywikibot.Site("en", "wikipedia")
cat = pywikibot.Category(site, "Physics")

# Member counts
print(cat.categoryinfo)  # {"size": 68, "pages": 22, "files": 0, "subcats": 46}

# Articles (non-recursive)
for page in cat.articles():
    print(page.title())

# Subcategories, 2 levels deep
for subcat in cat.subcategories(recurse=2):
    print(subcat.title())

# All members recursively (pages + subcategories + files)
for member in cat.members(recurse=True):
    print(member.title())

Built-in scripts for category maintenance:

ScriptPurposeExample
category.pyAdd/remove/move/tidy/clean/tree/listifypwb.py category move -from:"Old" -to:"New"
category_redirectFix redirected categoriespwb.py category_redirect -cat:"Category:Redirects"
category_graphVisualize hierarchy as DOT/SVG/HTMLpwb.py category_graph -from Physics -depth 3
commonscatAdd {{commonscat}} to category pagespwb.py commonscat -start:Category:!
External Tools
ToolBest forHow
PetScanCategory intersection + filteringWeb UI at https://petscan.wmflabs.org/ or URL API
WDQS (SPARQL)Cross-wiki recursive category querieshttps://query.wikidata.org/sparql
Special:CategoryTreeInteractive manual browsingBrowser-based, expand/collapse
Special:CategoriesDiscover all categories on a wikiAlphabetical with member counts

PetScan example URL — find FA-class articles in Category:Physics:

https://petscan.wmflabs.org/?language=en&project=wikipedia&categories=Physics
  &ns[0]=1&interface_language=en&wikidata_item=yes&templates_yes=WikiProject_Physics

WDQS example — find all subcategories recursively:

sparql
SELECT ?category ?categoryLabel WHERE {
  wd:Q413 wdt:P910 ?category .                        # Main topic's category
  ?category wdt:P279* ?subcategory .                   # Recursive subcategories
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
Trade-off Summary
Speed (fewer calls):
  action=categorytree (1)  >  prop=categoryinfo (1)  >  list=categorymembers (N)  >  Pywikibot (N + overhead)

Data richness:
  Pywikibot (full objects)  >  list=categorymembers (IDs + metadata)  >  action=categorytree (link text only)

Ease of use:
  PetScan (web UI)  >  Pywikibot CLI (-catr)  >  Action API direct  >  action=categorytree (needs HTML parser)

Stability:
  list=categorymembers (stable, documented)  >  Pywikibot (stable, wraps API)  >  action=categorytree (unstable HTML)

Quick Reference: API Patterns

# Categories of an article (visible only):
GET /w/api.php?action=query&prop=categories&titles=Albert_Einstein&clshow=!hidden&format=json

# Categories of an article (all, including hidden):
GET /w/api.php?action=query&prop=categories&titles=Albert_Einstein&format=json

# Members of a category (articles only):
GET /w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics&cmtype=page&format=json

# Members of a category (subcategories only):
GET /w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics&cmtype=subcat&format=json

# Category tree (subcategories, 3 levels):
GET /w/api.php?action=categorytree&category=Physics&options={"mode":"categories","depth":3}&format=json

# Category tree (all pages, 2 levels):
GET /w/api.php?action=categorytree&category=Physics&options={"mode":"pages","depth":2}&format=json

# Category info (member counts):
GET /w/api.php?action=query&prop=categoryinfo&titles=Category:Physics&format=json

See scripts/category-tree.sh for an interactive CLI explorer, and assets/ for Python utilities.


Cross-References

Related SkillWhy
wikimedia-api-accessUser-Agent and API patterns for category queries
wikipedia-page-anatomyArticle structure — categories as page elements
wikipedia-citationsCitation-related tracking categories (e.g., Articles with unsourced statements)
pywikibotBulk category operations via Pywikibot generators
wikimedia-search-cirrussearchincategory: and deepcategory: search operators

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Wikipedia Categories?

Understand and work with Wikipedia's category system — category trees, the three tests for valid categories (Verifiable/Neutral/Defining), topic vs set categories, sort keys and DEFAULTSORT, querying via API, overcategorization rules, and category maintenance workflows

Firwat Wikipedia Categories op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Wikipedia Categories besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Wikipedia Categories an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikipedia-categories an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Wikipedia Categories benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Wikipedia Categories benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Wikipedia Categories domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Wikipedia Categories gratis?

Jo. fuzheado huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇