Stored Workflows

This is going to be hard to describe what a UI would look like, but I think this could be a very strong way to leverage AI in the future.

First let me describe the use case I’m imagining:

I’m currently working with a typescript / prisma / zod project. Something I very commonly have to do is:

  1. Add a field to my prisma schema
  2. Run npx prisma db push
  3. Run the VSCode command npm run task check types
  4. Go to all areas of my code that are tagged as problems and update those according to the new field that’s added

What would be extremely cool is if Cursor implemented some sort of step-wise interaction with LLM’s that have access to doing things. Ideally it would walk me through each thing and allow me to accept, modify, reject, or something along those lines.

I’m imagining something like this. Maybe I have a workflow configuration that looks something like this (I’m using TS because I know it well, but I don’t care what language it’s written in):

const workflow = {
    name: "addFieldToDatabase",
   steps: [
       {
          name: "Add field to prisma",
          type: "modify-file",
          file: "path/to/prisma/file",
          parameters: ["modelName", "newField", "newType"]
          prompts:[
              `
               Please edit the {modelName} model by adding the field
               {newField} to it that has the type {newType}. 
              `,
             `Any additional notes?`
         ]
       },
      {
           name: "Push to Schema",
           type: "run-command",
           prompts: [
               "would you like me to run `npx prisma db push`"
           ],
           command: `npx prisma db push`
      },
     {
         name: "Check For Errors",
         type: "vscode-run-command",
         prompts: [
               "would you like me to run `npx prisma db push`"
        ],
        command: `run task`,
        select: ["check types"]
     },
     {
         name: "Sweep Through Errors",
         type: "fix-errors-in-project", // this would be some sort of opinionated mode where you walk through every error in the `problems` tab and fix it one by one
        filePriority: [ "*.shema.ts"] // this would be super helpful so that way we have it walk through problems in the right order, which can be very important when updating typescript problems because many times one file cascades to others
     }
   ]
}

With something like this, now it could walk me through adding a field from start to finish. Anyways just an idea, I know this is probably a heavy lift, but I think long run stuff like this could make a really big difference and actually act as onboarding for new members on a project or something like that which I think is super duper cool.