diff --git a/README.md b/README.md index 2eef86c..f4f2d83 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,6 @@ OLLIE_KIRO_TOKEN=... # bearer token or sqlite:// path (auto-detected f OLLIE_MODEL=qwen/qwen3-235b-a22b OLLIE_TOOLS_PATH=~/.config/ollie/tools # directory for tool scripts ({tool} steps) OLLIE_MEMORY_PATH=~/.config/ollie/memory # directory for memory files (ollie/m) -OLLIE_BEADS_ENABLE=0 # set to 0 to use markdown-based plan_* tools instead of beads ``` Shell environment variables take precedence over the env file. diff --git a/doc/help.md b/doc/help.md index b3e0831..b3b74aa 100644 --- a/doc/help.md +++ b/doc/help.md @@ -23,7 +23,6 @@ ollie/ m/ memories (r/w) ls, cat, edit idx memory index (ro) cat p/ prompt templates (ro) ls, cat (rebuilt on new session, /cwd, /agent) - pl/ plans (r/w) ls, cat, edit b/ batch jobs (ephemeral) ls idx job index (ro) cat: id status cwd agent, one per line new create job (r/w) cat: KV template; write spec to submit @@ -97,10 +96,8 @@ OLLIE_MODEL default model name OLLIE mount path (default: ~/mnt/ollie) OLLIE_TOOLS_PATH tool scripts directory (default: ~/.config/ollie/tools) OLLIE_SKILLS_PATH skills directory (default: ~/.config/ollie/skills) -OLLIE_PLAN_PATH plans directory (default: ~/.config/ollie/plans) OLLIE_MEMORY_PATH memory directory (default: ~/.config/ollie/memory) OLLIE_TRANSCRIPT_PATH transcript directory (default: ~/.config/ollie/transcript) -OLLIE_BEADS_ENABLE set to 0 to use markdown-based plan_* tools instead of beads (default: 1) OLLIE_OLLAMA_URL base URL for ollama (default: http://localhost:11434) OLLIE_OPENAI_URL base URL for openai-compatible backends diff --git a/prompts/06_tool-plan.md b/prompts/06_tool-plan.md deleted file mode 100644 index 6ad7790..0000000 --- a/prompts/06_tool-plan.md +++ /dev/null @@ -1,69 +0,0 @@ -# Task Planning - -**Never write plans as inline markdown in chat.** Plans always go to an external store — either beads (`bd`) or the plan files under `{{.OllieMountPath}}/pl/`. Writing a checklist in your response is not a plan. - -Plans are markdown checklists living under `{{.OllieMountPath}}/pl/`. Use the four plan tools below in order. - ---- - -## plan_create - -Create a new plan as an ordered checklist, tagged `__todo`. - -**Trigger condition**: the user asks you to do something with three or more distinct steps, or work spans multiple files or phases. - -**Calling convention**: -``` -execute_code: steps=[{tool: "plan_create", args: ["", "", "", ...]}] -``` - -**Returns**: plan filename (in `pl/`). - -**Constraints**: at least one task required; do not plan single-step tasks. - ---- - -## plan_start - -Mark a plan as in-progress by renaming its tag from `__todo` to `__wip`. - -**Trigger condition**: immediately before beginning work on a `__todo` plan. - -**Calling convention**: -``` -execute_code: steps=[{tool: "plan_start", args: [""]}] -``` - -**Returns**: new filename (tagged `__wip`). Errors if plan is not tagged `__todo`. - ---- - -## plan_check - -Mark a single task complete (`- [ ]` → `- [x]`). - -**Trigger condition**: call once per completed task, repeating until all tasks are done — then call `plan_finish`. Do not batch; mark each task done before starting the next. - -**Calling convention**: -``` -execute_code: steps=[{tool: "plan_check", args: ["", ""]}] -``` - -**Returns**: remaining unchecked tasks, or a prompt to run `plan_finish` if all are done. Errors if no unchecked task matches the substring. - ---- - -## plan_finish - -Close a plan by renaming its tag from `__wip` to `__done`. - -**Trigger condition**: after all tasks have been checked with `plan_check`. - -**Calling convention**: -``` -execute_code: steps=[{tool: "plan_finish", args: [""]}] -``` - -**Returns**: new filename (tagged `__done`). **Errors if any `- [ ]` tasks remain** — all tasks must be checked before a plan can be finished. - -**Constraints**: never call `plan_finish` while tasks remain unchecked; complete them first with `plan_check`. diff --git a/tools/plan_check b/tools/plan_check deleted file mode 100755 index 54b7387..0000000 --- a/tools/plan_check +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 -# description: Mark a plan task complete - [ ] -> - [x]; outputs remaining tasks -# Args: -import sys, os, re - -if len(sys.argv) < 3: - print("usage: plan_check ") - sys.exit(1) - -import shutil -def _find_beads(): - d = os.getcwd() - while d != os.path.dirname(d) and os.path.exists(os.path.join(d, '.git')): - if os.path.isdir(os.path.join(d, '.beads')): - return True - d = os.path.dirname(d) - return False -if os.environ.get('OLLIE_BEADS_ENABLE', '1') != '0' and shutil.which('bd') and _find_beads(): - print("error: beads is available — use 'bd' for planning instead of plan_check", file=sys.stderr) - sys.exit(2) - -ollie = os.environ.get('OLLIE', os.path.expanduser('~/mnt/ollie')) -plan_dir = os.path.join(ollie, 'pl') -filepath = os.path.join(plan_dir, os.path.basename(sys.argv[1])) -substring = sys.argv[2].lower() - -if not os.path.exists(filepath): - print(f"error: plan not found: {os.path.basename(filepath)}") - sys.exit(1) - -with open(filepath) as f: - lines = f.readlines() - -matched = False -for i, line in enumerate(lines): - if re.match(r'^- \[ \] ', line) and substring in line.lower(): - lines[i] = line.replace('- [ ] ', '- [x] ', 1) - matched = True - break - -if not matched: - print(f"error: no unchecked task matching {sys.argv[2]!r}") - sys.exit(1) - -with open(filepath, 'w') as f: - f.writelines(lines) - -remaining = [line[6:].strip() for line in lines if re.match(r'^- \[ \] ', line)] -if remaining: - print('\n'.join(f'- [ ] {s}' for s in remaining)) -else: - print('all tasks checked; run plan_finish to close the plan') diff --git a/tools/plan_create b/tools/plan_create deleted file mode 100755 index f3bf7d3..0000000 --- a/tools/plan_create +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# description: Create a task plan as a markdown checklist tagged __todo -# Args: [task2] ... -# Output: plan filename in pl/ -set -euo pipefail - -_find_beads() { local d="$PWD"; while [ "$d" != "/" ] && [ -e "$d/.git" ]; do [ -d "$d/.beads" ] && return 0; d="$(dirname "$d")"; done; return 1; } -if [ "${OLLIE_BEADS_ENABLE:-1}" != "0" ] && command -v bd >/dev/null 2>&1 && _find_beads; then - echo "error: beads is available — use 'bd' for planning instead of plan_create" >&2 - exit 2 -fi - -OLLIE="${OLLIE:-$HOME/mnt/ollie}" -PLAN_DIR="$OLLIE/pl" - -if [ $# -lt 2 ]; then - echo "usage: plan_create [task2] ..." - exit 1 -fi - -GOAL="$1"; shift - -[ -d "$PLAN_DIR" ] || { echo "error: plan directory not found: $PLAN_DIR"; exit 1; } - -TIMESTAMP=$(date '+%Y%m%dT%H%M%S') -UID8=$(cat /proc/sys/kernel/random/uuid 2>/dev/null | tr -d '-' | cut -c1-8 \ - || od -A n -t x1 /dev/urandom | tr -d ' \n' | cut -c1-8) -SLUG=$(printf '%s' "$GOAL" \ - | tr '[:upper:]' '[:lower:]' \ - | tr -cs 'a-z0-9' '-' \ - | sed 's/^-//;s/-$//' \ - | cut -c1-48) - -FILENAME="${TIMESTAMP}_${UID8}--${SLUG}__todo.md" -FILEPATH="$PLAN_DIR/$FILENAME" - -{ - printf '# %s\n\n' "$GOAL" - for task in "$@"; do - printf -- '- [ ] %s\n' "$task" - done -} > "$FILEPATH" || { echo "error: failed to write $FILEPATH"; exit 1; } - -echo "$FILENAME" diff --git a/tools/plan_finish b/tools/plan_finish deleted file mode 100755 index 2a5d656..0000000 --- a/tools/plan_finish +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python3 -# description: Close a plan (rename __wip -> __done); fails if any tasks remain unchecked -# Args: -# Output: new filename -import sys, os, re - -if len(sys.argv) < 2: - print("usage: plan_finish ") - sys.exit(1) - -import shutil -def _find_beads(): - d = os.getcwd() - while d != os.path.dirname(d) and os.path.exists(os.path.join(d, '.git')): - if os.path.isdir(os.path.join(d, '.beads')): - return True - d = os.path.dirname(d) - return False -if os.environ.get('OLLIE_BEADS_ENABLE', '1') != '0' and shutil.which('bd') and _find_beads(): - print("error: beads is available — use 'bd' for planning instead of plan_finish", file=sys.stderr) - sys.exit(2) - -ollie = os.environ.get('OLLIE', os.path.expanduser('~/mnt/ollie')) -plan_dir = os.path.join(ollie, 'pl') -filepath = os.path.join(plan_dir, os.path.basename(sys.argv[1])) - -if not os.path.exists(filepath): - print(f"error: plan not found: {os.path.basename(filepath)}") - sys.exit(1) - -if '__wip' not in os.path.basename(filepath): - print(f"error: plan is not tagged __wip: {os.path.basename(filepath)}") - sys.exit(1) - -with open(filepath) as f: - lines = f.readlines() - -remaining = [line[6:].strip() for line in lines if re.match(r'^- \[ \] ', line)] -if remaining: - print("error: all tasks must be completed before finishing the plan. remaining:") - for task in remaining: - print(f" - [ ] {task}") - sys.exit(1) - -newpath = filepath.replace('__wip.md', '__done.md') -os.rename(filepath, newpath) -print(os.path.basename(newpath)) diff --git a/tools/plan_start b/tools/plan_start deleted file mode 100755 index 2080d76..0000000 --- a/tools/plan_start +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# description: Mark a plan as in-progress (rename __todo -> __wip) -# Args: -# Output: new filename -set -euo pipefail - -_find_beads() { local d="$PWD"; while [ "$d" != "/" ] && [ -e "$d/.git" ]; do [ -d "$d/.beads" ] && return 0; d="$(dirname "$d")"; done; return 1; } -if [ "${OLLIE_BEADS_ENABLE:-1}" != "0" ] && command -v bd >/dev/null 2>&1 && _find_beads; then - echo "error: beads is available — use 'bd' for planning instead of plan_start" >&2 - exit 2 -fi - -OLLIE="${OLLIE:-$HOME/mnt/ollie}" -PLAN_DIR="$OLLIE/pl" - -[ $# -eq 1 ] || { echo "usage: plan_start "; exit 1; } - -SRC="$PLAN_DIR/$(basename "$1")" -[ -f "$SRC" ] || { echo "error: plan not found: $(basename "$1")"; exit 1; } - -case "$SRC" in - *__todo.md) ;; - *) echo "error: plan is not tagged __todo: $(basename "$SRC")"; exit 1 ;; -esac - -DST="${SRC/__todo.md/__wip.md}" -mv "$SRC" "$DST" -echo "$(basename "$DST")"