@wipcomputer/wip-ldm-os 0.4.38 → 0.4.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,239 @@
1
+ #!/bin/bash
2
+ # ldm-summary.sh — Multi-cadence summary generator (prompt-based)
3
+ # Each agent gets their own summary from their own data in ~/.ldm/agents/.
4
+ # Org-wide combines both agent summaries.
5
+ #
6
+ # Usage:
7
+ # ldm-summary.sh daily # today
8
+ # ldm-summary.sh daily --date 2026-02-10 # specific date (backfill)
9
+ # ldm-summary.sh weekly # current week (Sun-Mon)
10
+ # ldm-summary.sh monthly / quarterly
11
+ # ldm-summary.sh daily --dry-run
12
+ # ldm-summary.sh daily --dev-only / --team-only
13
+
14
+ set -euo pipefail
15
+ export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
16
+
17
+ LDM_HOME="$HOME/.ldm"
18
+ CADENCE="${1:-}"
19
+ shift || true
20
+
21
+ DRY_RUN=false
22
+ TEAM_ONLY=false
23
+ DEV_ONLY=false
24
+ TARGET_DATE=""
25
+
26
+ FORCE=false
27
+
28
+ while [[ $# -gt 0 ]]; do
29
+ case "$1" in
30
+ --dry-run) DRY_RUN=true; shift ;;
31
+ --team-only) TEAM_ONLY=true; shift ;;
32
+ --dev-only) DEV_ONLY=true; shift ;;
33
+ --date) TARGET_DATE="$2"; shift 2 ;;
34
+ --force) FORCE=true; shift ;;
35
+ *) echo "Unknown: $1" >&2; exit 1 ;;
36
+ esac
37
+ done
38
+
39
+ if [ -z "$CADENCE" ]; then
40
+ echo "Usage: ldm-summary.sh daily|weekly|monthly|quarterly [--date YYYY-MM-DD] [--dry-run]"
41
+ exit 1
42
+ fi
43
+
44
+ WORKSPACE=$(python3 -c "import json; print(json.load(open('$LDM_HOME/config.json')).get('workspace',''))" 2>/dev/null || true)
45
+ if [ -z "$WORKSPACE" ]; then echo "ERROR: No workspace" >&2; exit 1; fi
46
+
47
+ AGENTS=$(python3 -c "
48
+ import json; c=json.load(open('$LDM_HOME/config.json')); a=c.get('agents',[]); print(' '.join(a if isinstance(a,list) else a.keys()))
49
+ " 2>/dev/null || echo "cc-mini")
50
+
51
+ agent_team_name() { case "$1" in oc-lesa-mini) echo "Lēsa" ;; *) echo "$1" ;; esac; }
52
+
53
+ # Read prompt from shared/prompts/ (Dream Weaver prompt source)
54
+ PROMPTS_DIR="$LDM_HOME/shared/prompts"
55
+ read_prompt() {
56
+ local file="$PROMPTS_DIR/$1"
57
+ if [ -f "$file" ]; then
58
+ cat "$file"
59
+ else
60
+ echo "WARNING: Prompt not found: $file" >&2
61
+ echo ""
62
+ fi
63
+ }
64
+
65
+ DATE="${TARGET_DATE:-$(date +%Y-%m-%d)}"
66
+ NEXT_DATE=$(python3 -c "from datetime import datetime,timedelta; print((datetime.strptime('$DATE','%Y-%m-%d')+timedelta(days=1)).strftime('%Y-%m-%d'))")
67
+
68
+ echo "=== LDM Summary: $CADENCE ($DATE) ==="
69
+ echo " Workspace: $WORKSPACE"
70
+ echo " Agents: $AGENTS"
71
+ echo ""
72
+
73
+ # ── Per-agent team summaries ──
74
+
75
+ if [ "$DEV_ONLY" = false ]; then
76
+ echo "--- Per-agent team summaries ($CADENCE) ---"
77
+
78
+ if [ "$CADENCE" = "daily" ]; then
79
+ for AGENT in $AGENTS; do
80
+ TEAM_NAME=$(agent_team_name "$AGENT")
81
+ AGENT_DAILY="$LDM_HOME/agents/$AGENT/memory/daily/$DATE.md"
82
+ echo " $AGENT ($TEAM_NAME):"
83
+
84
+ CRYSTAL_RESULTS=$(crystal search "activity on $DATE" --agent "$AGENT" --since "$DATE" --until "$NEXT_DATE" --limit 20 --quality deep 2>/dev/null || echo "")
85
+ DAILY_LOG=""; [ -f "$AGENT_DAILY" ] && DAILY_LOG=$(cat "$AGENT_DAILY")
86
+
87
+ if [ -z "$CRYSTAL_RESULTS" ] && [ -z "$DAILY_LOG" ]; then
88
+ echo " No data. Skipping."; continue
89
+ fi
90
+
91
+ if [ "$DRY_RUN" = true ]; then
92
+ echo " [DRY RUN] Crystal: $(echo "$CRYSTAL_RESULTS" | wc -l | tr -d ' ') lines, Log: $(echo "$DAILY_LOG" | wc -l | tr -d ' ') lines"
93
+ continue
94
+ fi
95
+
96
+ PROMPT_TEMPLATE=$(read_prompt "daily-agent-summary.md")
97
+ PROMPT="$PROMPT_TEMPLATE
98
+
99
+ Agent: $AGENT
100
+ Date: $DATE
101
+
102
+ === Daily log ===
103
+ $DAILY_LOG
104
+
105
+ === Crystal search results ===
106
+ $CRYSTAL_RESULTS"
107
+
108
+ SUMMARY=$(claude -p "$PROMPT" --system-prompt "You are Dream Weaver. First person. Specific. Use ... for breaks. Never use em dashes." --output-format text 2>/dev/null || echo "Summary generation failed")
109
+
110
+ OUT_DIR="$WORKSPACE/team/$TEAM_NAME/automated/memory/summaries/daily"
111
+ mkdir -p "$OUT_DIR"
112
+ printf "# Daily summary ... %s (%s)\n\n%s\n" "$DATE" "$AGENT" "$SUMMARY" > "$OUT_DIR/$DATE.md"
113
+ echo " -> $OUT_DIR/$DATE.md"
114
+ done
115
+
116
+ # Org-wide: combine agent summaries
117
+ if [ "$DRY_RUN" = false ]; then
118
+ echo " Org-wide team:"
119
+ COMBINED=""
120
+ for AGENT in $AGENTS; do
121
+ TEAM_NAME=$(agent_team_name "$AGENT")
122
+ F="$WORKSPACE/team/$TEAM_NAME/automated/memory/summaries/daily/$DATE.md"
123
+ [ -f "$F" ] && COMBINED="$COMBINED
124
+ === $AGENT ($TEAM_NAME) ===
125
+ $(cat "$F")
126
+ "
127
+ done
128
+ if [ -n "$COMBINED" ]; then
129
+ ORG_PROMPT_TEMPLATE=$(read_prompt "org-daily-team.md")
130
+ ORG_PROMPT="$ORG_PROMPT_TEMPLATE
131
+
132
+ Date: $DATE
133
+
134
+ $COMBINED"
135
+ ORG_SUMMARY=$(claude -p "$ORG_PROMPT" --model opus --system-prompt "You are Dream Weaver. Combine agent perspectives into one org-wide view. Use ... for breaks. Never use em dashes." --output-format text 2>/dev/null || echo "Summary generation failed")
136
+ ORG_DIR="$WORKSPACE/operations/updates/team/daily"
137
+ mkdir -p "$ORG_DIR"
138
+ printf "# Org team summary ... %s\n\n%s\n" "$DATE" "$ORG_SUMMARY" > "$ORG_DIR/$DATE.md"
139
+ echo " -> $ORG_DIR/$DATE.md"
140
+ fi
141
+ fi
142
+
143
+ else
144
+ # Weekly/monthly/quarterly
145
+ PARENT=""; case "$CADENCE" in weekly) PARENT="daily" ;; monthly) PARENT="weekly" ;; quarterly) PARENT="monthly" ;; esac
146
+
147
+ for AGENT in $AGENTS; do
148
+ TEAM_NAME=$(agent_team_name "$AGENT")
149
+ PDIR="$WORKSPACE/team/$TEAM_NAME/automated/memory/summaries/$PARENT"
150
+ echo " $AGENT ($TEAM_NAME):"
151
+ if [ ! -d "$PDIR" ] || [ -z "$(ls "$PDIR"/*.md 2>/dev/null)" ]; then echo " No $PARENT summaries."; continue; fi
152
+
153
+ INPUT=""; for f in $(ls -1 "$PDIR"/*.md 2>/dev/null | sort | tail -7); do INPUT="$INPUT
154
+ --- $(basename "$f") ---
155
+ $(cat "$f")
156
+ "; done
157
+
158
+ if [ "$DRY_RUN" = true ]; then echo " [DRY RUN] $(ls "$PDIR"/*.md 2>/dev/null | wc -l | tr -d ' ') files"; continue; fi
159
+
160
+ CON_PROMPT_TEMPLATE=$(read_prompt "${CADENCE}-agent-summary.md")
161
+ # Read prior output for continuity
162
+ PRIOR=""; PRIOR_FILE=$(ls -1 "$WORKSPACE/team/$TEAM_NAME/automated/memory/summaries/$CADENCE/"*.md 2>/dev/null | sort | tail -1)
163
+ [ -n "$PRIOR_FILE" ] && [ -f "$PRIOR_FILE" ] && PRIOR="
164
+ === Previous ${CADENCE} summary (for continuity) ===
165
+ $(cat "$PRIOR_FILE")"
166
+
167
+ CON_PROMPT="$CON_PROMPT_TEMPLATE
168
+
169
+ Agent: $AGENT
170
+ Date: $DATE
171
+
172
+ === ${PARENT} summaries ===
173
+ $INPUT
174
+ $PRIOR"
175
+ SUMMARY=$(claude -p "$CON_PROMPT" --system-prompt "You are Dream Weaver. First person. Consolidate. Use ... for breaks. Never use em dashes." --output-format text 2>/dev/null || echo "Summary generation failed")
176
+
177
+ OUT_DIR="$WORKSPACE/team/$TEAM_NAME/automated/memory/summaries/$CADENCE"
178
+ mkdir -p "$OUT_DIR"
179
+ printf "# %s summary ... %s (%s)\n\n%s\n" "${CADENCE^}" "$DATE" "$AGENT" "$SUMMARY" > "$OUT_DIR/$DATE.md"
180
+ echo " -> $OUT_DIR/$DATE.md"
181
+ done
182
+ fi
183
+ fi
184
+
185
+ # ── Dev summary (org-wide, from git) ──
186
+
187
+ if [ "$TEAM_ONLY" = false ]; then
188
+ echo "--- Dev summary ($CADENCE) ---"
189
+
190
+ if [ "$CADENCE" = "daily" ]; then
191
+ GIT_LOG=""
192
+ for repo in $(find "$WORKSPACE/repos" -name ".git" -type d -maxdepth 4 2>/dev/null); do
193
+ RDIR=$(dirname "$repo"); RNAME=$(basename "$RDIR")
194
+ LOG=$(git -C "$RDIR" log --since="$DATE" --until="$NEXT_DATE" --oneline --all 2>/dev/null || true)
195
+ [ -n "$LOG" ] && GIT_LOG="$GIT_LOG
196
+ === $RNAME ===
197
+ $LOG
198
+ "
199
+ done
200
+
201
+ if [ -z "$GIT_LOG" ]; then echo " No git activity."
202
+ elif [ "$DRY_RUN" = true ]; then echo " [DRY RUN] $(echo "$GIT_LOG" | grep -c "===") repos"
203
+ else
204
+ DEV_PROMPT_TEMPLATE=$(read_prompt "daily-dev.md")
205
+ DEV_PROMPT="$DEV_PROMPT_TEMPLATE
206
+
207
+ Date: $DATE
208
+
209
+ $GIT_LOG"
210
+ SUMMARY=$(claude -p "$DEV_PROMPT" --system-prompt "You are Dream Weaver. Dev facts only. No narrative." --output-format text 2>/dev/null || echo "Summary generation failed")
211
+ ORG_DIR="$WORKSPACE/operations/updates/dev/daily"
212
+ mkdir -p "$ORG_DIR"
213
+ printf "# Dev summary ... %s\n\n%s\n" "$DATE" "$SUMMARY" > "$ORG_DIR/$DATE.md"
214
+ echo " -> $ORG_DIR/$DATE.md"
215
+ fi
216
+ else
217
+ PARENT=""; case "$CADENCE" in weekly) PARENT="daily" ;; monthly) PARENT="weekly" ;; quarterly) PARENT="monthly" ;; esac
218
+ PDIR="$WORKSPACE/operations/updates/dev/$PARENT"
219
+ if [ ! -d "$PDIR" ] || [ -z "$(ls "$PDIR"/*.md 2>/dev/null)" ]; then echo " No $PARENT dev summaries."
220
+ elif [ "$DRY_RUN" = true ]; then echo " [DRY RUN] $(ls "$PDIR"/*.md 2>/dev/null | wc -l | tr -d ' ') files"
221
+ else
222
+ INPUT=""; for f in $(ls -1 "$PDIR"/*.md 2>/dev/null | sort | tail -7); do INPUT="$INPUT
223
+ --- $(basename "$f") ---
224
+ $(cat "$f")
225
+ "; done
226
+ DEV_CON_PROMPT="Consolidate these $PARENT dev summaries into a $CADENCE dev report. What shipped? Key releases? Architecture changes?
227
+
228
+ $INPUT"
229
+ SUMMARY=$(claude -p "$DEV_CON_PROMPT" --model opus --system-prompt "You are Dream Weaver. Dev facts. No narrative." --output-format text 2>/dev/null || echo "Summary generation failed")
230
+ ORG_DIR="$WORKSPACE/operations/updates/dev/$CADENCE"
231
+ mkdir -p "$ORG_DIR"
232
+ printf "# %s dev summary ... %s\n\n%s\n" "${CADENCE^}" "$DATE" "$SUMMARY" > "$ORG_DIR/$DATE.md"
233
+ echo " -> $ORG_DIR/$DATE.md"
234
+ fi
235
+ fi
236
+ fi
237
+
238
+ echo ""
239
+ echo "=== Summary complete ==="
@@ -0,0 +1,13 @@
1
+ # Daily Agent Summary
2
+
3
+ Read your transcripts and daily logs from `~/.ldm/agents/{agentId}/memory/` for {date}.
4
+
5
+ Write a first-person daily summary:
6
+ - What did you work on?
7
+ - What decisions were made?
8
+ - What shipped?
9
+ - What surprised you? What did you learn?
10
+ - What's blocked and what's your next move?
11
+ - Who did you interact with?
12
+
13
+ Be specific. Name repos, tickets, people. Use "..." for casual breaks. Never use em dashes.
@@ -0,0 +1,12 @@
1
+ # Daily Dev Summary
2
+
3
+ Read git log output from all repos for {date}.
4
+
5
+ Summarize what shipped:
6
+ - PRs merged (repo, PR number, title)
7
+ - Releases (repo, version)
8
+ - Tickets closed
9
+ - New repos created
10
+ - Breaking changes or incidents
11
+
12
+ Be factual. List repos, versions, PR numbers. No narrative.
@@ -0,0 +1,13 @@
1
+ # Monthly Agent Summary
2
+
3
+ Read your weekly summaries for this month. Also read last month's monthly summary for continuity.
4
+
5
+ Write a monthly summary:
6
+ - Major themes.
7
+ - What shipped.
8
+ - What did you think mattered at the start of the month vs what actually mattered?
9
+ - Patterns emerging.
10
+ - What from the weeklies is noise that doesn't need to propagate? (Let it go.)
11
+ - One paragraph: the narrative of this month.
12
+
13
+ First person. Specific. Use "..." for casual breaks. Never use em dashes.
@@ -0,0 +1,12 @@
1
+ # Org Daily Team Summary
2
+
3
+ Read all agent daily summaries for {date}. Combine into one org-wide team summary.
4
+
5
+ - What happened across the whole team?
6
+ - Who worked on what?
7
+ - What decisions were made?
8
+ - What is unresolved?
9
+ - Overlaps or conflicts between agents?
10
+ - What was the emotional temperature?
11
+
12
+ Third person. Name each agent. Use "..." for casual breaks. Never use em dashes.
@@ -0,0 +1,14 @@
1
+ # Quarterly Agent Summary
2
+
3
+ Read your monthly summaries for this quarter. Also read last quarter's quarterly summary for continuity.
4
+
5
+ Write a quarterly summary:
6
+ - What was the arc of this quarter?
7
+ - What big decisions shaped the direction?
8
+ - What was built that didn't exist before?
9
+ - What got dropped and why?
10
+ - What would you tell yourself 3 months ago?
11
+ - What from the monthlies is noise that doesn't need to propagate? (Let it go.)
12
+ - One paragraph: the story of this quarter.
13
+
14
+ First person. Specific. Use "..." for casual breaks. Never use em dashes.
@@ -0,0 +1,14 @@
1
+ # Weekly Agent Summary
2
+
3
+ Read your 7 daily summaries for this week (Sunday to Saturday). Also read last week's weekly summary for continuity.
4
+
5
+ Write a weekly summary:
6
+ - What themes emerged?
7
+ - What decisions stuck? What changed?
8
+ - What did you get wrong this week?
9
+ - What shipped vs what was planned?
10
+ - Open threads going into next week.
11
+ - What from the dailies is noise that doesn't need to propagate? (Let it go.)
12
+ - One sentence: what was this week about?
13
+
14
+ First person. Specific. Use "..." for casual breaks. Never use em dashes.
@@ -0,0 +1,29 @@
1
+ # Git Conventions
2
+
3
+ ## Never commit to main
4
+
5
+ All work happens on branches. The pre-commit hook blocks commits on main.
6
+
7
+ ## Never squash merge
8
+
9
+ Every commit has co-authors and tells the story. Always `--merge` or fast-forward.
10
+
11
+ ## Never push directly to main
12
+
13
+ Always use a branch and PR.
14
+
15
+ ## Co-authors on every commit
16
+
17
+ List all contributors. Read co-author lines from `settings/config.json` in your workspace.
18
+
19
+ ## Branch prefixes
20
+
21
+ Each agent uses a prefix from `settings/config.json` agents section. Prevents collisions.
22
+
23
+ ## Worktrees
24
+
25
+ Use worktrees for isolated work. Main working tree stays on main (read-only).
26
+
27
+ ## Issues go on the public repo
28
+
29
+ For private/public repo pairs, all issues go on the public repo.
@@ -0,0 +1,25 @@
1
+ # Release Pipeline
2
+
3
+ ## Three steps. Never combine. Never skip.
4
+
5
+ | Step | What happens | What it means |
6
+ |------|-------------|---------------|
7
+ | **Merge** | PR merged to main | Code lands. Nothing else changes. |
8
+ | **Deploy** | wip-release + deploy-public.sh | Published to npm + GitHub. Not on your machine yet. |
9
+ | **Install** | Run the install prompt | Extensions updated on your machine. Only when Parker says "install." |
10
+
11
+ After Deploy, STOP. Do not copy files. Do not npm install -g. Do not npm link. Dogfood the install prompt.
12
+
13
+ ## The workflow
14
+
15
+ 1. Create worktree, make changes, commit
16
+ 2. Write RELEASE-NOTES on the branch (not after)
17
+ 3. Push, create PR, merge (--merge, never squash)
18
+ 4. `git checkout main && git pull`
19
+ 5. `wip-release patch` (auto-detects release notes)
20
+ 6. `deploy-public.sh` to sync public repo
21
+ 7. Dogfood: `Read https://wip.computer/install/wip-ldm-os.txt`
22
+
23
+ ## Never run tools from repo clones
24
+
25
+ Installed tools are for execution. Repo clones are for development. Use the installed commands (`crystal`, `wip-release`, `mdview`, etc.), never run from source.
@@ -0,0 +1,17 @@
1
+ # Security
2
+
3
+ ## Secret management
4
+
5
+ Use your org's secret management tool (configured in settings/config.json). Never hardcode API keys, tokens, or credentials.
6
+
7
+ ## Security audit before installing anything
8
+
9
+ Before installing ANY third-party skill, plugin, MCP server, or npm package, review it for prompt injection, malicious deps, data exfiltration.
10
+
11
+ ## Shared file protection
12
+
13
+ Never overwrite shared workspace files. Always append or edit specific sections. Never delete history from shared files.
14
+
15
+ ## Protected paths
16
+
17
+ Do not modify: secrets/, credentials/, auth-profiles.json, or any file containing API keys.
@@ -0,0 +1,21 @@
1
+ # Workspace Boundaries
2
+
3
+ ## Folder ownership
4
+
5
+ Each agent has its own folder under `staff/`. Never touch another agent's folders. If something needs to change, ask the other agent.
6
+
7
+ ## Repos are shared
8
+
9
+ All repos live under `repos/` in the workspace. All agents work from the same repos using branches and worktrees.
10
+
11
+ ## Memory-first rule
12
+
13
+ Before reaching for any external service or workaround: search memory first.
14
+
15
+ ## Local-first principle
16
+
17
+ Every tool must work fully on your machine without calling any external server. Cloud features are optional and self-hostable.
18
+
19
+ ## Never run tools from repo clones
20
+
21
+ Installed tools are for execution. Repo clones are for development. Use the installed commands, not source.
@@ -0,0 +1,5 @@
1
+ # Writing Style
2
+
3
+ Read writing conventions from your org's `settings/config.json` writingStyle section.
4
+
5
+ **Full paths in documentation.** Never truncate paths. Always show the complete path so there's no ambiguity.