This repository contains instructions for creating a game entirely using AI assistance.
Note: This entire development process is meant to be assisted by AI tools, showcasing how complex applications can be created with minimal human coding intervention.
Create a game with the following specifications:
- Game Concept: A player chooses the highest number from a set of randomly generated numbers.
- Time Limit: Players have 60 seconds to make as many correct choices as possible.
- Scorekeeping: Display the player's high score on the home page.
- Frontend: Use v0.dev for UI generation
- Smart Contracts: Build Cairo Contracts using the Dojo MCP
Follow these steps to create your game:
Clone the templates
and the docs
folder and ask the AI to create the documentation files for the about and the implementation under the docs
folder.
- about.md: Describe the game concept, rules, user experience, and any unique features
- implementation.md: Detail your technical approach, architecture, data models, and implementation plan
This helps you to understand the game and the implementation plan before starting to code. You can provide feedback to the AI to improve it's understanding of your requirements and refine these documents.
If you dont want to review the documentation then you can just look at the instructions/about.md
file to get an overview of how the AI Agent understood your game requirements.
A good prompt here for our game would be:
Create a game where a player needs to choose the lowest number from a set of randomly generated numbers.
The player can keep doing this for a total of 60 seconds. You need to show the high score of the player on the home page.
Create an about and an implementation doc using @templates and save these files under a docs folder. The implementation doc should be plan for building the game keeping in mind the archtitecture_reference.md file.
No need to start coding. Just complete these docs so i can understand your approach
Once documentation is complete, use the Dojo Sensei MCP to start building the smart contracts. The AI assistant will help guide you through this process.
A good prompt here would be:
Using the sensei mcp, get started on building the contracts for the game. You can use the documentation in the docs folder to help you understand the game and the implementation plan.
After contract development, create the game interface using any UI generator for building the frontend. We recommend using v0.dev for this but you can use any other UI generator (Bolt, Lovable, etc) and ask the AI to help you build the frontend.
Once the contracts are built, you can use the sensei mcp to test the contracts.
A good prompt for our game would be:
Using the sensei mcp, test the contracts for the game. Consider unit testing essential utilities like the random number generator. Try to also conduct integration tests for the game. Look at the implementation doc to understand the game and the implementation plan.
Run sozo test to test the contracts and according to what's breaking , you can ask the Agent to help you fix the contracts.
Connect the frontend to the contracts using the controller. Here a good way to get you started would be to add the cartridge controller docs and dojo docs to your cursor.
Steps to get you started:
- Navigate to the Cursor Settings
- Navigate to the Features Tab
- Scroll to the Docs Section (at the time of writing this , this would be just below the codebase indexing section)
- Click on the + button to add a new doc
- Add Dojo Docs:
https://www.dojoengine.org/llms.txt
- Add Cartridge Controller Docs:
https://docs.cartridge.gg/llms.txt
Now you can start connecting the frontend to the contracts using the docs. Type @Docs
and choose Cartridge Docs. and ask the agent to help you connect the frontend to the contracts using the cartridge controller. This should give you a good starting point and you can start testing the game using the above connected contracts.
Once the game is complete, you can deploy the contracts and the frontend. You can use slot to deploy the contracts on your own chain. Just tag the cartridge docs like we do above and ask the agent to help you deploy the contracts.
- You can use the
@docs
command to add documentation to your cursor (this is already done for you in the steps above. Maybe you can add more docs to help the agent understand the codebase better like Starknet docs, Dojo docs, Cairo docs, etc) - You can use the
@templates
command to add the instructions to your cursor. - Always refer to the cartridge docs for the latest updates on how to use the controller and the other components.
- Always refer to the Dojo docs for the latest updates on how to use the dojo framework in cairo.
- Try to use the sozo test to test the contracts and the frontend.
- The MCP is still in beta and the docs are not up to date. So you can please add suggestions which you think will help the MCP perform better.