Video Companion

[Part 4] How to Build an Astro Blog Post Layout – Hero, Components, Image Optimization (AI Prompts Included)

+
🔥 Steal the exact AI prompts + workflow from this video: https://thomasfellows.com/videos/astro-blog-post-layout-ai-prompts/ In this video, I build a complete Astro blog post system using AI — including the post layout, reusable components, responsive design, and Astro image optimization. No WordPress. No page builders. No coding experience required. ⏱️ TIMESTAMPS 00:00 The “perfect prompt” myth https://www.youtube.com/watch?v=EojC3UF3UFQ&t=0s 00:15 What we're actually building https://www.youtube.com/watch?v=EojC3UF3UFQ&t=15s 00:51 Why Astro image optimization matters https://www.youtube.com/watch?v=EojC3UF3UFQ&t=51s 01:01 Building websites without coding or page builders https://www.youtube.com/watch?v=EojC3UF3UFQ&t=61s 01:13 Overview of the full AI-first website series https://www.youtube.com/watch?v=EojC3UF3UFQ&t=73s 01:39 Building a real-world website system https://www.youtube.com/watch?v=EojC3UF3UFQ&t=99s 01:53 Where to get the prompts from this video https://www.youtube.com/watch?v=EojC3UF3UFQ&t=113s 02:05 Project walkthrough and final result preview https://www.youtube.com/watch?v=EojC3UF3UFQ&t=125s 03:11 Planning the post layout structure https://www.youtube.com/watch?v=EojC3UF3UFQ&t=191s 04:45 Building the hero section https://www.youtube.com/watch?v=EojC3UF3UFQ&t=285s 14:37 Structuring the blog post content area https://www.youtube.com/watch?v=EojC3UF3UFQ&t=877s 19:50 Creating the sidebar layout https://www.youtube.com/watch?v=EojC3UF3UFQ&t=1190s 24:15 Related posts section https://www.youtube.com/watch?v=EojC3UF3UFQ&t=1455s 29:54 Building reusable video components https://www.youtube.com/watch?v=EojC3UF3UFQ&t=1794s 35:34 Creating inline call-to-actions https://www.youtube.com/watch?v=EojC3UF3UFQ&t=2134s 42:58 Styling reusable content components https://www.youtube.com/watch?v=EojC3UF3UFQ&t=2578s 47:18 Building the author box https://www.youtube.com/watch?v=EojC3UF3UFQ&t=2838s 51:48 Related posts improvements https://www.youtube.com/watch?v=EojC3UF3UFQ&t=3108s 58:27 Responsive sidebar fixes https://www.youtube.com/watch?v=EojC3UF3UFQ&t=3507s 01:05:37 Final reusable component refinements https://www.youtube.com/watch?v=EojC3UF3UFQ&t=3937s 01:08:24 Mobile responsiveness testing https://www.youtube.com/watch?v=EojC3UF3UFQ&t=4104s 01:12:55 Converting the entire site to Astro image optimization https://www.youtube.com/watch?v=EojC3UF3UFQ&t=4375s 01:18:24 Responsive image optimization improvements https://www.youtube.com/watch?v=EojC3UF3UFQ&t=4704s 01:21:11 Final sidebar cleanup and testing https://www.youtube.com/watch?v=EojC3UF3UFQ&t=4871s 01:26:40 Final walkthrough and results https://www.youtube.com/watch?v=EojC3UF3UFQ&t=5200s This video is part 4 of my AI-first Astro website series where I'm documenting the full process of building a real SEO-driven website system using AI tools and modern web development workflows. You'll see how I structure reusable components, create scalable layouts, improve mobile responsiveness, and implement Astro's built-in image optimization system for better performance and cleaner code. 🔗 Resources * https://astro.build * https://docs.astro.build/en/guides/images/ * https://code.visualstudio.com * https://tailwindcss.com * https://docs.astro.build/en/guides/content-collections/ * https://docs.astro.build/en/guides/integrations-guide/mdx/ This video is for: • Web designers transitioning away from WordPress • Beginners learning Astro with AI • Freelancers building scalable website systems • Anyone interested in AI-assisted web development workflows Key outcomes from this video: • Build a reusable Astro blog post layout • Create scalable content components • Improve mobile responsiveness • Implement Astro image optimization correctly • Build a cleaner AI-first workflow for real projects 🔥 Get the prompts, workflows, and resources used in this video: https://thomasfellows.com/videos/astro-blog-post-layout-ai-prompts/
Beyond The Video

Companion Updates

Use this page to copy the phased AI prompts from the video and adapt them to your own Astro blog post layout build.

Key Takeaways

  • Build the post layout in phases instead of trying to prompt the whole system at once.
  • Treat the hero, MDX styling, sidebar, CTAs, related posts, and mobile states as one reusable content system.
  • Finish with QA and Astro image optimization before calling the layout production-ready.

Best Suited For

  • Web designers moving from WordPress or page builders into Astro.
  • Freelancers building reusable blog and content systems for client sites.
  • Beginners who want to use Codex prompts without losing the structure of a real production workflow.

