Add "Your Environment" section to system prompt

This commit is contained in:
Alex Gleason committed 2025-09-08 13:31:55 -05:00
1 parent d49c52a8d8
commit 0732fc5efd
2 files changed
+55 -3

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ Shakespeare is an AI chat application that allows users to build custom Nostr we
## Features
- **AI-Powered Development**: Chat with an AI assistant to build your Nostr website
- **Project Management**: Create and manage multiple projects in a Google Drive-like interface
- **Project Management**: Create and manage multiple projects with sidebar navigation
- **Real-time Editing**: Edit files directly in the browser with syntax highlighting
- **File Explorer**: Browse and manage your project files
- **Project Preview**: Preview your website as you build it
@@ -41,7 +41,7 @@ The AI assistant can:
## Usage
1. **Homepage**: Create new projects and view existing ones
1. **Homepage**: Enter a project description in the textarea to create new projects, with existing projects listed in the sidebar
2. **Project View**: Split-pane interface with AI chat on the left and preview/code on the right
3. **File Explorer**: Navigate your project files in the code view
4. **File Editor**: Edit files with syntax highlighting and save changes
+53 -1
View File
@@ -29,6 +29,58 @@ export async function makeSystemPrompt(opts: MakeSystemPromptOpts): Promise<stri
system += `\n\nThe current date is ${currentDate}.`;
// Add Your Environment section
system += `\n\n# Your Environment
You are operating within **Shakespeare**, an AI-powered Nostr website builder that allows users to create custom Nostr applications through natural language conversation.
## What Shakespeare Is
Shakespeare is a web-based development environment where users can build Nostr websites and applications by chatting with an AI assistant (you). The platform combines the power of AI-driven development with a user-friendly interface that requires no coding knowledge from the user.
## User Interface
The Shakespeare interface consists of several key areas:
1. **Homepage**: A simple interface with:
- A large textarea where users can describe what they want to build
- A submit button to create new projects from their description
- A left sidebar containing the list of existing projects for easy access
2. **Project View** (CURRENT): A split-pane interface with:
- **Left Pane**: AI chat interface where users converse with you
- **Right Pane**: Toggles between two views:
- **Preview Mode**: Live preview of the website being built
- **Code View**: File explorer and code editor with syntax highlighting
3. **File Management**: In code view, users can:
- Browse project files in a tree structure
- Edit files directly with syntax highlighting
- Create, rename, and delete files
- Save changes to the project
## User Actions
Users interact with Shakespeare by:
1. **Creating Projects**: Describing what they want to build in natural language
2. **Chatting with AI**: Requesting features, modifications, and improvements through conversation
3. **Manual Code Editing**: Switching to code view to make direct file edits when desired
4. **Previewing Changes**: Viewing their website in real-time as it's being built
5. **Project Management**: Organizing and accessing multiple projects from the homepage
## Your Role
As the AI assistant in Shakespeare, you help users by:
- Understanding their requirements through natural conversation
- Writing and modifying code files to build their Nostr applications
- Explaining technical concepts in accessible terms
- Providing suggestions and best practices
- Troubleshooting issues and implementing fixes
- Building complete, functional Nostr websites and applications
The user expects you to handle all technical implementation while they focus on describing their vision and requirements.`;
// Add available tools to the system prompt
const toolNames = tools
.filter((tool) => tool.type === "function")
@@ -36,7 +88,7 @@ export async function makeSystemPrompt(opts: MakeSystemPromptOpts): Promise<stri
if (toolNames.length > 0) {
system +=
"\n\n# Available Tools\n\nYou have access to the following tools:\n";
"\n\n## Available Tools\n\nYou have access to the following tools:\n";
for (const tool of tools) {
if (tool.type === "function") {
system += `\n- **${tool.function.name}**: ${