The Freelance Dojo: AI Negotiation Battle Simulator
Global hackathon-winning gamified Retool app simulating freelance client negotiations using multi-agent AI personas, turn state engines, and Retool DB.
Context
Freelance software engineers routinely struggle with scope creep, ambiguous briefs, and lowball pricing negotiations. Technical courses teach code, but rarely teach commercial negotiation tactics. The Freelance Dojo was conceived for the global Retool x Contra Challenge to gamify commercial client negotiations into an 8-bit retro RPG battle arena, where developers face AI clients modeled after real-world nightmare client behaviors.
What I Built
- Architected and built the entire application end-to-end within Retool and Retool DB.
- Designed dynamic AI client personas ("Gary the Ghoster", "Sam the Scope Creeper") driven by Retool AI with contextual system instructions, hidden weakness triggers, and structured JSON response schemas.
- Engineered an asynchronous JavaScript game loop that sequences player moves, triggers model inferences, updates health/deal metrics, and handles audio-visual state transitions.
- Built interactive retro battle UI components using custom HTML, DiceBear pixel-art avatars, CSS shake/attack keyframe animations, and sound effects for damage, victory, and negotiation events.
- Architected the underlying PostgreSQL database in Retool DB (
bossesandbattlestables) and wrote SQL window functions (dense_rank OVER (ORDER BY deal_value DESC)) to power a real-time global leaderboard of winning deals. - Built an administrative Boss Editor CRUD suite allowing dynamic configuration of new opponents, difficulty tiers, and system prompts.
Decisions & Trade-offs
- Strict JSON schema output from LLM: Enforced strict JSON response formatting rather than free-form text, enabling deterministic state updates in the JavaScript frontend while retaining LLM dialogue creativity.
- Fail-safe state validation: Implemented automated client-side overrides (e.g. forcing a win at $50k+ deal value or loss at 0 HP) in case the LLM omitted explicit
game_overflags. - Retool DB over external storage: Chose Retool DB (hosted PostgreSQL) to maintain single-platform deployment and sub-second query execution for the public embedded deployment.
Result
Selected as one of 4 global winners in the Retool x Contra Challenge, earning the Pitch Perfect Award. The application was publicly embedded, demonstrated, and played by global community members (live application, video demo, Contra submission, award announcement).
Verified Engineering Claims
Every statement below is validated against production records and verified sources.
Engineered dynamic system prompt injection in Retool AI (GPT-4o-mini) to simulate distinct client negotiation personas with game state feedback and strict JSON schema output.
Developed an asynchronous JavaScript turn engine managing player patience (HP), deal valuation pot, battle animation states, and audio cues across multi-turn negotiation transcripts.
Architected a PostgreSQL database schema in Retool DB tracking opponent personas, game transcripts, and high-score leaderboards using SQL window ranking functions.
Won the global Retool x Contra Challenge ("Pitch Perfect" Category Winner) for creative engineering, game mechanics, and practical AI workflow design.