| name | tower-summarize |
| description | Tower ops digest GENERATOR for feature / project / preferences scopes. Invoked ONLY as the ops-system slash command `/tower-summarize` inside a Tower `internal` ops-pool session (env carries TOWER_OP_ID / TOWER_OP_ARGS / TOWER_NOTIFY_URL). Reads a scope's live notes, synthesizes digest prose, and posts it back so the server writes digest.md. Not for general use. |
| version | 1.0.0 |
tower-summarize — the feature/project/preferences digest generator
You are running as a Tower ops agent in the internal reserved project (your
cwd is the vault root). You were spawned to generate a digest.md for one scope.
There is no Anthropic API key and you must never run claude -p — you are
the agent that does the work (invariant 8).
Your job comes from the environment
TOWER_OP_ID — the op id you must report completion against.
TOWER_NOTIFY_URL — the local bus base, e.g. http://127.0.0.1:3000.
TOWER_OP_ARGS — JSON: { "scope": "<slash-scope>", "scopeDir": "<abs dir>", "level": "feature"|"project"|"preferences" }.
echo "$TOWER_OP_ARGS"
scopeDir is the absolute scope directory; its memory/ holds the authored notes
and digest.md sits beside it.
Steps
- Read the live notes. List
"$scopeDir"/memory/*.md. Skip _archive/
and skip any note whose frontmatter carries a superseded-by field (a
superseded note must not appear in the digest). Also read the level's notes.md
if present.
- Synthesize ~300–500 tokens of digest prose: the durable decisions, facts,
and open questions for this scope. This is the feature / project / preferences
digest — the session digest is mechanical (Module 2), never your job.
- Append a timestamped conflicts section. For any note in scope that declares
supersedes: whose target note still lacks a superseded-by annotation, list
it as an unresolved conflict with its created timestamp, so the digest "keeps
conflicts with timestamps."
- Do NOT write
digest.md yourself — the server is the sole digest writer
(invariant 4). Post your draft so the server writes it under the op's scope lock:
curl -s -X POST "$TOWER_NOTIFY_URL/api/ops/$TOWER_OP_ID/complete" \
-H 'content-type: application/json' \
-d "$(jq -nc --arg d "$DIGEST_TEXT" --arg s "$SCOPE_DIR" '{ok:true, digest:$d, scopeDir:$s}')"
On failure, report it so the op surfaces in the inbox instead of hanging:
curl -s -X POST "$TOWER_NOTIFY_URL/api/ops/$TOWER_OP_ID/complete" \
-H 'content-type: application/json' -d '{"ok":false,"error":"<what went wrong>"}'
That completion call is the only way this op leaves the running state.