bd-source-adapter

bd-source-adapter is a skill for Claude Code, Codex from Lonsdale201/wp-agent-skills. It costs 207 tokens per session (3,274 once invoked), scanned A, original, MIT.

A guide for adding a source adapter to better-data, a library that turns WordPress-stored values into typed data objects. The adapter connects an uncovered WordPress data store, such as comments, attachments, transients, or custom tables, to that conversion process.

In plain words
What is it for?
Use it when extending better-data to read a new WordPress data store and hydrate its records into typed data objects.
Why use it?
It prevents missing values from being confused with stored empty strings, which would cause defaults and nullable fields to be handled incorrectly.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when extending better-data to read a new WordPress data store and hydrate its records into typed data objects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lonsdale201/wp-agent-skills/bd-source-adapter
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 Lonsdale201/wp-agent-skills --skill bd-source-adapter
Clone the repo
git clone --depth 1 https://github.com/Lonsdale201/wp-agent-skills

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 bd-source-adapter

README.md
[![agentmods](https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/bd-source-adapter/github.svg)](https://agentmods.dev/skills/lonsdale201/wp-agent-skills/bd-source-adapter)
Your own site
<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/bd-source-adapter"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/bd-source-adapter/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 bd-source-adapter

Your own site · 80×15
<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/bd-source-adapter"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/bd-source-adapter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 207 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,274 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00207 $0.03274
Opus 5 $0.00103 $0.01637
Sonnet 5 $0.00041 $0.00655
Haiku 4.5 $0.00021 $0.00327

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

Security

Grade A, and why

bd-source-adapter 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 10d 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.

better-data/bd-source-adapter/SKILL.md · 285 lines

How it starts

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

better-data: Adding a source adapter

For library maintainers integrating a new WordPress data store with better-data — comments, attachments, transients, custom tables, taxonomy hierarchies. Sources hydrate stored data into typed DataObjects via AttributeDrivenHydrator; the work is wiring up the bridge between WP's storage idioms and the hydrator's closure contract.

Misconception this skill corrects

"I'll call get_post_meta($id, $key, true) directly — empty string means 'not set'."

Wrong. WordPress get_meta($key, true) returns '' (empty string) for both "key does not exist" AND "key exists with empty-string value". The AttributeDrivenHydrator distinguishes these because the default-value fallback at src/Internal/AttributeDrivenHydrator.php:90-95 needs to know "missing → use the parameter's default" vs "present-but-empty → coerce as empty string". Without the distinction, every nullable meta-backed field with a non-null default falls back incorrectly.

The contract: the closure you pass to the hydrator returns:

  • null → key does not exist (hydrator falls back to parameter default / parameter nullable)
  • the stored value (including '') → key exists, hydrator coerces

Verified pattern from src/Source/PostSource.php:91-93:

if (\function_exists('metadata_exists')
    && !\metadata_exists('post', $postId, $key)) {
    return null;  // key does not exist
}
return \get_post_meta($postId, $key, true);  // exists; could be ''

Other AI-prone misconceptions:

  • "I'll instantiate WP_User directly with new WP_User($id) in a hot loop." Wrong — bypasses object cache. Use get_user_by('id', $id) so the per-request cache participates.
  • "Bulk hydration is just array_map($id => hydrate($id))." Wrong — without prewarming, that's N+1 queries. Always call update_meta_cache(...) (and _prime_post_caches for posts) first.
  • "I'll write the WP-touching code in src/Internal/." Wrong — src/Internal/ is the WP-free engine zone (so it's unit-testable without a WP runtime). Source adapters live in src/Source/ and CAN call WP functions.

Read the full file on GitHub · 285 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. 10d ago First seen · 285 lines · 207 tokens per session scan A eabdf027bc71

Subscribe to this mod's changes

bd-source-adapter is a skill published in the GitHub repository Lonsdale201/wp-agent-skills (22 stars, last pushed 11d ago), licensed MIT. It adds 207 tokens to every session and 3,274 once invoked, about $0.0010 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

mvc-expert

Expert guidelines to refactor legacy PHP codebases into clean, modern, and scalable MVC-structured projects / Pedoman ahli untuk merefaktor codebase PHP lama menjadi proyek terstruktur MVC yang bersih, modern, dan skalabel.

roedyrustam/vibes-plug · 51 tokens

php-laravel

Modern PHP 8.4 and Laravel patterns: architecture, Eloquent, migrations, queues, testing. Use when working with Laravel, Eloquent, Blade, artisan, or building/testing a framework-based PHP app. Not for php-src internals, standalone PHP libraries, or general PHP language discussion.

iliaal/ai-skills · 65 tokens

laravel-engineering

Laravel implementation discipline for tracing context, reusing present contracts, keeping code simple, preserving failures, and verifying the changed critical path. Use when implementing, refactoring, debugging or reviewing Laravel code where callers, configuration, data flow or proof of correctness may be unclear.

Foysal50x/skills · 58 tokens

webman

Expert skill for the webman framework (a long-lived, in-memory PHP framework based on workerman). Covers routing, controllers, middleware, database/Redis, custom processes, timers, coroutines (v2), plugin development, and guarding against memory leaks and cross-request state pollution under the resident process model.…

zjkal/webman-skill · 111 tokens

php-codeigniter-patterns

Guides CodeIgniter 4 application architecture — Controllers, Models (Query Builder, not an ORM), Entities, the Validation library, Filters (CI4's middleware equivalent), and Services. Use when building a CI4 controller or route, working with a CI4 Model or Entity, wiring a Filter to a route group, or adding a custom…

shennawardana23/skillme · 78 tokens

laravel-patterns

Guides Laravel application architecture — controllers, Eloquent, service/action layers, queues, and API resources. Use when building Laravel controllers or routes, working with Eloquent models and relationships, designing API resources, or adding queued jobs, events, or caching to a Laravel app.

shennawardana23/skillme · 60 tokens