From 1a01002f7bf20d44b0f86931758bba2b3dddcfec Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sun, 26 Apr 2026 09:00:54 +0200 Subject: [PATCH] planning: observe step, task dispatcher, tool parallel annotations, graceful degradation - agents: agentSpawn uses 'task prime', postTurn uses 'task list' (observe step) - scripts/x/task: dispatcher routes to bd (beads) or todo.sh based on availability - prompts/tools-todosh.md: prime context for todo.sh fallback - tools: add '# ollie:parallel read' annotation to file_read, file_glob, file_grep, file_grep, memory_recall, reasoning_think, denote_view - core: update submodule ref Co-Authored-By: Claude Sonnet 4.6 --- agents/coding.json | 6 +++--- agents/default.json | 4 ++-- agents/devops.json | 4 ++-- agents/greybeard.json | 4 ++-- agents/qa.json | 4 ++-- agents/reviewer.json | 4 ++-- agents/writer.json | 4 ++-- core | 2 +- prompts/tools-todosh.md | 32 ++++++++++++++++++++++++++++++++ scripts/x/task | 26 ++++++++++++++++++++++++++ tools/denote_view | 1 + tools/file_glob | 1 + tools/file_grep | 1 + tools/file_read | 1 + tools/memory_recall | 1 + tools/reasoning_think | 1 + 16 files changed, 80 insertions(+), 16 deletions(-) create mode 100644 prompts/tools-todosh.md create mode 100755 scripts/x/task diff --git a/agents/coding.json b/agents/coding.json index 5d41520..74dcffd 100644 --- a/agents/coding.json +++ b/agents/coding.json @@ -1,5 +1,5 @@ { - "prompt": "You are a coding agent.\n\n# Code modification\n\n- Never modify code you haven't read. Read the file first, understand the context, then change it.\n- When modifying a file, also read files it imports or depends on, and files that depend on it.\n- When asked to understand or explain code, explore broadly — enumerate source files, read all relevant files, don't stop at entry points or documentation.\n- Reference specific code locations as `file_path:line_number`.\n\n# Discipline\n\n- Only make changes that are directly requested or clearly necessary.\n- Don't add features, refactor code, or make improvements beyond what was asked.\n- Don't add error handling for scenarios that can't happen. Trust internal code; only validate at system boundaries.\n- Don't create abstractions for one-time operations. Three similar lines is better than a premature abstraction.\n- Don't add docstrings, comments, or type annotations to code you didn't change.\n- If something is unused after your changes, delete it completely. No backwards-compatibility hacks, no `// removed` comments.\n- Never create files unless necessary for the task. Prefer editing existing files.\n\n# Good output\n\n- Code you produce should compile and, where applicable, pass existing tests without modification.\n- Changes should be minimal and surgical — a diff that is hard to argue with.\n- If you are uncertain whether a change is correct, say so explicitly rather than committing to a guess.\n\n# Security\n\n- Do not introduce security vulnerabilities: command injection, XSS, SQL injection, path traversal, etc.\n- If you notice insecure code you wrote, fix it immediately.", + "prompt": "You are a coding agent.\n\n# Code modification\n\n- Never modify code you haven't read. Read the file first, understand the context, then change it.\n- When modifying a file, also read files it imports or depends on, and files that depend on it.\n- When asked to understand or explain code, explore broadly \u2014 enumerate source files, read all relevant files, don't stop at entry points or documentation.\n- Reference specific code locations as `file_path:line_number`.\n\n# Discipline\n\n- Only make changes that are directly requested or clearly necessary.\n- Don't add features, refactor code, or make improvements beyond what was asked.\n- Don't add error handling for scenarios that can't happen. Trust internal code; only validate at system boundaries.\n- Don't create abstractions for one-time operations. Three similar lines is better than a premature abstraction.\n- Don't add docstrings, comments, or type annotations to code you didn't change.\n- If something is unused after your changes, delete it completely. No backwards-compatibility hacks, no `// removed` comments.\n- Never create files unless necessary for the task. Prefer editing existing files.\n\n# Good output\n\n- Code you produce should compile and, where applicable, pass existing tests without modification.\n- Changes should be minimal and surgical \u2014 a diff that is hard to argue with.\n- If you are uncertain whether a change is correct, say so explicitly rather than committing to a guess.\n\n# Security\n\n- Do not introduce security vulnerabilities: command injection, XSS, SQL injection, path traversal, etc.\n- If you notice insecure code you wrote, fix it immediately.", "mcpServers": { "superpowers-mcp-server": { "command": "superpowers-mcp-server", @@ -15,7 +15,7 @@ ], "hooks": { "agentSpawn": [ - "bd prime 2>/dev/null || true", + "task prime 2>/dev/null || true", "$OLLIE/x/elevate-adapter-start 2>/dev/null || true", "$OLLIE/x/prime tools-file", "$OLLIE/x/prime tools-reasoning", @@ -27,7 +27,7 @@ "true" ], "postTurn": [ - "true" + "task list 2>/dev/null || true" ] } } diff --git a/agents/default.json b/agents/default.json index e19fa36..bec098c 100644 --- a/agents/default.json +++ b/agents/default.json @@ -4,7 +4,7 @@ ], "hooks": { "agentSpawn": [ - "bd prime 2>/dev/null || true", + "task prime 2>/dev/null || true", "$OLLIE/x/elevate-adapter-start 2>/dev/null || true", "$OLLIE/x/prime tools-file", "$OLLIE/x/prime tools-reasoning", @@ -15,7 +15,7 @@ "true" ], "postTurn": [ - "true" + "task list 2>/dev/null || true" ] } } diff --git a/agents/devops.json b/agents/devops.json index 75e9f9c..d9fc587 100644 --- a/agents/devops.json +++ b/agents/devops.json @@ -5,7 +5,7 @@ ], "hooks": { "agentSpawn": [ - "bd prime 2>/dev/null || true", + "task prime 2>/dev/null || true", "$OLLIE/x/elevate-adapter-start 2>/dev/null || true", "$OLLIE/x/prime tools-file", "$OLLIE/x/prime tools-reasoning", @@ -17,7 +17,7 @@ "true" ], "postTurn": [ - "true" + "task list 2>/dev/null || true" ] } } diff --git a/agents/greybeard.json b/agents/greybeard.json index 8dbc47a..59f28c2 100644 --- a/agents/greybeard.json +++ b/agents/greybeard.json @@ -5,7 +5,7 @@ ], "hooks": { "agentSpawn": [ - "bd prime 2>/dev/null || true", + "task prime 2>/dev/null || true", "$OLLIE/x/elevate-adapter-start 2>/dev/null || true", "$OLLIE/x/prime tools-file", "$OLLIE/x/prime tools-reasoning", @@ -16,7 +16,7 @@ "true" ], "postTurn": [ - "true" + "task list 2>/dev/null || true" ] } } diff --git a/agents/qa.json b/agents/qa.json index e1b8dca..405dd76 100644 --- a/agents/qa.json +++ b/agents/qa.json @@ -5,7 +5,7 @@ ], "hooks": { "agentSpawn": [ - "bd prime 2>/dev/null || true", + "task prime 2>/dev/null || true", "$OLLIE/x/elevate-adapter-start 2>/dev/null || true", "$OLLIE/x/prime tools-file", "$OLLIE/x/prime tools-reasoning", @@ -16,7 +16,7 @@ "true" ], "postTurn": [ - "true" + "task list 2>/dev/null || true" ] } } diff --git a/agents/reviewer.json b/agents/reviewer.json index 1f3e57a..ac110f8 100644 --- a/agents/reviewer.json +++ b/agents/reviewer.json @@ -5,7 +5,7 @@ ], "hooks": { "agentSpawn": [ - "bd prime 2>/dev/null || true", + "task prime 2>/dev/null || true", "$OLLIE/x/elevate-adapter-start 2>/dev/null || true", "$OLLIE/x/prime tools-file", "$OLLIE/x/prime tools-reasoning", @@ -16,7 +16,7 @@ "true" ], "postTurn": [ - "true" + "task list 2>/dev/null || true" ] } } diff --git a/agents/writer.json b/agents/writer.json index dd6d825..f16b49d 100644 --- a/agents/writer.json +++ b/agents/writer.json @@ -5,7 +5,7 @@ ], "hooks": { "agentSpawn": [ - "bd prime 2>/dev/null || true", + "task prime 2>/dev/null || true", "$OLLIE/x/elevate-adapter-start 2>/dev/null || true", "$OLLIE/x/prime tools-file", "$OLLIE/x/prime tools-reasoning", @@ -16,7 +16,7 @@ "true" ], "postTurn": [ - "true" + "task list 2>/dev/null || true" ] } } diff --git a/core b/core index 77dd5c6..6abf0cd 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 77dd5c6168e16a4e070d59715ffefc1d523d702e +Subproject commit 6abf0cdb3d27a7728cc3156f4a80b52e0d6f8978 diff --git a/prompts/tools-todosh.md b/prompts/tools-todosh.md new file mode 100644 index 0000000..43722f8 --- /dev/null +++ b/prompts/tools-todosh.md @@ -0,0 +1,32 @@ +# Task Tracking (todo.sh) + +No `.beads` directory found. Task tracking is available via `todo.sh`. + +todo.sh uses a plain-text `todo.txt` file. Tasks are numbered lines; numbers +shift after deletions, so always re-list before referencing by number. + +## Core commands + +| Command | Effect | +|---|---| +| `todo.sh add "TASK +project @context"` | Add a task | +| `todo.sh list [TERM]` | List open tasks (optionally filtered) | +| `todo.sh listall [TERM]` | List all tasks including done | +| `todo.sh do NR` | Mark task NR complete | +| `todo.sh del NR` | Delete task NR | +| `todo.sh pri NR A` | Set priority A–Z on task NR | +| `todo.sh append NR "TEXT"` | Append text to task NR | +| `todo.sh replace NR "NEW TEXT"` | Replace task NR entirely | + +## Conventions + +- `+project` tags group related tasks +- `@context` tags indicate where/how (e.g. `@code`, `@review`, `@shell`) +- Priority `(A)` is highest; unprioritised tasks sort below all lettered ones + +## Session close protocol + +Before ending the session, mark completed tasks done: +``` +todo.sh do NR +``` diff --git a/scripts/x/task b/scripts/x/task new file mode 100755 index 0000000..00005ee --- /dev/null +++ b/scripts/x/task @@ -0,0 +1,26 @@ +#!/bin/bash +# Task dispatcher: routes to bd (beads) or todo.sh depending on availability. +# Usage: task prime | task list + +cmd="${1:-list}" + +dir="$PWD" +while [ "$dir" != "/" ]; do + if [ -d "$dir/.beads" ]; then + case "$cmd" in + prime) exec bd prime ;; + list) exec bd list --status open ;; + esac + fi + [ ! -e "$dir/.git" ] && break + dir="$(dirname "$dir")" +done + +if command -v todo.sh >/dev/null 2>&1; then + case "$cmd" in + prime) exec prime tools-todosh ;; + list) exec todo.sh list ;; + esac +fi + +exit 0 diff --git a/tools/denote_view b/tools/denote_view index d6ea417..7516496 100755 --- a/tools/denote_view +++ b/tools/denote_view @@ -1,4 +1,5 @@ #!/bin/bash +# ollie:parallel read # capabilities: agent-kb # description: View a denote document by identifier # Usage: view_denote.sh --id diff --git a/tools/file_glob b/tools/file_glob index d5b3dd1..6a879b3 100755 --- a/tools/file_glob +++ b/tools/file_glob @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# ollie:parallel read # description: Find files by name/path pattern, sorted by modification time (newest first) # Args: [path] diff --git a/tools/file_grep b/tools/file_grep index 7599058..289cbfc 100755 --- a/tools/file_grep +++ b/tools/file_grep @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# ollie:parallel read # description: Search file contents using ripgrep # Args: [--path=] [--mode=files_with_matches|content|count] [--glob=] [--type=] [-i] [-n] [-A ] [-B ] [-C ] [--multiline] [--head=] [--offset=] diff --git a/tools/file_read b/tools/file_read index 83eb53d..d5569b6 100755 --- a/tools/file_read +++ b/tools/file_read @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# ollie:parallel read # description: Read a file from the local filesystem with optional offset and line limit # Args: [offset] [limit] diff --git a/tools/memory_recall b/tools/memory_recall index 7d0d780..653fd2c 100755 --- a/tools/memory_recall +++ b/tools/memory_recall @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# ollie:parallel read # description: Search memories by keyword, tag, or title # Args: diff --git a/tools/reasoning_think b/tools/reasoning_think index 04366d4..4dd7e59 100755 --- a/tools/reasoning_think +++ b/tools/reasoning_think @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# ollie:parallel read # description: Internal reasoning scratchpad; think through complex problems before acting # Args: