Skip to content

Instantly share code, notes, and snippets.

@iamhenry
Last active October 24, 2024 17:11
Show Gist options
  • Save iamhenry/e95135fab9adc825729f0c3d3a07ba80 to your computer and use it in GitHub Desktop.
Save iamhenry/e95135fab9adc825729f0c3d3a07ba80 to your computer and use it in GitHub Desktop.
Generate SOP (Cursor IDE - Saas)

Core Functionality

  • Brief bullet points describing what the feature should do
  • Focus on user outcomes rather than technical implementation
  • Focus on what users can do
  • Describe outcomes rather than implementation

Example: [Project Management]

  • Save progress automatically while working
  • Resume work from any device
  • Get notified when team members make changes
  • Filter projects by status, deadline, or team
  • Share project links with view-only access

Email Auth Example

  • send magic link email after successful stripe checkout
  • email should contain a token for authentication from the database
  • clicking the link should log me in to the protected pages including dashboard

Additional Context

  • Links to docs or similar features
  • Relevant existing components or patterns
  • Any specific technical concerns

I’m providing you with a high level core functionality of what I'm looking to build. I am working within an existing codebase using the following tech stack: Next.js 14 (App Router), Prisma, Neon (PostgreSQL), Auth.js v5, Resend & React Email, Shadcn UI, Radix UI, Tailwind, Stripe, and Server Actions.

Analysis and Preparation

  1. Thoroughly analyze the provided feature details, inferring the overall goal and technical requirements
  2. Identify potential gaps or overlooked areas across the full stack (e.g., routing, sessions, database interactions, server actions, API endpoints)
  3. Review existing codebase structure and relationships using provided context files (@data-flow.md, @data-models.md, @configurations.md, @project-structure.md, .cursorrules)

Instructions

Generate a new .md file in the existing _prompts/sop dir, prefixed with "sop-", containing a detailed comprehensive breakdown for the following sections:

  1. Goal: Define the goal of the feature in detail.
  2. Acceptance Criteria:
    • Define the criteria that need to be met for the feature to be considered complete. This should include functional requirements (e.g., successful user interaction, correct data display, proper authentication, API responses, etc) and non-functional requirements (e.g., performance, security, and UX considerations). Ensure that all major use cases and edge cases are covered in the criteria.
  3. What It Should Not Do:
    • Clearly specify any areas of the existing codebase that should remain unchanged. For example, if the feature should not modify existing components, logic, or routing structure, mention this to ensure no unnecessary changes are made. Outline any constraints such as avoiding changes to existing business logic, database schema where not needed, or bypassing performance-heavy operations.
  4. Technical Requirements (Frontend & Backend):
    • Identify necessary UI components, routes, state management updates, and API calls on the frontend, including styling changes and error handling. For the backend, specify Prisma schema changes, database interactions, API routes, authentication/authorization updates, and any impacts on caching, SSR, SSG, or external services (e.g., Stripe, Resend).
  5. Data Flow:
    • Outline the flow of data between frontend and backend, detailing what is sent (e.g., form data, API requests), how it is processed on the server (e.g., validation, database interactions), and what is returned to the frontend (e.g., responses, data rendering). Include key interactions between components, API routes, and database queries.
  6. Important Files:
    • List the files that need to be created, modified, or referenced for this feature. Include details on what changes need to be made and highlight opportunities for reusing existing components.
  7. Step-by-Step Implementation:
    • Provide a step-by-step, numbered Todo checklist to implementing this feature, breaking down the process into smaller, actionable subtasks for both frontend and backend development. Ensure the approach follows best practices for scalability and maintainability. Include the file that needs modification; if one doesn’t issues suggest it.

Rule

Before we begin don’t write any code yet. I need you to flag technical gaps, Identify and list any potential technical requirement that have not been covered in order to implement this successfully. After we have flushed this out, I will ask you to generate the SOP as described above.

[No code blocks in the final SOP] @Codebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment