Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# Deploy alive plugin from local clone to cache
# Usage: ./deploy.sh [--dry-run]

set -euo pipefail

SOURCE="$(cd "$(dirname "$0")/plugins/alive" && pwd)"
CACHE="$HOME/.claude/plugins/cache/alivecomputer/alive/1.0.1-beta"

if [ ! -d "$SOURCE" ]; then
echo "ERROR: Source not found at $SOURCE"
exit 1
fi

if [ ! -d "$CACHE" ]; then
echo "ERROR: Cache not found at $CACHE"
exit 1
fi

DRY_RUN=""
if [ "${1:-}" = "--dry-run" ]; then
DRY_RUN="--dry-run"
echo "=== DRY RUN ==="
fi

echo "Source: $SOURCE"
echo "Cache: $CACHE"
echo ""

rsync -av --delete \
--exclude='.git' \
--exclude='.DS_Store' \
$DRY_RUN \
"$SOURCE/" "$CACHE/"

echo ""
echo "Deployed $(date '+%Y-%m-%d %H:%M:%S')"
21 changes: 19 additions & 2 deletions plugins/alive/hooks/scripts/alive-session-new.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ if [ -f "$WORLD_KEY_FILE" ]; then
WORLD_KEY_CONTENT=$(cat "$WORLD_KEY_FILE")
fi

# Read world index (.alive/_index.yaml) for injection — walnut registry
WORLD_INDEX_CONTENT=""
WORLD_INDEX_FILE="$WORLD_ROOT/.alive/_index.yaml"
if [ -f "$WORLD_INDEX_FILE" ]; then
WORLD_INDEX_CONTENT="<WORLD_INDEX>
$(cat "$WORLD_INDEX_FILE")
</WORLD_INDEX>"
fi

# Capsule awareness injection
CAPSULE_AWARENESS="<CAPSULE_AWARENESS>
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.
Expand Down Expand Up @@ -210,8 +219,12 @@ Model: $HOOK_MODEL
$PREFS
Rules: ${RULE_COUNT} loaded (${RULE_NAMES})"

# Escape and combine — world key + capsule awareness + tidy nudge + rules
# Escape and combine — world key + index + capsule awareness + tidy nudge + rules
WORLD_KEY_ESCAPED=$(escape_for_json "$WORLD_KEY_CONTENT")
INDEX_ESCAPED=""
if [ -n "$WORLD_INDEX_CONTENT" ]; then
INDEX_ESCAPED=$(escape_for_json "$WORLD_INDEX_CONTENT")
fi
CAPSULE_ESCAPED=$(escape_for_json "$CAPSULE_AWARENESS")
TIDY_ESCAPED=""
if [ -n "$TIDY_NUDGE" ]; then
Expand All @@ -221,7 +234,11 @@ SESSION_MSG_ESCAPED=$(escape_for_json "$SESSION_MSG")
PREAMBLE_ESCAPED=$(escape_for_json "$PREAMBLE")
RUNTIME_ESCAPED=$(escape_for_json "$RUNTIME_RULES")

CONTEXT="${SESSION_MSG_ESCAPED}\n\n${WORLD_KEY_ESCAPED}\n\n${CAPSULE_ESCAPED}"
CONTEXT="${SESSION_MSG_ESCAPED}\n\n${WORLD_KEY_ESCAPED}"
if [ -n "$INDEX_ESCAPED" ]; then
CONTEXT="${CONTEXT}\n\n${INDEX_ESCAPED}"
fi
CONTEXT="${CONTEXT}\n\n${CAPSULE_ESCAPED}"
if [ -n "$TIDY_ESCAPED" ]; then
CONTEXT="${CONTEXT}\n\n${TIDY_ESCAPED}"
fi
Expand Down
4 changes: 2 additions & 2 deletions plugins/alive/rules/capsules.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ tags: [engineering, vendors]
### Body Sections

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

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

### 2. Capsule-scoped tasks

`## Tasks` in companion body with checkbox + @session_id. `[~]` means actively being worked on.
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.

### 3. Append-only work log

Expand Down
4 changes: 1 addition & 3 deletions plugins/alive/templates/capsule/companion.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ tags: []

## Tasks

Capsule-scoped work items. Same syntax as walnut tasks.md.

- [ ] Example task @session_id
Tasks for this capsule live in the walnut's `_core/tasks.md` under a capsule heading. Do not duplicate tasks here.

## Changelog

Expand Down
Loading