Agent skill

Builder Payload Smith

by discord-php in discord-php/DiscordPHP

Maintain Builder classes — outbound payload construction, validation, serialization, component handling, and fromPart symmetry.

MITAuto-check passed

Install Builder Payload Smith

skills CLI
$ npx skills add discord-php/DiscordPHP --skill builder-payload-smith -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install discord-php/DiscordPHP builder-payload-smith --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/discord-php/DiscordPHP.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/builder-payload-smith .claude/skills/builder-payload-smith && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
builder-payload-smith
GitHub stars
1.1k
Token cost
~1.8k tokens
SKILL.md length
888 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

Maintain Builder classes — outbound payload construction, validation, serialization, component handling, and fromPart symmetry.

  • Works in 6 steps: src/Discord/Builders/Builder.php → src/Discord/Helpers/DynamicPropertyMutato… → src/Discord/Builders/ComponentsTrait.php → …
  • Changing Builders
  • SKILL.md covers Goal, Read in this order, Core contract and Base patterns to preserve, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Builder Payload Smith is an agent skill from discord-php/DiscordPHP. Maintain Builder classes — outbound payload construction, validation, serialization, component handling, and fromPart symmetry. Use when changing Builders or outbound Discord API payloads.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with Discord and PHP. The repository describes itself as: An API to interact with the popular messaging app Discord. The licence is MIT.

When your agent uses it

  • Changing Builders
  • Outbound Discord API payloads

Example prompts

  • “/builder-payload-smith”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. src/Discord/Builders/Builder.php
  2. src/Discord/Helpers/DynamicPropertyMutatorTrait.php
  3. src/Discord/Builders/ComponentsTrait.php
  4. Representative builders
  5. Component base types
  6. Matching part or repository family that consumes builder output

What it can do on your machine

Read from SKILL.md and the folder at commit 580c66a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Builder Payload Smith loads about 1.8k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 888 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from discord-php/DiscordPHP at commit 580c66a, republished under its MIT licence (© discord-php). 888 words, ~1,840 tokens.

