# Implementation Automation Guide

**Last Updated:** 2026-01-11
**Date:** 2026-01-11
**Status:** Ready for Use

## Overview

This guide outlines automation scripts and tools available to help implement the improvements identified in improvement plans.

## Available Automation Scripts

### Data Collection Scripts

#### 1. Keyword Collection

```bash
# Collect SISTRIX keywords for posts
php v2/scripts/blog/collect-post-keywords-sistrix.php --category=lexikon --limit=10

# Collect for all posts (use carefully - credit limits)
php v2/scripts/blog/collect-post-keywords-sistrix.php --all
```

#### 2. Performance Data Collection

```bash
# Collect GA4 performance data
php v2/scripts/blog/collect-post-performance-ga4.php --category=lexikon --limit=10

# Collect GSC performance data
php v2/scripts/blog/collect-post-performance-gsc.php --category=lexikon --limit=10
```

#### 3. Advanced Data Collection

```bash
# Collect SERP features
php v2/scripts/blog/collect-post-serp-features.php --limit=50

# Collect search intent
php v2/scripts/blog/collect-post-search-intent.php --all

# Collect competition levels
php v2/scripts/blog/collect-post-competition-levels.php --all

# Collect domain opportunities
php v2/scripts/blog/collect-domain-opportunities.php --limit=100
```

### Analysis Scripts

#### 1. Content Analysis

```bash
# Analyze content for all posts
php v2/scripts/blog/analyze-post-content.php --all

# Analyze specific category
php v2/scripts/blog/analyze-post-content.php --category=lexikon
```

#### 2. SEO Analysis

```bash
# Analyze SEO for all posts
php v2/scripts/blog/analyze-post-seo.php --all

# Analyze specific post
php v2/scripts/blog/analyze-post-seo.php --post=slug --category=lexikon
```

#### 3. Link Analysis

```bash
# Analyze internal links for all posts
php v2/scripts/blog/analyze-post-links.php --all
```

### Documentation Scripts

#### 1. Generate Documentation

```bash
# Generate all documentation
php v2/scripts/blog/generate-post-documentation.php --all

# Generate for specific category
php v2/scripts/blog/generate-post-documentation.php --category=lexikon

# Generate for specific post
php v2/scripts/blog/generate-post-documentation.php --post=slug --category=lexikon
```

#### 2. Generate Improvement Plans

```bash
# Generate improvement plans for all posts
php v2/scripts/blog/generate-improvement-plan.php --all

# Generate for specific category
php v2/scripts/blog/generate-improvement-plan.php --category=ratgeber
```

#### 3. Validate Documentation

```bash
# Validate all documentation
php v2/scripts/blog/validate-post-documentation.php --all

# Validate specific category
php v2/scripts/blog/validate-post-documentation.php --category=lexikon
```

### Review Tools

#### 1. Priority Lists

```bash
# Generate review priority list
php v2/scripts/blog/generate-review-priority-list.php
```

#### 2. Progress Tracking

```bash
# Generate progress tracker
php v2/scripts/blog/generate-review-progress-tracker.php
```

#### 3. Content Gaps

```bash
# Generate content gaps summary
php v2/scripts/blog/generate-content-gaps-summary.php
```

#### 4. Readiness Check

```bash
# Check implementation readiness
php v2/scripts/blog/check-implementation-readiness.php
```

## Implementation Workflows

### Workflow 1: Quick Wins Implementation

**Step 1: Identify Opportunities**

```bash
# Review domain opportunities
cat docs/content/blog/domain-level-data/domain-opportunities.json | jq '.opportunities[0:10]'
```

**Step 2: Analyze Target Posts**

```bash
# Analyze specific post
php v2/scripts/blog/analyze-post-seo.php --post=prozentrechner --category=tools
```

**Step 3: Generate Improvement Plan**

```bash
# Generate plan (if blog post exists)
php v2/scripts/blog/generate-improvement-plan.php --post=slug --category=category
```

**Step 4: Implement Changes**

- Manual: Update meta tags, add FAQs, implement structured data
- Automated: Use scripts to validate changes

**Step 5: Monitor Results**

```bash
# Re-collect performance data after 1-2 weeks
php v2/scripts/blog/collect-post-performance-gsc.php --post=slug --category=category
```

