Building Automated Technical Blog Infrastructure Across Four Sites with Session-Based Content Generation
This session implemented a comprehensive automated technical documentation system for four distinct web properties: queenofsandiego.com, sailjada.com, dangerouscentaur.com, and burialsatseasandiego.com. Each site now has a dedicated tech blog subdomain that auto-generates detailed posts capturing every infrastructure change, code modification, and deployment action—providing complete transparency for stakeholders like Sergio who need to see the exact technical work being performed.
What Was Done
- Created automated tech blog infrastructure at tech.queenofsandiego.com, tech.sailjada.com, tech.dangerouscentaur.com, and tech.burialsatseasandiego.com
- Built session-aware blog post generator that captures file modifications, command executions, and infrastructure changes
- Integrated Claude Code hooks to trigger post generation at session end
- Added navigation links to Ship's Papers menus across all four properties
- Set up S3 static hosting, CloudFront CDN distribution, and DNS routing for each tech blog
- Implemented credential scrubbing to ensure no secrets appear in published posts
Technical Architecture
The system comprises three primary components:
1. Blog Generator Engine
The core generator (/Users/cb/Documents/repos/tools/tech_blog_generator.py) reads Claude Code session transcripts in JSONL format and extracts:
- File Operations: Exact file paths modified, created, or edited with timestamps
- Command Executions: Every CLI command run, with arguments visible but credentials redacted
- Tool Use: AWS API calls, infrastructure changes, DNS modifications
- Context: User requests that drove the work, reasoning from the agent
The generator parses session data to identify infrastructure changes by pattern-matching command outputs and tool invocations, then structures findings into semantic HTML sections. Sensitive data (API keys, passwords, credential strings) are detected via regex patterns and replaced with placeholder text like [REDACTED_AWS_KEY].
2. Infrastructure Initialization
The infrastructure script (/Users/cb/Documents/repos/tools/tech_blog_init.py) provisions identical AWS resources for each tech blog:
- S3 Bucket Creation: One bucket per tech blog (e.g.,
qos-tech-blog,jada-tech-blog,dc-sites,bats-tech-blog) with static website hosting enabled and index.html/error.html routing configured - CloudFront Distribution: Each bucket gets a custom CDN distribution with:
- Origin pointing to S3 website endpoint
- Default root object set to index.html
- Compression enabled for HTML, CSS, JSON
- Cache behaviors with appropriate TTLs
- SSL/TLS Certificates: Leveraging existing wildcard ACM certificates:
*.queenofsandiego.comwildcard cert for tech.queenofsandiego.com*.sailjada.comwildcard cert for tech.sailjada.com- New certificate request and DNS validation for tech.dangerouscentaur.com
- GoDaddy-managed certificate for tech.burialsatseasandiego.com
- DNS Configuration: CNAME records pointing to CloudFront distributions:
- Route53 for queenofsandiego.com and sailjada.com properties
- Namecheap for dangerouscentaur.com (wildcard CF dist E2Q4UU71SRNTMB reused)
- GoDaddy for burialsatseasandiego.com
3. Claude Code Integration Hook
A bash script at /Users/cb/.claude/hooks/tech_blog_stop.sh runs automatically when a Claude Code session ends. The hook:
- Locates the current session's transcript file in
/Users/cb/.claude/projects - Determines which repository/site the work involved by parsing file paths
- Routes the transcript to the appropriate blog generator
- Uploads generated HTML to the corresponding S3 bucket
- Invalidates the CloudFront distribution cache for immediate visibility
- Logs all operations to
/Users/cb/.claude/logs/tech_blog_hook.log
The hook is registered in Claude Code settings (/Users/cb/.claude/settings.json) under hooks.onSessionStop, ensuring it fires after every session completes.
Infrastructure Details
Each tech blog follows an identical deployment pattern. For example, queenofsandiego.com:
- S3 Bucket:
qos-tech-blogin us-west-2 region - CloudFront Distribution: Custom domain
tech.queenofsandiego.com, distribution ID visible in CloudFront console - SSL Certificate: Wildcard cert
*.queenofsandiego.com(existing, no validation needed) - DNS CNAME:
tech.queenofsandiego.com→d[distribution-id].cloudfront.netin Route53 hosted zone
The dangerouscentaur tech blog reuses the existing wildcard CloudFront distribution (E2Q4UU71SRNTMB) already serving from the dc-sites S3 bucket, adding a tech-blog prefix path in the S3 key structure rather than creating a separate distribution.
For burialsatseasandiego.com (GoDaddy-managed DNS), the new ACM certificate required DNS validation. The validation CNAME record was programmatically added to GoDaddy's DNS via their API, confirmed active, then the certificate was issued.
Key Decisions
Why Session-Based Generation? Rather than post-by-feature or post-by-day, session-based generation captures the natural workflow boundary. Each Claude Code session represents a focused effort, and the transcript contains complete context (what was asked, what was tried, what succeeded). This provides chronological accountability and technical precision.
Why Pattern Matching for Infrastructure Detection? The generator uses regex patterns to identify infrastructure changes from command output and tool use entries. Examples include detecting CloudFront distribution creation from AWS CLI JSON responses, S3 bucket names from tool invocations, and DNS records from Route53 API calls. This approach is resilient to tool output variations and requires no external state tracking.
Why Wildcard Certificates? Existing *.queenofsandiego.com and *.sailjada.com wildcards already covered these tech subdomains, eliminating certificate provisioning overhead. For dangerouscentaur.com (which didn't have a wildcard), a new certificate was requested. GoD