You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/skills/pgweekly-blog-generation/SKILL.md
+20-12Lines changed: 20 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,26 +9,29 @@ Generates English and Chinese technical blog posts from PostgreSQL mailing list
9
9
10
10
## Quick Workflow
11
11
12
-
1.**Fetch** thread data (required; do not skip): run the fetch script so that the thread HTML, Markdown, and **all patch attachments** are downloaded and saved under `data/threads/`:
This creates `data/threads/YYYY-MM-DD/<sanitized-thread-id>/` and downloads every `.patch` (and other allowed attachments) into `data/threads/YYYY-MM-DD/<sanitized-thread-id>/attachments/`. Always run this step before writing the blog.
16
+
-**Wait for the command to finish** (check exit code is 0). Do not proceed if fetch failed.
17
+
- This creates `data/threads/YYYY-MM-DD/<sanitized-thread-id>/` and downloads attachments into `attachments/`.
18
+
- The `YYYY-MM-DD` in the path is the **fetch date** (when you ran the script), NOT the thread date—do not use it for year/week.
17
19
18
20
2.**Locate** fetched content in `data/threads/YYYY-MM-DD/<thread-id>/`:
19
21
-`thread.html` - Original HTML
20
22
-`thread.md` - Converted Markdown
21
-
-`metadata.txt` - Thread info (use for year/week)
23
+
-`metadata.txt` - Thread info
22
24
-`attachments/` - **Downloaded patches** (e.g. `.patch` files from the mailing list)
23
25
-`attachments.txt` - List of downloaded attachment filenames
24
26
25
-
3.**Verify** all patch set versions are downloaded (required before analyze):
26
-
- Read `thread.md` and `thread.html` to identify all patch versions referenced in the thread (e.g. v1, v2, v3, v4, v5…; also patterns like `0001-`, `0002-` in patch series)
27
-
- List files in `attachments/` and compare: every referenced version must have a corresponding downloaded file
28
-
- If any referenced version is missing:
29
-
- Run `python3 tools/fetch_data.py --thread-dir "data/threads/YYYY-MM-DD/<thread-id>"` to retry downloading missing attachments
30
-
- If still missing, do not proceed with analysis; report the missing versions and ask the user to verify the thread or manually add the patches
31
-
- Only proceed to analyze/generate once all referenced patch versions are present in `attachments/`
27
+
3.**Verify** all patch set versions are downloaded — **MANDATORY GATE; do not skip**:
28
+
- Read `thread.md` and `thread.html` to identify **all** patch versions referenced (v1, v2, v3…; or `0001-`, `0002-` in patch series)
29
+
- Run `ls data/threads/YYYY-MM-DD/<thread-id>/attachments/` and compare with the list of referenced versions
30
+
-**If any referenced version is missing:**
31
+
- Run `python3 tools/fetch_data.py --thread-dir "data/threads/YYYY-MM-DD/<thread-id>"` to retry
32
+
- Re-verify; if still missing, **STOP** — report missing versions to the user and do not write the blog
33
+
-**If the thread has no patches**, verification passes (nothing to check).
34
+
-**CRITICAL:** Do not proceed to step 4 (Analyze) until you have explicitly confirmed: "Referenced versions: [list] ✓ All present in attachments/". Only then may you write the blog.
32
35
33
36
4.**Analyze** content:
34
37
- If multiple patch versions (v1, v2, v3...), run `diff -u` between versions to explain evolution
@@ -48,7 +51,7 @@ Generates English and Chinese technical blog posts from PostgreSQL mailing list
- Filename: kebab-case from main topic (e.g. `planner-count-optimization`)
50
53
51
-
7.**Update** SUMMARY.md and year READMEs:
54
+
7.**Update**`src/SUMMARY.md` and year READMEs:
52
55
- Add entries under both `# 🇬🇧 English` and `# 🇨🇳 中文`
53
56
- Follow existing hierarchy: year → week → link to article
54
57
-**Put the new week/article at the top** (newest first): insert the new week immediately after the year line, so the latest week appears first in the list.
@@ -57,7 +60,12 @@ Generates English and Chinese technical blog posts from PostgreSQL mailing list
57
60
58
61
## Year/Week
59
62
60
-
Determine from `metadata.txt` (thread date) or use current date. Use ISO week number (e.g. 06 for week 6).
63
+
**Use the blog writing date (the day you write the blog) as the source of truth.** This determines which week the article is filed under.
64
+
65
+
**Rules:**
66
+
- Compute ISO year and ISO week from **today's date** (the date when the blog is being written).
67
+
- Example: if writing on 2026-03-20, use year=2026, week=12 (from `datetime(2026, 3, 20).isocalendar()`).
68
+
-**Do NOT use** the thread date, `metadata.txt`, the directory name `YYYY-MM-DD` (fetch date), or "Downloaded:" for year/week.
0 commit comments