learning-log

Weekly learning log + forward horizon + productivity stats distilled from the fleet's GitHub work stream (merged PRs and closed issues, no source code). E.g. "/learning-log", "weekly learning log", "w

SKILL.md

GitHub

learning-log

Capability preflight: read workflow-capabilities and bind dispatch, results, waits, cancellation, model tiers and questions to this session’s actual tools before proceeding. Tool names below are conditional examples; the contract governs adaptation. Keep this skill’s worktree, independent-review, human-review and shipping gates.

Goal: surface the learning journey and productivity shape hidden inside individual PRs/issues. Weekly: read every merged PR and closed issue across the ferraroroberto fleet since the last run, then (a) compute exact productivity tables (PRs / issues / LOC, by project and by work-type) and (b) fan out one easy-tier sub-agent per work-type bucket to extract insights (patterns, recurring root-causes, decisions, durable lessons). Aggregate into a themed log, grade last week's horizon, and set the next one.

Journey + productivity lens only. Reads no source code (that's /audit-fleet); does not regenerate the architecture PNG (that's /system-map — only cross-links it); is not coding-agent usage metrics (that's /insights-weekly). Only input is GitHub: merged PRs + closed issues.

Scatter-gather, like /audit-fleet. Deterministic Python (gather.py) does the GitHub gather + exact stats + per-bucket partition; the orchestrator fans out easy-tier sub-agents (one per bucket), each returning a fixed format. The orchestrator never reads source; it weaves the bucket insights, grades the horizon, assembles the digest.

Arguments

  • No argument → auto window (since the ledger's last-run-at, or trailing 7 days on the first run).
  • since <YYYY-MM-DD> → override the window start (first backfill / validation, e.g. since 2026-05-01).

Execution rules (read first)

  • Run from the fleet-config repo root (E:/automation/fleet-config) so helper paths resolve.
  • Public repos only. The digest and its stats are published in a public ledger issue, so gather.py lists with --visibility public — private-repo activity (and even repo names) is never gathered, counted, or narrated. A sub-agent must never cite a repo#N outside the public set it was handed.
  • Read-only on GitHub except three writes: the kind=learning ledger issue (upsert), the weekly comment on it, and the Telegram ping. Step 3b adds local writes only: one chief-mailbox event and the machine-local proposals ledger, through chief_ops.py proposals. Never edits source, commits, pushes, or restarts.
  • Stats are deterministic — never let the model invent numbers. Every count and LOC figure comes from gather.py (Python over gh JSON), pasted verbatim. Sub-agents narrate insight, not statistics.
  • Sub-agents are Sonnet, fan out freely (exempt from the 3-Opus cap). One per non-empty bucket. READ-ONLY analysts — file nothing, change no state.
  • Degrade gracefully, never block (unattended). A bucket sub-agent that errors is recorded as such and skipped; the run still produces a log. A quiet week (no PRs/issues) still records the run so the ledger keeps cadence.
  • No AI attribution; no hard-wrapped paragraphs (global CLAUDE.md).

Steps

1. Gather + stat the work stream

E:/automation/fleet-config/.venv/Scripts/python.exe .claude/skills/learning-log/gather.py gather              # scheduled: auto window
E:/automation/fleet-config/.venv/Scripts/python.exe .claude/skills/learning-log/gather.py gather --since 2026-05-01   # override (backfill/validation)

Lists every fleet repo (gh repo list), reads each repo's merged PRs + closed issues per repo (gh pr list / gh issue list — REST, so no search rate-limit; each list is capped at PER_REPO_LIST_LIMIT items per repo and the repo list at REPO_LIST_LIMIT, so a very busy repo can under-count a long --since backfill; a list that comes back full prints one stderr line naming the repo, the list and the cap), buckets each item by work type, computes exact stats, writes into <OUT_DIR>: stats.md (the productivity tables), prior-horizon.md, and one bucket-<slug>.md per non-empty bucket. Prints a manifest — capture every line:

  • SINCE= / TOTALS= — window start and grand totals. FAILED_REPOS=<names> (with failed_repos=N in TOTALS=) lists repos whose gh reads failed: they are not counted as zero, and stats.md carries an "Incomplete" note — say so in the digest. A failed repo enumeration exits non-zero with nothing published.
  • STATS_FILE= — the productivity tables (paste verbatim into the digest).
  • PRIOR_HORIZON_FILE= — last week's horizon (grade against it).
  • OUT_DIR= and one BUCKET=<slug>|<name>|prs=N|issues=M|file=<path> per non-empty bucket — dispatch one sub-agent per line.

2. Scatter — one easy-tier sub-agent per bucket

For each BUCKET= line, dispatch an easy-tier worker through the capability contract, bounded by available slots. Collect every terminal result within this turn; timeouts remain pending. With no spawn, extract buckets serially using the same inputs and output format. Each reads only its bucket-<slug>.md and EXTRACTS INSIGHTS in this exact format (so the aggregate is uniform):

### <Bucket name>
**Themes:** 2-4 short labels.
**Insights & learnings:**
- <durable, non-obvious lesson or recurring pattern — not a restatement of one PR title> (repo#N)
- … (3-6 bullets)
**Notable:**
- <1-3 most significant items and why> (repo#N)
**Focus signal:** <one line — what this bucket says about where effort/attention went>

Tell each agent: read-only (file nothing, change no state); cite evidence as repo#N; be concrete to THIS fleet. Collect each report as it returns.

3. Aggregate into the digest

Compose the weekly digest as markdown (single long lines, no hard wraps). Order:

  • # 📓 Weekly learning log — <SINCE> → <today> + a one-line subtitle with the grand totals.
  • ## TL;DR — 3-5 phone bullets synthesizing the biggest cross-bucket signals.
  • ## What shipped & what we learned — the per-bucket sections from the sub-agents, in BUCKETS order, verbatim (lightly normalized).
  • ## Discoveries to archive — 4-8 durable, dated-worthy bullets pulled from across the buckets, each tagged repo#N.
  • ## Horizon grading — grade ONLY the items in prior-horizon.md (shipped / slipped) + what emerged UNPLANNED. If it says first run, write First run — baseline, no prior horizon to grade.
  • ## Horizon → next week — 4-8 forward checkboxes inferred from open threads + direction of travel.
  • The contents of STATS_FILE pasted verbatim (the productivity tables).
  • A one-line cross-link to the current architecture/system-map.png (milestones crossed).

3b. Propose workflow improvements (gated by chief_weekly_proposals)

Run in the foreground, in this turn. chief_ops.py below is E:/automation/fleet-config/.venv/Scripts/python.exe skills/_lib/chief_ops.py, the entry point the chief uses.

  1. chief_ops.py proposals context. A first line PROPOSALS=off reason=... or PROPOSALS=unknown reason=... means the Settings switch is off, missing or unreadable (or the ledger is unreadable): log that line in the Report (step 6), draft nothing, and skip the rest of this step. Until app-launcher ships the switch it reads off.
  2. On PROPOSALS=on, add the PROPOSALS_LAST_WEEK= line (Last week: N proposed, M filed.) verbatim to the digest under the TL;DR.
  3. Draft at most 4 candidates from this week's digest, as a JSON list in <OUT_DIR>/proposals.json: {"repo", "title", "type", "reason", "evidence"}. type is one of bug|enhancement|refactor|docs|chore|test|perf; reason is at most 300 characters stating this week's evidence; evidence is a list of repo#N taken from the gathered public set. Lean towards the types and repos the PROPOSALS_RATE= lines show get accepted, and never re-draft a PROPOSALS_DECLINED= item unless this week's evidence cites a repo#N its line does not list. Propose workflow and tooling improvements (a recurring failure, a manual step that keeps recurring, a gap two PRs worked around), not product features. Public repos only: nothing from Life OS or any private or personal source, in a title, a reason or an evidence ref.
  4. chief_ops.py proposals publish --file <OUT_DIR>/proposals.json. It re-checks the switch, drops anything not in a public repo, matching an open issue's title or a prior proposal, and writes one kind=proposals event. Copy its PROPOSALS_PUBLISHED= and every PROPOSALS_DROPPED= line into the Report. PROPOSALS=unknown or PROPOSALS_REFUSED is reported and not retried; the digest still ships.

4. Assemble the ledger body + upsert

Write the new horizon bullets to horizon.md and the discovery bullets to discoveries.md (in OUT_DIR), then let Python preserve the durable archive + stamp last-run-at. The archive is deduped on content and windowed to the newest ARCHIVE_CAP bullets (fleet-config#732) — keeps growing week over week but no longer without bound, so the body stays under GitHub's issue-body ceiling. build_ledger_body also renders a fixed Fleet map link near the top of the body — the architecture/system-map.png produced by /system-map (cross-linked, never regenerated here):

E:/automation/fleet-config/.venv/Scripts/python.exe .claude/skills/learning-log/gather.py assemble-ledger \
  --repo ferraroroberto/fleet-config \
  --horizon-file <OUT_DIR>/horizon.md --discoveries-file <OUT_DIR>/discoveries.md \
  --out <OUT_DIR>/ledger-body.md

A non-zero exit here means the prior ledger could not be read (transient gh auth / rate-limit / network failure) — no body was written, so stop and skip the upsert below rather than publishing an archive built from an empty prior (fleet-config#1061).

Then upsert the one canonical kind=learning ledger (deduped by C:/Users/rober/.claude/skills/_lib/audit_issue.py; title learning log — fleet; label audit-meta so work listings skip it):

E:/automation/fleet-config/.venv/Scripts/python.exe C:/Users/rober/.claude/skills/_lib/audit_issue.py upsert --repo ferraroroberto/fleet-config \
  --kind learning --label audit-meta --title "learning log — fleet" --body-file <OUT_DIR>/ledger-body.md

Capture LEDGER_URL. Post the digest as a comment (the running week-by-week log):

COMMENT_URL=$(gh issue comment "<LEDGER_URL>" --repo ferraroroberto/fleet-config --body-file <digest file>)

5. Telegram completion ping

E:/automation/fleet-config/.venv/Scripts/python.exe hooks/notify_complete.py --kind learning --comment-url "<COMMENT_URL>" \
  --summary "<N> PRs / <M> issues across <K> repos | <one-line horizon grade>"

Keep the summary pure ASCII, separating its parts with | — the hook renders that as · from a Python literal. A literal · in the command line reached the chat as ?? (fleet-config#507); a Windows command line is not a UTF-8-safe channel.

📓 Learning log — opt-in (silent no-op if no [global] telegram_chat), never blocks. Omit --comment-url if the comment was skipped.

6. Report

A few lines: window, grand totals, buckets analysed (+ any agent that errored), ledger + comment URLs, Telegram result, and the proposals outcome (the PROPOSALS= line or the published count).

Notes

  • Deterministic stats + LLM insight, not LLM stats: counts/LOC must be exact and reproducible, so Python computes them from gh JSON; Sonnet agents do the judgement (patterns, lessons) a table can't. GitHub's per-repo Pulse/contributor stats aren't cross-fleet or per-work-type, so these tables are additive, not a duplicate.
  • Ledger issue, not docs/: global CLAUDE.md rule — durable knowledge lives in one canonical issue with a dated decision log. Issue body is the deduped durable archive + live horizon; comments are the week-by-week record (narrative + tables).
  • Window anchored to last-run-at: a missed/late run never drops a week — next run widens. First run with no ledger falls back to trailing 7 days.
  • Buckets are by work type — PRs by conventional-commit prefix (feat/fix/chore/docs/refactor/…), issues by type label. Items with neither land in Other (known limitation; tighten with keyword heuristics in gather.py if it grows).
  • Separate from /system-map (cross-linked, not modified) and from fleet-config#95.

Wiring the weekly schedule

An app-launcher Job (config/jobs.json, weekly, visible: true) calls the co-located .claude/skills/learning-log/run-weekly.bat, staggered clear of the other Friday claude-runs. The wrapper preserves /learning-log, claude-sonnet-5, and bypass permissions while streaming filtered milestones through the shared claude_progress.py adapter. Every step must degrade gracefully rather than block on a prompt.

cwd = E:/automation/fleet-config. The Sonnet orchestrator gathers, fans out the Sonnet bucket sub-agents, aggregates, and writes the ledger + comment + Telegram itself.