@gurupanguji

My Web This Week Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Automatically generate or refresh a weekly Sunday roundup post and companion snippet from that weekโ€™s existing ๐Ÿ”— posts, then open a PR instead of writing directly to main.

Architecture: Add one narrow Python generator that owns week selection, source extraction, markdown rendering, and snippet rendering for the Sunday roundup. Keep validation and deploy behavior mostly unchanged, add focused unit tests first, and add one GitHub Actions workflow that runs the generator, commits changes on a branch, and opens or updates a PR for the generated artifacts.

Tech Stack: Python 3, unittest, GitHub Actions, Jekyll post conventions, existing repo hooks and validators


Task 1: Add Failing Tests For Week Selection And Metadata

Files:

Write a test that asserts a helper can resolve the target Sunday and the preceding Monday through Saturday window from an explicit Sunday date.

Use a case like:

target_sunday = date(2026, 3, 29)
window = build_roundup_window(target_sunday)
assert window.start == date(2026, 3, 23)
assert window.end == date(2026, 3, 28)

Run: python3 -m unittest tests/test_generate_my_web_this_week.py -k target_sunday Expected: FAIL because the generator module or helper does not exist yet

Write tests that assert:

Run: python3 -m unittest tests/test_generate_my_web_this_week.py -k metadata Expected: FAIL because the metadata helpers are not implemented yet

Task 2: Implement The Generator Skeleton And Metadata Helpers

Files:

Implement focused data models for:

Add helpers that:

Add helpers that return:

Run: python3 -m unittest tests/test_generate_my_web_this_week.py -k "target_sunday or metadata" Expected: PASS

Task 3: Add Failing Tests For Source Post Selection

Files:

Write a test that creates temporary _posts/ fixtures and asserts the selector includes only files that:

Write a test that creates multiple qualifying posts and asserts the selected sources are sorted by post date ascending.

Write a test that includes a normal post title without the ๐Ÿ”— prefix and asserts it is skipped.

Run: python3 -m unittest tests/test_generate_my_web_this_week.py -k selection Expected: FAIL because the selection behavior is not implemented yet

Task 4: Implement Source Post Loading And Selection

Files:

Add narrow helpers that load a post from _posts/, parse front matter, and extract:

Select only posts that:

Sort sources by date ascending, then by path name to avoid unstable ordering on ties.

Run: python3 -m unittest tests/test_generate_my_web_this_week.py -k selection Expected: PASS

Task 5: Add Failing Tests For Quote And Embed Extraction

Files:

Write a test for a modern link post body like:

> A strong quote.
>
> [Source](https://example.com/story)

Reaction paragraph.

Assert the generator captures the leading blockquote and classifies the source item as quote-backed.

Write a test for a leading embed block and assert the generator extracts the visible source URL and classifies the source item as embed-led.

Write a test for a post that begins with legacy wp:quote HTML and assert the generator skips it with a logged reason.

Run: python3 -m unittest tests/test_generate_my_web_this_week.py -k extraction Expected: FAIL because extraction logic is not implemented yet

Task 6: Implement Narrow Extraction Rules And Skip Logging

Files:

Parse only the leading markdown blockquote cluster at the top of the post body. Stop once non-blockquote content starts.

Handle a leading embed wrapper that contains a visible source URL and capture that URL for roundup rendering.

If the source shape requires legacy wp:quote extraction, skip that post and record the reason in a structured warning list.

Run: python3 -m unittest tests/test_generate_my_web_this_week.py -k extraction Expected: PASS

Task 7: Add Failing Tests For Roundup Post And Snippet Rendering

Files:

Write a test that asserts the generated markdown post contains:

Write a test that asserts the snippet file contains:

Write a test that pre-creates the Sunday post and snippet, reruns rendering, and asserts content is refreshed in place instead of failing.

Write a test that passes zero qualifying sources and asserts the generator exits non-zero or raises a dedicated error.

Run: python3 -m unittest tests/test_generate_my_web_this_week.py -k "render or update or empty" Expected: FAIL because rendering and update behavior are not implemented yet

Task 8: Implement Roundup Rendering, Snippet Rendering, And CLI Write Path

Files:

Generate content with:

Follow the existing _snippets/ front matter conventions and generate platform sections that point to the weekly roundup canonical URL.

Write or refresh:

Do not fail when they already exist for the same Sunday.

Support commands like:

python3 scripts/generate_my_web_this_week.py --date 2026-03-29 --write

Run: python3 -m unittest tests/test_generate_my_web_this_week.py Expected: PASS

Task 9: Add Workflow Tests By Verifying The Operational Path

Files:

Create a workflow that:

Grant only the permissions needed for:

Add a workflow step that checks for required permissions or emits a direct error pointing to the repository setting that allows Actions to create pull requests.

Run:

python3 scripts/generate_my_web_this_week.py --date 2026-03-29 --write

Expected: weekly post and snippet are created or refreshed locally without syntax or import errors

Task 10: Verify Validation And Hook Compatibility

Files:

Run:

python3 scripts/validate_posts.py --today 2026-03-26

Expected: the generated weekly post shape passes existing filename-date, scheduled timestamp, and snippet checks without special-casing

If needed, add or update tests in tests/test_validate_posts.py for the generated weekly post and snippet shape.

Run:

python3 -m unittest tests/test_generate_my_web_this_week.py tests/test_validate_posts.py

Expected: PASS

Run:

TZ=America/Los_Angeles python3 scripts/validate_posts.py --staged --today "$(date +%F)"

Expected: no validator regressions for staged weekly artifacts

Task 11: Final Verification And Landing

Files:

Run:

python3 -m unittest tests/test_generate_my_web_this_week.py tests/test_validate_posts.py tests/test_publish_social.py
python3 scripts/generate_my_web_this_week.py --date 2026-03-29 --write
python3 scripts/validate_posts.py --today 2026-03-26
git diff --stat

Expected:

git add docs/superpowers/specs/2026-03-26-my-web-this-week-design.md docs/superpowers/plans/2026-03-26-my-web-this-week-implementation-plan.md scripts/generate_my_web_this_week.py tests/test_generate_my_web_this_week.py .github/workflows/generate_my_web_this_week.yml scripts/validate_posts.py tests/test_validate_posts.py _posts/2026-03-29-my-web-this-week.md _snippets/2026-03-29-my-web-this-week.md
git commit -m "feat: add weekly my web this week generator"