type-map-keeper

Official

Centralize polymorphic dispatch with type maps

Authordiscord-php
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Centralize type maps to stabilize polymorphic dispatch across DiscordPHP. This skill ensures a single source of truth for the TYPE_* constants and TYPES maps to prevent drift and brittle branching.

Core Features & Use Cases

  • Centralizes TYPE_* constants on root classes (Channel, Interaction, Embed, Component) and provides a canonical TYPES map per family.
  • Aligns inbound deserialization and outbound builder mappings by using a single map lookup at every materialization site.
  • Guides safe evolution when adding new subtypes by updating constants, maps, and all dispatch sites in a coordinated manner.

Quick Start

Add a new TYPE_* constant on the root class, update the root TYPES map with the new entry, and verify all dispatch sites use the map lookup to hydrate the correct subtype.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: type-map-keeper
Download link: https://github.com/discord-php/DiscordPHP/archive/main.zip#type-map-keeper

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.