Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

type-map-keeper

Skill by discord-php

Maintains the TYPES maps and subtype dispatch in the discord-php library, covering Channel, Interaction, Embed and component types. It is for contributors who add subtypes or change polymorphic dispatch.

  • Score 76
  • 1.1k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install type-map-keeper

Built from the published package, never by AI.

git clone --depth 1 https://github.com/discord-php/DiscordPHP /tmp/DiscordPHP && mkdir -p ~/.claude/skills && cp -r /tmp/DiscordPHP/.agents/skills/type-map-keeper ~/.claude/skills/type-map-keeper

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install type-map-keeper in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

type-map-keeper is an agent skill that guides changes to the TYPES constant arrays and TYPE_* constants in the discord-php codebase. Each TYPES map is a constant array on a root class. Its keys are discriminator values sent by Discord, such as the type field, and its values are the concrete PHP classes for those values. Index 0 holds the root class as a fallback for unknown values.

The skill lists the files to read in order, the materialization sites that consume these maps, and a step-by-step sequence for adding a new subtype. It also covers builder-side mirrors for components and channels, deprecated alias preservation, and a checklist before commit. It is written for developers working on the discord-php library.

Written from the project's SKILL.md and checked against it.

What it can do

  • Map shape guidanceExplains how TYPES arrays key discriminators to subtype classes, with index 0 as fallback.
  • Adding a new subtypeGives a nine-step sequence covering TYPE_* constants, the class, map entries and docblocks.
  • Builder mirror checksFlags where inbound and outbound component maps or the ChannelBuilder alias must be kept aligned.
  • Materialization site reviewLists event handlers and PartTrait helpers that dispatch through maps, for verification.
  • Deprecated alias handlingAdvises keeping old TYPE_* constants with @deprecated docblocks unless a major version bump occurs.
  • Pre-commit checklistProvides a checklist of map, fallback, builder and test items to verify before committing.

Try asking

  • Add a new subtype to Channel::TYPES in discord-php and list the steps.
  • Check whether ComponentObject::TYPES and Component::TYPES are in sync.
  • Review my change that adds a TYPE_* constant for a new interaction type.

Good to know

  • Written for the discord-php codebase, with file paths specific to that repository.
  • Channel::TYPES has no index 0 fallback, so event handlers add an explicit fallback instead.
  • Deprecated constant aliases should not be removed without a major version bump.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .agents/skills/type-map-keeper/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to type-map-keeper

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

type-map-keeper: common questions

What does the type-map-keeper skill do?

It guides changes to TYPES maps and TYPE_* constants that decide which class represents each Discord discriminator value. It also tells developers which dispatch sites must stay consistent.

How does a new Discord subtype get added with this skill?

The skill says to add a TYPE_* constant on the root class, create the concrete class, and add a TYPES map entry. It then says to update event handlers, builder mirrors and typed collection helpers as needed.

Why does the skill recommend an index 0 fallback?

The source says index 0 handles unknown future discriminator values safely. It also says relying on an explicit fallback at every call site is fragile and easy to forget.

How do I install type-map-keeper?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is type-map-keeper free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is type-map-keeper safe to use?

It scores 76 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to type-map-keeper?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

type-map-keeper Install

Add to stack

Loading.