Skip to content

feat: smarter weekly snippets - Claude summaries and prettier formatting - #94

Merged
cgrindel merged 3 commits into
mainfrom
smarter_snippets
May 25, 2026
Merged

feat: smarter weekly snippets - Claude summaries and prettier formatting#94
cgrindel merged 3 commits into
mainfrom
smarter_snippets

Conversation

@cgrindel

Copy link
Copy Markdown
Owner

Summary

  • Reworks the weekly entry layout so hand-written summaries stay at ## while authored/reviewed PRs move under a single ## Activity block with ### Authored and ### Reviewed subsections (bold-bullet repo labels with nested PR links).
  • Wires buildbuddy-io/rules_claude (use_latest) into the generator: after the gh+jq activity pass, the script feeds the activity Markdown to claude -p and slots its ## Glydways / ## Open Source output above the activity. Graceful fallback to activity-only when Claude errors or --no_summary is passed.
  • Brings prettier into the Bazel workspace via aspect_rules_js + aspect_rules_lint + pnpm-managed package.json (prettier@3.8.3); the generator runs prettier --print-width 100 --prose-wrap always --write on the year file after prepending the new entry, so Claude's summaries are wrapped consistently. --no_format skips it.

Test plan

  • bazel test //... — all 24 tests pass.
  • Integration test asserts prettier ran (blank line between ### Authored and the first bullet).
  • New sub-test asserts --no_format skips prettier (no blank line in that case).
  • Live run for week ending 2026-05-24 produced a clean entry — summary headings correct, activity intact, wrapping at 100 chars.

🤖 Generated with Claude Code

cgrindel and others added 3 commits May 25, 2026 10:20
Wrap authored and reviewed PRs under '## Activity' with '### Authored' and '### Reviewed' subheadings. Repos become bold bullets with PRs nested under them, replacing the previous per-repo h2 headings and ensuring authored/reviewed share the same shape. Also guarantee a blank line between an entry's '---' separator and the next heading when prepending to a snippets file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wire buildbuddy-io/rules_claude into the generator so it produces hand-written-style summary sections (## Glydways, ## Open Source) above the activity block. The summary pass runs after gh+jq has assembled the activity Markdown and feeds that activity, along with a static prompt, to claude -p; if Claude errors or --no_summary is passed, the script falls back to an activity-only entry. Tests pass --no_summary so they don't depend on Claude auth at test time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bring prettier into the Bazel workspace via aspect_rules_js + aspect_rules_lint and a pnpm-managed package.json that pins prettier@3.8.3. Expose it as a runnable //:prettier target via npm_link_all_packages and the package's bin macro, then wire it into the generator as a runfile so the script invokes 'prettier --print-width 100 --prose-wrap always --write' on the year file after prepending the new entry. BAZEL_BINDIR=. is set because the js_binary launcher runs outside a Bazel action. A --no_format flag short-circuits the prettier pass.

The Claude summary prompt loses its wrap instructions now that prettier handles line wrapping. Test coverage gains two assertions: the create-file sub-test verifies prettier ran (blank line between '### Authored' and the first bullet), and a new --no_format sub-test verifies prettier was skipped. The test sh_test gets matching env / toolchains entries so the script's CLAUDE_BIN and PRETTIER_BIN_RUNFILE references resolve when the .sh is invoked directly. node_modules/ is gitignored.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cgrindel cgrindel self-assigned this May 25, 2026
@cgrindel
cgrindel marked this pull request as ready for review May 25, 2026 22:30
@cgrindel
cgrindel merged commit e1defa7 into main May 25, 2026
1 check passed
@cgrindel
cgrindel deleted the smarter_snippets branch May 25, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant