TheCraigHewitt/seomachine
SEO Machine
A specialized Claude Code workspace for creating long-form, SEO-optimized blog content for any business. This system helps you research, write, analyze, and optimize content that ranks well and serves your target audience.
Overview
SEO Machine is built on Claude Code and provides:
- Custom Commands:
/research,/write,/rewrite,/analyze-existing,/optimize,/performance-review,/publish-draft,/article,/priorities, plus specialized research and landing page commands - Specialized Agents: Content analyzer, SEO optimization, meta element creation, internal linking, keyword mapping, editor, performance analysis, headline generator, CRO analyst, landing page optimizer
- Marketing Skills: 26 marketing skills for copywriting, CRO, A/B testing, email sequences, pricing strategy, and more
- Advanced SEO Analysis: Search intent detection, keyword density & clustering, content length comparison, readability scoring, SEO quality rating (0-100)
- Data Integrations: Google Analytics 4, Google Search Console, DataForSEO for real-time performance insights
- Context-Driven: Brand voice, style guide, SEO guidelines, and examples guide all content
- Workflow Organization: Structured directories for topics, research, drafts, and published content
Getting Started
Prerequisites
- Claude Code installed
- Anthropic API account
Installation
- Clone this repository:
|
|
- Install Python dependencies for analysis modules:
|
|
This installs:
- Google Analytics/Search Console integrations
- DataForSEO API client
- NLP libraries (nltk, textstat)
- Machine learning (scikit-learn)
- Web scraping tools (beautifulsoup4)
- Open in Claude Code:
|
|
-
Customize Context Files (Important!):
All context files are provided as templates. Fill them out with your companyβs information:
context/brand-voice.md- Define your brand voice and messaging (see examples/castos/ for reference)context/writing-examples.md- Add 3-5 exemplary blog posts from your sitecontext/features.md- List your product/service features and benefitscontext/internal-links-map.md- Map your key pages for internal linkingcontext/style-guide.md- Fill in your style preferencescontext/target-keywords.md- Add your keyword research and topic clusterscontext/competitor-analysis.md- Add competitor analysis and insightscontext/seo-guidelines.md- Review and adjust SEO requirements
Quick Start: Check out
examples/castos/to see a complete real-world example of all context files filled out for a podcast hosting SaaS company.
Workflows
Creating New Content
1. Start with Research
|
|
What it does:
- Performs keyword research
- Analyzes top 10 competitors
- Identifies content gaps
- Creates comprehensive research brief
- Saves to
/research/directory
Example:
|
|
2. Write the Article
|
|
What it does:
- Creates 2000-3000+ word SEO-optimized article
- Maintains your brand voice from
context/brand-voice.md - Integrates keywords naturally
- Includes internal and external links
- Provides meta elements (title, description, keywords)
- Automatically triggers optimization agents
- Saves to
/drafts/directory
Example:
|
|
Agent Auto-Execution: After writing, these agents automatically analyze the content:
- SEO Optimizer: On-page SEO recommendations
- Meta Creator: Multiple meta title/description options
- Internal Linker: Specific internal linking suggestions
- Keyword Mapper: Keyword placement and density analysis
3. Final Optimization
|
|
What it does:
- Comprehensive SEO audit
- Validates all elements meet requirements
- Provides final polish recommendations
- Generates publishing readiness score
- Creates optimization report
Example:
|
|
Updating Existing Content
1. Analyze Existing Post
|
|
What it does:
- Fetches and analyzes current content
- Evaluates SEO performance
- Identifies outdated information
- Assesses competitive positioning
- Provides content health score (0-100)
- Recommends update priority and scope
- Saves analysis to
/research/directory
Examples:
|
|
2. Rewrite/Update Content
|
|
What it does:
- Updates content based on analysis findings
- Refreshes statistics and examples
- Improves SEO optimization
- Adds new sections to fill gaps
- Maintains what works from original
- Tracks changes made
- Saves to
/rewrites/directory
Example:
|
|
Commands Reference
/research [topic]
Comprehensive keyword and competitive research for new content.
Output: Research brief in /research/brief-[topic]-[date].md
Includes:
- Primary and secondary keywords
- Competitor analysis (top 10)
- Content gaps and opportunities
- Recommended outline
- Internal linking strategy
- Meta elements preview
/write [topic]
Create long-form SEO-optimized article (2000-3000+ words).
Output: Article in /drafts/[topic]-[date].md
Includes:
- Complete article with H1/H2/H3 structure
- SEO-optimized content
- Internal and external links
- Meta elements (title, description, keywords)
- SEO checklist
Auto-Triggers:
- SEO Optimizer agent
- Meta Creator agent
- Internal Linker agent
- Keyword Mapper agent
/rewrite [topic]
Update and improve existing content.
Output: Updated article in /rewrites/[topic]-rewrite-[date].md
Includes:
- Rewritten/updated content
- Change summary
- Before/after comparison
- Updated SEO elements
/analyze-existing [URL or file]
Analyze existing blog posts for improvement opportunities.
Output: Analysis report in /research/analysis-[topic]-[date].md
Includes:
- Content health score (0-100)
- Quick wins (immediate improvements)
- Strategic improvements
- Rewrite priority and scope
- Research brief for rewrite
/optimize [file]
Final SEO optimization pass before publishing.
Output: Optimization report in /drafts/optimization-report-[topic]-[date].md
Includes:
- SEO score (0-100)
- Priority fixes
- Quick wins
- Meta element options
- Link enhancement suggestions
- Publishing readiness assessment
/publish-draft [file]
Publish article to WordPress via REST API with Yoast SEO metadata.
/article [topic]
Simplified article creation workflow.
/priorities
Content prioritization matrix using analytics data to identify highest-impact content tasks.
/scrub [file]
Remove AI watermarks and patterns from content (em-dashes, filler phrases, robotic patterns).
Research Commands
| Command | Description |
|---|---|
/research-serp [keyword] |
SERP analysis for a target keyword |
/research-gaps |
Competitor content gap analysis |
/research-trending |
Trending topic opportunities |
/research-performance |
Performance-based content priorities |
/research-topics |
Topic cluster research |
Landing Page Commands
| Command | Description |
|---|---|
/landing-write [topic] |
Create conversion-optimized landing page |
/landing-audit [file] |
Audit landing page for CRO issues |
/landing-research [topic] |
Research competitors and positioning |
/landing-competitor [URL] |
Deep competitor landing page analysis |
/landing-publish [file] |
Publish landing page to WordPress |
Agents
Specialized agents that automatically analyze content and provide expert recommendations.
Content Analyzer (NEW!)
Purpose: Comprehensive, data-driven content analysis using 5 specialized modules
Analyzes:
- Search intent classification (informational/navigational/transactional/commercial)
- Keyword density and clustering with topic detection
- Content length comparison vs top SERP competitors
- Readability scoring (Flesch Reading Ease, Flesch-Kincaid Grade Level)
- SEO quality rating (0-100 score with category breakdowns)
- Keyword stuffing risk detection
- Passive voice ratio and sentence complexity
- Distribution heatmap showing keyword placement by section
Output:
- Executive summary with publishing readiness assessment
- Priority action plan (critical/high priority/optimization)
- Competitive positioning analysis
- Detailed recommendations for each analysis area
- Exact metrics and benchmarks for improvements
Powered by:
search_intent_analyzer.py- Search intent detectionkeyword_analyzer.py- Keyword density, clustering, LSI keywordscontent_length_comparator.py- SERP competitor analysisreadability_scorer.py- Multiple readability metricsseo_quality_rater.py- Comprehensive SEO scoring
SEO Optimizer
Purpose: On-page SEO analysis and optimization recommendations
Analyzes:
- Keyword optimization and density
- Content structure and headings
- Internal and external links
- Meta elements
- Readability and user experience
- Featured snippet opportunities
Output: SEO score (0-100) with specific improvement recommendations
Meta Creator
Purpose: Generate high-converting meta titles and descriptions
Creates:
- 5 meta title variations (50-60 chars)
- 5 meta description variations (150-160 chars)
- Testing recommendations
- SERP preview
- Conversion-optimized copy
Output: Multiple options with recommendation and reasoning
Internal Linker
Purpose: Strategic internal linking recommendations
Provides:
- 3-5 specific internal link suggestions
- Exact placement locations
- Anchor text recommendations
- User journey mapping
- SEO impact prediction
References: context/internal-links-map.md
Keyword Mapper
Purpose: Keyword placement and integration analysis
Analyzes:
- Keyword density and distribution
- Critical placement checklist
- Natural language integration quality
- LSI keyword coverage
- Cannibalization risk
Output: Distribution map, gap analysis, specific revision suggestions
Editor
Purpose: Transform technically accurate content into human-sounding, engaging articles
Analyzes:
- Voice and personality
- Specificity of examples
- Readability and flow
- Robotic vs. human patterns
- Engagement and storytelling
Provides:
- Humanity score (0-100)
- Critical edits with before/after
- Pattern analysis
- Specific rewrites to inject personality
- Readability improvements
Output: Editorial report with specific improvements to make content sound human
Performance
Purpose: Data-driven content prioritization using real analytics
Analyzes:
- Google Analytics traffic and trends
- Google Search Console rankings and CTR
- DataForSEO competitive data
- Quick wins (position 11-20)
- Declining content
- Low CTR opportunities
- Trending topics
Provides:
- Priority queue of content tasks
- Opportunity scores (0-100)
- Impact and effort estimates
- Week-by-week roadmap
- Success metrics
Output: Comprehensive performance report with actionable priorities
Headline Generator
Purpose: Generate high-converting headline variations and A/B testing recommendations
Provides:
- 10+ headline variations using proven formulas
- Conversion potential scoring
- A/B testing strategies
- Audience-specific headline options
CRO Analyst
Purpose: Conversion rate optimization analysis for landing pages
Analyzes:
- Above-the-fold effectiveness
- CTA quality and distribution
- Trust signal presence
- Friction points
- Page structure
Landing Page Optimizer
Purpose: Comprehensive landing page optimization recommendations
Provides:
- CRO scoring (0-100) with category breakdowns
- Above-fold, CTA, trust signal, structure, and SEO analysis
- A/B testing recommendations
- Priority action list
Marketing Skills
SEO Machine includes 26 marketing skills accessible as slash commands:
| Category | Skills |
|---|---|
| Copywriting | /copywriting, /copy-editing |
| CRO | /page-cro, /form-cro, /signup-flow-cro, /onboarding-cro, /popup-cro, /paywall-upgrade-cro |
| Strategy | /content-strategy, /pricing-strategy, /launch-strategy, /marketing-ideas |
| Channels | /email-sequence, /social-content, /paid-ads |
| SEO | /seo-audit, /schema-markup, /programmatic-seo, /competitor-alternatives |
| Analytics | /analytics-tracking, /ab-test-setup |
| Other | /referral-program, /free-tool-strategy, /marketing-psychology |
Data Sources
Integration with Analytics
SEO Machine integrates with real-time data sources to inform content strategy:
Google Analytics 4:
- Traffic and engagement metrics
- Conversion tracking
- Trend analysis
- Traffic sources
Google Search Console:
- Keyword rankings and positions
- Impressions and clicks
- CTR analysis
- Query performance
DataForSEO:
- Competitive rankings
- SERP features
- Keyword metrics
- Competitor gap analysis
Advanced SEO Analysis Modules (NEW!)
SEO Machine includes 5 specialized Python modules for comprehensive content analysis:
Search Intent Analyzer (search_intent_analyzer.py):
- Classifies queries into informational, navigational, transactional, or commercial intent
- Analyzes SERP features and content patterns
- Provides confidence scores and content alignment recommendations
Keyword Analyzer (keyword_analyzer.py):
- Calculates exact keyword density and distribution
- Detects keyword stuffing risk with warnings
- Performs topic clustering using TF-IDF and K-means
- Generates distribution heatmap by section
- Identifies LSI (semantically related) keywords
SEO Quality Rater (seo_quality_rater.py):
- Rates content against SEO best practices (0-100 score)
- Category breakdowns: content, keywords, meta, structure, links, readability
- Identifies critical issues, warnings, and suggestions
- Determines publishing readiness
Content Length Comparator (content_length_comparator.py):
- Fetches and analyzes top 10-20 SERP competitor word counts
- Calculates median, 75th percentile, and optimal length
- Shows competitive positioning and gap to target
- Provides data-driven expansion recommendations
Readability Scorer (readability_scorer.py):
- Flesch Reading Ease and Flesch-Kincaid Grade Level
- Sentence and paragraph structure analysis
- Passive voice detection and ratio calculation
- Complex word identification
- Transition word usage analysis
- Overall readability score (0-100)
All modules can be used directly in Python or through the Content Analyzer agent.
CRO Analysis Modules
Six Python modules for landing page conversion optimization:
above_fold_analyzer.py- Above-the-fold content analysis (headline, value prop, CTA, trust)cta_analyzer.py- CTA effectiveness scoring (quality, distribution, goal alignment)trust_signal_analyzer.py- Trust signal detection (testimonials, social proof, risk reversals)landing_page_scorer.py- Overall landing page scoring (0-100 with category breakdowns)landing_performance.py- Landing page performance tracking via GA4/GSCcro_checker.py- CRO best practices checklist validation
Additional Analysis Modules
opportunity_scorer.py- 8-factor opportunity scoring for content prioritizationcontent_scorer.py- 5-dimension content quality scoring (humanity, specificity, structure, SEO, readability)engagement_analyzer.py- Content engagement pattern analysiscompetitor_gap_analyzer.py- Competitive content gap identificationarticle_planner.py- Data-driven article planningsection_writer.py- Section-level content guidancesocial_research_aggregator.py- Social media research aggregation
Python Research Scripts
Run from repo root:
|
|
Note: SEO analysis scripts load competitor lists and keywords from config/competitors.json. Copy config/competitors.example.json and customize for your business.
WordPress Integration
Publishing uses the WordPress REST API with a custom MU-plugin that exposes Yoast SEO fields.
Setup:
- Install
wordpress/seo-machine-yoast-rest.phpas an MU-plugin on your WordPress site - Add
wordpress/functions-snippet.phpto your themeβs functions.php - Configure WordPress credentials in
.env:1 2 3WP_URL=https://yoursite.com WP_USERNAME=your_username WP_APP_PASSWORD=your_application_password
See wordpress/README.md for detailed setup instructions.
See data_sources/README.md for analytics setup instructions.
Directory Structure
|
|
Context Files (Important!)
The quality of your content depends on well-configured context files:
context/brand-voice.md
Defines your brand voice, tone, and messaging framework.
Must include:
- Voice pillars
- Tone guidelines by content type
- Core brand messages
- Writing style guidelines
- Terminology preferences
Purpose: Ensures all content sounds like your brand
context/writing-examples.md
Contains 3-5 exemplary blog posts from your site.
Must include:
- Full article content
- What makes each example great
- Key takeaways for voice and structure
Purpose: Teaches AI your specific writing style through examples
context/style-guide.md
Editorial and formatting standards.
Must include:
- Grammar and mechanics rules
- Capitalization conventions
- Formatting standards
- Preferred terminology
Purpose: Maintains consistency across all content
context/seo-guidelines.md
SEO best practices and requirements.
Includes:
- Content length requirements
- Keyword optimization rules
- Meta element standards
- Link strategy guidelines
- Readability requirements
Purpose: Ensures all content meets SEO standards
context/target-keywords.md
Keyword research organized by topic cluster.
Must include:
- Pillar keywords by cluster
- Cluster keywords (subtopics)
- Long-tail variations
- Search intent classification
- Current rankings
Purpose: Guides keyword targeting for new content
context/internal-links-map.md
Catalog of key pages from your site for internal linking.
Must include:
- Product pages and features
- Pillar content URLs
- Top performing blog articles
- Topic cluster mapping
- Recommended anchor text
Purpose: Enables strategic internal linking in every article
context/competitor-analysis.md
Competitive intelligence and content gaps.
Must include:
- Primary competitors
- Their content strategies
- Keyword gaps
- Differentiation opportunities
Purpose: Informs content strategy and competitive positioning
Content Quality Standards
Every article must meet these requirements:
Content
- Minimum 2,000 words (2,500-3,000+ preferred)
- Provides unique value vs. competitors
- Factually accurate and current
- Actionable advice for your target audience
- Brand voice maintained
SEO
- Primary keyword density 1-2%
- Keyword in H1, first 100 words, 2-3 H2s
- 3-5 internal links with descriptive anchor text
- 2-3 external authority links
- Meta title 50-60 characters
- Meta description 150-160 characters
- Proper H1>H2>H3 hierarchy
Readability
- 8th-10th grade reading level
- Average sentence length 15-20 words
- Paragraphs 2-4 sentences
- Subheadings every 300-400 words
- Lists and formatting for scannability
Structure
- Compelling introduction (hook, problem, promise)
- Logical section flow
- Clear conclusion with CTA
- Examples and data included
Best Practices
Before Writing
- Research first: Always run
/researchbefore/write - Review context: Read
brand-voice.mdand relevantwriting-examples.md - Check keywords: Verify target keyword in
target-keywords.md - Plan internal links: Review
internal-links-map.mdfor linking opportunities
During Writing
- Follow the brief: Use research brief as your outline
- Natural keywords: Integrate keywords naturally, never force them
- Add value: Every section should provide actionable insights
- Use examples: Include real scenarios and use cases from your industry
- Cite sources: Link to statistics and data sources
After Writing
- Review agent output: Read all agent recommendations carefully
- Make improvements: Address high-priority issues before optimizing
- Run optimize: Use
/optimizefor final polish - Self-edit: Read article as if youβre the target reader
- Check quality: Verify all checklist items met
For Rewrites
- Analyze first: Run
/analyze-existingto understand scope - Determine strategy: Light update vs. major rewrite?
- Preserve what works: Keep effective sections
- Focus on gaps: Add whatβs missing from competitive content
- Update everything: Stats, examples, screenshots, links
Workflow Examples
Example 1: Creating New Content from Scratch
|
|
Example 2: Updating Existing Content
|
|
Example 3: Quick Content Audit
|
|
Tips & Tricks
Maximizing Content Quality
- Study examples: Read your
writing-examples.mdbefore each writing session - Use data: Always include current statistics and cite sources
- Be specific: β40% increaseβ beats βsignificant improvementβ
- Show, donβt tell: Use real examples and scenarios from your industry
- Answer questions: Address βPeople Also Askβ questions from research
SEO Optimization
- Keywords early: Get primary keyword in first 100 words
- Natural integration: Read content aloud - if keywords sound forced, rewrite
- Vary anchor text: Donβt use same anchor text for all internal links
- Link strategically: Link to pillar content and related cluster articles
- Update regularly: Refresh top-performing content every 6-12 months
Workflow Efficiency
- Batch research: Research multiple topics in one session
- Follow structure: Use consistent article structure from
/writecommand - Address high-priority first: Fix critical issues before optimizing details
- Use agents wisely: Let agents handle analysis, you focus on writing
- Build templates: Save commonly used sections for reuse
Avoiding Common Mistakes
- β Skipping research phase
- β Ignoring brand voice guidelines
- β Forcing keywords unnaturally
- β Forgetting internal links
- β Not citing data sources
- β Publishing without optimization
- β Copying competitor content instead of differentiating
Maintenance
Weekly
- Add new topic ideas to
/topics/ - Update
target-keywords.mdwith new keyword opportunities - Check for broken links in
internal-links-map.md
Monthly
- Review published content performance
- Update
writing-examples.mdif better examples emerge - Add newly published content to
internal-links-map.md - Track competitor activity in
competitor-analysis.md
Quarterly
- Full audit of context files
- Update SEO guidelines based on algorithm changes
- Comprehensive competitor analysis refresh
- Review and update topic clusters in
target-keywords.md
Troubleshooting
βContent doesnβt sound like my brandβ
- Solution: Update
context/brand-voice.mdwith more specific guidance - Solution: Add more diverse examples to
context/writing-examples.md - Solution: Reference specific examples when using
/writecommand
βKeyword density too high/lowβ
- Solution: Review
seo-guidelines.mdtarget density (1-2%) - Solution: Use
/optimizeto get specific keyword placement suggestions - Solution: Use Keyword Mapper agent for distribution analysis
βInternal links arenβt relevantβ
- Solution: Update
context/internal-links-map.mdwith current pages - Solution: Organize by topic cluster for easier agent matching
- Solution: Provide more context about what each page covers
βArticles too similar to competitorsβ
- Solution: Update
competitor-analysis.mdwith differentiation opportunities - Solution: Add your unique advantages to
brand-voice.mdandfeatures.md - Solution: Reference specific differentiation angles in
/researchcommand
Support & Contributions
Getting Help
- Review this README thoroughly
- Check context files are properly configured
- Consult Claude Code documentation
Contributing
- Report issues via GitHub Issues
- Suggest improvements to commands or agents
- Share successful workflows or tips
License
[Add your license information]
Credits
Built with Claude Code by Anthropic.
Originally developed for Castos, now available as an open-source tool for any business to streamline long-form SEO content creation.
Examples & Community
See It In Action: Check out examples/castos/ for a complete real-world example of how a podcast hosting SaaS company uses SEO Machine.
Contributions Welcome: Found a bug? Have a feature request? Want to share your own industry example? Contributions and PRs are welcome!
Ready to start creating?
- Configure your context files (use the templates as your guide)
- Run
/research [your topic] - Review the brief
- Run
/write [your topic] - Publish amazing content!
Happy writing! π