repository-cache-keeper
Skill1.1k starsChanged 35 days agoMITView on GitHub
Maintain Repository classes — REST endpoints, route vars, cache coherence, typed collections, and persistence boundaries. Use when changing repository CRUD, cache behavior, or endpoint bindings.
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
- builder-payload-smithSkill
- gateway-cache-sync-keeperSkill
- helpers-and-infra-keeperSkill
- interaction-flow-keeperSkill
- legacy-command-client-keeperSkill
- part-model-maintainerSkill
- 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
17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Use this skill when work touches src/Discord/Repository//*.
- Distinctive: line 24
Not as service dumping ground.
- Distinctive: line 42
Every repository centers on same shape:
- Distinctive: line 53
If a method no longer feels like typed collection + route-aware persistence, it probably belongs elsewhere.
- Distinctive: line 71
Not every repository supports every operation.
- Very specific: line 81
When repo behavior looks wrong, inspect parent part getRepositoryAttributes() first.
- Very specific: line 148
If child repository starts losing route info, fix parent part getRepositoryAttributes() or repo constructor normalization, not random …
- Distinctive: line 152
If a repo needs to clean or enrich vars for route correctness, constructor override is fine.
- Distinctive: line 159
Add repo-specific methods when operation is broader than generic CRUD and naturally belongs to collection/route boundary.
- Distinctive: line 188
If code needs to know "is this current member or generic member", "is this webhook message or normal message", or "does bot need …
- Distinctive: line 195
Verify parent route vars required
- Very specific: line 196
Verify parent part getRepositoryAttributes()
- Distinctive: line 197
Add domain-specific methods only if generic CRUD not enough
- Very specific: line 199
Add docblock @method helpers if family uses them
- Distinctive: line 214
If nested route shape is tricky, normalize vars in constructor instead of forcing every caller to know internals.
- Distinctive: line 232
Stop if you see:
- Very specific: line 246
create/save/delete/fetch semantics remain typed and Promise-based
≈ “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: repository-cache-keeper
Use this skill when work touches src/Discord/Repository/**/*.
This is cache-and-REST boundary skill. Load it when a change affects how parts are collected, fetched, persisted, cached, or routed to endpoints.
Goal
Keep repositories as:
- typed collections
- route-aware REST wrappers
- cache coordinators
- owning persistence boundary for a part family
Not as service dumping ground.
Read in this order
src/Discord/Repository/AbstractRepository.phpsrc/Discord/Repository/AbstractRepositoryTrait.phpsrc/Discord/Parts/PartTrait.phpsections forgetRepositoryAttributes(),getCreatableAttributes(),getUpdatableAttributes()src/Discord/Helpers/CacheWrapper.phpand cache config code if cache behavior matters- Representative repos:
src/Discord/Repository/GuildRepository.phpsrc/Discord/Repository/Guild/ChannelRepository.phpsrc/Discord/Repository/Channel/MessageRepository.phpsrc/Discord/Repository/Interaction/GlobalCommandRepository.phpsrc/Discord/Repository/Guild/GuildCommandRepository.php
- The owning part for the repository you are touching
Core contract
Every repository centers on same shape:
- extends
AbstractRepository - sets
$classto the concrete part family - usually sets
$endpoints - may override
$discrim - receives
$varsroute context from parent part or caller - stores typed items in collection semantics
- persists through HTTP
- mirrors authoritative state into cache
If a method no longer feels like typed collection + route-aware persistence, it probably belongs elsewhere.
Meaning of common properties
$class
Concrete part family allowed in this repository. If wrong, hydration, type checks, and cache writes all become unsafe.
$endpoints
Route templates keyed by operation name. Typical keys:
allgetcreateupdatedelete
Not every repository supports every operation. Missing endpoint is an intentional capability statement.
$vars
Route-binding context. This is how nested repos know where they live:
- guild repositories get
guild_id - channel repositories get
channel_id - some repos also need
application_id,message_id, or other parent route pieces
When repo behavior looks wrong, inspect parent part getRepositoryAttributes() first.
$discrim
Collection key field, usually id. Only change when payload family genuinely keys on a different field.
$cache
Per-repository cache wrapper. It is not optional frosting. Repo methods should keep it coherent with in-memory items.
Core methods and what they mean
create(array|object $attributes = [], bool $created = false)
Builds local typed part using repository context plus attributes. No REST call. No remote persistence. Use it for drafts or hydration helpers.
save(Part $part, ?string $reason = null)
Generic persistence path:
- POST when
$part->createdis false - PATCH when
$part->createdis true - uses part-provided repository attributes and creatable/updatable attributes
- updates cache with returned part
Part-level save() may wrap or redirect this when semantics demand it.
delete($part, ?string $reason = null)
Remote delete plus cache removal. Accepts part or identifier. Keep typed return contract.
fetch(string $id, bool $fresh = false)
Resolve from memory, then cache, then REST unless forced fresh. This is one of main async entry points. Keep it Promise-based.
fresh(Part $part, array $queryparams = [])
Refresh a known created part from REST and update cache.
freshen(array $queryparams = [])
Bulk refresh repository contents from REST. This is repo-wide sync tool, not a one-item fetch.
How cache and collection semantics fit together
Repositories are hybrid objects:
- collection-like for iteration, filtering,
get(),find(),first(),last() - async cache-aware for
cacheGet(),cachePull(),fetch(),freshen()
That dual nature is intentional. Do not flatten repository into only async map or only plain collection.
Important behavior to preserve
- in-memory
itemscan hold real parts,WeakReference, or null placeholders - cache wrapper may outlive in-memory strong references
- repo methods often try memory first, then cache, then REST
- successful REST mutations should refresh cache state immediately
Endpoint routing rules
Use Endpoint and bound vars
Repository methods should bind route vars through Endpoint/Endpoint::bind(), not manual string interpolation spread across code.
Parent context comes from parts
If child repository starts losing route info, fix parent part getRepositoryAttributes() or repo constructor normalization, not random callers.
Constructor normalization is acceptable
If a repo needs to clean or enrich vars for route correctness, constructor override is fine. Example patterns already exist:
MessageRepositoryunsetsthread_idfor thread message routingGuildCommandRepositoryinjects bot application id
When to add domain-specific repository methods
Add repo-specific methods when operation is broader than generic CRUD and naturally belongs to collection/route boundary.
Good examples:
- leaving a guild from
GuildRepository - previewing a guild from
GuildRepository - creating guild channels from
ChannelRepository
Bad examples:
- permission-heavy semantic operation better expressed as
$part->save()or$part->someAction() - userland convenience that only repackages one line and adds no domain meaning
Ownership boundary: part vs repository
Part owns
- semantic meaning of operation
- permission checks
- special-case routing based on object meaning
- public high-level API surface
Repository owns
- endpoint selection
- request method and payload dispatch
- cache persistence
- typed hydration from HTTP response
If code needs to know "is this current member or generic member", "is this webhook message or normal message", or "does bot need manage_messages here", that usually belongs on part side first.
New repository playbook
- Choose concrete part family and set
$class - Set
$endpoints - Decide
$discrim - Verify parent route vars required
- Verify parent part
getRepositoryAttributes() - Add domain-specific methods only if generic CRUD not enough
- Inspect gateway events that should populate this repo
- Add docblock
@methodhelpers if family uses them
Existing patterns worth copying
Thin specialization
Some repos are intentionally small:
GlobalCommandRepositoryMessageRepository
That is okay. Not every repo needs custom methods.
Constructor route correction
If nested route shape is tricky, normalize vars in constructor instead of forcing every caller to know internals.
Cache-first reads
Methods like fetch() and get() preserve performance by preferring in-memory/cache before REST. Keep that bias unless correctness requires bypass.
Gateway interaction rules
Repositories are often updated from gateway events, not only from their own REST methods. When changing repository keying or cache semantics, inspect matching event handlers. If repository expectations change but event cache writes do not, the repo will look "randomly stale".
Common families to cross-check:
- guild/channel/message/thread create/update/delete events
- interaction entitlements or command-related caches
- member/user/presence caches
Smells
Stop if you see:
- raw REST payloads returned where typed part should be returned
- new route vars threaded manually through many call sites
- repo mutating part semantics that belong in part
save() - cache not updated after successful REST mutation
- in-memory
itemsupdated but cache wrapper ignored, or reverse - parent part and repo disagree on route context
- generic service/helper class added to do what repository already does
Checklist before commit
$class,$endpoints,$discrim,$varsstill describe repo correctly- parent
getRepositoryAttributes()still supplies needed route vars - create/save/delete/fetch semantics remain typed and Promise-based
- cache and in-memory items stay aligned
- any special methods belong here semantically
- related gateway event handlers still populate repo coherently
- docs/tests updated if public behavior changed
Bottom line
Repository code in this repo should feel boring in right way: typed, route-aware, cache-coherent, and predictable. If a repository starts making domain decisions or returning untyped transport data, pull it back to its real job.
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.

