Building Automated Technical Documentation System Across Four Sailing Operations Sites
This session focused on building an infrastructure-as-code system to automatically generate granular technical blog posts for four sailing operation websites: queenofsandiego.com, sailjada.com, dangerouscentaur.com, and burialsatseasandiego.com. The goal was to create a mechanism where engineering work is automatically documented in real-time, making it easy for stakeholders like Sergio to audit and understand ongoing technical activities.
What Was Done
- Created an automated blog generation system that captures Claude Code session transcripts and converts them into technical documentation
- Deployed four independent CloudFront distributions with S3 origins for tech blogs across all sailing operation domains
- Integrated the tech blog system into the Ship's Papers navigation menu on queenofsandiego.com
- Built comprehensive infrastructure initialization that handles DNS, SSL/TLS certificates, CloudFront caching, and S3 bucket policies across multiple DNS providers (Route53, GoDaddy, Namecheap)
- Implemented a Stop hook mechanism in Claude Code to automatically trigger blog generation when development sessions end
Technical Architecture
Blog Generation Pipeline
The system works by leveraging Claude Code's session transcript feature. When a development session completes:
- The
tech_blog_stop.shhook is triggered - It extracts the session transcript from
~/.claude/sessions/ - It passes the transcript to
tech_blog_generator.py - The Python script parses tool use entries and file modifications to build a narrative
- HTML content is generated and uploaded to the appropriate tech blog S3 bucket
- CloudFront cache is invalidated to ensure immediate visibility
This approach captures granular details—exact file paths, function names, infrastructure changes—rather than summarizing work at a high level.
Multi-Domain Infrastructure Setup
The infrastructure initialization script (tech_blog_init.py) handles four different domain configurations:
- queenofsandiego.com (Route53 + AWS): Uses wildcard certificate
*.queenofsandiego.comwith existing infrastructure. Tech blog attech.queenofsandiego.comserved from S3 bucketqos-tech-blogvia CloudFront distribution. - sailjada.com (Route53 + AWS): Uses wildcard certificate
*.sailjada.com. Tech blog attech.sailjada.comserved from S3 bucketjada-tech-blogvia CloudFront distribution. - dangerouscentaur.com (Namecheap DNS): Leverages existing wildcard CloudFront distribution on
dc-sitesbucket. Tech blog accessible via CNAME record to CloudFront distribution endpoint. - burialsatseasandiego.com (GoDaddy DNS): Uses GoDaddy API credentials to programmatically add CNAME records. New ACM certificate provisioned with DNS validation through GoDaddy.
Key Implementation Details
CloudFront Distributions and Caching
Each tech blog uses a CloudFront distribution with:
- S3 origin with origin access identity (OAI) for secure bucket access
- Caching disabled for HTML index files to ensure fresh content
- 24-hour cache TTL for static assets
- Gzip compression enabled
- HTTP to HTTPS redirect
- IPv6 support
The initialization script stores distribution IDs in a JSON configuration file at ~/.claude/projects/-Users-cb-Documents-repos/memory/infrastructure_config.json for quick lookup during blog uploads.
S3 Bucket Policies and Security
Each tech blog bucket enforces:
- Block all public access except through CloudFront
- Bucket policies that restrict access to the CloudFront OAI
- Versioning enabled for rollback capability
- Server-side encryption with S3 managed keys
DNS Strategy Across Multiple Providers
The system adapts to each domain's DNS provider:
- Route53 domains: Creates CNAME record pointing to CloudFront distribution domain name using Boto3
- Namecheap domains: Adds manual CNAME record (user provides exact record name and value)
- GoDaddy domains: Uses GoDaddy API to programmatically create CNAME records with endpoint URL from stored credentials
SSL/TLS Certificate Management
ACM certificates follow a pattern:
- Request wildcard certificate for domain (e.g.,
*.queenofsandiego.com) - Validation via DNS CNAME records added to the domain's DNS provider
- For Route53: Automated validation
- For GoDaddy: Manual validation record creation via API
- For Namecheap: Manual validation record creation
Integration with Ship's Papers Navigation
The queenofsandiego.com navigation was updated to include a Technical Documentation link in the Ship's Papers dropdown menu. This provides immediate access to the tech blog for stakeholders reviewing site operations.
Session Transcript Parsing
The blog generator parses Claude Code session transcripts in JSONL format, extracting:
- All file modifications (paths, operations, timestamps)
- Commands executed and their purposes
- Tool use entries describing API calls and infrastructure changes
- Logical grouping of related activities into sections
The generator filters out sensitive data (credentials, API keys, passwords) while preserving technical details like resource names, bucket names, distribution IDs, and exact file paths.
Key Decisions and Rationale
- Automated trigger via Stop hook: Rather than manual blog creation, the system automatically captures work when sessions end. This ensures comprehensive documentation without requiring developer discipline.
- Granular documentation: Instead of summarizing work, the system preserves exact details (file paths, function names, infrastructure resource IDs). This allows Sergio to drill down into specifics if questions arise.
- Separate tech blogs per domain: Rather than centralizing all technical documentation, each sailing operation maintains its own tech blog under its own domain. This keeps operational context clear and documentation close to the business it supports.
- Multi-provider DNS abstraction: Rather than forcing all domains to use a single DNS provider, the infrastructure script adapts to Route53, GoDaddy, and Namecheap. This respects existing registrar relationships.
- S3 + CloudFront architecture: Rather than running web servers, static HTML files served through CloudFront provide cost-effective, highly available documentation with built-in caching and DDoS protection.
What's Next
Immediate next steps include:
- Testing blog generation on