Логотип Wikipedia Reference Verifiability

Wikipedia Reference Verifiability

Спільнота
fuzheado
wikipedia-reference-verifiability

Analyze whether a Wikipedia page's references contain URLs — detect bare plain-text citations, template-based citations without url= parameters, shortened footnotes, and named ref reuse. Useful for article quality assessment, NPP triage, and citation maintenance

Огляд

Видавецьfuzheado
РепозиторійWikipedia-AI-Skills
Назва навичкиwikipedia-reference-verifiability
Зірки
27
Форки
10
Файли в пакеті
8
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 8

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем fuzheado. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Wikipedia Reference Verifiability у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikipedia-reference-verifiability
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

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-reference-verifiability .claude/skills/wikipedia-reference-verifiability
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Wikipedia Reference Verifiability в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Wikipedia Reference Verifiability, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Wikipedia Reference Verifiability не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

⚠️ User-Agent required: The API calls in this skill need a descriptive User-Agent header. See the wikimedia-api-access skill for the correct format.

⚠️ Prerequisite: This skill assumes you can parse wikitext with mwparserfromhell. See the wikimedia-wikitext skill for AST parsing patterns.


Reference: Why Reference URLs Matter for Verifiability

Wikipedia's core policy, Verifiability (WP:V), requires that readers can verify that content is backed by reliable sources. A reference that provides a clickable URL is immediately verifiable by any reader. A reference without a URL requires the reader to:

  • Own the cited book or journal
  • Have access to a library with the cited work
  • Trust the author's claim about the source

This is one of the most common red flags during New Page Patrol (NPP) review, and a frequent target for citation maintenance.

Reference Types and Verifiability

