Skip to main content

Using AI with Pulse

AI assistants can write complete, working Pulse components once they have the right context. Without context they'll write generic Lua that won't compile. This page shows how to give them what they need.

:::caution Disclaimer Scripts you build with Pulse should only be used on games you own or have permission to test on, or for learning purposes only. Do not use scripting tools in games without the owner's permission. The Pulse framework is a development tool — how you use it is your responsibility. :::


The best setup: Claude Code

The easiest way to work with Pulse + AI is Claude Code — Anthropic's CLI tool that runs directly in your terminal alongside your project files. With a Claude subscription (~$20/month) you get a coding assistant that:

  • Reads your entire project tree (src/, rb/, build output)
  • Can run rb build and see compiler errors directly
  • Reads llms.txt and llms-full.txt automatically for framework context
  • Remembers context across the whole session, not just one prompt
  • Can iterate: write a component → build → see the error → fix it → build again

Setup:

  1. Install Claude Code: npm install -g @anthropic-ai/claude-code
  2. Run claude in your project root
  3. Claude automatically picks up llms.txt from https://pulse-rb.vercel.app/llms.txt if you reference the site, or paste the contents from /llms-full.txt

Tell it at the start of the session:

Read https://pulse-rb.vercel.app/llms-full.txt for the Pulse framework context,
then help me build a [description of what you want].

Claude Code is the only AI workflow where you can say "build it, run rb build, fix errors, repeat" without copying and pasting between windows.


Any other AI: paste llms-full.txt

If you're using ChatGPT, Gemini, or any other AI, paste the contents of /llms-full.txt at the start of your conversation. This single file contains:

  • Complete TypeScript component syntax (defineComponent, signal, on.*)
  • All signal and handler patterns
  • All Pulse.* helper APIs
  • Common mistakes and what to avoid
  • Real examples

Without this, the AI will hallucinate syntax that doesn't exist.


Writing a good prompt

After giving context, be specific. Vague prompts produce vague output.

Weak:

"Write me an ESP component"

Good:

"Write a Pulse component called PlayerESP. It should:

  • Have signals: enabled, showNames, showHealth, color
  • Create a Highlight per player character in CoreGui, parented there so it survives replication
  • On CharacterAdded, rebuild highlights
  • On enabled/disabled, create or destroy all highlights
  • Show color-coded HP bars using BillboardGui Adornee on HumanoidRootPart
  • Use component:bind() for all connections"

Include: component name, signals needed, what events it reacts to, which Pulse helpers to use, cleanup requirements.


What AI does well

  • Component skeleton — signals, on.* hooks, widget return array
  • Helper usage — once it has the API, it uses Pulse.Loop, Pulse.Draw, Pulse.Aim correctly
  • Boilerplateon.respawn, null checks, task.spawn load guards
  • Iteration — fixing specific errors when you paste the compiler output back

What to always verify

AI makes consistent mistakes with Pulse. Check these before injecting:

Signal write syntax — use .set() not direct assignment: enabled.set(true) not enabled = true.

Signal read syntax — call the signal like a function: speed() not speed.

Missing null checks — AI writes _PulseGetHumanoid()!.WalkSpeed without a null guard. Add if (!h) return.

Raw connections — AI uses RunService.Heartbeat.Connect(...) without cleanup. Use on.heartbeat(...) instead.

wait() instead of task.wait() — always replace legacy wait().

Missing component:bind() — AI creates connections without registering them for cleanup. Every :Connect() inside on blocks should be wrapped in component:bind("name", connection).

Invented paths — AI will make up paths like workspace.NPCs.Enemies. Verify with Dex against your actual game.


Iterating effectively

Build incrementally — smaller prompts produce more reliable code:

  1. Skeleton first: ask for signals, ui block, empty on handlers
  2. Build → verify UI appears in game
  3. Logic next: ask to fill in the event handler bodies
  4. Build → verify behavior
  5. Polish: add logging, error handling, edge cases

Trying to generate everything at once usually produces longer code with more bugs. Get it working in steps.


Giving AI your current files

For Claude Code: it reads your files automatically. For other AIs, paste the relevant files:

Here is my current component [paste file].
Here is the compiler error [paste error].
Fix the issue.

Paste the actual error from rb build output — AI fixes compiler errors very accurately when given the exact message.


See also