---
schema_version: 1
revision: "22ce5d34dbcb5a78"
id: "factory-prompt-builder-discussion"
title: "Compose the prompt before choosing the agent — discussion and evidence"
---

# Compose the prompt before choosing the agent — discussion and evidence

Detailed companion accounts of concepts, questions, demonstrations, exercises, and unresolved observations.

These are the companion’s accounts of the recorded discussion. Model capabilities, subscription rules, prices, version-specific flags, and predictions are contextual claims, not current guidance. An observed action is not proof that the attempted result succeeded. Distinct answers and uncertainties remain separate.

## Concepts and distinctions

### Prompt-Composing Surface

A dedicated intermediate layer detached from an execution engine, designed to optimize layout composition and metadata handling.

### Instant UI Rendering

Using compiled low-overhead systems languages (e.g., Rust and Ratatui) to avoid initialization latency during high-frequency developer interactions.

### Unified Skill Auto-completion

Normalizing tool call syntax variations across differing third-party agents into a single interactive search component.

### Cross-Model Prompt History

A feature built into custom prompt interfaces allowing developers to navigate and search past prompt records regardless of which LLM agent or target model was queried.

### External GUI Editor Synchronization

Integrating terminal utilities with modern graphical editors (like Zed or VS Code) requires setting process flags such as --wait via the VISUAL or EDITOR environment variables so the shell pauses execution until the file buffer is saved and closed.

### Agentic Engineering / Responsible Vibe Coding

Utilizing AI coding assistants to design and implement software in an unfamiliar language (e.g., Rust) by asking targeted architectural questions about user interfaces, navigation libraries, and potential edge cases instead of letting the AI blindly generate bulk code.

### Zsh Aliases for Agents

Creating prefix-driven keyboard macros or functions (e.g., p-) to inject project-specific context, prompt formatting patterns, or session behaviors immediately into a terminal agent session.

### Conversation Forking/Branching

Dividing an active, long-running agent chat thread into a new independent thread to explore alternative problem variations without corrupting or cluttering the primary context timeline.

### Conversation Compacting

Condensing an extensive agent interaction history into a short summary or structured snapshot before starting a fresh context window to save input tokens and keep responses focused.

### Prompt Builder Context Injection

The technique of running help flags for multiple separate command-line utilities within an agent prompt to automatically populate the context window with complete option schemas.

### Cross-CLI Tool Synthesis

Enabling an AI agent to compose interoperable wrappers or functions (like a Zsh function combining Claude Code and Prompt Builder) by giving it direct access to each tool's interface definition.

### ZSH Wrapper Functions for AI Tools

Writing targeted shell aliases or wrapper commands (e.g., p-pr) that encapsulate multiple specialized flags for AI developer CLI tools, avoiding repetitive typing.

### Markdown Flow Agent Plane

Using structured Markdown files as an active orchestration layout for automated agents, as built into the MDFlow ecosystem.

## Questions and answer status

### How well did you know rust in order to build the prompt builder? Or did you just vibe-code it with AI?

**Status: answered.** John states he only knew Rust from a few introductory examples and had never written serious Rust before. He describes his approach to 'vibe coding' as a responsible way of asking an agent for library recommendations, keyboard navigation handling, and structural architecture rather than just hoping code randomly appears.

### In Claude code is /branch or /fork

**Status: partial.** John mentions that Claude Code has built-in features (like 'by the way') for context isolation, though he does not directly reply to the chat text during the video chunk.

### Please build up a prompt builder that uses Claude code's PR flags and create a ZSH function for it so that I can launch it with P-PR.

**Status: partial.** The agent maps the user's local directory and targets layout to build a tailored wrapper script pattern, executing checks up to the shard boundary.

## Exercises

- **Try:** Configure custom Zsh prefixes or shorthand command aliases in your .zshrc configuration file to quickly spin up, clone, or clean context threads inside CLI-based AI agents.
  **Basis:** Transcript time 02:41:48.250 to 02:42:16.570

- **Try:** Open an interactive agent loop or prompt interface, run the help/documentation commands for two independent CLI tools you use frequently, and ask the agent to construct a unified shell function or shortcut that links their features together seamlessly.
  **Basis:** 02:47:08.000

## Observed actions and statements

These timestamped observations retain troubleshooting detail and the limits of what was visible. Commands mentioned here are observations, not vetted installation instructions; use the topic’s prepared recipes for runnable examples.

- [02:34:33](https://proud-anchor-53zn.here.now/watch.html?t=9273#recording-player) — John discusses the value of building personalized developer tools and workspaces.

- [02:35:02](https://proud-anchor-53zn.here.now/watch.html?t=9302#recording-player) — John shares the link to his repository: https://github.com/johnlindquist/prompt-builder.

- [02:35:45](https://proud-anchor-53zn.here.now/watch.html?t=9345#recording-player) — The reference document displays a table comparing prompt composing tools including Fabric, bis, aichat, espanso, and promptfoo.

- [02:36:05](https://proud-anchor-53zn.here.now/watch.html?t=9365#recording-player) — John inputs the command pi in the terminal to demonstrate its startup delay.

- [02:36:10](https://proud-anchor-53zn.here.now/watch.html?t=9370#recording-player) — John terminates the agent and invokes codex to show the initialization speed of the Rust tool.

- [02:36:13](https://proud-anchor-53zn.here.now/watch.html?t=9373#recording-player) — John terminates the application and runs claude to demonstrate its Bun-based initialization speed.

- [02:36:24](https://proud-anchor-53zn.here.now/watch.html?t=9384#recording-player) — John executes his custom prompt tool, which brings up the prompt-builder TUI instantaneously.

- [02:36:50](https://proud-anchor-53zn.here.now/watch.html?t=9410#recording-player) — John types Oracleandhere-now in the Prompt field to demonstrate the active skills auto-completion pop-up menu.

- [02:37:05](https://proud-anchor-53zn.here.now/watch.html?t=9425#recording-player) — John shifts focus to the conversation Name input field to illustrate naming sessions up front.

- [02:37:30](https://proud-anchor-53zn.here.now/watch.html?t=9450#recording-player) — John interacts with the Target row selection at the bottom to toggle between execution models (pi, codex, claude).

- [02:37:40](https://proud-anchor-53zn.here.now/watch.html?t=9460#recording-player) — John opens the flows menu overlay (Enter flows) in the TUI application.

- [02:38:01](https://proud-anchor-53zn.here.now/watch.html?t=9481#recording-player) — The shard concludes with John detailing how a central TUI removes the need to remember individual CLI flags and parameters.

- [02:38:07](https://proud-anchor-53zn.here.now/watch.html?t=9487#recording-player) — Transcript claim by John Lindquist regarding the purpose of the project allowing prompt history navigation across all models.

- [02:38:10](https://proud-anchor-53zn.here.now/watch.html?t=9490#recording-player) — Visual shows John pressing the up arrow to populate the Prompt area with a past command (move to ./images).

- [02:38:16](https://proud-anchor-53zn.here.now/watch.html?t=9496#recording-player) — Visual shows the TUI switching to a Search history: mockup overlay after pressing Ctrl+R.

- [02:38:36](https://proud-anchor-53zn.here.now/watch.html?t=9516#recording-player) — Visual shows the workspace returning back to the TUI prompt builder, rendering an error label stating -editor: zed returned immediately without changes; GUI editors need a wait flag, e.g. VISUAL="zed --wait";.

- [02:38:52](https://proud-anchor-53zn.here.now/watch.html?t=9532#recording-player) — Transcript claim by John explaining that the external text entry failed because the VISUAL environment variable was not configured to await the GUI editor process properly.

- [02:39:45](https://proud-anchor-53zn.here.now/watch.html?t=9585#recording-player) — Visual shows John scrolling past tables containing alternative prompt composition tools like Fabric, Bim, espanso, aichat, and promptfoo.

- [02:41:14](https://proud-anchor-53zn.here.now/watch.html?t=9674#recording-player) — Transcript claim by John recognizing a participant's phrase and stating "Agentic Engineering is the snobby way of saying it."

- [02:41:55](https://proud-anchor-53zn.here.now/watch.html?t=9715#recording-player) — John types p- and presses Tab in the Zsh prompt, showing completion aliases: p-bird, p-bm, p-c, p-cm, p-cx, p-f, p-fl, p-kx, p-zx.

- [02:42:33](https://proud-anchor-53zn.here.now/watch.html?t=9753#recording-player) — John runs p-c, opening a terminal prompt composition UI overlay with interactive fields (Name, Prompt, and checkboxes).

- [02:44:24](https://proud-anchor-53zn.here.now/watch.html?t=9864#recording-player) — John types which p-zx and p-zx into the terminal prompt to inspect the alias mapping.

- [02:44:30](https://proud-anchor-53zn.here.now/watch.html?t=9870#recording-player) — John types p-bird and which p-bird into the terminal.

- [02:45:08](https://proud-anchor-53zn.here.now/watch.html?t=9908#recording-player) — John triggers an overlay window containing Name and Prompt fields to compose an agent task.

- [02:45:14](https://proud-anchor-53zn.here.now/watch.html?t=9914#recording-player) — John types !claude --help into the Prompt input area.

- [02:45:18](https://proud-anchor-53zn.here.now/watch.html?t=9918#recording-player) — The prompt tool executes the inline shell command, logging pi-cmdr loaded: type ! to open the command picker and planning execution.

- [02:45:24](https://proud-anchor-53zn.here.now/watch.html?t=9924#recording-player) — The terminal prints the end section of the claude --help output.

- [02:45:41](https://proud-anchor-53zn.here.now/watch.html?t=9941#recording-player) — John runs p --help inside the prompt field to feed Prompt Builder's context into the agent session.

- [02:46:15](https://proud-anchor-53zn.here.now/watch.html?t=9975#recording-player) — John scrolls up and clicks to expand the previous tool execution blocks to ensure full help menus are loaded in the viewer.

- [02:47:08](https://proud-anchor-53zn.here.now/watch.html?t=10028#recording-player) — John submits the task asking the agent to build up a prompt builder that uses Claude code's PR flags and create a ZSH function for it.

- [02:47:33](https://proud-anchor-53zn.here.now/watch.html?t=10053#recording-player) — John executes which x (returning exit code 1) and enters a new instruction guiding the agent to ~/.config/zsh.

- [02:47:52](https://proud-anchor-53zn.here.now/watch.html?t=10072#recording-player) — The agent restarts with the updated prompt and reports that it is inspecting the external Zsh configuration.

- [02:47:55](https://proud-anchor-53zn.here.now/watch.html?t=10075#recording-player) — The agent shares its plan to inspect existing p wrappers and style conventions, mentioning Claude's --from-pr flag.

- [02:47:58](https://proud-anchor-53zn.here.now/watch.html?t=10078#recording-player) — The agent runs an automated sequence of commands to inspect ~/.config/zsh and the p target help system.

- [02:48:08](https://proud-anchor-53zn.here.now/watch.html?t=10088#recording-player) — The agent inspects local profiles by executing p target list and p target add --help.

- [02:48:26](https://proud-anchor-53zn.here.now/watch.html?t=10106#recording-player) — Ghostty terminal window displays prompt-builder tool executing tests for resume wrappers.

- [02:48:26](https://proud-anchor-53zn.here.now/watch.html?t=10106#recording-player) — John recommends building personal ZSH functions or scripts to encapsulate tool configurations.

- [02:48:35](https://proud-anchor-53zn.here.now/watch.html?t=10115#recording-player) — The prompt builder updates targets.toml adding the claude-pr profile configuration.

- [02:48:50](https://proud-anchor-53zn.here.now/watch.html?t=10130#recording-player) — The prompt builder system outputs text showing it has written the ZSH wrapper script to ~/.config/zsh/conf.d/44-ai-claude-pr-dsl.zsh.

- [02:50:00](https://proud-anchor-53zn.here.now/watch.html?t=10200#recording-player) — John runs the ghv alias which opens the Chrome browser directly onto the mdflow repository on GitHub.

- [02:50:31](https://proud-anchor-53zn.here.now/watch.html?t=10231#recording-player) — John runs the new wrapper command p-pr 24 in his terminal.

### Unresolved: Exact keystrokes or string used to open prompt-builder tool at 02:36:24.

The interface switch occurs in a single frame update, hiding any prior input command typed into the shell.

**Discriminating evidence:** Consult the user's open-source dotfiles repository or global keybindings.

### Unresolved: The exact configuration variable syntax John intends to append next to resolve the Zed process wait issue.

The prompt tool only prints a diagnostic hint on the screen; John describes the bug orally but defers editing his profile configurations or setting the exact variable during the shard.

**Discriminating evidence:** Wait for subsequent segments where terminal shell profiles or workspace configuration files are altered.

### Unresolved: Exact definition and logic for all experimental prompt builder shortcuts (p-zx, p-bird, p-bm).

John notes that these are experimental or need a 'cleanup pass' and does not successfully run or explain them all.

**Discriminating evidence:** Can be verified in subsequent configuration or script walkthrough shards.

### Demonstration detail: 02:36:05

- Tested loading performance for terminal agents pi, codex, and claude inside the mdflow project directory.
- Opened custom prompt-builder terminal user interface.
- Demonstrated dropdown autocompletion for conversation skill definitions using token syntax.
- Interacted with input fields for target applications and workflow options.

**Tools observed:** Pi CLI, OpenAI Codex CLI, Claude Code, Prompt Builder TUI.

**Command or prompt observations (not a verified recipe):**

```text
pi
codex
claude
```

### Demonstration detail: 02:38:01

- Demonstrating prompt history by pressing up arrow in custom TUI prompt builder
- Searching past prompts using Ctrl+R search history overlay
- Launching external Zed editor to write prompt text
- Observing process exit error due to lack of zed --wait flag setup
- Manually typing placeholder text into the prompt input

**Tools observed:** mdflow, Zed editor.

### Demonstration detail: 02:39:36

- Opening Google Chrome browser to view documentation
- Navigating from Agentic Software Factory index page to prompt-builder section
- Scrolling through prompt-builder CLI usage instructions, installation commands, and targets configuration format

**Tools observed:** Google Chrome.

**Command or prompt observations (not a verified recipe):**

```text
cargo install --git https://github.com/johnlindquist/prompt-builder.git --locked
prompt-builder --dry-run --print-command "hello"
prompt-builder target list
```

### Demonstration detail: 02:41:55

- Triggered Zsh autocomplete options via tab on prefix p-
- Executed p-c command to launch terminal-based prompt overlay surface
- Inspected script path routing via which command calls for p-zx and p-bird

**Tools observed:** Ghostty, Zsh, Claude Code.

**Command or prompt observations (not a verified recipe):**

```text
p-c
which p-zx
which p-bird
```

### Demonstration detail: 02:45:08

- Opened task overlay wizard from the command picker tool.
- Executed help flags for Claude and Prompt Builder to feed tool descriptions into context.
- Authored a prompt to synthesize a hybrid Zsh function named p-pr.
- Aborted execution and redirected the agent to search local Zsh files.
- Observed automated file exploration and config analysis performed by the agent.

**Tools observed:** Ghostty, Prompt Builder CLI, Claude Code.

**Command or prompt observations (not a verified recipe):**

```text
!claude --help
p --help
which x
p target list
```

### Demonstration detail: 02:48:26

- Automated generation of ZSH targets and file outputs via the prompt builder engine.

**Tools observed:** Ghostty, Prompt Builder CLI.

### Demonstration detail: 02:49:33

- Checking repo via terminal, running the repo browser lookup command, and execution of pull request targeting.

**Tools observed:** GitHub CLI, Google Chrome.

**Command or prompt observations (not a verified recipe):**

```text
ghv
p-pr 24
```

## Original references

- [Published evidence reference](https://proud-anchor-53zn.here.now/resource-manifest.json)
- [Recorded discussion](https://proud-anchor-53zn.here.now/watch.html)
