You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnINITIAL_SYSTEM_PROMPT+`. \n The website should interact the smart contract deployed at this address: ${options.address} on ${options.chainId} network. The ABI of the contract is: ${JSON.stringify(options.abi)}. Put the following code in the header to be able to connect to the blockchain:${providerCode}. Follow the design and features proposed in this description: ${options.description}`
179
+
return`. \n The website should interact the smart contract deployed at this address: ${options.address} on ${options.chainId} network. The ABI of the contract is: ${JSON.stringify(options.abi)}. Put the following code in the header to be able to connect to the blockchain:${providerCode}. Follow the design and features proposed in this description: ${options.description}`
return`Here is the full code of my current project:\n\n${filesString}\n\nNow, please apply the following update based on this current code: ${description}. Remember to return ALL project files in the specified START_TITLE format.`
184
185
}
185
186
186
187
privategetProviderCode(): string{
@@ -194,7 +195,7 @@ export class AIDappGenerator extends Plugin {
Copy file name to clipboardExpand all lines: apps/remix-ide/src/app/plugins/prompt.ts
+69-71Lines changed: 69 additions & 71 deletions
Original file line number
Diff line number
Diff line change
@@ -95,82 +95,80 @@ export default App;
95
95
IMPORTANT: The first file should be always named index.html.
96
96
You MUST generate all files: index.html, src/main.jsx, src/App.jsx.`;
97
97
98
-
exportconstFOLLOW_UP_SYSTEM_PROMPT=`You are an expert UI/UX and Front-End Developer modifying an existing HTML files.
99
-
The user wants to apply changes and probably add new features/pages to the website, based on their request.
100
-
You MUST output ONLY the changes required using the following UPDATE_PAGE_START and SEARCH/REPLACE format. Do NOT output the entire file.
101
-
If it's a new page, you MUST applied the following NEW_PAGE_START and UPDATE_PAGE_END format.
98
+
exportconstFOLLOW_UP_SYSTEM_PROMPT=`You are an expert Front-End Developer specializing in React, Vite, and ethers.js.
99
+
Your task is to generate a multi-file DApp project structure.
100
+
You MUST generate separate files for HTML, CSS, and JavaScript (JSX).
101
+
You MUST use React with JSX syntax (not "text/babel" scripts).
102
+
You MUST use ethers.js (v6) for all blockchain interactions.
103
+
The user's contract address, ABI, and network info will be provided in the main prompt.
104
+
105
+
Return EACH file using the specified "TITLE_PAGE_START" format.
106
+
The file structure MUST be:
107
+
1. \`index.html\`: The HTML root file. It MUST link to \`/src/main.jsx\` as a module.
108
+
2. \`src/main.jsx\`: The React entry point. It MUST import \`App.jsx\` and use \`ReactDOM.createRoot\`.
109
+
3. \`src/App.jsx\`: The main React component containing all DApp logic (wallet connection, ABI calls).
110
+
4. \`src/index.css\`: (Optional) Basic CSS file, imported by \`src/main.jsx\`.
111
+
102
112
${PROMPT_FOR_IMAGE_GENERATION}
103
-
Do NOT explain the changes or what you did, just return the expected results.
104
-
Update Format Rules:
105
-
1. Start with ${UPDATE_PAGE_START}
106
-
2. Provide the name of the page you are modifying.
107
-
3. Close the start tag with the ${UPDATE_PAGE_END}.
108
-
4. Start with ${SEARCH_START}
109
-
5. Provide the exact lines from the current code that need to be replaced.
110
-
6. Use ${DIVIDER} to separate the search block from the replacement.
111
-
7. Provide the new lines that should replace the original lines.
112
-
8. End with ${REPLACE_END}
113
-
9. You can use multiple SEARCH/REPLACE blocks if changes are needed in different parts of the file.
114
-
10. To insert code, use an empty SEARCH block (only ${SEARCH_START} and ${DIVIDER} on their lines) if inserting at the very beginning, otherwise provide the line *before* the insertion point in the SEARCH block and include that line plus the new lines in the REPLACE block.
115
-
11. To delete code, provide the lines to delete in the SEARCH block and leave the REPLACE block empty (only ${DIVIDER} and ${REPLACE_END} on their lines).
116
-
12. IMPORTANT: The SEARCH block must *exactly* match the current code, including indentation and whitespace.
117
-
Example Modifying Code:
118
-
\`\`\`
119
-
Some explanation...
120
-
${UPDATE_PAGE_START}index.html${UPDATE_PAGE_END}
121
-
${SEARCH_START}
122
-
<h1>Old Title</h1>
123
-
${DIVIDER}
124
-
<h1>New Title</h1>
125
-
${REPLACE_END}
126
-
${SEARCH_START}
127
-
</body>
128
-
${DIVIDER}
129
-
<script>console.log("Added script");</script>
130
-
</body>
131
-
${REPLACE_END}
132
-
\`\`\`
133
-
Example Deleting Code:
134
-
\`\`\`
135
-
Removing the paragraph...
113
+
No need to explain what you did. Just return the code for each file.
114
+
115
+
Example Format:
136
116
${TITLE_PAGE_START}index.html${TITLE_PAGE_END}
137
-
${SEARCH_START}
138
-
<p>This paragraph will be deleted.</p>
139
-
${DIVIDER}
140
-
${REPLACE_END}
141
-
\`\`\`
142
-
The user can also ask to add a new page, in this case you should return the new page in the following format:
143
-
1. Start with ${NEW_PAGE_START}.
144
-
2. Add the name of the page without special character, such as spaces or punctuation, using the .html format only, right after the start tag.
145
-
3. Close the start tag with the ${NEW_PAGE_END}.
146
-
4. Start the HTML response with the triple backticks, like \`\`\`html.
IMPORTANT: While creating a new page, UPDATE ALL THE OTHERS (using the UPDATE_PAGE_START and SEARCH/REPLACE format) pages to add or replace the link to the new page, otherwise the user will not be able to navigate to the new page. (Dont use onclick to navigate, only href)
176
-
No need to explain what you did. Just return the expected result.`
133
+
${TITLE_PAGE_START}src/index.css${TITLE_PAGE_END}
134
+
\`\`\`css
135
+
/* AI will generate Tailwind base styles or custom CSS here */
0 commit comments