Download SKILL.mdSave it as .claude/skills/builder-payload-smith/SKILL.md (or your agent's skills folder).
name
builder-payload-smith
description
Maintain Builder classes — outbound payload construction, validation, serialization, component handling, and fromPart symmetry. Use when changing Builders or outbound Discord API payloads.

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

  1. src/Discord/Builders/Builder.php
  2. src/Discord/Helpers/DynamicPropertyMutatorTrait.php
  3. src/Discord/Builders/ComponentsTrait.php
  4. Representative builders:
    • src/Discord/Builders/MessageBuilder.php
    • src/Discord/Builders/ChannelBuilder.php
    • src/Discord/Builders/CommandBuilder.php
    • src/Discord/Builders/ModalBuilder.php
  5. Component base types:
    • src/Discord/Builders/Components/Component.php
    • src/Discord/Builders/Components/ComponentObject.php
  6. 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.

Show full SKILL.md (335 more words)Show less
ComponentObject::TYPES

If new outbound component subtype appears:

  1. add constant
  2. add map entry
  3. add class
  4. check matching inbound component family if relevant
  5. 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 appropriate
  • fromPart() 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.

© discord-php, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/builder-payload-smith of discord-php/DiscordPHP.

Open the folder on GitHubat commit 580c66a

Compare with similar skills

Builder Payload Smith next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Builder Payload Smith compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Builder Payload Smith this skilldiscord-php/DiscordPHP1.1k—~1.8kAutomated safety check: PassMIT
Agent Browser CLIvercel-labs/agent-browser44k24 repos~864Automated safety check: PassApache-2.0
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Tailwindcss Developmentanonaddy/anonaddy4.9k10 repos~865Automated safety check: PassMIT
Fortify Developmentcoollabsio/coolify63k4 repos~1.9kAutomated safety check: PassMIT
MCP Developmentcoollabsio/coolify63k1 repos~949Automated safety check: PassMIT

Similar skills

  • Agent Browser CLI

    vercel-labs/agent-browser

    Official

    Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking…

    44k GitHub starsUsed in 24 repos~864 tokens
    Productivity & AutomationAuto-check passed
  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Tailwindcss Development

    anonaddy/anonaddy

    Always invoke when the user's message includes 'tailwind' in any form.

    4.9k GitHub starsUsed in 10 repos~865 tokens
    Frontend & DesignAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed
  • MCP Development

    coollabsio/coolify

    A skill your agent uses for Laravel MCP development. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 1 repo~949 tokens
    Frontend & DesignAuto-check passed
  • Electron App Automation

    vercel-labs/agent-browser

    Official

    Automates Electron desktop apps such as VS Code, Slack or Discord by connecting agent-browser to their Chrome DevTools Protocol port.

    44k GitHub starsUsed in 5 repos~1.7k tokens
    Productivity & AutomationAuto-check passed

More from discord-php/DiscordPHP

All 14 skills in this repo
  • Async Test And Doc Sync

    discord-php/DiscordPHP

    Maintain test and documentation alignment — PHPUnit tests, async testing patterns, PHPDoc contracts, guide pages, and documentation workflow.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check: notes
  • Discord Php Bot Security

    discord-php/DiscordPHP

    Audit checklist for DiscordPHP bots and API libraries — stop the bot token leaking to third-party APIs or logs, keep secrets out of customids and exception messages, use constant-time comparison and…

    1.1k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check: notes
  • Discord Php Extension

    discord-php/DiscordPHP

    Scaffold and maintain a DiscordPHP-based bot or an API-library-on-DiscordPHP (the DiscordPHP-MTG / DiscordPHP-NHA / DiscordPHP-Sabacc pattern) — client subclass, third-party HTTP layer, Parts…

    1.1k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Discord Php Interactions

    discord-php/DiscordPHP

    Build DiscordPHP slash commands and message components — global command trees with subcommands, user- AND guild-installable commands usable in DMs / group DMs / guild channels, Components V2…

    1.1k GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Helpers And Infra Keeper

    discord-php/DiscordPHP

    Work with DiscordPHP's infrastructure utilities — CacheWrapper, CacheConfig, BigInt, Multipart, Endpoint::bind URL templates, Collection base class, and domain Exceptions.

    1.1k GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Part Model Maintainer

    discord-php/DiscordPHP

    Maintain Part domain models — fillable attributes, mutators, typed nested data, save/fetch behavior, permission checks, PHPDoc, and repository bindings.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Builder Payload Smith

What does Builder Payload Smith do?

Maintain Builder classes — outbound payload construction, validation, serialization, component handling, and fromPart symmetry. Builder Payload Smith is an agent skill from discord-php/DiscordPHP. Maintain Builder classes — outbound payload construction, validation, serialization, component handling, and fromPart symmetry.

When should I use Builder Payload Smith?

Builder Payload Smith fits situations like: changing Builders; outbound Discord API payloads.

How do I install Builder Payload Smith in Claude Code?

Run `npx skills add discord-php/DiscordPHP --skill builder-payload-smith -a claude-code`. Or copy the skill folder (.agents/skills/builder-payload-smith in discord-php/DiscordPHP) into .claude/skills/builder-payload-smith in your project. Claude Code loads it when a task matches its description.

How do I install Builder Payload Smith in Codex?

Run `npx skills add discord-php/DiscordPHP --skill builder-payload-smith -a codex`. Or copy the skill folder (.agents/skills/builder-payload-smith in discord-php/DiscordPHP) into .agents/skills/builder-payload-smith in your project. Codex loads it when a task matches its description.

Can I use Builder Payload Smith in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add discord-php/DiscordPHP --skill builder-payload-smith -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/builder-payload-smith, .gemini/skills/builder-payload-smith, .github/skills/builder-payload-smith and .opencode/skills/builder-payload-smith in your project.

What does Builder Payload Smith need to run?

SKILL.md names no scripts, command-line tools or credentials: Builder Payload Smith is instructions for the agent only.

Does Builder Payload Smith access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Builder Payload Smith safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Builder Payload Smith use?

Builder Payload Smith is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Builder Payload Smith use?

About 1.8k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Builder Payload Smith?

Skills that share tags, products or a category with Builder Payload Smith: Agent Browser CLI (vercel-labs/agent-browser, 44k stars), Configuring Horizon (coollabsio/coolify, 63k stars), Tailwindcss Development (anonaddy/anonaddy, 4.9k stars) and Fortify Development (coollabsio/coolify, 63k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Builder Payload Smith?

discord-php (a GitHub organization) maintains it in discord-php/DiscordPHP, which has 1,080 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 6, 2026.

Source: discord-php/DiscordPHP on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.