Astro Blog Post Layout AI Prompts

Copy these prompts one phase at a time so Codex can build the layout, components, responsive behavior, and image optimization in a controlled sequence.

Core Layout Skeleton

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement the foundational post layout structure for individual post pages.

Important context: This is not the final post design. This step is about creating the real structural foundation that later post components will plug into.

The implementation may include real layout/components such as:

  • A post layout file
  • A post hero placeholder component
  • A content wrapper/container
  • A sidebar placeholder component
  • End-of-post placeholder components or slots/regions

However, these should only establish structure. They should not contain final content, final design, or advanced logic yet.

The layout should include:

  • Hero region
  • Main article/content column
  • Sidebar region
  • End-of-post regions
  • Responsive desktop/mobile structure
  • Semantic HTML
  • Tailwind classes that match the existing project conventions
  • Clean component boundaries that will make later implementation easier

Do not build the final versions of:

  • Hero design
  • MDX typography styling
  • Table of contents logic
  • Glossary context block
  • Newsletter CTA
  • Inline CTA
  • Video component
  • Related posts logic
  • Author box
  • Final end CTA
  • Final marketing copy

Dependency rule: Prefer the existing project stack and conventions. Do not add new dependencies casually. If a dependency is genuinely needed for the layout scaffold, explain why it is needed before including it in the implementation prompt.

Please inspect:

  • Existing routes/pages for posts
  • Existing layouts
  • Existing components
  • Existing content collections
  • Existing Tailwind/design conventions
  • Existing naming and folder patterns

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file/component
  4. The implementation order
  5. Project-specific findings from this repo
  6. Constraints and what not to build yet
  7. Dependency guidance
  8. A final checklist for the fresh Codex chat to follow

The final answer should only be the copy-pasteable prompt for the next Codex chat.

Style the MDX Article Content

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement MDX content styling inside the post content column.

Important context: The foundational post layout skeleton already exists or will exist. This step is about styling raw MDX/article content inside the main content area only.

Goal: Create clean, readable article styling for MDX content elements and create one realistic sample post inside the actual posts collection so I can review the styling in context.

The MDX styling should cover:

  • H1–H6
  • Paragraphs
  • Links
  • Ordered and unordered lists
  • Nested lists if appropriate
  • Blockquotes
  • Inline code
  • Code blocks
  • Images
  • Tables
  • Horizontal rules

Sample post requirement: Create a sample post inside the actual posts collection that uses all of these MDX elements naturally inside a realistic article.

Do not create a fake style-guide page that just lists elements in order.

The sample post should read like a real article, where:

  • H1 is used as the article title if that matches the project’s MDX/content convention
  • H2s divide major sections
  • H3/H4/H5/H6 are used only where contextually reasonable
  • Lists appear where lists would naturally help the reader
  • A blockquote appears as a real pull quote or quoted insight
  • A table appears where comparison or structured information makes sense
  • Code appears only if contextually useful
  • Images appear with realistic placeholder usage based on the project’s existing asset conventions
  • Horizontal rules are used only if they make sense in the article flow

The sample article should be polished enough to evaluate design decisions, but it is not final marketing content.

Important: After I review and approve the MDX styling visually, this styling will later be codified into the project’s design system for repeated use across the website. For now, focus on creating and testing the article content styling in the real post context.

Please inspect:

  • Existing post layout structure
  • Existing posts collection schema and file conventions
  • Existing MDX/content collection setup
  • Existing global CSS, Tailwind config, typography utilities, and design tokens
  • Existing article/content styling patterns, if any
  • Existing image/assets conventions

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file
  4. The implementation order
  5. Project-specific findings from this repo
  6. How to create the realistic sample posts post
  7. How to style the MDX content elements
  8. Constraints and what not to build yet
  9. Dependency guidance
  10. A final implementation checklist for the fresh Codex chat to follow

Constraints:

  • Do not build unrelated post components
  • Do not build the final hero section
  • Do not build sidebar functionality
  • Do not build CTAs, related posts, author box, video components, newsletter forms, or glossary blocks
  • Do not over-design
  • Do not add new dependencies casually
  • Prefer existing project conventions
  • If a dependency is genuinely required, explain why before recommending it
  • Keep the styling scoped to article/MDX content where possible
  • Avoid one-off styles that will be hard to codify later
  • Preserve the existing layout structure

The final answer should only be the copy-pasteable prompt for the next Codex chat.

Hero Section

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement a production-ready post hero section for individual post pages.

Important context: The foundational post layout skeleton and MDX content styling either already exist or are being built separately. This step is only about the post hero section.

Goal: Build the real post hero section for individual post pages.

The hero section should include:

  • Featured image
  • Post title
  • Breadcrumbs
  • Author
  • Publish date
  • Reading time
  • Glossary tags

The hero should be production-ready visually and structurally, but it should not trigger unrelated work outside the hero.

