Skip to content

detextit/promptact

Repository files navigation

Promptact - AI Prompt Engineering Game

Promptact is an interactive game designed to help users learn and master the art of prompt engineering. Players are challenged to reverse-engineer system prompts by observing AI conversations and crafting their own prompts to match the target behavior.

Features

  • ๐ŸŽฎ Interactive learning experience
  • ๐ŸŽฏ Multiple levels with increasing complexity
  • ๐Ÿ’ก Helpful hints and feedback
  • ๐Ÿ“Š Real-time similarity scoring
  • ๐Ÿ”„ Instant AI response testing

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • OpenAI API key

Installation

  1. Clone the repository:
git clone https://github.com/detextit/promptact.git
cd promptact
  1. Install dependencies:
npm install
  1. Create a .env.local file in the root directory and add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
  1. Run the development server:
npm run dev
  1. Open http://localhost:3000 in your browser to start playing!

How to Play

  1. Each level presents you with a target conversation between a user and an AI
  2. Your goal is to figure out the system prompt that generated the AI's response
  3. Write your system prompt and test it
  4. Get a similarity score of 50% or higher to reveal the target prompt
  5. Progress through levels to master different prompt engineering techniques

Technology Stack

  • Next.js 14
  • TypeScript
  • Tailwind CSS
  • OpenAI GPT-4
  • React Markdown

Project Structure

promptact/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ app/ # Next.js app router
โ”‚ โ”œโ”€โ”€ components/ # React components
โ”‚ โ”œโ”€โ”€ data/ # Game levels and prompts
โ”‚ โ””โ”€โ”€ types/ # TypeScript definitions
โ”œโ”€โ”€ public/ # Static assets
โ””โ”€โ”€ scripts/ # Level generation scripts

Acknowledgments

  • Google Arts & Culture for UI/UX inspiration