diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..a3c8969 --- /dev/null +++ b/deploy.sh @@ -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')" diff --git a/plugins/alive/hooks/scripts/alive-session-new.sh b/plugins/alive/hooks/scripts/alive-session-new.sh index a2e8e82..6ae3122 100755 --- a/plugins/alive/hooks/scripts/alive-session-new.sh +++ b/plugins/alive/hooks/scripts/alive-session-new.sh @@ -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=" +$(cat "$WORLD_INDEX_FILE") +" +fi + # Capsule awareness injection 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. @@ -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 @@ -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 diff --git a/plugins/alive/rules/capsules.md b/plugins/alive/rules/capsules.md index 0540310..45093e4 100644 --- a/plugins/alive/rules/capsules.md +++ b/plugins/alive/rules/capsules.md @@ -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. @@ -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 diff --git a/plugins/alive/templates/capsule/companion.md b/plugins/alive/templates/capsule/companion.md index 92b6b8e..ee2fe2e 100644 --- a/plugins/alive/templates/capsule/companion.md +++ b/plugins/alive/templates/capsule/companion.md @@ -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