Please inspect:

  • Existing post layout structure
  • Existing posts collection schema and frontmatter fields
  • Existing author data structure, if any
  • Existing glossary/tag/reference system
  • Existing image/asset conventions
  • Existing breadcrumb patterns, if any
  • Existing date formatting utilities, if any
  • Existing reading-time logic, if any
  • Existing components and design conventions
  • Existing global CSS, Tailwind config, tokens, and typography styles

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file/component
  4. The implementation order
  5. Project-specific findings from this repo
  6. How the hero should pull data from the post/frontmatter/content collection
  7. How breadcrumbs should be generated
  8. How reading time should be handled
  9. How glossary tags should be displayed and linked, if the project already supports that
  10. Fallback behavior for missing featured image, author, date, tags, or reading time
  11. Constraints and what not to build yet
  12. Dependency guidance
  13. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Create a real reusable hero component if that matches the project architecture
  • Use semantic HTML
  • Match existing design system and Tailwind conventions
  • Keep the component easy to reuse across post pages
  • Keep data handling clean and predictable
  • Avoid hardcoded article-specific content except for temporary test/sample content if needed
  • Preserve the existing layout and MDX styling work
  • Use existing utilities before creating new ones
  • Add small utilities only if they clearly reduce duplication or improve maintainability

Do not build:

  • Sidebar functionality
  • Table of contents logic
  • Inline CTA
  • End CTA
  • Related posts
  • Author box
  • Video component
  • Newsletter form
  • Glossary context block
  • Full post layout redesign
  • New design system pass
  • Unrelated refactors

Dependency rule: Prefer the existing project stack and conventions. Do not add new dependencies casually. If a dependency is genuinely needed for featured images, reading time, breadcrumbs, or metadata handling, explain why before recommending it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.

Video Component

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement a reusable embedded YouTube video component for MDX content.

Goal: Create a reusable video component that can be used inside MDX posts.

The component should support:

  • YouTube video embed
  • Simple MDX usage
  • Responsive aspect ratio
  • Optional title/caption if appropriate
  • Accessible iframe title
  • Clean styling that matches the existing article/content design
  • Reuse across multiple posts

Please inspect:

  • Existing Astro component structure
  • Existing MDX setup
  • Existing posts collection setup
  • Existing post layout and MDX content styling
  • Existing Tailwind/design conventions
  • Any existing media/embed components

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file/component
  4. The implementation order
  5. Project-specific findings from this repo
  6. The recommended component API/props
  7. Example MDX usage
  8. How to handle YouTube IDs vs full URLs
  9. Accessibility requirements
  10. Responsive styling requirements
  11. Constraints and what not to build yet
  12. Dependency guidance
  13. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Create a real reusable component if that matches the project architecture
  • Keep usage simple inside MDX
  • Prefer accepting a YouTube video ID, but allow full URL support only if it can be done cleanly without overbuilding
  • Use semantic, accessible markup
  • Make the embed responsive without relying on unnecessary dependencies
  • Match existing Tailwind/design-system conventions
  • Avoid hardcoded video-specific content
  • Add the component to the sample MDX post only if that helps verify it works in real content context

Do not build:

  • A full video library system
  • Video CMS fields
  • Playlist support
  • Custom video player controls
  • Analytics tracking
  • Lazy-loading framework unless the existing project already has a pattern for it
  • Related videos
  • CTA logic
  • Sidebar changes
  • Hero changes
  • Unrelated MDX styling changes
  • New design system pass
  • Unrelated refactors

Dependency rule: Prefer the existing project stack and browser-native iframe support. Do not add new dependencies casually. If a dependency is genuinely needed for YouTube embeds or MDX component usage, explain why before recommending it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.

Inline CTA Component

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement a reusable inline CTA component for MDX/post content.

Goal: Create a reusable inline CTA component that can be placed naturally inside article content.

The component should support:

  • Flexible headline/copy
  • Flexible button text
  • Flexible button URL
  • Optional small label/eyebrow if useful
  • No image
  • Clean layout inside the content column
  • Reuse across multiple posts

Please inspect:

  • Existing Astro component structure
  • Existing MDX setup
  • Existing posts collection setup
  • Existing post layout and MDX content styling
  • Existing button/link components, if any
  • Existing Tailwind/design conventions
  • Existing CTA or card patterns, if any

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file/component
  4. The implementation order
  5. Project-specific findings from this repo
  6. The recommended component API/props
  7. Example MDX usage
  8. Accessibility requirements
  9. Responsive styling requirements
  10. Constraints and what not to build yet
  11. Dependency guidance
  12. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Create a real reusable component if that matches the project architecture
  • Keep usage simple inside MDX
  • Use existing button/link styles if available
  • Keep the CTA content flexible through props or slots
  • Make it visually distinct from normal article content without feeling like a full end-of-post sales block
  • Make it work naturally between paragraphs or sections
  • Use semantic, accessible markup
  • Avoid hardcoded campaign-specific copy
  • Add the component to the sample MDX post only if that helps verify it in real article context

Do not build:

  • End-of-post CTA
  • Image-based CTA
  • Newsletter form
  • Lead magnet delivery logic
  • Form handling
  • Tracking/analytics
  • Related posts
  • Sidebar changes
  • Hero changes
  • New design system pass
  • Unrelated MDX styling changes
  • Unrelated refactors

Dependency rule: Prefer the existing project stack and conventions. Do not add new dependencies casually. If a dependency is genuinely needed for this inline CTA component, explain why before recommending it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.

What To Do Next Component

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement a reusable “What To Do Next” component for individual post pages.

Goal: Create a contextual next-step component that can appear inside or near the end of a post and guide the reader toward the best next action.

This component should include:

  • Recommended post
  • Recommended video
  • Work-with-me option

Important context: This is not a generic related-posts grid. This is a curated next-step component.

The recommended post, recommended video, and work-with-me CTA should be variable based on what the current post is about.

Please inspect:

  • Existing post layout structure
  • Existing posts collection schema and frontmatter fields
  • Existing glossary/tag/reference system
  • Existing video component from the previous step
  • Existing CTA/button components
  • Existing content collection relationships
  • Existing design conventions and Tailwind patterns
  • Existing utilities for filtering/querying posts, if any

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file/component
  4. The implementation order
  5. Project-specific findings from this repo
  6. The recommended component API/props
  7. How the recommended post should be selected or passed in
  8. How the recommended video should be selected or passed in
  9. How the work-with-me CTA should be selected or passed in
  10. Whether this should be manual/frontmatter-driven, automatic, or hybrid based on the existing project
  11. Example usage in a post/layout/MDX file
  12. Fallback behavior if one of the three options is missing
  13. Accessibility requirements
  14. Responsive styling requirements
  15. Constraints and what not to build yet
  16. Dependency guidance
  17. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Create a real reusable component if that matches the project architecture
  • Make the component flexible enough to support different recommendations per post
  • Prefer a simple manual or frontmatter-driven system unless the project already has a clean relationship system for automatic recommendations
  • Avoid overbuilding a recommendation engine
  • Allow the current post topic, category, glossary references, or frontmatter fields to influence the recommendations if the existing content system supports it
  • Make each option visually clear and distinct:
  • Recommended post = continue learning
  • Recommended video = watch the related explanation
  • Work with me = conversion/action step
  • Keep the CTA copy flexible
  • Use existing button/link/card styles if available
  • Match the existing article and design-system conventions
  • Keep the component easy to place in multiple posts
  • Add it to the sample MDX post or post layout only if that helps verify it in context

Recommended data approach: Prefer a hybrid system if it fits the project:

  • Let posts manually define recommended next steps in frontmatter when precision matters
  • Allow fallback recommendations based on shared glossary tags, category, or content silo if manual recommendations are missing
  • Keep the first version simple and maintainable

Do not build:

  • Full recommendation engine
  • Analytics/tracking
  • Newsletter form
  • Contact form
  • Booking system
  • Related posts grid
  • Sidebar changes
  • Hero changes
  • Author box
  • End-of-post CTA replacement
  • New design system pass
  • Unrelated MDX styling changes
  • Unrelated refactors

Dependency rule: Prefer the existing project stack and conventions. Do not add new dependencies casually. If a dependency is genuinely needed for querying posts, videos, or recommendations, explain why before recommending it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.

Author Box

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement a reusable author box component for individual post pages.

Goal: Create a reusable author box component that displays author information for the current post.

Important context: This project has an authors content collection. Individual posts should reference an author, and the author box should use that post-author relationship to pull the correct author data from the authors collection.

The author box should include:

  • Author name
  • Author bio/description
  • Author image/avatar if available
  • Optional link to about/contact page
  • Any existing author metadata already supported by the project

Please inspect:

  • Existing authors content collection
  • Existing posts collection schema
  • How posts currently reference authors
  • Existing author frontmatter fields
  • Existing image/avatar conventions
  • Existing post layout structure
  • Existing Astro content collection references
  • Existing components and Tailwind/design conventions
  • Existing author usage in the hero section, if already implemented

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file/component
  4. The implementation order
  5. Project-specific findings from this repo
  6. The recommended author data flow
  7. How the current post’s author should connect to the authors collection
  8. The recommended component API/props
  9. Whether author lookup should happen in the post layout, page route, or inside the component
  10. Fallback behavior for missing author, missing avatar, missing bio, or missing link
  11. Example usage in the post layout or post page
  12. Accessibility requirements
  13. Responsive styling requirements
  14. Constraints and what not to build yet
  15. Dependency guidance
  16. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Create a real reusable author box component
  • Prefer pulling structured author data from the authors collection instead of duplicating author details in every post
  • Keep the post frontmatter lightweight, ideally referencing the author by slug/id if the project supports that
  • Preserve compatibility with the existing hero author display
  • If needed, update the schema carefully so posts can reference authors cleanly
  • If additional author frontmatter fields are useful for the author box, recommend them clearly before adding them
  • Keep the component flexible enough to support future fields without overbuilding
  • Use semantic, accessible markup
  • Match existing article and design-system conventions
  • Use existing image handling conventions
  • Avoid hardcoded author-specific content in the component

