Agent skill

Gateway Cache Sync Keeper

by discord-php in discord-php/DiscordPHP

Maintain gateway event handlers — payload hydration, cache mutation, event return shapes, and handler registration.

MITAuto-check passedBackend & APIs

Install Gateway Cache Sync Keeper

skills CLI
$ npx skills add discord-php/DiscordPHP --skill gateway-cache-sync-keeper -a claude-code

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

GitHub CLI
$ gh skill install discord-php/DiscordPHP gateway-cache-sync-keeper --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/gateway-cache-sync-keeper .claude/skills/gateway-cache-sync-keeper && 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
gateway-cache-sync-keeper
GitHub stars
1.1k
Token cost
~1.9k tokens
SKILL.md length
930 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

Maintain gateway event handlers — payload hydration, cache mutation, event return shapes, and handler registration.

  • Works in 4 steps: src/Discord/WebSockets/Event.php → src/Discord/WebSockets/Handlers.php → Matching part/repository families → …
  • Touching WebSockets/Events
  • SKILL.md covers Goal, Read in this order, Core contract and Three files usually move…, plus 11 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Gateway Cache Sync Keeper is an agent skill from discord-php/DiscordPHP. Maintain gateway event handlers — payload hydration, cache mutation, event return shapes, and handler registration. Use when touching WebSockets/Events, Handlers.php, or Event.php.

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

It sits in Backend & APIs, covering Realtime and WebSockets. It works with PHP and Discord. The repository describes itself as: An API to interact with the popular messaging app Discord. The licence is MIT.

When your agent uses it

  • Touching WebSockets/Events
  • Tasks that involve Realtime and WebSockets

Example prompts

  • “/gateway-cache-sync-keeper”

Workflow steps

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

  1. src/Discord/WebSockets/Event.php
  2. src/Discord/WebSockets/Handlers.php
  3. Matching part/repository families
  4. Representative events

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

Gateway Cache Sync Keeper loads about 1.9k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 930 words of instructions outside code blocks.

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

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). 930 words, ~1,946 tokens.