TypeWikitext ExampleHas URL?Verifiable Online?
Citation template with URL{{cite web|url=https://...}}✅✅ Yes
Citation template without URL{{cite book|title=X|year=2020}}❌❌ (print only)
Plain-text ref<ref>Smith, 2020, p.42</ref>❌❌ (no link)
Shortened footnote<ref>{{harvsp|Smith|2020}}</ref>❌❌ (may resolve in bibliography)
Named ref (reuse)<ref name="x" />resolves to definitiondepends on definition

Verifiable ≠ must have a URL

A source is verifiable online if it carries a resolvable identifier, even with no url= parameter. A {{cite journal|doi=10.1000/xyz123}} is as verifiable as one with a URL — the DOI resolves to a landing page. When assessing verifiability, count these identifier parameters the same as a URL:

IdentifierTemplatesExample
doicite journal / conference10.1000/xyz123
pmid / pmccite journal12345678 / PMC1234567
isbncite book978-0-262-52316-5
issnany0040-165X
oclccite book123456789
jstorcite journal123456
bibcodecite journal1924PhRv...23..123B
arxiv / eprintcite arXiv / bioRxiv1234.56789
s2cidcite journal12345678
python
from assets.ref_url_checker import has_any_url_refs, has_any_verifiable_refs

# URL-only view (strict):
has_url, total, url_count, samples = has_any_url_refs(wikitext)

# Verifiable view (URL or identifier):
has_v, total, v_count, samples = has_any_verifiable_refs(wikitext)

Use the URL-only view when the question is literally "does the reader get a clickable link"; use the verifiable view when the question is "can a reader verify this online at all" (the WP:V question).


SOP: URL Detection Strategy

The analysis proceeds in several passes:

Pass 1 — Collect all <ref> tags

python
import mwparserfromhell

parsed = mwparserfromhell.parse(wikitext)
ref_tags = parsed.filter_tags(
    matches=lambda t: str(t.tag).strip().lower() == "ref"
)

Pass 2 — Index named ref definitions

Named refs can be defined anywhere on the page, even after their first use. Index all definitions before evaluating individual refs. Ref names are scoped per group (the Cite extension's group attribute): name="x" in group "n" is a different name from name="x" in the default (unnamed) group. Index by the (group, name) pair, never by bare name:

python
named_defs: dict[tuple[str, str], str] = {}
for tag in ref_tags:
    name = _named_ref_name(tag)
    group = _ref_group(tag)          # "" for the default group
    content = _tag_content(tag)
    if name and content and (group, name) not in named_defs:
        named_defs[(group, name)] = content

Without group-scoping, a reuse like <ref group="n" name="apsis" /> would wrongly resolve against a default-group definition — producing false "has URL" results (a real bug found and fixed in this skill's library).

Pass 3 — Evaluate each reference

For each ref tag:

  1. If it has content, use that. If it's a named ref reuse (no content but has a name attribute), resolve from the index.
  2. Count it only once per name group (avoid double-counting reused named refs).
  3. Check for URLs in the content via two strategies (see below).

Pass 4 — Check inline citation templates outside <ref> tags

Some pages use citation templates directly in the text (old-style inline citations). Check for {{cite ...}} templates that aren't nested inside any <ref> tag:

python
for template in parsed.filter_templates():
    name = str(template.name).strip().lower()
    if name.startswith("cite "):
        if not _is_inside_ref(template, ref_tags):
            # Check this template for URL presence

SOP: URL Detection — Two Strategies

Strategy A — Raw URL in text

A simple regex check catches bare URLs and links inside plain text:

python
import re

URL_RE = re.compile(r"https?://", re.IGNORECASE)

def _contains_raw_url(text: str) -> bool:
    return bool(URL_RE.search(text))

This catches:

  • <ref>https://example.com/article</ref> (bare URL)
  • <ref>Available at https://example.com</ref> (URL in prose)
  • <ref>{{cite web|url=https://...|title=...}}</ref> (URL inside template)
  • <ref>[https://example.com Article]</ref> (external link syntax)

Strategy B — Citation template URL parameters

When a reference uses a CS1/CS2 citation template, the URL may be in a named parameter, not in the raw text. Check for the following parameter names:

python
URL_PARAM_NAMES = frozenset({
    "url",
    "chapter-url",
    "conference-url",
    "contribution-url",
    "transcript-url",
    "archive-url",
    # camelCase legacy variants
    "chapterurl",
    "conferenceurl",
    "contributionurl",
    "transcripturl",
    "archiveurl",
})

Note: access-date is a date, not a URL — do not treat it as one. The url=, *-url= and archive-url= parameters (plus doi, pmid, isbn, etc. — see "Verifiable ≠ must have a URL" above) are what make a ref verifiable.

Implementation:

python
def _template_has_url_param(template: mwparserfromhell.nodes.Template) -> bool:
    for param in template.params:
        name = str(param.name).strip().lower()
        if name in URL_PARAM_NAMES:
            value = str(param.value).strip()
            if value:  # non-empty value = URL present
                return True
        # Also check unnamed params for raw URLs
        if not name and _contains_raw_url(str(param.value)):
            return True
    return False

Known citation template families that accept URL parameters:

Template FamilyURL ParameterNotes
{{cite web}}urlPrimary parameter
{{cite news}}url
{{cite journal}}urlOften has DOI instead
{{cite book}}urlRarely used (print sources)
{{cite magazine}}url
{{cite encyclopedia}}url
{{cite report}}url
{{cite thesis}}url
{{cite conference}}url
{{cite podcast}}url
{{cite episode}}url
{{cite map}}url
{{citation}}urlGeneric citation template

SOP: Handling Edge Cases

Named Ref Reuse

python
seen_named: set[str] = set()

for tag in ref_tags:
    name = _named_ref_name(tag)
    content = _tag_content(tag)

    # Resolve reuse
    if not content and name:
        content = named_defs.get(name, "")
    elif not content:
        continue  # self-closing with no name

    # Deduplicate per name
    if name:
        if name in seen_named:
            continue
        seen_named.add(name)

    # Now evaluate content for URL presence
    ...

Shortened Footnotes ({{harvsp}}, {{sfn}}, {{harvnb}})

These author-date templates point to a bibliography entry elsewhere on the page. The inline ref has no URL, but the bibliography entry might. To check the bibliography:

  1. Scan the page for a == Bibliography == or == References == section.
  2. Look for full {{cite ...}} templates in that section.
  3. Check if the author/year from the shortened footnote matches a biblio entry.
  4. Determine if that entry has a URL.

This is heuristic — a simplified approach is to flag the inline ref and report the bibliography entries separately:

python
SHORTENED_FOOTNOTE_TEMPLATES = frozenset({
    "harvsp", "harvnb", "harv", "sfn", "harvard citation",
})

def _is_shortened_footnote(name: str) -> bool:
    return name in SHORTENED_FOOTNOTE_TEMPLATES or \
           name.startswith("harv") or name.startswith("sfn")

Nested Templates

A citation template may be nested inside another template inside a <ref>:

<ref>{{citation|title=X|url=https://...}}</ref>         ← simple nest
<ref>{{harvsp|Smith|2020}}                              ← shortened footnote

The inner {{citation|url=...}} must still be detected. After extracting the ref content, parse it recursively:

python
for template in parsed.filter_templates():
    if _template_has_url_param(template):
        return True
    # Recurse: check nested templates in params
    for param in template.params:
        inner = mwparserfromhell.parse(str(param.value))
        for nt in inner.filter_templates():
            if _template_has_url_param(nt):
                return True

Infobox Presence

Infoboxes are templates whose name starts with Infobox:

python
def has_infobox(wikitext: str) -> bool:
    parsed = mwparserfromhell.parse(wikitext)
    for template in parsed.filter_templates():
        name = str(template.name).strip()
        if name.lower().startswith("infobox"):
            return True
    return False

Reference: Summarizing References for Display

When displaying a URL-free reference to a reviewer, produce a human-readable snippet that identifies the type of reference:

python
def _summarize_ref(content: str) -> str:
    # Extract template name for template-based refs
    cleaned = re.sub(
        r"\{\{(\s*[Cc]ite\s+\w+|\s*[Hh]arv[np]?\w*|\s*[Ss]fn)\b[^}]*\}\}",
        lambda m: "[" + m.group(1).strip() + "]",
        content,
    )
    # Generic fallback for unrecognized templates
    cleaned = re.sub(r"\{\{[^}]*\}\}", "[template]", cleaned)
    # Simplify wikilinks
    cleaned = re.sub(r"\[\[([^\]|\]]+)\|([^\]]+)\]\]", r"\2", cleaned)
    cleaned = re.sub(r"\[\[([^\]|]+)\]\]", r"\1", cleaned)
    cleaned = re.sub(r"'''''|'''|''", "", cleaned)
    cleaned = re.sub(r"\s+", " ", cleaned).strip()
    if len(cleaned) > 80:
        cleaned = cleaned[:77] + "..."
    return cleaned or "(empty ref)"

This produces readable labels like:

  • [harvsp] — shortened footnote
  • [Cite journal] — cite journal template without URL
  • [cite Instagram] — Instagram citation
  • Smith, J. The Book... — plain text

Tooling

🔧 Check References for a Single Page (scripts/check-ref-urls.sh)

bash
./scripts/check-ref-urls.sh "Betka Ait Mokran"
./scripts/check-ref-urls.sh "LOL: Slutty Bass"

Outputs a per-reference summary showing whether each ref has a URL.

🔧 Batch Scan New Pages (scripts/batch-ref-audit.sh)

bash
./scripts/batch-ref-audit.sh --days 7 --limit 100
./scripts/batch-ref-audit.sh --days 1 --limit 50 --no-quality

Combines the PageTriage two-pass pipeline with reference analysis. Equivalent to the npp-finder tool.

🐍 Reference URL Checker Library (assets/ref_url_checker.py)

The full reference analysis library — importable, with all edge cases handled:

python
from assets.ref_url_checker import (
    has_any_url_refs,
    has_any_verifiable_refs,
    has_infobox,
)

# URL-only view (strict: literal clickable links)
has_url, total, url_count, samples = has_any_url_refs(wikitext)

# Verifiable view (URL or identifier: doi/pmid/isbn/arxiv/...)
has_v, total, v_count, samples = has_any_verifiable_refs(wikitext)

# Check infobox presence
has_box = has_infobox(wikitext)

Named-ref resolution is group-scoped (keyed by (group, name)) so refs in separate footnote groups never cross-resolve — see "Pass 2" above.

🐍 Test Suite (assets/test_ref_checker.py)

bash
python3 -m pytest assets/test_ref_checker.py -v

Tests cover: raw URLs, citation templates with/without URL, named ref resolution, shortened footnotes, nested templates, empty pages, self-closing tags, and reused named refs.


SOP: New Page Patrol with PageTriage

⚠️ Deployment: PageTriage is in active production on enwiki and testwiki only (ruwiki in progress). Requires the patrol right for write operations. Verify availability: check Special:Version or the API sandbox for pagetriagelist.

Review Status Codes

The pagetriage_page SQL table stores review status:

ValueMeaning
0Unreviewed — needs NPP review
1Reviewed
2Patrolled (admin)
3Autopatrolled (creator has the right)

API Endpoints

List unreviewed pages (requires patrol right):

GET /w/api.php?action=pagetriagelist&showunreviewed=1&limit=50&format=json

Check review status (no auth needed):

GET /w/api.php?action=query&prop=info&inprop=protection&titles=Page_Title&format=json

Mark reviewed (POST, requires CSRF token):

POST /w/api.php?action=pagetriageaction&pageid=12345&reviewed=1&token=...

Legacy API (no patrol right required for reading):

GET /w/api.php?action=query&list=unreviewedpages&filterlevel=0&namespace=0&limit=50&format=json

Database Access (for bulk analysis)

When you have Toolforge SQL access, query the pagetriage_page table directly:

sql
SELECT ptrp_page_id, ptrp_reviewed, ptrp_created
FROM pagetriage_page
WHERE ptrp_reviewed = 0 AND ptrp_deleted = 0
  AND ptrp_created >= NOW() - INTERVAL 7 DAY
ORDER BY ptrp_created DESC LIMIT 100;

Tooling

FilePurpose
scripts/list-unreviewed.shList last N unreviewed mainspace pages
scripts/check-status.shCheck patrol status for specific pages
assets/pagetriage_client.pyPython client wrapping the PageTriage API
assets/patrol_simulator.pyTwo-pass pipeline: fetch new pages → reference analysis → enrich matches

See also: wikimedia-database for SQL access, wikimedia-eventstreams for real-time page-create detection.


Cross-References

Related SkillWhy
wikimedia-api-accessUser-Agent and API patterns
wikimedia-wikitextAST-based parsing for extracting references from wikitext
wikipedia-citationsCitation formatting — complementary: ref-check finds URLs, citations formats them
wikipedia-categoriesBare-URL tracking categories for citation maintenance
wikipedia-page-anatomyReference section structure in articles

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Wikipedia Reference Verifiability?

Analyze whether a Wikipedia page's references contain URLs — detect bare plain-text citations, template-based citations without url= parameters, shortened footnotes, and named ref reuse. Useful for article quality assessment, NPP triage, and citation maintenance

Навіщо використовувати Wikipedia Reference Verifiability у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Wikipedia Reference Verifiability — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Wikipedia Reference Verifiability у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikipedia-reference-verifiability. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Wikipedia Reference Verifiability?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Wikipedia Reference Verifiability?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Wikipedia Reference Verifiability — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Wikipedia Reference Verifiability?

Так. Навичку опубліковано на GitHub: fuzheado, за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