Recommended data approach: Prefer this structure if it fits the existing project:

  • Each post references one author by slug/id
  • The page route or layout resolves that author from the authors collection
  • The resolved author object is passed into the AuthorBox component
  • The component only renders the author data it receives

Do not build:

  • Full author archive pages
  • Author listing pages
  • Multi-author system unless the project already supports it
  • Social profile system unless author fields already exist
  • Contact form
  • Newsletter form
  • Sidebar changes
  • Related posts
  • End CTA
  • New design system pass
  • Unrelated post schema refactors
  • Unrelated MDX styling changes

Dependency rule: Prefer Astro content collections and the existing project stack. Do not add new dependencies casually. If a dependency is genuinely needed for author lookup, image handling, or collection references, explain why before recommending it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement a reusable related posts component for individual post pages.

Goal: Create a related posts system that recommends posts based on shared glossary references.

Important context: This project has a glossary content collection. Glossary entries work like topic references/tags for posts. For example, a post about SEO might reference the seo glossary entry, and a post about tracking might reference the utm-parameters glossary entry.

The related posts component should:

  • Look at the current post’s glossary references
  • Query other posts that share one or more of those same glossary references
  • Exclude the current post
  • Limit the number of results
  • Output a reusable related posts section

Please inspect:

  • Existing posts collection schema
  • Existing glossary collection schema
  • How posts currently reference glossary entries
  • Existing content collection relationship patterns
  • Existing post card/list components, if any
  • Existing route/slug structure for posts
  • Existing post layout structure
  • Existing Tailwind/design conventions
  • Existing utilities for filtering/sorting posts, if any

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file/component
  4. The implementation order
  5. Project-specific findings from this repo
  6. The recommended data flow
  7. How to read the current post’s glossary references
  8. How to query posts with shared glossary references
  9. How to exclude the current post
  10. How to limit the results
  11. How to sort/rank related posts if multiple posts match
  12. The recommended component API/props
  13. Example usage in the post layout or post page
  14. Fallback behavior if there are no glossary references or no related posts
  15. Accessibility requirements
  16. Responsive styling requirements
  17. Constraints and what not to build yet
  18. Dependency guidance
  19. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Create a real reusable related posts component
  • Prefer using Astro content collections and existing project conventions
  • Treat glossary references as topic relationships, not as a separate generic tag system
  • Keep the first version simple and maintainable
  • Avoid creating duplicate tag archives or a parallel tagging system
  • Rank posts with more shared glossary references higher if practical
  • Exclude drafts or unpublished posts if the project has that convention
  • Use existing post card styles if available
  • Match the existing article and design-system conventions
  • Keep the component easy to reuse later
  • Avoid hardcoded related post data in the component

Recommended data approach: Prefer this structure if it fits the existing project:

  • The current post includes a frontmatter field referencing glossary entries
  • The page route or post layout gets all published posts from the posts collection
  • A small utility filters posts by shared glossary references
  • The current post is excluded by slug/id
  • Matching posts are sorted by number of shared glossary references
  • The limited result set is passed into a reusable RelatedPosts component
  • The component only renders the posts it receives

Do not build:

  • Generic tag archive system
  • Glossary archive redesign
  • Full recommendation engine
  • Search system
  • Pagination
  • Sidebar changes
  • Author box changes
  • End CTA
  • Newsletter form
  • New design system pass
  • Unrelated schema refactors
  • Unrelated MDX styling changes

Dependency rule: Prefer Astro content collections and existing utilities. Do not add new dependencies casually. If a dependency is genuinely needed for content querying or ranking, explain why before recommending it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.

End CTA

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement a reusable end-of-post CTA component.

Goal: Create a primary conversion component that appears near the end of individual post pages.

Important context: This is the final service-focused CTA block, not the smaller inline CTA and not the “What To Do Next” component.

The end CTA should:

  • Promote the main service/offer
  • Be reusable across posts
  • Support flexible headline/copy/button text/button URL
  • Optionally support different CTA variations based on the post topic
  • Work as the primary conversion block near the bottom of an article

