Build Roblox games with Flamework, a TypeScript framework...
A comprehensive skill for working with Flamework, the TypeScript game framework for Roblox.
Flamework is an extensible TypeScript game framework for Roblox that provides singletons, dependency injection, networking, and a component system with minimal boilerplate.
What This Skill Covers:
Documentation Source: Based on official Flamework documentation (https://flamework.fireboltofdeath.dev/) - current as of Flamework v1.0+
import { Service, OnStart } from "@flamework/core";
@Service()
export class MyService implements OnStart {
onStart() {
print("Service started!");
}
}
import { Service } from "@flamework/core";
import { OtherService } from "./other-service";
@Service()
export class MyService {
// Dependencies injected via constructor
constructor(private otherService: OtherService) {}
method() {
this.otherService.doSomething();
}
}
// runtime.server.ts or runtime.client.ts
import { Flamework } from "@flamework/core";
// Preload paths (services, controllers, components)
Flamework.addPaths("src/server/services/");
Flamework.addPaths("src/server/components/");
// Start the framework
Flamework.ignite();
Services (@Service) run on server, Controllers (@Controller) run on client. Only one instance created per class. Load order determined automatically by dependencies or via loadOrder option.
Implement interfaces to hook into lifecycle: OnStart, OnInit, OnTick, OnPhysics, OnRender (client only). Prefer OnStart over OnInit (OnInit blocks sequential execution).
Use constructor DI (preferred) or Dependency<T>() macro. Framework automatically determines load order from constructor dependencies.
This skill uses progressive disclosure for efficient context usage:
Available Reference Files:
This skill activates when you mention Flamework-related concepts:
For best results:
@Service()
export class PlayerService implements OnStart {
constructor(
private dataService: DataService,
private components: Components
) {}
onStart() {
// Initialize after dependencies ready
}
}
// shared/networking.ts
import { Networking } from "@flamework/networking";
interface ClientToServer {
requestData(id: string): void;
}
interface ServerToClient {
updateData(id: string, data: unknown): void;
}
export const GlobalEvents = Networking.createEvent<ClientToServer, ServerToClient>();
// server/networking.ts
export const Events = GlobalEvents.createServer();
// client/networking.ts
export const Events = GlobalEvents.createClient();
import { Component, BaseComponent } from "@flamework/components";
interface Attributes {
health: number;
maxHealth: number;
}
@Component({ tag: "Health" })
export class HealthComponent extends BaseComponent<Attributes> implements OnStart {
onStart() {
print(`Health: ${this.attributes.health}/${this.attributes.maxHealth}`);
}
}
# Install Flamework
npm i -D rbxts-transformer-flamework
npm i @flamework/core
# Optional modules
npm i @flamework/networking
npm i @flamework/components
tsconfig.json requirements:
{
"compilerOptions": {
"experimentalDecorators": true,
"plugins": [{ "transform": "rbxts-transformer-flamework" }],
"typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"]
}
}
default.project.json requirements:
{
"node_modules": {
"@rbxts": { "$path": "node_modules/@rbxts" },
"@flamework": { "$path": "node_modules/@flamework" }
}
}
Dependency<T>() macro when possible"Dependency called before ignition" - Use constructor DI or move Dependency
Components not loading - Check ancestorBlacklist/Whitelist, ensure CollectionService tag is set, verify instanceGuard passes
Network type guard failures - Ensure types are supported by guard generation, check middleware configuration
Load order issues - Let automatic resolution handle it, or specify loadOrder in decorator options
For detailed troubleshooting and advanced topics, see the reference documentation files.
Complete Flamework v1.0+ Feature Set:
✅ Core singletons and DI
✅ Lifecycle events (OnStart, OnTick, OnPhysics, OnRender)
✅ Full networking module with middleware
✅ Complete component system with attributes
✅ Configuration and setup (tsconfig, flamework.json)
✅ All utility macros (id, implements, createGuard, hash)
✅ Modding and extension API
Best Practices Emphasized:
