---
schema_version: 1
revision: "22ce5d34dbcb5a78"
id: "factory-tools-prompt-tooling"
title: "Prompt composing (prompt-builder)"
---

# Prompt composing (prompt-builder)

Tool roles, alternatives, selection tradeoffs, and compatibility caveats.

## Prompt composing (prompt-builder)

**John uses:** [prompt-builder](https://github.com/johnlindquist/prompt-builder) (`p`, MIT) — a Rust/Ratatui TUI that gives the prompt its own tool before any agent launches: skills lookup (`$`), file search (`@`), cross-session history (`Ctrl+R`, shared with Codex's history.jsonl), then launches pi/Codex/Claude via `targets.toml` — or hands the prompt as the final argv element to *any* command (`--handoff-command`), which is the bridge to mdflow.

Nothing public replicates this exact "compose-then-launch-any-agent" TUI; these cover its axes:

| Alternative | What it is | How it differs | License |
|----|----|----|----|
| [fabric](https://github.com/danielmiessler/Fabric) | Open-source framework with a crowdsourced library of reusable AI prompts ('patterns') runnable from the CLI | Curated prompt library + pipe-friendly CLI rather than an interactive composer; patterns ≈ reusable prompt shapes | MIT |
| [llm (Simon Willison)](https://github.com/simonw/llm) | CLI for any LLM with reusable templates, fragments, logged history in SQLite | Templates + logged/searchable prompt history covers prompt-builder's reuse and history axes, minus the TUI and agent handoff | Apache-2.0 |
| [aichat](https://github.com/sigoden/aichat) | All-in-one LLM CLI: Shell Assistant, chat REPL, roles, sessions, RAG, macros | Roles/sessions give reusable prompt setups; REPL-centric rather than compose-then-launch; check current repository activity | Apache-2.0 |
| [espanso](https://github.com/espanso/espanso) | Privacy-first cross-platform text expander in Rust | System-wide snippet expansion — the low-tech way to get instant prompt scaffolds in ANY agent's input box | GPL-3.0 |
| [promptfoo](https://github.com/promptfoo/promptfoo) | Test/eval harness for prompts, agents, and RAGs with declarative configs | Adjacent, not a composer: it evaluates prompt variants — pairs well with a this-or-that habit | MIT |

### Pick this if…

- **fabric** — you want a library of proven prompt shapes runnable from the shell.
- **llm** — you want reusable templates plus searchable prompt history (the SQLite log is the killer feature).
- **espanso** — you just want instant prompt scaffolds in *any* input box, agents included.
- **aichat** — you want roles/sessions in a REPL rather than compose-then-launch.
- **promptfoo** — you're past composing and want to *measure* prompt variants.
- Or steal the pattern cheaply: a zsh function + `$EDITOR` tempfile + `"$(cat file)"` into your agent is 70% of `p`.

## Original references

- [Tool comparison reference](https://dewy-sleet-n5zs.here.now/#prompt-tooling)