Please inspect:

  • Existing post layout structure
  • Existing MDX/post components
  • Existing inline CTA component
  • Existing “What To Do Next” component, if already implemented
  • Existing button/link/card styles
  • Existing service/offer copy patterns
  • Existing Tailwind/design conventions
  • Existing content collection/frontmatter structure

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file/component
  4. The implementation order
  5. Project-specific findings from this repo
  6. The recommended component API/props
  7. Whether CTA content should be passed manually, controlled by frontmatter, or use defaults
  8. How to support topic-specific CTA variations without overbuilding
  9. Example usage in the post layout, post page, or MDX
  10. Fallback behavior if no custom CTA is provided
  11. Accessibility requirements
  12. Responsive styling requirements
  13. Constraints and what not to build yet
  14. Dependency guidance
  15. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Create a real reusable component
  • Make it visually stronger than the inline CTA
  • Make it clearly service-focused and conversion-focused
  • Keep the copy flexible, not hardcoded into the component unless using sensible defaults
  • Prefer existing button/link/card styles if available
  • Match the existing article and design-system conventions
  • Keep it easy to use across all posts
  • Allow future variation by post topic, category, content silo, or frontmatter if the project structure supports it
  • Avoid duplicating the purpose of the inline CTA or “What To Do Next” component

Recommended data approach: Prefer a simple hybrid system if it fits the project:

  • Component has sensible default CTA content
  • Individual posts can override CTA headline, copy, button text, and URL through frontmatter or props
  • Optional CTA variant can be selected by content silo/topic if the project already has that structure
  • Avoid building a full CTA management system in this step

Do not build:

  • Contact form
  • Booking system
  • Newsletter form
  • Lead magnet delivery system
  • Analytics/tracking
  • Full CTA management engine
  • Sidebar changes
  • Hero changes
  • Related posts changes
  • Author box changes
  • New design system pass
  • Unrelated MDX styling changes
  • Unrelated refactors

Dependency rule: Prefer the existing project stack and conventions. Do not add new dependencies casually. If a dependency is genuinely needed for this CTA component, explain why before recommending it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to implement a standalone sidebar system for individual post pages.

Goal: Create a complete reusable post sidebar component that is independent from the main article content and can be used across post pages.

The sidebar should include:

  • Table of contents
  • Glossary context block
  • Newsletter CTA

Important context: This sidebar should be built as a standalone system, not mixed into the MDX content styling or individual post body components.

The sidebar should understand the current post context where needed:

  • The table of contents should be based on the current post headings
  • The glossary context block should be based on the current post’s glossary references
  • The newsletter CTA should be reusable and optionally customizable

Please inspect:

  • Existing post layout structure
  • Existing sidebar placeholder from the foundational layout
  • Existing MDX rendering setup
  • Existing heading/slug generation behavior
  • Existing posts collection schema
  • Existing glossary collection schema
  • How posts reference glossary entries
  • Existing newsletter/CTA components or patterns
  • Existing Tailwind/design conventions
  • Existing responsive layout conventions

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files to create or edit
  3. The role of each file/component
  4. The implementation order
  5. Project-specific findings from this repo
  6. The recommended sidebar component structure
  7. How the table of contents should be generated and rendered
  8. How the glossary context block should pull glossary data for the current post
  9. How the newsletter CTA should be handled
  10. The recommended component API/props
  11. Example usage in the post layout or post page
  12. Fallback behavior if headings, glossary references, or newsletter copy are missing
  13. Accessibility requirements
  14. Desktop behavior
  15. Mobile behavior should be considered, but do not do the full mobile optimization pass yet
  16. Responsive styling requirements
  17. Constraints and what not to build yet
  18. Dependency guidance
  19. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Create a real reusable sidebar component
  • Keep the sidebar independent from the article body
  • Use smaller internal components if helpful, such as:
  • PostSidebar
  • TableOfContents
  • GlossaryContext
  • NewsletterSidebarCTA
  • Prefer passing prepared data into the sidebar instead of making the sidebar perform heavy querying internally
  • Use existing content collection utilities and conventions
  • Keep table-of-contents logic simple and maintainable
  • Use existing heading metadata if Astro/MDX already provides it
  • Do not duplicate glossary or tag systems
  • Use glossary references as the source of truth for the glossary context block
  • Keep newsletter CTA copy flexible, with sensible defaults if appropriate
  • Match existing design-system and Tailwind conventions
  • Preserve the existing main post layout and content styling

Recommended data approach: Prefer this structure if it fits the project:

  • The post route/layout gets the current post data
  • The route/layout gets headings or table-of-contents data from rendered MDX if available
  • The route/layout resolves the current post’s glossary references from the glossary collection
  • The route/layout passes prepared data into PostSidebar
  • PostSidebar renders the table of contents, glossary context block, and newsletter CTA
  • The sidebar components focus on rendering, not complex data fetching

Do not build:

  • Full mobile accordion behavior yet
  • Sticky behavior unless the existing layout already supports it cleanly
  • Advanced scrollspy/highlight logic unless already available
  • Newsletter backend integration
  • Form submission handling
  • Email marketing integration
  • New glossary archive system
  • Related posts
  • End CTA
  • Author box
  • Hero changes
  • MDX typography changes
  • New design system pass
  • Unrelated refactors

Dependency rule: Prefer Astro/MDX’s existing heading metadata and the current project stack. Do not add new dependencies casually. If a dependency is genuinely needed for table-of-contents generation, heading anchors, or newsletter functionality, explain why before recommending it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.

Mobile Pass

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to complete a mobile optimization pass for the individual post layout and all post-related components.

