plugin-architecture-patterns

plugin-architecture-patterns is a skill for Claude Code, Codex from xberg-io/xberg. It costs 49 tokens per session (1,706 once invoked), scanned A, original, MIT.

Reference guidance for designing and diagnosing Xberg’s plugin system. It lists the available plugin roles, their Rust interfaces, and how plugins are registered and connected to Python bridges.

In plain words
What is it for?
It helps build or troubleshoot document extractors, OCR backends, post-processors, validators, embedding and reranking backends, tokenizers, renderers, and related plugin registration.
Why use it?
It gives agents the project’s expected extension points and registration patterns. This reduces the risk of adding a plugin in the wrong place or with the wrong interface.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/xberg-io/xberg/plugin-architecture-patterns
Any agent
npx skills add xberg-io/xberg --skill plugin-architecture-patterns
Clone the repo
git clone --depth 1 https://github.com/xberg-io/xberg

Made for: Claude Code, Codex.

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 plugin-architecture-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/xberg-io/xberg/plugin-architecture-patterns.svg)](https://agentmods.dev/skills/xberg-io/xberg/plugin-architecture-patterns)
Your own site
<a href="https://agentmods.dev/skills/xberg-io/xberg/plugin-architecture-patterns"><img src="https://agentmods.dev/badge/skills/xberg-io/xberg/plugin-architecture-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,706 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.00049 $0.01706
Opus 5 $0.00024 $0.00853
Sonnet 5 $0.00010 $0.00341
Haiku 4.5 $0.00005 $0.00171

Measured 4d ago against content hash 071a1f84b43e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

plugin-architecture-patterns 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 4d ago.

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.

.ai-rulez/skills/plugin-architecture-patterns/SKILL.md · 156 lines

How it starts

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

Plugin Architecture & Registration

Plugin Types

Type Trait Location
Document extractor (binding-facing) DocumentExtractor: Plugin plugins/extractor/trait.rs
Document extractor (in-crate) InternalDocumentExtractor: Plugin plugins/extractor/trait.rs
OCR backend OcrBackend: Plugin plugins/ocr.rs (a file, not a directory)
Post processor PostProcessor: Plugin plugins/processor/trait.rs
Validator Validator: Plugin plugins/validator/trait.rs
Embedding backend EmbeddingBackend: Plugin plugins/embedding.rs
Reranker backend RerankerBackend: Plugin plugins/reranker.rs
Tokenizer backend TokenizerBackend: Plugin plugins/tokenizer.rs
Renderer Renderer: Plugin plugins/renderer.rs

Plugin (plugins/traits.rs) is Send + Sync and requires name(); version(), initialize(), shutdown(), description(), and author() have defaults. There is no 'static trait bound; registry-owned Arc<dyn Trait> supplies the necessary lifetime.

Native Rust extractors implement InternalDocumentExtractor

DocumentExtractor is the binding-facing surface. In-crate extractors implement InternalDocumentExtractor and get DocumentExtractor from a blanket impl. Implementing DocumentExtractor directly in this crate is the wrong layer.

#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
impl InternalDocumentExtractor for MyExtractor {
    async fn extract_content(&self, content: &[u8], mime_type: &str, config: &ExtractionConfig)
        -> Result<InternalDocument> { /* ... */ }

    fn supported_mime_types(&self) -> &[&str] { &["application/x-custom"] }
    fn priority(&self) -> i32 { 50 }
}

extract_path has a default that reads the file and delegates to extract_content (and errors without tokio-runtime).

Always use the two-arm cfg_attr form for async_trait. A bare #[async_trait] does not match the trait declaration on wasm32.

Read the full file on GitHub · 156 lines

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. 4d ago First seen · 156 lines · 49 tokens per session scan A 071a1f84b43e

Subscribe to this mod's changes

plugin-architecture-patterns is a skill published in the GitHub repository xberg-io/xberg (9,248 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 1,706 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

doc-reader

PDF/DOCX/XLSX/image document intelligence — text extraction, table parsing, OCR, financial statement analysis, contract clause detection, document classification, and format conversion. Use when reading, analyzing, extracting data from, or converting documents.

JansenAnalytics/claudex · 51 tokens

html-to-markdown

Convert HTML to Markdown, Djot, or plain text with structured extraction. Use when writing code that calls html-to-markdown APIs in Rust, Python, TypeScript, Go, Ruby, PHP, Java, C#, Elixir, R, C, or WASM. Covers installation, conversion, configuration, metadata extraction, tables, document structure, inline images…

xberg-io/html-to-markdown · 85 tokens

converting-html

Use when converting HTML to Markdown, Djot, or plain text. Covers output formats, heading and code-block styles, lists, escaping, wrapping, and HTML preprocessing.

xberg-io/html-to-markdown · 38 tokens

extracting-metadata

Use when extracting metadata from HTML — title, description, language, Open Graph, JSON-LD / Microdata / RDFa, headers, links, and images. Covers the --json output shape and the --extract-metadata flag.

xberg-io/html-to-markdown · 52 tokens

extracting-tables

Use when extracting tabular data from HTML. Covers GFM Markdown tables, the structured tables array (grid cells plus pre-rendered markdown), and HTML line breaks in table cells.

xberg-io/html-to-markdown · 41 tokens

fetching-and-converting-urls

Use when fetching a live URL and converting it to Markdown. Covers --url, custom user agents, preprocessing for noisy pages, and the --json ConversionResult shape.

xberg-io/html-to-markdown · 41 tokens