```html

Building a Multi-Site Automated Technical Blog System with Session Capture and Infrastructure as Code

What Was Done

Implemented a comprehensive automated technical blog generation system across four distinct domain properties (queenofsandiego.com, sailjada.com, dangerouscentaur.com, and burialsatseasandiego.com). The system captures development session transcripts in real-time, extracts technical work performed, and automatically publishes granular technical posts to dedicated tech subdomains. This enables stakeholders like Sergio to see exactly what was built, modified, and deployed—down to specific file paths, infrastructure resources, and architectural decisions.

Technical Architecture

The solution comprises three core components:

  • Session Capture Hook (/Users/cb/.claude/hooks/tech_blog_stop.sh): A bash script executed when Claude Code sessions terminate. This hook reads the session transcript in JSONL format from ~/.claude/sessions, extracts all file modifications and command executions, and passes them to the blog generator.
  • Blog Generator Engine (/Users/cb/Documents/repos/tools/tech_blog_generator.py): A Python application that parses session data, filters sensitive information (credentials, API keys, tokens), generates semantic HTML articles, and publishes posts to the appropriate S3 bucket via CloudFront distribution.
  • Infrastructure Initializer (/Users/cb/Documents/repos/tools/tech_blog_init.py): Sets up S3 buckets, CloudFront distributions, Route53/Namecheap DNS, and ACM certificates for each tech blog subdomain in a single idempotent operation.

Infrastructure Implementation

S3 & CloudFront Setup:

For each domain, provisioned dedicated infrastructure:

  • tech-queenofsandiego-com S3 bucket with CloudFront distribution (root domain on Route53)
  • tech-sailjada-com S3 bucket with CloudFront distribution (root domain on Route53)
  • dc-tech-sites S3 bucket with CloudFront distribution (Namecheap CNAME record)
  • tech-burialsatseasandiego-com S3 bucket with CloudFront distribution (GoDaddy DNS via API)

Each distribution enforces HTTPS with ACM certificates. For Route53-managed domains (queenofsandiego.com and sailjada.com), existing wildcard certificates (*.queenofsandiego.com and *.sailjada.com) were reused. For dangerouscentaur.com and burialsatseasandiego.com, new certificates were requested and DNS validation records added to their respective registrars.

DNS Resolution:

  • Route53: Used alias records pointing CloudFront distributions for tech.queenofsandiego.com and tech.sailjada.com
  • Namecheap: Added CNAME record for tech.dangerouscentaur.com pointing to CloudFront domain
  • GoDaddy: Integrated via API (credentials stored in environment) to add CNAME for tech.burialsatseasandiego.com

ACM Certificate Management:

The initializer detects existing wildcard certificates before requesting new ones, preventing duplicate issuances. For new certificates, it retrieves DNS validation records and automatically adds CNAME records to Route53 or through registrar APIs.

Session Transcript Processing

Claude Code sessions are stored as JSONL files in ~/.claude/sessions. Each line represents an event (user message, assistant response, tool use). The stop hook extracts tool use entries containing:

  • files_modified: Write and Edit operations with full paths
  • commands_run: Shell commands executed during the session
  • tool_use_id, timestamp: Metadata for chronological reconstruction

The generator filters this data through a secret detection regex pattern (matching AWS keys, database passwords, API credentials, private keys, bearer tokens) and redacts any matches before generating posts. This ensures no sensitive data leaks into public technical documentation.

Blog Post Generation and Publishing

Generated posts follow a consistent structure:

<h2>Specific title based on work performed</h2>
<h3>What Was Done</h3>
<h3>Technical Details</h3>
<h3>Infrastructure</h3>
<h3>Key Decisions</h3>
<h3>What's Next</h3>

Each post:

  • Names exact file paths (e.g., /Users/cb/Documents/repos/tools/tech_blog_init.py)
  • Specifies CloudFront distribution IDs and S3 bucket names
  • Documents infrastructure changes with exact resource identifiers
  • Explains architectural decisions and why patterns were chosen
  • Includes sanitized command examples (no credentials)
  • Targets technical language appropriate for engineers reviewing implementation details

Posts are uploaded to their respective S3 buckets with timestamps and invalidate CloudFront cache to ensure immediate visibility.

Navigation Integration

Updated the Ship's Papers menu across all four main websites to include a "Technical Blog" link pointing to the respective tech.[domain] subdomain. This makes the technical documentation discoverable and positions it as a first-class resource alongside other operational materials.

Key Architectural Decisions

Why Automated Capture? Manual blog post creation is friction-prone and documentation lags behind work. By hooking into session termination, we capture context while fresh without imposing on the development workflow.

Why Granular, Not Summary-Level? High-level summaries hide implementation details. File paths, function names, configuration changes, and infrastructure modifications are the details that matter when auditing work or training new team members. Granularity enables "hammering it home" with concrete evidence.

Why Multi-Site? Each domain (Queen of San Diego events, SailJADA charters, Dangerous Centaur experiences, Burial at Sea ceremonies) is a distinct business entity. Separate tech blogs allow stakeholders to focus on what's relevant to their operation while maintaining the same infrastructure pattern across all.

Why Idempotent Infrastructure Init? The tech_blog_init.py` script can be run multiple times safely—it detects existing resources and skips recreation. This allows incremental addition of new domains without manual state tracking.

What's Next

The system is now live on all four domains. Future enhancements include:

  • Automated post indexing and search functionality
  • Category and tag filtering by domain or work type
  • Integration with project boards to link technical posts to tracked tasks
  • Email digests of technical work performed during a week
  • Analytics on which technical areas receive most focus or change frequency