### Workflow 2: Content Expansion

**Step 1: Identify Posts Needing Expansion**

```bash
# Generate content gaps summary
php v2/scripts/blog/generate-content-gaps-summary.php

# Review priority list
cat docs/content/blog/REVIEW_PRIORITY_LIST.md
```

**Step 2: Analyze Content**

```bash
# Analyze content for specific post
php v2/scripts/blog/analyze-post-content.php --post=slug --category=category
```

**Step 3: Review Improvement Plan**

```bash
# View improvement plan
cat docs/content/blog/posts/{category}/{slug}/IMPROVEMENT_PLAN.md
```

**Step 4: Implement Content Changes**

- Manual: Expand content, add sections, improve depth

**Step 5: Regenerate Documentation**

```bash
# Regenerate after changes
php v2/scripts/blog/generate-post-documentation.php --post=slug --category=category
```

### Workflow 3: SEO Optimization

**Step 1: Identify SEO Issues**

```bash
# Analyze SEO for all posts
php v2/scripts/blog/analyze-post-seo.php --all

# Review SEO reports
find docs/content/blog/posts -name "SEO_REPORT.md" -exec grep -l "SEO score.*< 70" {} \;
```

**Step 2: Review Competition Levels**

```bash
# Check competition for keywords
cat docs/content/blog/posts/{category}/{slug}/data/keywords-sistrix.json | jq '.keywords[] | select(.competition_level < 30)'
```

**Step 3: Optimize Based on Data**

- Use search intent data to align content
- Use competition levels to prioritize
- Use SERP features to optimize for snippets

**Step 4: Validate Changes**

```bash
# Validate documentation after changes
php v2/scripts/blog/validate-post-documentation.php --post=slug --category=category
```

## Monitoring & Reporting

### Weekly Monitoring

**Check Performance**

```bash
# Collect latest performance data
php v2/scripts/blog/collect-post-performance-gsc.php --category=lexikon --limit=20
php v2/scripts/blog/collect-post-performance-ga4.php --category=lexikon --limit=20
```

**Update Documentation**

```bash
# Regenerate documentation with new data
php v2/scripts/blog/generate-post-documentation.php --category=lexikon --limit=20
```

**Track Progress**

```bash
# Generate progress tracker
php v2/scripts/blog/generate-review-progress-tracker.php
```

### Monthly Reporting

**Comprehensive Analysis**

```bash
# Run all analysis scripts
php v2/scripts/blog/analyze-post-content.php --all
php v2/scripts/blog/analyze-post-seo.php --all
php v2/scripts/blog/analyze-post-links.php --all

# Regenerate all documentation
php v2/scripts/blog/generate-post-documentation.php --all

# Update dashboard
php v2/scripts/blog/update-improvement-dashboard.php
```

## Credit Management

### Check Credit Usage

```bash
# View credit log
cat v2/data/blog/sistrix-credits-log.json

# Check remaining credits
php -r "echo 10000 - json_decode(file_get_contents('v2/data/blog/sistrix-credits-log.json'), true)['total_used'];"
```

### Plan Collection

```bash
# Estimate credits needed
# SERP Features: 1 credit per keyword
# Search Intent: 1 credit per keyword
# Competition: 1 credit per keyword
# Domain Opportunities: 1 credit per opportunity
```

## Best Practices

### Before Running Scripts

1. Check credit limits
2. Review script documentation
3. Test with `--limit=1` first
4. Use `--dry-run` when available

### After Running Scripts

1. Validate output files
2. Check for errors
3. Review generated documentation
4. Update status reports

### Regular Maintenance

1. Weekly: Collect performance data
2. Monthly: Run comprehensive analysis
3. Quarterly: Review and update strategies
4. After changes: Regenerate documentation

## Troubleshooting

### Common Issues

**Credit Limit Reached**

- Check `sistrix-credits-log.json`
- Wait for weekly reset (Monday)
- Prioritize high-value collections

**Missing Data Files**

- Run collection scripts
- Check file permissions
- Verify API access

**Documentation Errors**

- Run validation script
- Check template files
- Review error logs

## Status

✅ **Scripts Operational**
✅ **Workflows Defined**
✅ **Best Practices Documented**
✅ **Ready for Use**
