This folder contains reusable prompt files, a workflow library, and manifest scripts for agent-driven repository maintenance.
prompt/
├── lib.sh ← library: render_prompt + exec_prompt
├── builder/
│ ├── agent.sh ← default workflow manifest
│ ├── resolve-todo.md ← prompt: resolve todo items
│ ├── planner.md ← prompt: refine todo plans
│ ├── simplify-and-refactor.md ← prompt: cleanup pass
│ └── stage-and-commit.md ← prompt: stage and commit
├── AGENTS.md ← todo-file format rules
├── todo.md ← active work queue
├── done.md ← completed work archive
└── README.md
A manifest is a bash script that sources lib.sh and calls two primitives:
render_prompt <path> [KEY=VAL ...]— read a prompt file, replace{{KEY}}placeholders, print to stdout.exec_prompt <text> <cli> <yolo>— execute rendered prompt text via the selected CLI.
cli is codex or claude. yolo is true or false, controlling
whether the CLI runs with full auto-approval flags.
# Default workflow (resolve → commit → cleanup → commit)
bash prompt/builder/agent.sh
# With custom variables
bash prompt/builder/agent.sh TODO_FILES=prompt/todo.md ITERS=10 CLI=claude
# Write your own manifest
bash my-workflow.sh TODO_FILES=my-todo.md ITERS=5#!/usr/bin/env bash
# my-workflow.sh
set -euo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/../lib.sh" # or wherever lib.sh lives
TODO_FILES="${TODO_FILES:-prompt/todo.md}"
ITERS="${ITERS:-30}"
CLI="${CLI:-codex}"
for ((i = 0; i < ITERS; i++)); do
exec_prompt "$(render_prompt builder/resolve-todo.md "TODO_FILES=$TODO_FILES")" "$CLI" false
exec_prompt "$(render_prompt builder/stage-and-commit.md)" "$CLI" false
done- Keep prompt files in
builder/. They use{{PLACEHOLDER}}syntax for template variables. lib.shis the only file that hardcodes CLI flags. When a CLI adds a new flag, updateexec_promptthere.- Write manifest scripts as plain bash. They are Turing-complete by virtue of being bash — loops, conditionals, functions are all available.
- Update this README when the file layout changes.