bd-attribute

Coordinate a new attribute across BetterData engines with unit tests.

21|1|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/Lonsdale201/wp-agent-skills --skill bd-attribute
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bd-attribute
Source: https://github.com/Lonsdale201/wp-agent-skills/tree/main/better-data/bd-attribute
Command: npx skills add https://github.com/Lonsdale201/wp-agent-skills --skill bd-attribute

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

When adding a new declarative attribute to BetterData, multiple engines must be wired (hydration, storage projection, REST schema, and presentation). Without consistent wiring, attributes can be ignored or cause incomplete behavior.

Core Features & Use Cases

  • Provides a pure data carrier under src/Attribute with constructor-promoted public properties.
  • Guides coordinated wiring across AttributeDrivenHydrator, SinkProjection, OptionSink, RestSchemaBuilder, and Presenter.
  • Includes documentation and unit-test patterns to ensure end-to-end correctness when introducing new attributes.

Quick Start

Create a new final readonly attribute under src/Attribute with constructor-promoted public properties and wire it into all engines (hydrator, sink, rest schema, and presenter) and add unit tests to cover end-to-end behavior.

Frequently Asked Questions about bd-attribute

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new declarative attribute to a PHP DTO schema without breaking hydration?

To add a new declarative attribute to a PHP DTO schema, you must coordinate wiring across all BetterData engines including hydration, storage projection, and REST schema paths to ensure complete behavior.

What engines need to be updated when introducing a new attribute to BetterData?

When introducing a new attribute to BetterData, you must wire it into the AttributeDrivenHydrator, SinkProjection, OptionSink, RestSchemaBuilder, and Presenter to ensure end-to-end correctness.

How does constructor-promoted property attribute wiring work for data objects?

Constructor-promoted property attribute wiring works by applying the pure data carrier attribute to constructor parameters and properties, then routing it through read, write, and schema paths across all engines.

Do I need unit tests for schema projection and hydration when creating a new data attribute?

Yes, you need unit tests for schema projection and hydration when creating a new data attribute to verify complete end-to-end behavior covering storage projection and REST schema output.

Why does my custom PHP attribute get ignored during REST schema generation?

Your custom PHP attribute gets ignored during REST schema generation because it lacks coordinated wiring into the RestSchemaBuilder and other BetterData engines required for complete end-to-end behavior.