top | item 44854637

(no title)

dnh44 | 6 months ago

These are some of the things I do to try and get good results:

- I prime the context of the LLM with any extra rules or instructions I want it to follow.

- I also prime the context with every single file it needs to see in order to be able to do its job properly. Sometimes this can be two files but sometimes it can be 15 files.

- I instruct the LLM in bullet point format for smaller edits. For larger edits I ask the llm to convert my prompt to markdown. Most of my prompts are created by an LLM

- In 90% of cases I only prompt once per chat, and start a new chat each time. Unless I'm using an agent like Claude Code in which case I use one context window per feature.

- I keep notes of small things that it's done not quite how I want so I can go back and change them.

- I use a program called RepoPrompt to make all this faster and easier.

I'm working on making a game right now and this was the last prompt I did last night. The prompt itself was written by Opus and the implementation was done by GPT-5 High. The actual file edits were performed by Gemini 2.5 Flash to save on API costs.

--- Prompt from Opus:

I need to implement a GameTick event bus system for Ionforge. This will add:

1. A new GameTick model (Sendable, Codable, Hashable) with turnNumber, secondsUntilNextTick, and inGameDateTime

2. A GameTickEvents enum following the pattern of OreInventoryEvents using Combine PassthroughSubject

3. A GameTimerService protocol with tickPublisher, start(), and stop()

4. A MockGameTimerService that generates ticks every 600 seconds using Task.sleep

5. Modify GameServiceActor to own the timer service, subscribe to it, broadcast to GameTickEvents, and cache latestTick

6. Modify PlayerServiceActor to subscribe to GameTickEvents and cache latestTick

The goal is to create an event-driven tick system that can later be swapped from mock to real API. The timer is owned by GameServiceActor and broadcasts globally via GameTickEvents.

Please implement these changes following the existing patterns in the codebase, particularly matching the OreInventoryEvents pattern for the event bus.

--- Response from GPT-5 High:

- Create a new GameTick model (Sendable, Codable, Hashable) with turnNumber, secondsUntilNextTick, and inGameDateTime.

- Add a GameTickEvents enum mirroring the existing OreInventoryEvents pattern (Combine PassthroughSubject).

- Define a GameTimerService protocol that exposes a Combine publisher and start/stop controls.

- Implement MockGameTimerService using Task.sleep to emit ticks every 600 seconds.

- Update GameServiceActor to:

  - own a GameTimerService (mock by default),

  - subscribe to its publisher,

  - broadcast via GameTickEvents,

  - cache the latest tick.
- Update PlayerServiceActor to subscribe to global GameTickEvents and cache the latest tick.

- Keep edits targeted and minimal using delegate edit scopes, with proper Combine imports.

---

GPT-5 then outputted about 120 lines of code across 7 files that compiled and worked on the first try.

discuss

order

ModernMech|6 months ago

This sounds less like engineering advice and more like spellcasting advice.

tptacek|6 months ago

What part of this prompt reads like "spellcasting" to you?

dnh44|6 months ago

Yeah it is a bit isn't it