roblox-luau-patterns
Skill150 starsChanged 51 days agoMITView on GitHub
Use when writing or refactoring Roblox Luau modules, object lifecycles, signals, task scheduling, pcall, and cleanup.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- szlay/roblox-basetheir own version, first seen Jul 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- szlay/roblox-base★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- roblox-architectureSkill
- roblox-collaboration-modeSkill
- roblox-dataSkill
- roblox-luau-coreSkill
- roblox-luau-typesSkill
- roblox-networkingSkill
- roblox-performanceSkill
- roblox-securitySkill
- roblox-server-dataSkill
- roblox-analyticsSkill
- roblox-game-designSkill
- roblox-growth-designSkill
- roblox-monetizationSkill
- roblox-player-psychologySkill
- roblox-animation-vfxSkill
- roblox-audioSkill
- roblox-buildingSkill
- roblox-cameraSkill
- roblox-guiSkill
- roblox-inputSkill
- roblox-lightingSkill
- roblox-localizationSkill
- roblox-npc-aiSkill
- roblox-physicsSkill
- roblox-cloudSkill
- roblox-publish-checklistSkill
- roblox-studio-mcpSkill
- roblox-toolingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Plain functions: default for stateless transformation or validation.
- Distinctive: line 30
Existing library abstraction: follow it when the project already uses it consistently.
- Distinctive: line 50
Do not collapse "call succeeded and returned nil" into "call failed." Retry only when the domain operation is safe to repeat.
- Very specific: line 58
Use task.defer, task.spawn, task.delay, and task.cancel deliberately.
≈ “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
Luau Patterns
When to Load
Load for module shapes, resource ownership, scheduling, and failure contracts. See roblox-luau-core for semantics, roblox-luau-types for types, roblox-architecture for startup.
Quick Reference
Choose a shape
- Plain functions: default for stateless transformation or validation.
- Module with private state: one explicit subsystem owner. Do not create a manager class merely to namespace functions.
- Object with metatable: multiple independent values need shared behavior and lifecycle.
- Existing library abstraction: follow it when the project already uses it consistently. Do not add Promise, signal, cleanup, or framework dependencies for one call site.
Constructors use ., instance methods use :, and mutable fields belong on the instance, not the class table.
Make ownership visible
Signal connections, instances, and tasks need cleanup owners. Disconnect/cancel at teardown. Export typed custom signal payloads (Signal<T...>).
Configure before parenting to hide partial state. Parent earlier only when ancestry is required; explain why. This does not guarantee replication ordering.
Preserve failure semantics
local ok, value = pcall(dataStore.GetAsync, dataStore, key)
if not ok then
return nil, `read failed: {value}`
end
return value, nil -- value may legitimately be nilDo not collapse "call succeeded and returned nil" into "call failed." Retry only when the domain operation is safe to repeat. Persistence, HTTP, purchases, and remotes belong to their domain skills.
Naming and return contracts
Practitioner conventions: mark yielding functions Async, keep return counts consistent, and prefer named module exports. Respect existing project contracts; details in full.md.
Schedule deliberately
Use task.defer, task.spawn, task.delay, and task.cancel deliberately. Avoid legacy wait() and unjustified polling. Prefer a real state-change signal; otherwise choose and measure an explicit cadence.
Review
Clear owner, narrow public API, no circular require, no accidental concurrent startup, success and missing-data states remain distinct, connections/tasks cleaned up, client input routed to roblox-networking.
Details: references/full.md
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.

