Skip to content

Commit 73be17c

Browse files
authored
Merge pull request #18 from alivecomputer/will/capsule-tasks-and-cleanup
Capsule tasks, world injection and cleanup
2 parents efe6c10 + c76c008 commit 73be17c

4 files changed

Lines changed: 59 additions & 7 deletions

File tree

deploy.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
# Deploy alive plugin from local clone to cache
3+
# Usage: ./deploy.sh [--dry-run]
4+
5+
set -euo pipefail
6+
7+
SOURCE="$(cd "$(dirname "$0")/plugins/alive" && pwd)"
8+
CACHE="$HOME/.claude/plugins/cache/alivecomputer/alive/1.0.1-beta"
9+
10+
if [ ! -d "$SOURCE" ]; then
11+
echo "ERROR: Source not found at $SOURCE"
12+
exit 1
13+
fi
14+
15+
if [ ! -d "$CACHE" ]; then
16+
echo "ERROR: Cache not found at $CACHE"
17+
exit 1
18+
fi
19+
20+
DRY_RUN=""
21+
if [ "${1:-}" = "--dry-run" ]; then
22+
DRY_RUN="--dry-run"
23+
echo "=== DRY RUN ==="
24+
fi
25+
26+
echo "Source: $SOURCE"
27+
echo "Cache: $CACHE"
28+
echo ""
29+
30+
rsync -av --delete \
31+
--exclude='.git' \
32+
--exclude='.DS_Store' \
33+
$DRY_RUN \
34+
"$SOURCE/" "$CACHE/"
35+
36+
echo ""
37+
echo "Deployed $(date '+%Y-%m-%d %H:%M:%S')"

plugins/alive/hooks/scripts/alive-session-new.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ if [ -f "$WORLD_KEY_FILE" ]; then
143143
WORLD_KEY_CONTENT=$(cat "$WORLD_KEY_FILE")
144144
fi
145145

146+
# Read world index (.alive/_index.yaml) for injection — walnut registry
147+
WORLD_INDEX_CONTENT=""
148+
WORLD_INDEX_FILE="$WORLD_ROOT/.alive/_index.yaml"
149+
if [ -f "$WORLD_INDEX_FILE" ]; then
150+
WORLD_INDEX_CONTENT="<WORLD_INDEX>
151+
$(cat "$WORLD_INDEX_FILE")
152+
</WORLD_INDEX>"
153+
fi
154+
146155
# Capsule awareness injection
147156
CAPSULE_AWARENESS="<CAPSULE_AWARENESS>
148157
If you detect work with a deliverable or future audience — drafting for someone, iterating a document, building something to ship, send, or reference later — check: is there an active capsule? If not, invoke the capsule skill to offer creation.
@@ -210,8 +219,12 @@ Model: $HOOK_MODEL
210219
$PREFS
211220
Rules: ${RULE_COUNT} loaded (${RULE_NAMES})"
212221

213-
# Escape and combine — world key + capsule awareness + tidy nudge + rules
222+
# Escape and combine — world key + index + capsule awareness + tidy nudge + rules
214223
WORLD_KEY_ESCAPED=$(escape_for_json "$WORLD_KEY_CONTENT")
224+
INDEX_ESCAPED=""
225+
if [ -n "$WORLD_INDEX_CONTENT" ]; then
226+
INDEX_ESCAPED=$(escape_for_json "$WORLD_INDEX_CONTENT")
227+
fi
215228
CAPSULE_ESCAPED=$(escape_for_json "$CAPSULE_AWARENESS")
216229
TIDY_ESCAPED=""
217230
if [ -n "$TIDY_NUDGE" ]; then
@@ -221,7 +234,11 @@ SESSION_MSG_ESCAPED=$(escape_for_json "$SESSION_MSG")
221234
PREAMBLE_ESCAPED=$(escape_for_json "$PREAMBLE")
222235
RUNTIME_ESCAPED=$(escape_for_json "$RUNTIME_RULES")
223236

224-
CONTEXT="${SESSION_MSG_ESCAPED}\n\n${WORLD_KEY_ESCAPED}\n\n${CAPSULE_ESCAPED}"
237+
CONTEXT="${SESSION_MSG_ESCAPED}\n\n${WORLD_KEY_ESCAPED}"
238+
if [ -n "$INDEX_ESCAPED" ]; then
239+
CONTEXT="${CONTEXT}\n\n${INDEX_ESCAPED}"
240+
fi
241+
CONTEXT="${CONTEXT}\n\n${CAPSULE_ESCAPED}"
225242
if [ -n "$TIDY_ESCAPED" ]; then
226243
CONTEXT="${CONTEXT}\n\n${TIDY_ESCAPED}"
227244
fi

plugins/alive/rules/capsules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ tags: [engineering, vendors]
7070
### Body Sections
7171

7272
- `## Context` — what this capsule is about, current state
73-
- `## Tasks`capsule-scoped checkboxes with @session_id attribution. Same syntax as walnut tasks.md.
73+
- `## Tasks`pointer to `_core/tasks.md`. Capsule tasks live in the walnut task list under a capsule heading, not in the companion.
7474
- `## Changelog` — every version after v0.1 gets a brief note about what changed
7575
- `## Work Log` — append-only. Each session adds its entry at the bottom. Never edit previous entries.
7676

@@ -165,7 +165,7 @@ If two capsules overlap, link them or spawn a third that synthesizes both. Only
165165

166166
### 2. Capsule-scoped tasks
167167

168-
`## Tasks` in companion body with checkbox + @session_id. `[~]` means actively being worked on.
168+
Capsule tasks live in the walnut's `_core/tasks.md` under a heading matching the capsule name. Not in the companion. This prevents split source of truth.
169169

170170
### 3. Append-only work log
171171

plugins/alive/templates/capsule/companion.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ tags: []
4141

4242
## Tasks
4343

44-
Capsule-scoped work items. Same syntax as walnut tasks.md.
45-
46-
- [ ] Example task @session_id
44+
Tasks for this capsule live in the walnut's `_core/tasks.md` under a capsule heading. Do not duplicate tasks here.
4745

4846
## Changelog
4947

0 commit comments

Comments
 (0)