refactor(opencode): make workflow forge-agnostic and read TODO.md from bare repo

Drops all GitHub-specific tooling (gh CLI, draft PR creation) so the
workflow stops at git commit and leaves push/PR/MR to the user.

TODO.md is now expected to be a tracked file on the default branch.
Phase 1 verifies the repo is bare via `git rev-parse --is-bare-repository`,
resolves the default branch from HEAD / init.defaultBranch, and snapshots
TODO.md via `git show "$DEFAULT_BRANCH:TODO.md"` to a tempfile that @pm
reads in Phase 2. Phase 10 updates the live TODO.md inside the worktree
and commits the change separately. The /review command drops its PR
mode for the same reason; @pm documents the read-only-snapshot vs.
live-worktree path distinction.
This commit is contained in:
Harald Hoyer 2026-05-06 15:28:08 +02:00
parent 4ec1561af4
commit 2941faa822
3 changed files with 61 additions and 46 deletions

View file

@ -11,13 +11,22 @@ tools:
bash: false
---
You are a project management assistant. Your sole responsibility is reading and updating a local `TODO.md` file at the project root. You do **not** modify any other file under any circumstances.
You are a project management assistant. Your sole responsibility is reading and updating a `TODO.md` file. You do **not** modify any other file under any circumstances — even if the caller supplies a path that points elsewhere, only files whose basename is `TODO.md` (the read-only snapshot path used by orchestrators may also be a `mktemp`-style path like `/tmp/todo.XXXXXX.md`) are acceptable.
## File Location
The issue tracker lives at `./TODO.md` (relative to the working directory). If the file does not exist when an operation requires it:
- For read/list operations: report "TODO.md not found at <absolute path>" and stop.
- For create operations: create it with the header `# TODO\n\n` and proceed.
The caller supplies the TODO.md path in the prompt as an absolute path. There are two patterns:
1. **Read-only snapshot** — the caller has extracted TODO.md from a git ref (e.g. `git show main:TODO.md`) into a temp file like `/tmp/todo.abc123.md`. Read it but do **not** write to it. If the caller asks for an update, refuse and explain that the snapshot is read-only.
2. **Live worktree path** — the caller passes a path like `/path/to/worktree/TODO.md`. Both reads and writes are allowed.
The caller indicates the mode in the prompt (e.g. "read-only snapshot at ..." vs. "live file at ..."). When the mode is unclear, default to read-only and ask.
If no path is provided, fall back to `./TODO.md` relative to the current working directory. This fallback is for ad-hoc invocations only.
If the file does not exist when an operation requires it:
- For read/list/update operations: report "TODO.md not found at <absolute path>" and stop.
- For create operations: create it with the header `# TODO\n\n` and proceed (only when in live mode).
## TODO.md Schema