Goal: Handle all mobile behavior for the post experience at once so the article page feels clean, readable, and intentionally designed on small screens.

Important context: The desktop post system should already include:

  • Post layout skeleton
  • MDX content styling
  • Hero section
  • Video component
  • Inline CTA
  • What To Do Next component
  • Author box
  • Related posts
  • End CTA
  • Sidebar system with TOC, glossary context block, and newsletter CTA

This step is not about rebuilding those components. It is about making the full post experience work well on mobile.

Mobile pass should adjust:

  • Layout stacking
  • Sidebar behavior
  • Table of contents behavior
  • Glossary context placement
  • Newsletter CTA placement
  • Component spacing
  • CTA placement
  • Article readability
  • Image/video responsiveness
  • Touch-friendly buttons and links
  • Visual hierarchy on small screens

Specific sidebar/mobile behavior:

  • The desktop sidebar should not simply appear as a cramped sidebar on mobile
  • The table of contents should become mobile-friendly, likely as an accordion/disclosure near the top of the article or another sensible position
  • Glossary context and newsletter CTA should be repositioned where they make sense in the mobile reading flow
  • Avoid duplicating sidebar content in confusing ways
  • Keep the mobile flow intentional, not just stacked by default

Please inspect:

  • Existing post layout
  • Existing sidebar system
  • Existing table of contents component
  • Existing glossary context block
  • Existing newsletter CTA
  • Existing post hero
  • Existing MDX content styling
  • Existing CTA components
  • Existing author box
  • Existing related posts
  • Existing video component
  • Existing Tailwind breakpoints and responsive conventions
  • Existing design tokens and spacing scale

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files/components likely to edit
  3. The role of each mobile adjustment
  4. The implementation order
  5. Project-specific findings from this repo
  6. Recommended mobile layout flow from top to bottom
  7. How the sidebar should transform on mobile
  8. How the TOC accordion/disclosure should work
  9. Where glossary context should appear on mobile
  10. Where newsletter CTA should appear on mobile
  11. How CTAs should be spaced and ordered on mobile
  12. How article readability should be improved
  13. Accessibility requirements for mobile interactions
  14. Responsive styling requirements
  15. What to test visually
  16. Constraints and what not to rebuild
  17. Dependency guidance
  18. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Preserve the existing desktop layout unless a small fix is clearly necessary
  • Use existing Tailwind breakpoints and project conventions
  • Prefer CSS/responsive classes over JavaScript
  • If an accordion/disclosure is needed, prefer native HTML details/summary or an existing project pattern before adding JS
  • Keep mobile behavior simple, accessible, and maintainable
  • Make buttons and links touch-friendly
  • Ensure video embeds and images scale correctly
  • Ensure tables do not break the mobile layout
  • Ensure long headings, code blocks, and links wrap or scroll properly
  • Avoid over-compressing vertical spacing
  • Avoid creating one-off styles that will be hard to codify later

Recommended mobile article flow: Use this as a starting point, but adjust based on the actual project structure:

  1. Hero
  2. Optional mobile table of contents accordion
  3. Main article content
  4. Inline CTAs where they naturally appear in content
  5. What To Do Next component
  6. Author box
  7. Related posts
  8. End CTA
  9. Newsletter CTA or glossary context only if they are not already shown in a better mobile position

Do not build:

  • New desktop redesign
  • New content components
  • New CTA system
  • New newsletter backend
  • New glossary system
  • New related posts logic
  • New author system
  • New hero system
  • New design system pass
  • Advanced scrollspy
  • Complex JavaScript interactions
  • Unrelated refactors

Dependency rule: Prefer existing CSS, Tailwind, Astro, and native HTML behavior. Do not add new dependencies casually. If a dependency is genuinely needed for mobile accordion behavior or responsive interactions, explain why before recommending it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.

Astro Image Optimization Plan

copy and paste

I want to refactor this Astro project so all eligible images use Astro’s built-in image optimization through astro:assets.

Please inspect the project first and create a plan only. Do not edit files yet.

Goal:

  • Identify every image currently used across pages, layouts, reusable components, MDX files, and content collections.
  • Determine which images should move into Astro’s optimized asset pipeline.
  • Determine which images should remain in public/ because they require fixed URLs or should not be processed.
  • Identify every place currently using raw <img> tags, string image paths, /public image paths, or unoptimized image references.
  • Recommend the safest refactor path for using Astro’s Image / Picture components where appropriate.
  • Pay special attention to MDX images, frontmatter images, reusable components, hero images, card images, thumbnails, logos, icons, and OG/social images.
  • Note any dynamic image cases that may need a special approach instead of a simple import.
  • Avoid overengineering. Keep the final system simple, Astro-native, and easy for a non-coder to maintain.

In your plan, include:

  1. Current image usage patterns you found
  2. Which files/folders need changes
  3. Which images should be moved and where
  4. Which components/pages should be updated
  5. Any risks or edge cases
  6. A recommended step-by-step implementation order

