Skip to main content

Ghostwriter Chat

Replit's Ghostwriter Chat is an chat-based AI assistant that enables users to quickly get answers to their coding-related questions directly in the Workspace, without ever leaving the page.


Ghostwriter Debugger

The Ghostwriter Debugger is an AI feature of Replit's Ghostwriter that helps users debug their code by identifying errors. Additionally, it provides step-by-step guidance and hints to help users figure out solutions to their coding problems.


Tips & Tricks

Getting an AI model to generate the correct results can be challenging. Even though Ghostwriter has context of some files in your repl, you have to think a little deeper about Ghostwriter's perspective and how it understands human language.

1. Make your questions detailed

Write prompts in fully-formed sentences, and include as much detail and context as you can.

If Ghostwriter is provided with little information, it has a hard time giving you the results you want

Ghostwriter
IroncladDev

make a discord bot

Ghostwriter

Making a discord bot requires the use of a Discord API library such as discord.js or discord.py. First you need to...

Mock profile picture

Providing lots of information yields much better results.

Ghostwriter
IroncladDev

Make me a discord bot in discord.js that sends a user a direct message when they join.

Ghostwriter
const Discord = require('discord.js');
const client = new Discord.Client();
‎
client.on('guildMemberAdd', member => {
...
Mock profile picture

2. Ask follow-up questions

You can chat with Ghostwriter like a real pair programmer. Try asking follow-up questions by mentioning a previous message.

Ghostwriter
IroncladDev

Make me an algorithm that sorts an array in javascript

Ghostwriter
function sort(arr) {
‎ for (let i = 0; i < arr.length; i++) { 
‎ ‎  let min = i; 
‎ ‎  ...
IroncladDev

Use the javascript array .sort function and sort an array of numbers by ascending

Ghostwriter
let numbers = [6, 2, 8, 1];
// Sort the array in ascending order
numbers.sort((a, b) => a - b);
‎
console.log(numbers); // Output: [1, 2, 6, 8]
Mock profile picture

3. Modify Ghostwriter's Behavior

Telling Ghostwriter to act like a programmer in a different field could yield better results.

Ghostwriter
IroncladDev

I want you to act as a UX/UI developer. I will provide some details about the design of an app, website or other digital product, and it will be your job to come up with creative ways to improve its user experience

Ghostwriter

Got it! As a UX/UI developer, I'm here to help you make your digital product user-friendly and visually appealing. From the details you provided, my first suggestion would be to ensure that the user interface is intuitive and easy to navigate...

IroncladDev

Design me a product landing page in HTML. The product should be a database hosting provider named 'Daddybase'. The accent color should be blue and the headline on the landing page should be 'The best way to store dad jokes'

Ghostwriter
<html>
‎ ‎<head>
‎ ‎  <title>Daddybase - Database hosting</title>
‎ ‎  ...
Mock profile picture

4. Explain and reference code

Ghostwriter Chat can be used to explain files in your code. Ghostwriter tries to be smart and include files you interact with. In this example, we have a simple rickroll website as our HTML.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Never gonna give you up</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<script>location.href = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"</script>
</body>
</html>
Ghostwriter
IroncladDev

What does the <script> tag do in my index.html file?

Ghostwriter

The <script> tag in your index.html file is used to define a script, which is a set of instructions that can be executed by a web browser. In this case, the script redirects the browser to the https://www.youtube.com/watch?v=dQw4w9WgXcQ URL.

IroncladDev

What is the title in my index.html file?

Ghostwriter

The title in your index.html file is 'Never gonna give you up'. This is defined between the

and tags on line 5.

Mock profile picture

Limitations

Some of the limitations of Ghostwriter Chat include:

  • No internet access of knowledge of recent events
  • Occasionally hallucinates and gets line numbers incorrectly
  • Does not know everything about your Repl
  • Cannot interact with your Repl (create files, etc)
  • Tries to avoid talking about things that are not related to coding.