Download SKILL.mdSave it as .claude/skills/gateway-cache-sync-keeper/SKILL.md (or your agent's skills folder).
name
gateway-cache-sync-keeper
description
Maintain gateway event handlers — payload hydration, cache mutation, event return shapes, and handler registration. Use when touching WebSockets/Events, Handlers.php, or Event.php.

Skill: gateway-cache-sync-keeper

Use this skill when work touches:

  • src/Discord/WebSockets/Handlers.php
  • src/Discord/WebSockets/Event.php
  • src/Discord/WebSockets/Events/*

This is event-to-cache coherence skill. Load it when changing gateway dispatch behavior, event return shapes, or cache mutation.

Goal

Keep gateway handling as real-time state sync layer:

  • dispatch payloads become typed parts
  • related repositories get updated immediately
  • emitted event payloads stay semantically useful
  • caches for users, members, channels, messages, threads, guilds stay coherent

Read in this order

  1. src/Discord/WebSockets/Event.php
  2. src/Discord/WebSockets/Handlers.php
  3. Matching part/repository families
  4. Representative events:
    • src/Discord/WebSockets/Events/MessageCreate.php
    • src/Discord/WebSockets/Events/MessageUpdate.php
    • src/Discord/WebSockets/Events/GuildCreate.php
    • src/Discord/WebSockets/Events/GuildDelete.php
    • src/Discord/WebSockets/Events/InteractionCreate.php
    • src/Discord/WebSockets/Events/ThreadListSync.php
    • src/Discord/WebSockets/Events/GuildMemberAdd.php

Core contract

Event classes in this repo are not dumb payload forwarders. They:

  • interpret transport payloads
  • instantiate correct typed parts, often via runtime TYPES maps
  • update owning repositories and related caches
  • warm user/member caches from nested payloads
  • preserve secondary invariants like counters or last_message_id
  • return semantic values used by userland listeners

If handler only hydrates one object and ignores related caches, change is probably incomplete.

Three files usually move together

When adding or changing event family, inspect all three:

  1. src/Discord/WebSockets/Event.php — constant
  2. src/Discord/WebSockets/Handlers.php — registration
  3. src/Discord/WebSockets/Events/<Name>.php — implementation

If one changes and the others do not, make sure that is intentional.

Event base helpers to use

cacheUser(object $userdata)

Use when payload contains user data. Keeps top-level user cache current.

cacheMember(MemberRepository $members, array $memberdata)

Use when payload contains guild member data. Keeps guild member cache current. Some event families override details for performance reasons, like InteractionCreate.

Do not manually duplicate user/member cache update logic unless event family has special latency or shape constraints.

Hydration rules

Prefer typed parts immediately

Use factory plus subtype maps when payload family is polymorphic:

  • channels from Channel::TYPES
  • interactions from Interaction::TYPES
  • components from component TYPES

Do not push raw stdClass payloads deep into caches when repo already has typed part model.

Create vs update vs delete semantics matter
  • create events usually instantiate new parts and set them into owning repo
  • update events often clone old cached part, mutate current part, and return both new and old values
  • delete events often pull from cache and return removed typed part plus extra status

Preserve those shapes unless you have strong compatibility reason to change them.

Coherence rules by family

Message events

These are easy to break because they carry many side effects:

  • store or update message in channel/thread repo when configured
  • keep last_message_id current
  • handle message-content intent limits correctly
  • update author/mention/interacting user caches
  • preserve old/new payload behavior on update

If you change MessageCreate or MessageUpdate, inspect:

  • message cache behavior
  • intent-gated content handling
  • DM vs guild channel routing
  • thread message counting or parent lookup logic
Guild create/delete/update families

Guild events often do bulk cache work:

  • guild create populates guild repo plus member, user, voice state, thread, stage instance, scheduled event, sound caches
  • guild delete must preserve unavailable-vs-removed semantics

Do not treat guild create as "just one guild part". It is bootstrap event for several nested repositories.

Thread events

Threads are child collections hanging off parent channels. Thread handlers usually must:

  • locate parent channel
  • update parent threads repo
  • possibly update thread member state
  • preserve thread counters or metadata
Interaction events

Interaction handlers are latency-sensitive. They still must:

  • hydrate correct interaction subtype
  • cache resolved users/members
  • avoid unnecessarily slow cache paths
  • invoke registered command handlers/autocomplete flow

Event return-shape rules

Userland listens to emitted values. Keep return shapes stable and meaningful.

Common patterns already used:

  • MessageCreate returns new Message
  • MessageUpdate returns [newOrData, oldMessage]
  • GuildDelete returns [$guildPartOrData, $unavailableFlag]

Before changing a return shape, inspect:

  • existing event listeners in examples/tests/docs
  • parity with sibling events in same family
  • whether old state is required for consumers
Show full SKILL.md (346 more words)Show less

Cache path playbook

When changing event behavior, walk this checklist:

  1. What is primary part produced by payload?
  2. Which repository should own it?
  3. Which parent or child repositories also need update?
  4. Which related users or members appear in payload?
  5. Do counters, last IDs, or status fields need sync?
  6. What should event listener receive back?

If you cannot answer each, handler is not fully understood yet.

Registration playbook

When adding new dispatch type:

  1. add constant to Event.php
  2. add handler registration to Handlers.php
  3. create event class
  4. choose emitted event aliases if handler needs alternatives
  5. ensure any runtime option that disables events still behaves sensibly

Partial payload and intent rules

Gateway payloads are not always full objects.

Examples:

  • message update may be partial
  • message content may be missing without MESSAGE_CONTENT intent
  • interaction-related payloads may favor speed over full cache warmup
  • guild create member lists vary with guild size and enabled intents

Do not blindly overwrite cached richer state with partial payload unless code already accounts for missing fields.

Performance rules

  • prefer payload data over avoidable REST fetches
  • reuse cache lookups instead of broad scans when possible
  • but preserve correctness for parent-child lookup when repo shape demands it
  • interaction path should avoid slow cache resolution that delays response handling

Smells

Stop if you see:

  • event class added without handler registration
  • cache update for primary part but not related repositories
  • raw payload stuffed in cache when typed part exists
  • user/member data in payload ignored even though later code depends on cache
  • update event overwriting rich cached fields with partial sparse payload
  • return shape change with no thought for existing listener contract

Checklist before commit

  • event constant and handler registration aligned
  • correct subtype hydration path used
  • primary and related repositories updated
  • user/member caches updated where payload carries them
  • partial/intents behavior preserved
  • event return shape still intentional and compatible
  • tests/docs/examples checked if public listener contract changed

Bottom line

Gateway events are cache-synchronization code. Treat them like consistency-critical logic, not like thin adapters. One missed repository update can make the whole object graph lie.

© 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/gateway-cache-sync-keeper of discord-php/DiscordPHP.

Open the folder on GitHubat commit 580c66a

Compare with similar skills

Gateway Cache Sync Keeper 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.

Gateway Cache Sync Keeper compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gateway Cache Sync Keeper this skilldiscord-php/DiscordPHP1.1k—~1.9kAutomated safety check: PassMIT
Neon Functionsneondatabase/agent-skills100—~12kAutomated safety check: NotesApache-2.0
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Fortify Developmentcoollabsio/coolify63k4 repos~1.9kAutomated safety check: PassMIT
Supabase Development and Debuggingsupabase/agent-skills2.7k3 repos~3.6kAutomated safety check: PassMIT
Laravel Best Practicesanonaddy/anonaddy4.9k13 repos~1.2kAutomated safety check: PassMIT

Similar skills

  • Neon Functions

    neondatabase/agent-skills

    Official

    Long-running, serverless Node.js HTTP functions deployed onto your Neon branch, with DATABASEURL injected automatically and compute that runs next to your data.

    100 GitHub stars~12k tokensUpdated yesterday
    Backend & APIsAuto-check: notes
  • 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
  • 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
  • Official

    General Supabase skill for database, auth, Edge Functions, Realtime and storage work, plus client libraries, migrations, security audits, debugging and reading logs.

    2.7k GitHub starsUsed in 3 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • Laravel Best Practices

    anonaddy/anonaddy

    Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code.

    4.9k GitHub starsUsed in 13 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-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

Categories

Questions about Gateway Cache Sync Keeper

What does Gateway Cache Sync Keeper do?

Maintain gateway event handlers — payload hydration, cache mutation, event return shapes, and handler registration. Gateway Cache Sync Keeper is an agent skill from discord-php/DiscordPHP. Maintain gateway event handlers — payload hydration, cache mutation, event return shapes, and handler registration.

When should I use Gateway Cache Sync Keeper?

Gateway Cache Sync Keeper fits situations like: touching WebSockets/Events; tasks that involve Realtime and WebSockets.

How do I install Gateway Cache Sync Keeper in Claude Code?

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

How do I install Gateway Cache Sync Keeper in Codex?

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

Can I use Gateway Cache Sync Keeper 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 gateway-cache-sync-keeper -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gateway-cache-sync-keeper, .gemini/skills/gateway-cache-sync-keeper, .github/skills/gateway-cache-sync-keeper and .opencode/skills/gateway-cache-sync-keeper in your project.

What does Gateway Cache Sync Keeper need to run?

SKILL.md names no scripts, command-line tools or credentials: Gateway Cache Sync Keeper is instructions for the agent only.

Does Gateway Cache Sync Keeper 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 Gateway Cache Sync Keeper 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 Gateway Cache Sync Keeper use?

Gateway Cache Sync Keeper 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 Gateway Cache Sync Keeper use?

About 1.9k tokens (SKILL.md is roughly 7.8k 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 Gateway Cache Sync Keeper?

Skills that share tags, products or a category with Gateway Cache Sync Keeper: Neon Functions (neondatabase/agent-skills, 100 stars), Configuring Horizon (coollabsio/coolify, 63k stars), Fortify Development (coollabsio/coolify, 63k stars) and Supabase Development and Debugging (supabase/agent-skills, 2.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gateway Cache Sync Keeper?

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.