Important: Do not make changes yet. Only analyze the project and produce the plan.

Design System and Layout QA

copy and paste

I’m working on an existing Astro + Tailwind + TypeScript website.

I want you to inspect the project and create a self-contained implementation prompt that I can copy into a brand-new Codex chat after clearing context.

Do not implement anything yet.

Your output should be one clean, copy-pasteable prompt for the next Codex chat.

The next prompt should tell Codex how to perform the final site-wide design system codification pass, using the approved MDX article content sample as the styling source of truth, plus the final layout QA pass for the complete individual post layout.

Goal: Codify the approved MDX article content sample styling into the project’s overall website design system, then verify the post layout is production-ready.

Important context: The post system should already include:

  • Post layout skeleton
  • MDX content styling
  • Hero section
  • YouTube video component
  • Inline CTA
  • What To Do Next component
  • Author box
  • Related posts
  • End CTA
  • Sidebar system
  • Mobile behavior

There should also be a sample post called the MDX article content sample. Treat that sample’s approved visual styling as the reference for the site-wide content design system, including H1, H2, H3, H4, H5, H6, paragraphs, links, unordered lists, ordered lists, nested lists, blockquotes, inline code, code blocks, images, tables, horizontal rules, and related article-content spacing.

This step is not about adding new features. It is about standardizing, codifying, cleaning up, and QA-checking the full post experience while making the approved article-content styling available through the website’s shared design system, not only through one post/content-collection layout.

The QA/design system pass should:

  • Standardize spacing
  • Standardize typography usage across the entire website based on the approved MDX article content sample
  • Normalize component styles
  • Ensure visual consistency across all post components
  • Ensure the article-content element styling is codified into shared/global design-system primitives so it can be reused outside the posts collection
  • Remove one-off styles and conflicts
  • Confirm desktop/tablet/mobile behavior
  • Confirm accessibility basics
  • Confirm the layout is production-ready

Please inspect:

  • Existing global CSS/design tokens
  • Tailwind config
  • Post layout file
  • All post-related components
  • MDX/content styling
  • Mobile responsive behavior
  • The MDX article content sample post and its approved styling for headings, lists, links, code, quotes, tables, images, and spacing
  • Sample posts post used for testing
  • Any repeated one-off class patterns
  • Any inconsistent spacing, typography, borders, shadows, colors, or radius usage

Then produce a self-contained implementation prompt that includes:

  1. The exact goal
  2. The files/components likely to review or edit
  3. The role of each QA/design-system task
  4. The recommended order of review
  5. Project-specific findings from this repo
  6. What should be standardized into reusable site-wide tokens/classes/components, using the MDX article content sample styling as the reference
  7. What one-off styles should be removed or normalized
  8. How to verify consistency across post components
  9. How to verify desktop, tablet, and mobile layouts
  10. How to verify accessibility basics
  11. How to verify MDX content edge cases
  12. How to verify production readiness
  13. Constraints and what not to change
  14. Dependency guidance
  15. A final implementation checklist for the fresh Codex chat to follow

Implementation expectations:

  • Do not redesign the post layout from scratch
  • Do not add new major features
  • Do not change the approved component purposes
  • Preserve the existing content model
  • Preserve the existing post routing
  • Preserve the existing collection relationships
  • Prefer refining existing components over creating new ones
  • Use existing design tokens and Tailwind conventions
  • Codify the approved MDX article content sample styling into shared website-level design-system primitives, not just styles scoped to the posts collection
  • Codify other repeated patterns only where it improves consistency and maintainability
  • Remove duplicated styles where safe
  • Fix obvious visual, responsive, semantic, and accessibility issues
  • Make the final layout feel like one cohesive system

QA areas to check:

  • Hero spacing, typography, metadata, image behavior
  • Article content readability
  • Headings hierarchy and spacing
  • Links, lists, blockquotes, code blocks, images, tables, and horizontal rules
  • Video embed responsiveness
  • Inline CTA contrast and spacing
  • What To Do Next component hierarchy
  • Author box consistency
  • Related posts layout
  • End CTA visual priority
  • Sidebar layout, TOC, glossary context, newsletter CTA
  • Mobile TOC/sidebar behavior
  • Tablet layout behavior
  • Long titles
  • Missing optional fields
  • Posts with no glossary references
  • Posts with no related posts
  • Long code blocks
  • Wide tables
  • Images with different aspect ratios

Do not build:

  • New post features
  • New content collections
  • New recommendation engine
  • New newsletter backend
  • New analytics/tracking
  • New contact or booking system
  • Full site redesign
  • New page templates outside the post layout, though updating shared design-system styles used across the website is in scope
  • Unrelated refactors

Dependency rule: Do not add new dependencies for this pass unless there is a clear production-blocking issue that cannot be solved cleanly with the existing Astro, Tailwind, and project conventions. If a dependency is recommended, explain why before including it.

The final answer should only be the copy-pasteable prompt for the next Codex chat.