builder-payload-smith
Skill1.1k starsChanged 35 days agoMITView on GitHub
Maintain Builder classes — outbound payload construction, validation, serialization, component handling, and fromPart symmetry. Use when changing Builders or outbound Discord API payloads.
Trending
More talk lately.about the whole repository
Who's talking about discord-php/DiscordPHP
- @throwable.bsky.social“📦 team-reflex/discord-php v10.45.21 An unofficial API to interact with the voice and text service Discord. …”Bluesky · Feb 27, 2026 · 1 likes
- crimsonstrife/streamer.live“Bump team-reflex/discord-php from 10.18.24 to 10.18.45”GitHub · Aug 19, 2025 · 1 reactions
- crimsonstrife/streamer.live“Bump team-reflex/discord-php from 10.18.0 to 10.18.5”GitHub · Jul 8, 2025 · 1 reactions
- crimsonstrife/streamer.live“build(deps): bump team-reflex/discord-php from 10.17.0 to 10.17.3”GitHub · Jun 16, 2025 · 1 reactions
- crimsonstrife/streamer.live“build(deps): bump team-reflex/discord-php from 10.13.1 to 10.14.0”GitHub · Jun 9, 2025 · 1 reactions
The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 52
Talked about on GitHub and Bluesky (52 times).
On GitHub · 50
- Aug 19, 2025Bump team-reflex/discord-php from 10.18.24 to 10.18.45 — crimsonstrife/streamer.live1 reaction · 2 comments
- Jul 8, 2025Bump team-reflex/discord-php from 10.18.0 to 10.18.5 — crimsonstrife/streamer.live1 reaction · 3 comments
- Jun 16, 2025build(deps): bump team-reflex/discord-php from 10.17.0 to 10.17.3 — crimsonstrife/streamer.live1 reaction · 3 comments
- Jun 9, 2025build(deps): bump team-reflex/discord-php from 10.13.1 to 10.14.0 — crimsonstrife/streamer.live1 reaction · 3 comments
- Jun 2, 2025build(deps): bump team-reflex/discord-php from 10.10.12 to 10.11.6 — crimsonstrife/streamer.live1 reaction · 3 comments
45 more on GitHub
- May 26, 2025build(deps): bump team-reflex/discord-php from 10.10.0 to 10.10.6 — crimsonstrife/streamer.live1 reaction · 2 comments
- May 19, 2025build(deps): bump team-reflex/discord-php from 10.7.3 to 10.8.5 — crimsonstrife/streamer.live1 reaction · 2 comments
- May 5, 2025build(deps): bump team-reflex/discord-php from 10.7.1 to 10.7.2 — crimsonstrife/streamer.live1 reaction · 2 comments
- Apr 28, 2025build(deps): bump team-reflex/discord-php from 10.4.7 to 10.7.1 — crimsonstrife/streamer.live1 reaction · 3 comments
- Mar 25, 2025build(deps): bump team-reflex/discord-php from 10.4.3 to 10.4.4 — crimsonstrife/streamer.live1 reaction · 3 comments
- Jul 18, 2024✨ Add support for polls — laracord/framework1 reaction
- May 11, 2024update d.py/d.php polls — advaith1/libs1 reaction · 1 comment
- Nov 2, 2026build(deps): update team-reflex/discord-php requirement from 10.66.* to 10.71.* — smrealms/smr0 reactions
- Oct 26, 2026build(deps): update team-reflex/discord-php requirement from 10.66.* to 10.69.* — smrealms/smr0 reactions · 1 comment
- Oct 20, 2026build(deps): update team-reflex/discord-php requirement from 10.66.* to 10.68.* — smrealms/smr0 reactions · 1 comment
- Oct 19, 2026Bump team-reflex/discord-php from 10.59.0 to 10.67.0 — omnicolor/commlink0 reactions · 1 comment
- Oct 14, 2026build(deps): update team-reflex/discord-php requirement from 10.66.* to 10.67.* — smrealms/smr0 reactions · 1 comment
- Oct 13, 2026Bump team-reflex/discord-php from 10.59.0 to 10.66.3 — omnicolor/commlink0 reactions · 1 comment
- Oct 6, 2026Bump team-reflex/discord-php from 10.59.0 to 10.66.1 — omnicolor/commlink0 reactions · 1 comment
- Oct 5, 2026Bump team-reflex/discord-php from 10.59.0 to 10.65.0 — omnicolor/commlink0 reactions · 1 comment
- Oct 1, 2026build(deps): update team-reflex/discord-php requirement from 10.49.* to 10.66.* — smrealms/smr0 reactions
- Oct 1, 2026Bump team-reflex/discord-php from 10.57.0 to 10.59.0 — omnicolor/commlink0 reactions
- Sep 30, 2026build(deps): update team-reflex/discord-php requirement from 10.49.* to 10.62.* — smrealms/smr0 reactions · 1 comment
- Sep 29, 2026Bump team-reflex/discord-php from 10.57.0 to 10.58.0 — omnicolor/commlink0 reactions · 1 comment
- Sep 28, 2026build(deps): update team-reflex/discord-php requirement from 10.49.* to 10.59.* — smrealms/smr0 reactions · 1 comment
- Sep 25, 2026build(deps): update team-reflex/discord-php requirement from 10.49.* to 10.58.* — smrealms/smr0 reactions · 1 comment
- Sep 25, 2026Bump team-reflex/discord-php from 10.56.18 to 10.57.0 — omnicolor/commlink0 reactions
- Sep 23, 2026Bump team-reflex/discord-php from 10.56.17 to 10.56.18 — omnicolor/commlink0 reactions
- Sep 21, 2026build(deps): update team-reflex/discord-php requirement from 10.49.* to 10.57.* — smrealms/smr0 reactions · 1 comment
- Sep 14, 2026Bump team-reflex/discord-php from 10.56.15 to 10.56.17 — omnicolor/commlink0 reactions
- Sep 7, 2026Bump team-reflex/discord-php from 10.56.10 to 10.56.15 — omnicolor/commlink0 reactions
- Sep 7, 2026build: Bump team-reflex/discord-php from 10.48.14 to 10.56.15 — VATSIM-UK/core0 reactions
- Sep 4, 2026Bump team-reflex/discord-php from 10.56.10 to 10.56.13 — omnicolor/commlink0 reactions · 1 comment
- Sep 2, 2026Bump team-reflex/discord-php from 10.56.8 to 10.56.10 — omnicolor/commlink0 reactions
- Sep 1, 2026Bump team-reflex/discord-php from 10.56.8 to 10.56.9 — omnicolor/commlink0 reactions · 1 comment
- Aug 26, 2026Bump team-reflex/discord-php from 10.55.1 to 10.56.5 — omnicolor/commlink0 reactions
- Aug 25, 2026Bump team-reflex/discord-php from 10.55.1 to 10.56.3 — omnicolor/commlink0 reactions · 1 comment
- Aug 18, 2026build(deps): update team-reflex/discord-php requirement from 10.49.* to 10.56.* — smrealms/smr0 reactions · 1 comment
- Apr 20, 2026Bump team-reflex/discord-php from 10.47.12 to 10.48.1 — crimsonstrife/streamer.live0 reactions · 1 comment
- Feb 10, 2026Bump team-reflex/discord-php from 10.45.15 to 10.45.16 — crimsonstrife/streamer.live0 reactions · 3 comments
- Nov 4, 2025Add Discord Announcement Bot System — k33bz/lastwar-server15860 reactions · 4 comments
- Oct 20, 2025Tag "@property" has error when both ? and null types are included — phpDocumentor/phpDocumentor0 reactions · 1 comment
- Nov 15, 2024Update dependency team-reflex/discord-php to v10 — System3-2/discord-bot0 reactions
- Feb 11, 2024Thread gets terminated when using a slash command with options. — DiscordBot-PMMP/DiscordBot0 reactions · 3 comments
- Jan 14, 2024Update dependency team-reflex/discord-php to v7.3.5 — Karhal/discord-gpt0 reactions
- Jan 14, 2024Update dependency team-reflex/discord-php to v7.3.5 — System3-2/discord-bot0 reactions
- Jan 31, 2023Invalid Activity URL — DiscordBot-PMMP/DiscordBot0 reactions · 3 comments
- Dec 20, 2022Another message type not supported when delete the message — DiscordBot-PMMP/DiscordBot0 reactions · 6 comments
- Aug 19, 2022[Egg Request]: DiscordPHP — pelican-eggs/eggs0 reactions · 1 comment
- Apr 17, 2022Intents help — DiscordBot-PMMP/DiscordBot0 reactions · 4 comments
On Bluesky · 2
- Feb 27, 2026📦 team-reflex/discord-php v10.45.21 An unofficial API to interact with the voice and text service Discord. 🔗… — @throwable.bsky.social1 likes and repost
- Aug 10, 2026📦 team-reflex/discord-php v10.55.0 An unofficial API to interact with the voice and text service Discord. 🔗… — @throwable.bsky.social0 likes and reposts · 1 reply
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- async-test-and-doc-syncSkill
- gateway-cache-sync-keeperSkill
- helpers-and-infra-keeperSkill
- interaction-flow-keeperSkill
- legacy-command-client-keeperSkill
- part-model-maintainerSkill
- repository-cache-keeperSkill
- runtime-bootstrap-keeperSkill
- type-map-keeperSkill
- voice-subsystem-keeperSkill
- discord-php-bot-securitySkill
- discord-php-extensionSkill
- discord-php-interactionsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 14 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Use this skill when work touches:
- Distinctive: line 21
Keep builders as the repo's safe way to author complex outbound payloads:
- Distinctive: line 49
keep mutable fluent state for outbound payloads
- Distinctive: line 54
If a builder starts acting like cached domain object or repository, wrong layer.
- Very specific: line 69
Not part-style getContentAttribute().
- Distinctive: line 93
Do not rely on far-away repository methods to catch simple builder invariants.
- Distinctive: line 112
If builder accepts nested objects:
- Distinctive: line 116
keep final payload JSON-friendly
- Distinctive: line 125
Do not move outbound validation rules into parts if there is already a builder abstraction.
- Distinctive: line 141
Keep these worlds aligned conceptually, but do not collapse them into one class family.
- Distinctive: line 145
If new outbound component subtype appears:
- Distinctive: line 150
check matching inbound component family if relevant
- Distinctive: line 151
update builders using components
- Distinctive: line 165
Add or extend a builder when:
- Distinctive: line 215
Stop if you see:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: builder-payload-smith
Use this skill when work touches:
src/Discord/Builders/*src/Discord/Builders/Components/*- outbound payload construction paths in parts or interaction responses
This is outbound-shape skill. Load it when a change affects how callers build data to send to Discord.
Goal
Keep builders as the repo's safe way to author complex outbound payloads:
- fluent and ergonomic for callers
- validated before hitting REST
- cleanly separated from in-memory parts
- serializable into Discord API payloads
Read in this order
src/Discord/Builders/Builder.phpsrc/Discord/Helpers/DynamicPropertyMutatorTrait.phpsrc/Discord/Builders/ComponentsTrait.php- Representative builders:
src/Discord/Builders/MessageBuilder.phpsrc/Discord/Builders/ChannelBuilder.phpsrc/Discord/Builders/CommandBuilder.phpsrc/Discord/Builders/ModalBuilder.php
- Component base types:
src/Discord/Builders/Components/Component.phpsrc/Discord/Builders/Components/ComponentObject.php
- Matching part or repository family that consumes builder output
Core contract
Builders are not parts. Builders:
- extend
Builder - often implement
JsonSerializable - keep mutable fluent state for outbound payloads
- validate limits and allowed values in setters or adders
- serialize to request-ready arrays
- sometimes provide
create($repository)helpers for smoother public API
If a builder starts acting like cached domain object or repository, wrong layer.
Base patterns to preserve
Builder::fromPart(Part $part)
This is bridge from stored part data into editable payload state. Preserve it when adding new builder properties or part fields. Edit flows depend on this symmetry.
DynamicPropertyMutatorTrait
Builder property access uses property-level mutators like:
setContent()getContent()
Not part-style getContentAttribute(). Keep that distinction.
From outside the builder, $builder->content, isset($builder->content) and ?? all go through getContent(): a property is set when its getter returns non-null, and a property with no getter is never set. Declare every property a builder stores. An undeclared one makes $this->x = ... inside setX() re-enter __set() and create a deprecated dynamic property, and makes isset($this->x) go through __isset().
new() factory
Most builders expose new() for userland ergonomics. Preserve pattern when adding new top-level builders.
create($repository) helper
Newer builders often let callers hand the builder to a repository directly. Prefer keeping that path because it nudges users away from raw arrays.
Validation rules
Validation should live as close as possible to setter/add method that introduces invalid state.
Good examples already in repo:
- message content length limits
- modal title and custom id length limits
- max embeds/components counts
- valid channel type enums
- valid video quality modes
Do not rely on far-away repository methods to catch simple builder invariants.
Serialization rules
jsonSerialize() is canonical outbound shape
This is where builder translates fluent internal state into Discord payload array. Keep it:
- explicit
- ordered enough to read
- faithful to API docs
- selective about optionals
Omit unset optionals when possible
Many Discord APIs treat missing field differently from explicit null. Builders should usually omit properties that were never set unless API specifically wants null.
Normalize nested builder or part inputs
If builder accepts nested objects:
- serialize nested builders
- convert parts to raw attributes or IDs where appropriate
- keep final payload JSON-friendly
Boundaries with parts and repositories
Builder vs part
- part = canonical resource model received from Discord or stored in memory
- builder = request payload authoring tool
Do not move outbound validation rules into parts if there is already a builder abstraction.
Builder vs repository
- builder prepares payload
- repository performs REST call
Repositories should not become payload authoring zones full of hand-built nested arrays if builder exists.
Component-specific rules
Component system exists in both builder and part worlds:
- builder components under
src/Discord/Builders/Components/* - inbound message component parts under
src/Discord/Parts/Channel/Message/*
Keep these worlds aligned conceptually, but do not collapse them into one class family. Outbound builders and inbound parts solve different problems.
ComponentObject::TYPES
If new outbound component subtype appears:
- add constant
- add map entry
- add class
- check matching inbound component family if relevant
- update builders using components
Usage contexts
Component usage constraints matter:
- message
- modal
- interaction contexts
Where repo already encodes allowed contexts, keep validation there instead of free-form component insertion.
Builder selection guide
Add or extend a builder when:
- payload has multiple related fields
- Discord API has length/count/value limits
- nested structures are easy to get wrong by hand
- same shape is authored from several call sites
Raw array may be enough when:
- payload is tiny
- shape is stable and local
- repo does not already have builder convention for that family
But if users will author it directly or repeatedly, bias toward builder.
Existing patterns worth copying
Message builder
Best example for:
- content validation
- embeds/files/stickers/components combination
- fluent helpers
- repository
create()bridge
Channel builder
Best example for:
- type-specific optional fields
- enum validation
- payload fields that differ by channel subtype
Command builder
Best example for:
- optional field omission
- payload shape depending on command type
Modal builder
Best example for:
- strict component usage constraints
- response payload shape nested under
type+data
Smells
Stop if you see:
- raw arrays duplicated across many callers when builder exists
- validation postponed until after HTTP call
- builder storing cache/domain state
- repository assembling complicated payload shape that should live in builder
- mismatch between builder and part edit flow because
fromPart()path no longer reflects real fields - new component type added only on one side of builder/part system
Builder change checklist
- new property has setter/getter if public
- validation lives near write path
jsonSerialize()includes it only when appropriatefromPart()behavior still makes sense- any
create($repository)helper remains correct - component/type maps updated if subtype introduced
- tests cover invalid and valid boundary cases
- docs/examples updated if preferred public usage changed
Bottom line
Builders in this repo exist to keep outbound payload rules from leaking everywhere. If a caller has to memorize Discord payload trivia instead of relying on builder methods, builder design is unfinished.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

