the-grid-cc 1.3.0 → 1.5.0

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,235 @@
1
+ ---
2
+ cluster: james-weatherhead-blog
3
+ block: 05
4
+ type: execute
5
+ wave: 3
6
+ depends_on: [01, 03]
7
+ files_modified: [src/pages/rss.xml.ts, src/utils/rss.ts]
8
+ autonomous: true
9
+
10
+ must_haves:
11
+ truths:
12
+ - "RSS feed is accessible at /rss.xml"
13
+ - "Feed contains all published blog posts"
14
+ - "Feed validates against RSS 2.0 specification"
15
+ artifacts:
16
+ - path: "src/pages/rss.xml.ts"
17
+ provides: "RSS feed endpoint"
18
+ exports: ["GET"]
19
+ - path: "src/utils/rss.ts"
20
+ provides: "RSS generation utility functions"
21
+ min_lines: 20
22
+ key_links:
23
+ - from: "rss.xml.ts"
24
+ to: "@astrojs/rss"
25
+ via: "rss() function import"
26
+ pattern: "import.*@astrojs/rss"
27
+ - from: "rss.xml.ts"
28
+ to: "getCollection('blog')"
29
+ via: "fetch posts for feed"
30
+ pattern: "getCollection\\('blog'\\)"
31
+ ---
32
+
33
+ <objective>
34
+ Implement RSS feed generation for blog posts using @astrojs/rss.
35
+
36
+ Purpose: Provide RSS feed for readers who prefer feed readers (Feedly, NewsBlur, etc.).
37
+ Output: Valid RSS 2.0 feed at /rss.xml with all published posts.
38
+ </objective>
39
+
40
+ <context>
41
+ Dependencies:
42
+ - Block 01: @astrojs/rss installed during project setup
43
+ - Block 03: Blog content collection configured
44
+
45
+ This block adds RSS feed support - a standard feature for technical blogs. Requirements explicitly mention "RSS feed" as a feature.
46
+
47
+ RSS feeds are static XML files generated at build time. Astro's @astrojs/rss integration makes this straightforward - no complex logic needed.
48
+
49
+ This block runs in parallel with Block 04 (wave 3) since there's no file overlap:
50
+ - Block 04 modifies: pages (index, blog, about, tags)
51
+ - Block 05 modifies: rss.xml.ts, utils/rss.ts
52
+ </context>
53
+
54
+ <threads>
55
+
56
+ <thread type="auto">
57
+ <name>Thread 1: Create RSS feed endpoint</name>
58
+ <files>src/pages/rss.xml.ts</files>
59
+ <action>
60
+ Create RSS feed using @astrojs/rss integration:
61
+
62
+ 1. Create src/pages/rss.xml.ts (note: .ts not .astro for API route)
63
+
64
+ 2. Import dependencies:
65
+ ```ts
66
+ import rss from '@astrojs/rss';
67
+ import { getCollection } from 'astro:content';
68
+ import type { APIContext } from 'astro';
69
+ ```
70
+
71
+ 3. Export GET function:
72
+ ```ts
73
+ export async function GET(context: APIContext) {
74
+ const posts = await getCollection('blog', ({ data }) => !data.draft);
75
+ const sortedPosts = posts.sort(
76
+ (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
77
+ );
78
+
79
+ return rss({
80
+ title: 'James Weatherhead Blog',
81
+ description: 'Technical writing on web development, DevOps, and software engineering',
82
+ site: context.site || 'https://jamesweatherhead.com',
83
+ items: sortedPosts.map(post => ({
84
+ title: post.data.title,
85
+ description: post.data.description,
86
+ pubDate: post.data.pubDate,
87
+ link: `/blog/${post.slug}/`,
88
+ categories: post.data.tags,
89
+ })),
90
+ customData: '<language>en-us</language>',
91
+ });
92
+ }
93
+ ```
94
+
95
+ 4. Ensure astro.config.mjs has site URL set (required for RSS):
96
+ - If not set, use placeholder: https://jamesweatherhead.com
97
+
98
+ AVOID: Do not add full content to RSS (use description only for preview). Do not add custom XML transformations (use @astrojs/rss defaults). WHY: Full content RSS increases bandwidth and complexity; previews encourage click-through to site.
99
+ </action>
100
+ <verify>
101
+ Run: npm run build
102
+ Check: dist/rss.xml exists
103
+ Run: npm run preview
104
+ Visit: http://localhost:4321/rss.xml
105
+ Check: XML renders in browser with all posts
106
+ Validate: Use https://validator.w3.org/feed/ or RSS validator
107
+ </verify>
108
+ <done>
109
+ - rss.xml.ts exports GET function returning RSS feed
110
+ - Feed includes all non-draft posts sorted by date
111
+ - Each item has title, description, pubDate, link, categories (tags)
112
+ - site URL configured in astro.config.mjs
113
+ - RSS feed accessible at /rss.xml
114
+ </done>
115
+ </thread>
116
+
117
+ <thread type="auto">
118
+ <name>Thread 2: Create RSS utility functions (optional helpers)</name>
119
+ <files>src/utils/rss.ts</files>
120
+ <action>
121
+ Create optional utility functions for RSS generation:
122
+
123
+ 1. Create src/utils/rss.ts
124
+
125
+ 2. Add helper functions:
126
+ ```ts
127
+ import type { CollectionEntry } from 'astro:content';
128
+
129
+ export function formatPostForRSS(post: CollectionEntry<'blog'>) {
130
+ return {
131
+ title: post.data.title,
132
+ description: post.data.description,
133
+ pubDate: post.data.pubDate,
134
+ link: `/blog/${post.slug}/`,
135
+ categories: post.data.tags,
136
+ };
137
+ }
138
+
139
+ export function sortPostsByDate(posts: CollectionEntry<'blog'>[]) {
140
+ return posts.sort(
141
+ (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
142
+ );
143
+ }
144
+ ```
145
+
146
+ 3. Refactor rss.xml.ts to use these utilities (DRY principle)
147
+
148
+ Note: This thread is optional but recommended for cleaner code. If time-constrained, inline logic in rss.xml.ts is acceptable.
149
+
150
+ AVOID: Do not add XML parsing utilities (use @astrojs/rss). Do not add feed caching (Astro handles this). WHY: @astrojs/rss provides all RSS functionality; additional abstractions add unnecessary complexity.
151
+ </action>
152
+ <verify>
153
+ Check: src/utils/rss.ts exports helper functions
154
+ Check: rss.xml.ts imports and uses utilities
155
+ Run: npm run build (should succeed)
156
+ Check: dist/rss.xml unchanged (same output, cleaner code)
157
+ </verify>
158
+ <done>
159
+ - src/utils/rss.ts created with helper functions
160
+ - formatPostForRSS converts post to RSS item format
161
+ - sortPostsByDate sorts posts by date descending
162
+ - rss.xml.ts refactored to use utilities
163
+ - Build output identical (cleaner code, same result)
164
+ </done>
165
+ </thread>
166
+
167
+ <thread type="auto">
168
+ <name>Thread 3: Add RSS autodiscovery link</name>
169
+ <files>src/layouts/BaseLayout.astro</files>
170
+ <action>
171
+ Add RSS feed autodiscovery to site header:
172
+
173
+ 1. Open src/layouts/BaseLayout.astro (created in Block 02)
174
+
175
+ 2. In the <head> section, add autodiscovery link:
176
+ ```html
177
+ <link
178
+ rel="alternate"
179
+ type="application/rss+xml"
180
+ title="James Weatherhead Blog"
181
+ href="/rss.xml"
182
+ />
183
+ ```
184
+
185
+ 3. This allows:
186
+ - Browsers to detect RSS feed (shows RSS icon in address bar)
187
+ - Feed readers to auto-discover feed
188
+ - Standard SEO best practice for blogs
189
+
190
+ 4. Optional: Add visible RSS link in Footer component:
191
+ - Icon or text link: "RSS Feed"
192
+ - Links to /rss.xml
193
+
194
+ AVOID: Do not add Atom feed (RSS 2.0 sufficient). Do not add JSON Feed (RSS standard more widely supported). WHY: RSS 2.0 is universal standard; additional feed formats add maintenance overhead without significant benefit.
195
+ </action>
196
+ <verify>
197
+ Run: npm run dev
198
+ Visit: http://localhost:4321
199
+ Check: View page source - <link rel="alternate" type="application/rss+xml"> in <head>
200
+ Check: Browser RSS icon appears (if browser supports)
201
+ Check: Footer has RSS link (if added)
202
+ </verify>
203
+ <done>
204
+ - BaseLayout.astro has RSS autodiscovery link in <head>
205
+ - RSS feed detectable by browsers and feed readers
206
+ - Optional: Footer contains visible RSS link
207
+ - Feed properly advertised to users
208
+ </done>
209
+ </thread>
210
+
211
+ </threads>
212
+
213
+ <verification>
214
+ Complete verification checklist:
215
+ 1. src/pages/rss.xml.ts exports GET function
216
+ 2. RSS feed includes all non-draft posts
217
+ 3. Posts sorted by date descending (newest first)
218
+ 4. Each item has title, description, pubDate, link, categories
219
+ 5. Feed validates against RSS 2.0 spec (use validator)
220
+ 6. /rss.xml accessible after build
221
+ 7. BaseLayout.astro has autodiscovery link in <head>
222
+ 8. Optional: Footer has visible RSS link
223
+ 9. npm run build generates dist/rss.xml
224
+ 10. Feed loads in feed reader (test with Feedly or similar)
225
+ </verification>
226
+
227
+ <success_criteria>
228
+ - RSS feed accessible at /rss.xml
229
+ - Feed contains all published blog posts
230
+ - Feed validates against RSS 2.0 specification
231
+ - Autodiscovery link present in site <head>
232
+ - Feed items have complete metadata (title, description, date, link, tags)
233
+ - Build generates static RSS XML file
234
+ - Feed works in standard feed readers
235
+ </success_criteria>
@@ -0,0 +1,325 @@
1
+ ---
2
+ cluster: james-weatherhead-blog
3
+ block: 06
4
+ type: execute
5
+ wave: 4
6
+ depends_on: [02, 04, 05]
7
+ files_modified: [.gitignore, README.md, vercel.json]
8
+ autonomous: false
9
+
10
+ must_haves:
11
+ truths:
12
+ - "Project builds successfully for production"
13
+ - "All pages render without errors"
14
+ - "Vercel configuration is deployment-ready"
15
+ artifacts:
16
+ - path: "README.md"
17
+ provides: "Project documentation for setup and deployment"
18
+ min_lines: 30
19
+ - path: ".gitignore"
20
+ provides: "Git ignore rules for build artifacts and secrets"
21
+ min_lines: 10
22
+ - path: "vercel.json"
23
+ provides: "Vercel deployment configuration"
24
+ min_lines: 5
25
+ key_links:
26
+ - from: "vercel.json"
27
+ to: "astro.config.mjs"
28
+ via: "framework detection"
29
+ pattern: "astro"
30
+ ---
31
+
32
+ <objective>
33
+ Finalize project for production deployment - verification, documentation, and deployment configuration.
34
+
35
+ Purpose: Ensure blog is production-ready with comprehensive documentation and verified build.
36
+ Output: Deployment-ready blog with README, verified build, and Vercel config.
37
+ </objective>
38
+
39
+ <context>
40
+ All feature blocks completed:
41
+ - Block 01: Project initialization ✓
42
+ - Block 02: Layout system with dark mode ✓
43
+ - Block 03: Content collection and blog posts ✓
44
+ - Block 04: Static pages and tag filtering ✓
45
+ - Block 05: RSS feed ✓
46
+
47
+ This final block:
48
+ 1. Verifies entire site builds without errors
49
+ 2. Creates comprehensive README for users/developers
50
+ 3. Confirms Vercel configuration from Block 01
51
+ 4. Tests production build locally
52
+ 5. Prepares for Vercel deployment
53
+
54
+ This is a verification and documentation block - no new features, just ensuring everything works together.
55
+ </context>
56
+
57
+ <threads>
58
+
59
+ <thread type="auto">
60
+ <name>Thread 1: Comprehensive production build verification</name>
61
+ <files>.gitignore</files>
62
+ <action>
63
+ Verify production build and clean up configuration:
64
+
65
+ 1. Run full build pipeline:
66
+ ```bash
67
+ cd /Users/jacweath/grid/blog
68
+ npm run build
69
+ ```
70
+
71
+ 2. Verify build outputs:
72
+ - Check dist/ directory created
73
+ - Verify all pages generated (index, blog, about, posts, tags, rss.xml)
74
+ - Check for build warnings or errors
75
+ - Verify syntax highlighting assets included
76
+
77
+ 3. Test production build locally:
78
+ ```bash
79
+ npm run preview
80
+ ```
81
+ - Visit all pages: /, /blog, /about, /blog/sample-post, /blog/tags/{tag}, /rss.xml
82
+ - Test dark mode toggle on each page
83
+ - Check for console errors
84
+ - Verify navigation links work
85
+
86
+ 4. Update .gitignore if needed:
87
+ - Ensure dist/ excluded
88
+ - Ensure .astro/ excluded
89
+ - Ensure .vercel/ excluded
90
+ - Add any OS-specific files (.DS_Store, Thumbs.db)
91
+
92
+ AVOID: Do not ignore node_modules in package-lock.json (commit lock file). Do not add IDE configs to gitignore (use global gitignore). WHY: Lock files ensure reproducible builds; IDE configs are personal preference, not project-level.
93
+ </action>
94
+ <verify>
95
+ Run: npm run build
96
+ Check: Exit code 0 (success)
97
+ Check: dist/ contains index.html, blog/, rss.xml
98
+ Run: npm run preview
99
+ Visit: All pages load without errors
100
+ Check: Console has no errors
101
+ Check: Dark mode works on all pages
102
+ </verify>
103
+ <done>
104
+ - npm run build completes successfully
105
+ - All pages generated in dist/ directory
106
+ - npm run preview serves production build
107
+ - All pages accessible and functional
108
+ - No console errors or build warnings
109
+ - .gitignore updated with all necessary exclusions
110
+ </done>
111
+ </thread>
112
+
113
+ <thread type="auto">
114
+ <name>Thread 2: Create comprehensive README documentation</name>
115
+ <files>README.md</files>
116
+ <action>
117
+ Create README.md with project documentation:
118
+
119
+ 1. Project overview section:
120
+ - Project name: James Weatherhead Blog
121
+ - Description: Minimal technical blog built with Astro
122
+ - Tech stack: Astro, Tailwind CSS, TypeScript
123
+ - Features: Dark mode, markdown posts, tags, RSS feed
124
+
125
+ 2. Prerequisites section:
126
+ - Node.js 18+ required
127
+ - npm or pnpm
128
+
129
+ 3. Getting Started section:
130
+ ```bash
131
+ # Install dependencies
132
+ npm install
133
+
134
+ # Start dev server
135
+ npm run dev
136
+
137
+ # Build for production
138
+ npm run build
139
+
140
+ # Preview production build
141
+ npm run preview
142
+ ```
143
+
144
+ 4. Project Structure:
145
+ ```
146
+ /
147
+ ├── src/
148
+ │ ├── components/ # Reusable components
149
+ │ ├── content/
150
+ │ │ └── blog/ # Markdown blog posts
151
+ │ ├── layouts/ # Layout components
152
+ │ ├── pages/ # Route pages
153
+ │ └── styles/ # Global styles
154
+ ├── public/ # Static assets
155
+ └── astro.config.mjs # Astro configuration
156
+ ```
157
+
158
+ 5. Content Management:
159
+ - How to add new blog post (create .md in src/content/blog/)
160
+ - Frontmatter schema explanation
161
+ - Tag usage
162
+
163
+ 6. Deployment section:
164
+ - Vercel deployment instructions
165
+ - Environment variables (if any)
166
+ - Custom domain setup (brief)
167
+
168
+ 7. Features section:
169
+ - Dark mode toggle
170
+ - Syntax highlighting
171
+ - RSS feed at /rss.xml
172
+ - Tag-based filtering
173
+
174
+ AVOID: Do not add contributing guidelines yet (single author). Do not add license section unless specified. WHY: Personal blog doesn't need complex governance docs; add if project becomes open source.
175
+ </action>
176
+ <verify>
177
+ Check: README.md exists with all sections
178
+ Check: Installation commands are accurate
179
+ Check: Project structure matches actual structure
180
+ Run: Follow getting started steps to verify accuracy
181
+ </verify>
182
+ <done>
183
+ - README.md created with comprehensive documentation
184
+ - All sections present: overview, prerequisites, getting started, structure, deployment
185
+ - Installation and build commands verified
186
+ - Content management instructions clear
187
+ - Deployment instructions for Vercel included
188
+ </done>
189
+ </thread>
190
+
191
+ <thread type="auto">
192
+ <name>Thread 3: Verify and document Vercel configuration</name>
193
+ <files>vercel.json</files>
194
+ <action>
195
+ Verify Vercel deployment configuration:
196
+
197
+ 1. Check vercel.json from Block 01:
198
+ - Ensure framework: "astro"
199
+ - Ensure buildCommand: "npm run build"
200
+ - Ensure outputDirectory: "dist"
201
+
202
+ 2. Verify astro.config.mjs:
203
+ - Adapter: @astrojs/vercel/serverless (or /static if fully static)
204
+ - Site URL: Update if final domain known (e.g., https://jamesweatherhead.com)
205
+
206
+ 3. Create deployment checklist in README:
207
+ ```markdown
208
+ ## Deployment to Vercel
209
+
210
+ 1. Push code to GitHub repository
211
+ 2. Import project in Vercel dashboard
212
+ 3. Vercel auto-detects Astro framework
213
+ 4. Set environment variables (if any):
214
+ - SITE_URL: https://yourdomain.com
215
+ 5. Deploy
216
+ 6. Configure custom domain (optional)
217
+ ```
218
+
219
+ 4. Test local build mimics Vercel:
220
+ - Ensure no local-only dependencies
221
+ - Verify all imports are relative (not absolute)
222
+ - Check no hardcoded localhost URLs
223
+
224
+ AVOID: Do not add CI/CD pipelines yet (Vercel handles this). Do not add preview deployment config (Vercel provides automatically). WHY: Vercel's built-in CI/CD is sufficient for blog; manual configuration adds complexity.
225
+ </action>
226
+ <verify>
227
+ Check: vercel.json has correct framework and build settings
228
+ Check: astro.config.mjs has site URL configured
229
+ Check: README.md has deployment instructions
230
+ Run: npm run build (simulate Vercel build)
231
+ Check: No errors referencing localhost or local paths
232
+ </verify>
233
+ <done>
234
+ - vercel.json verified with correct configuration
235
+ - astro.config.mjs has site URL set
236
+ - README.md includes deployment checklist
237
+ - Build succeeds without local-only dependencies
238
+ - Project ready for Vercel deployment
239
+ </done>
240
+ </thread>
241
+
242
+ <thread type="checkpoint:human-verify" gate="blocking">
243
+ <what-built>
244
+ Production-ready blog with:
245
+ - Verified production build (all pages generate correctly)
246
+ - Comprehensive README documentation
247
+ - Vercel deployment configuration
248
+ - Complete project ready for deployment
249
+ </what-built>
250
+ <how-to-verify>
251
+ 1. cd /Users/jacweath/grid/blog
252
+
253
+ 2. Clean build test:
254
+ ```bash
255
+ rm -rf dist/
256
+ npm run build
257
+ ```
258
+ - Should complete without errors
259
+ - Check dist/ contains all expected files
260
+
261
+ 3. Preview production build:
262
+ ```bash
263
+ npm run preview
264
+ ```
265
+ - Visit http://localhost:4321
266
+ - Test all pages: /, /blog, /about, /blog/sample-post
267
+ - Test tag filtering: click tags, verify filtered posts
268
+ - Test RSS feed: visit /rss.xml
269
+ - Test dark mode toggle on each page
270
+ - Check browser console for errors (should be none)
271
+
272
+ 4. Review documentation:
273
+ - Read README.md
274
+ - Verify instructions are clear and accurate
275
+ - Check project structure matches reality
276
+
277
+ 5. Verify deployment readiness:
278
+ - Check vercel.json exists with correct settings
279
+ - Check .gitignore excludes build artifacts
280
+ - Verify no hardcoded localhost URLs in code
281
+
282
+ 6. Final checklist:
283
+ - [ ] Build completes successfully
284
+ - [ ] All pages load in preview
285
+ - [ ] Dark mode works everywhere
286
+ - [ ] Navigation links functional
287
+ - [ ] Tags filter correctly
288
+ - [ ] RSS feed validates
289
+ - [ ] README accurate
290
+ - [ ] No console errors
291
+ </how-to-verify>
292
+ <resume-signal>Type "approved" if blog is production-ready and documentation is complete, or describe issues (e.g., "build fails", "page missing", "README unclear")</resume-signal>
293
+ </thread>
294
+
295
+ </threads>
296
+
297
+ <verification>
298
+ Complete verification checklist:
299
+ 1. npm run build completes with exit code 0
300
+ 2. dist/ directory contains all pages and assets
301
+ 3. npm run preview serves production build successfully
302
+ 4. All pages load without errors (/, /blog, /about, posts, tags, rss.xml)
303
+ 5. Dark mode toggle works on all pages
304
+ 6. Navigation links functional across site
305
+ 7. Tag filtering displays correct posts
306
+ 8. RSS feed accessible and validates
307
+ 9. README.md complete with all sections
308
+ 10. vercel.json configured correctly
309
+ 11. .gitignore excludes all build artifacts
310
+ 12. No hardcoded localhost or local-only dependencies
311
+ 13. Browser console has no errors
312
+ 14. User approves blog is deployment-ready
313
+ </verification>
314
+
315
+ <success_criteria>
316
+ - Production build succeeds without errors
317
+ - All pages render correctly in preview
318
+ - Dark mode functional across entire site
319
+ - Navigation and filtering work as expected
320
+ - RSS feed validates and loads in feed readers
321
+ - README provides clear setup and deployment instructions
322
+ - Vercel configuration ready for deployment
323
+ - No console errors or warnings
324
+ - User confirms blog is ready to deploy to Vercel
325
+ </success_criteria>