diff --git a/prompts/22_implement-prompt-log-commands.md b/prompts/22_implement-prompt-log-commands.md index b98957b..9fb9126 100644 --- a/prompts/22_implement-prompt-log-commands.md +++ b/prompts/22_implement-prompt-log-commands.md @@ -7,11 +7,11 @@ input_tokens: output_tokens: --- -# Run 22 +# Implement prompt log commands -Note: @Clanker refers to the "ai agent" (you) who is working on this task. +Note: @Clanker refers to the "ai agent" (you) who is working on this prompt. -@Clanker when working on this task, make sure to: +@Clanker when working on this prompt, make sure to: - Read context and task section first - Prepare a list of todos @@ -29,21 +29,13 @@ Instead of storing the prompts in the `prompts` folder I would like to store the ### Design decisions -These are settled and should be implemented as-is, not re-decided: +Settled points that aren't otherwise spelled out in the Commands section below: -- **Branch access:** all commands operate on the `prompt-log` branch via a dedicated `git worktree` (e.g. sibling directory `../.prompt-log-worktree`), never via `git checkout` on the main working tree. Add a shared helper (e.g. `prompt-log-worktree-dir`) that resolves this path and creates the worktree on demand if missing. -- **Commit reference:** `store-prompt` simply uses `git rev-parse --short HEAD` at the time it runs — no dirty-tree check, no auto-commit. If the user runs it before committing their code, that's on them. -- **Commit hash for updates:** `edit-prompt` writes the resolved commit hash into `prompt.md`'s own frontmatter (a new field, e.g. `prompt_log_commit`) instead of an env var or dotfile. `store-prompt` reads this frontmatter field to decide whether to create vs. update an entry, and clears it after a successful update. -- **Hash format:** use git's default abbreviated hash (`git rev-parse --short`, currently 7 chars) everywhere — filenames, `list-prompts` output, and prefix lookups. Lookups must error clearly if a prefix matches more than one file. -- **Command naming:** the canonical name is `convert-prompts-folder-to-prompt-log` (used consistently in the Commands section and the Test section below). -- **`list-prompts` date column:** shows each file's first-commit date on the `prompt-log` branch (via `git log --follow --format=%aI -- | tail -1`), not the frontmatter `date_completed`. Rows are sorted by this date. -- **Push failures:** if pushing `prompt-log` fails (e.g. no `origin` configured), print a warning and continue — do not fail the command, since the local commit already succeeded. -- **`convert-prompts-folder-to-prompt-log` cleanup:** after all files are successfully migrated, delete the old `prompts/` folder and its files. -- **`create-prompt` overwrite behavior:** always overwrites `prompt.md` silently, even if an unstored prompt already exists there. -- **Clipboard copy:** drop the clipboard-copy step from `create-prompt` entirely — it copied the old numbered file path, which added no value once the path is always `prompt.md`. -- **Optional directory argument:** repurpose the existing optional argument (previously "look in `/prompts`") to mean "operate on a different git repository." When given, resolve the worktree, branch, and `prompt.md` relative to that repository's path instead of the current one. Apply this consistently across `create-prompt`, `prompt-with-pi`, `store-prompt`, `list-prompts`, and `edit-prompt`. -- **Session token/model capture:** out of scope for this task. Frontmatter fields `model`, `input_tokens`, `output_tokens` remain manually filled in for now. -- **`prompt.md.template`:** since there's no more numbering, remove the `${PROMPT_ID}` placeholder from the template and stop `create-prompt` from exporting `PROMPT_ID`. Add the new `prompt_log_commit` frontmatter field (empty by default). +- **Worktree lifecycle:** every command assumes the `prompt-log` git worktree exists and creates it on demand (same logic as `init-prompt-log`) if it doesn't — don't require the user to run `init-prompt-log` first every time. +- **Clipboard copy:** the clipboard-copy step in the current `create-prompt` is dropped entirely, not carried over. +- **`repo-path` argument:** wherever `[repo-path]` appears below, it means "operate on a different git repository" (worktree, branch, and `prompt.md` resolved relative to that path) — applied consistently, not just where spelled out under `create-prompt`. +- **`prompt.md.template`:** remove the `${PROMPT_ID}` placeholder (no more numbering) and stop `create-prompt` from exporting `PROMPT_ID`; add the new `prompt_log_commit` frontmatter field, empty by default. +- **Session token/model capture:** out of scope for this task — `model`, `input_tokens`, `output_tokens` stay manually filled in. ### Commands @@ -129,4 +121,4 @@ task convert-prompts-folder-to-prompt-log @Clanker Add a summary here once the task has been completed. -@Clanker Set frontmatter state to completed and update date and model. If you have access to session info also add token count. \ No newline at end of file +@Clanker Set frontmatter state to completed and update date and model. If you have access to session info also add token count.