This is the basic concept:

I have a tool called cpai you and I built that concatenates a given path (recursively). It also generates a "code tree" (think `tree` but also the classes/functions/methods and parameters in each file). It can output just the code tree or the full selected path.

Sometimes I'll send the code, its docs, and test failures to an ai along with a set of instructions. Generally, I manually assemble these by pasting things together. It's a little unwieldy because they're huge outputs. 

What I want to do is have a method for just sending this straight to an AI via api, but I'd like to make it even more convenient than that by creating a file that looks like this:

```markdown
# mypromptscript.ps.md

This is my prompt and here's the instructions I am providing:

1. Do this
2. Then this
3. Then this

In order for you to do this, I am including the code's docs, a tree showing the codebase structure and function calls within the system, a relevant portion of the code, and the failing tests.

--- DOCS ---

@cmd[cpai docs/architecture]

--- CODE TREE ---

@cmd[cpai src --tree]

--- RELEVANT CODE ---

@cmd[cpai src/server]
@cmd[cpai src/core]
@cmd[cpai src/types]

--- RELEVANT TESTS ---

@cmd[cpai src/__tests__/server

--- TEST FAILURES ---

@cmd[npm test]
```

There's a tool that will just compile that to a markdown file

```bash
ps mypromptscript.ps.md
```

you can also take that file and send it directly to specific ai apis, including requesting multiple iterations of replies from the same model:

```bash
oneshot [model] mypromptscript.md --iterations 3
```

Or you can send specific additional prompts for each variation:

```bash
oneshot [model] mypromptscript.md --variations ["Evaluate the following from your perspective as a system architect", "Evaluate the following from your perspective as a data engineer", "Evaluate the following from your perspective as a UX designer"]
```

Or have a very simple yaml file where you provide a definitions file for prompts variations:

```yaml
architect: "Evaluate this from the perspective of a system architect"
data-engineer: "Evaluate this from the perspective of a data engineer"
ux-designer: "Evaluate this from the perspective of a UX designer"
```


```bash
oneshot [model] mypromptscript.md --variations roles.yaml
```

Or you can do this which does the `ps` concatenation and oneshot api call in one move:

```bash
oneshotcat mypromptscript.ps.md
```

And you can ultimately chain them, which appends the result of the first command to the first parameter, with `secondprompt.md` being something like: 

> "review these three responses from different perspectives. identify common themes, points of dissonance, and a recommended path which balances pragmatism, keeping in mind this is one developer, one server rather than enterprise software"

```bash
oneshot [model] mypromptscript.md --variations roles.yaml | oneshot [model] secondprompt.md 
```

(any place you have a file you could also just do this straight from the command line in quotes)