agentleFS
OpenAIKnown publisheropenai/build-hours/18-responses-api/openai-simulator/AGENTS.md

build-hours / openai-simulator

AGENTS.md850 starsChanged 14 months agoMITView on GitHub

Keep the UX snappy: conversations should feel like texting with a coach. Preserve the last-two-message window and streaming feel whenever you touch dialogue logic.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No automated tests yet. Manually verify:

    line 31
  2. Distinctive:

    Consider adding integration tests (Playwright + Phaser headless) if time allows.

    line 35
  3. Distinctive:

    Add message throttling/length guards before sending to the LLM.

    line 42
  4. Distinctive:

    Keep the UX snappy: conversations should feel like texting with a coach.

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Agents Handbook

What We're Building

  • Top-down Phaser sandbox where the player chats with nearby NPCs acting as LLM-backed mentors inside OpenAI HQ.
  • Each NPC has its own dialogue agent with custom instructions and rolling memory so conversations resume where they left off.
  • The UI keeps the last two thread messages visible, color-codes player (green) vs NPC (white), and supports live streaming responses.

Core Pieces

  • src/scenes/MainScene.ts: Manages player movement, proximity detection, interaction prompts, and the threaded chat UI. Handles switching between NPCs, cancelling with ESC or by walking away, and consuming streamed responses.
  • src/gameobjects/Character.ts: Wrapper around a Phaser sprite + optional DialogueAgent configuration and physics helpers.
  • src/dialogue/DialogueAgent.ts: Streams responses from OpenAI (or falls back to canned text), stores per-NPC message history, and exposes helpers for display name, prefixes, and initial greetings.

Implementation Notes

  • Conversations stream token-by-token. MainScene updates the latest NPC entry as chunks arrive and only resumes input once streaming completes.
  • DialogueAgent records every user/assistant turn; conversations should never be manually truncated unless intentionally resetting state.
  • NPC configs currently live inline in MainScene (npcConfigs). Expand these or load from data files if you need richer casts.
  • The default DialogueAgent constructor bakes in a temporary API key; replace it with environment-driven configuration before shipping anything real.

Open TODOs & Watchouts

  • Populate npcConfigs with real assets/positions/instructions; current entries are placeholders.
  • Swap the hardcoded OpenAI key and model for injected configuration or per-NPC overrides.
  • Interaction radius (interactionRadius = 72) may feel aggressive when NPCs are close together; tweak or add prioritization if players see prompt flicker.
  • Double-check UI teardown: leaving range or cancelling should hide both dialogue boxes and reset threadMessages.

Testing & Manual QA

  • No automated tests yet. Manually verify:
    • Switching between multiple NPCs without dropping ongoing history.
    • Walking away mid-stream cancels gracefully and lets streaming finish silently.
    • ESC always exits the active conversation and clears the UI.
  • Consider adding integration tests (Playwright + Phaser headless) if time allows.

Future Extensions

  • Wire real LLM calls via dependency injection (pass an OpenAI client per NPC or through a factory).
  • Persist conversation history to storage so it survives reloads.
  • Replace hardcoded art/assets with data-driven definitions or a content pipeline.
  • Add message throttling/length guards before sending to the LLM.

Keep the UX snappy: conversations should feel like texting with a coach. Preserve the last-two-message window and streaming feel whenever you touch dialogue logic.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.