This file outlines a set of tasks for building a simple Next.js project. In this project, the user enters their name in a text box on the Home Page and is then greeted with "Hello, {name}" on a separate Greeting Page.
Here's an example prompt to use to generate this. Note that you'll first want to either provide a detailed set of notes / prd of exactly what to build, or have a two-step process where you have the AI create the spec, then proceed with this step: Be sure to use an advanced thinking model with this, ideally "Deep Research" from OpenAI but o1-pro, o3-mini, flash-2-thinking, or (maybe?) DeepSeek R1 could work as well.
Great! Now convert that information into a very very detailed markdown numbered list of 1 story point tasks that an AI coding agent can complete.
Be sure to pull in the necessary data for each storybook story and be detailed about the exact data and storybook story states should be for each component.
This will likely be a long detailed list in markdown, be sure to use numbers for the top-level story title and checkboxes (all default unchecked) for each
substep of the story with the details.After you generate this task list, here is a prompt to use in cursor agent to kick this off (might be useful to put at the end of your cursorrules file as well?) Probably helpful to just @include the cursor-tasks.md file as well.
Go through each task in the .cursor-tasks file. After you complete each task, update the file to check off any task. Run builds and commits after each task. Continue with each task until you have checked off each one. After each story, do not take a screenshot. If you need more detail about a task, you can gather relevant files and pass the FULL file to the research agent.-
Initialize the Next.js Project
- Use Create Next App to bootstrap the project.
- Enable the App Router.
- Configure Tailwind CSS for styling.
- Set up TypeScript with strict mode.
-
Configure Basic Routing
- Ensure the project has two main pages:
- Home Page (
pages/index.tsx) for user input. - Greeting Page (
pages/greeting.tsx) to display the greeting.
- Home Page (
- Ensure the project has two main pages:
-
Create the Home Page (
pages/index.tsx)- Render a form containing:
- A text input where the user enters their name.
- A submit button labeled "Submit".
- Use Tailwind CSS classes for styling (e.g., input borders, padding, and button colors).
- Render a form containing:
-
Implement Form Handling
- Use React’s
useStatehook to manage the input value. - Validate that the input is not empty before submission.
- On form submission, navigate to the Greeting Page while passing the entered name (using query parameters or a simple state management solution).
- Use React’s
-
Create the Greeting Page (
pages/greeting.tsx)- Retrieve the user's name from the query parameters or via a shared state.
- Display a greeting message in the format: "Hello, {name}".
- Style the greeting message using Tailwind CSS (e.g., text size, color, and margin).
-
Implement Navigation from Home Page
- Ensure that the Home Page form submission correctly routes to the Greeting Page with the user’s name attached.
-
Form Validation
- Prevent submission if the text input is empty.
- Display a simple error message below the input (e.g., "Please enter your name.") when validation fails.
-
Test the User Flow
- Manually test by entering a name and verifying that the Greeting Page shows the correct message.
- Optionally, write unit tests for the form logic to ensure reliability.
-
Update the Project README
- Include instructions on how to install dependencies, run the development server, and build the project.
- Provide a brief overview of the project’s purpose and structure.
-
Final Review and Testing
- Ensure that all components render correctly and the navigation works as expected.
- Test the app in both development and production modes to confirm proper behavior.