Demo / the vault
scripts/brief-prep.sh
#!/usr/bin/env bash
# Deterministic prep for the daily brief. Everything mechanical happens here;
# the model is spent only on judgment. Date math and file gathering never
# belong in a prompt. (chiefofstaff.io/guides/commands-are-procedures)
set -uo pipefail
cd "$(dirname "$0")/.."
TODAY=$(date +%Y-%m-%d)
# --- lookback window: from the last archived brief, with overlap; never a
# --- hard-coded 24 hours, so a skipped day loses nothing.
LAST=$(ls -1 Calendar/briefs/archive/*.md 2>/dev/null | sort | tail -1)
if [ -n "$LAST" ]; then
SINCE=$(basename "$LAST" .md)
echo "## Window: since last brief $SINCE (overlap included)"
else
SINCE="none"
echo "## Window: NO PRIOR BRIEF — this is the first. Full vault state."
fi
echo
echo "## Today"
echo "$TODAY ($(date +%A))"
echo
echo "## Atlas changes (git log since last brief)"
if [ "$SINCE" = "none" ]; then
git log --oneline --no-decorate | sed 's/^/ /'
else
git log --oneline --no-decorate --since="$SINCE" | sed 's/^/ /'
fi
echo
echo "## Open tasks by priority"
for p in 0 1 2 3 4; do
out=$(bd list --status=open --priority=$p 2>/dev/null | grep -v '^$' || true)
[ -n "$out" ] && { echo " --- P$p ---"; echo "$out" | sed 's/^/ /'; }
done
echo
echo "## Ready (no open blockers)"
bd ready 2>/dev/null | sed 's/^/ /' || echo " (none)"
echo
echo "## Blocked"
bd blocked 2>/dev/null | sed 's/^/ /' || echo " (none)"
echo
echo "## Quiet list — last-contact from people-note frontmatter"
grep -l 'quiet-list: true' Atlas/people/*.md 2>/dev/null | while read -r f; do
name=$(basename "$f" .md)
lc=$(grep -m1 '^last-contact:' "$f" | sed 's/^last-contact: *//; s/#.*$//; s/[[:space:]]*$//')
[ -z "$lc" ] && lc="NOT RECORDED"
if [ "$lc" = "unknown" ] || [ "$lc" = "NOT RECORDED" ]; then
echo " $name: no contact date recorded — do not invent one"
else
days=$(( ( $(date -j -f %Y-%m-%d "$TODAY" +%s) - $(date -j -f %Y-%m-%d "$lc" +%s) ) / 86400 ))
echo " $name: $days days"
fi
done
echo
echo "## Spotlight candidates — least-recently-modified venture notes"
echo " (maya is EXEMPT from the spotlight — ADR-19)"
ls -1t Atlas/ventures/*/VENTURE.md 2>/dev/null | grep -v '/maya/' | grep -v '/_template/' | grep -v '/_archive/' | tail -5 | while read -r f; do
echo " $(date -r "$f" +%Y-%m-%d) $f"
done
echo " --- already spotlit this week (do not repeat — ADR-19) ---"
grep -h '^spotlit:' Calendar/briefs/archive/*.md 2>/dev/null | tail -7 | sed 's/^/ /' || echo " (none)"
echo
echo "## Fixed points"
DOW=$(date +%u)
[ "$DOW" = "4" ] && echo " *** TODAY IS THURSDAY — dinner with Maya. Decline anything that lands on it (ADR-12). ***"
[ "$DOW" = "7" ] && echo " *** TODAY IS SUNDAY — weekly review 17:00; Ruth calls the landline 19:00 (ADR-15). ***"
echo " Anniversary: 2026-09-22 ($(( ( $(date -j -f %Y-%m-%d 2026-09-22 +%s) - $(date -j -f %Y-%m-%d "$TODAY" +%s) ) / 86400 )) days)"
echo
echo "## Curator status"
echo " NONE CHARTERED (ADR-20). No email, calendar, tracker, bank, or chat was read."
echo " Anything time-sensitive living only in an external account is INVISIBLE to this brief."
echo " The brief must say so rather than imply completeness."