# FAQ Automation Quick Reference

**Last Updated:** 2026-01-13

Quick reference guide for FAQ automation scripts and workflows.

## Quick Commands

### New Post FAQ Generation

```bash
# Complete workflow (recommended)
php v2/scripts/blog/generate-faqs-complete.php --post=slug --category=category
```

This single command:
- Generates FAQ questions
- Generates FAQ answers (AI-powered)
- Adds keywords automatically
- Adds links automatically
- Validates quality

### Existing Post Enhancement

```bash
# Enhance existing FAQs
php v2/scripts/blog/automate-faq-enhancement.php --post=slug --category=category
```

### Prioritization

```bash
# Generate priority list
php v2/scripts/blog/prioritize-faq-improvements.php

# Aggregate performance data
php v2/scripts/blog/aggregate-faq-performance.php

# View dashboard
# Access: /v2/admin/faq-prioritization-dashboard.php
```

### Quality Validation

```bash
# Validate expansion quality
php v2/scripts/blog/validate-expansion-quality.php --all

# Analyze expansion results
php v2/scripts/blog/analyze-expansion-results.php

# Audit FAQ quality
php v2/scripts/blog/audit-faq-quality.php
```

## Individual Scripts

### Planning
- `faq-planning-checklist.php` - Generate planning checklist

### Question Generation
- `generate-faq-questions.php` - Generate FAQ questions from research data

### Answer Generation
- `generate-faq-answers-ai.php` - AI-powered answer generation (requires OpenAI API key)

### Enhancement
- `integrate-faq-keywords.php` - Add keywords to FAQs
- `add-faq-links.php` - Add internal links to FAQs
- `expand-short-faq-answers.php` - Expand short answers (<40 words)
- `condense-faqs-auto.php` - Condense long answers (>80 words)

### Analysis
- `prioritize-faq-improvements.php` - Rank posts by priority
- `aggregate-faq-performance.php` - Aggregate performance metrics
- `analyze-expansion-results.php` - Analyze expansion effectiveness

### Validation
- `validate-expansion-quality.php` - Validate expanded answers
- `audit-faq-quality.php` - Comprehensive quality audit
- `validate-faq-schema.php` - Schema validation

## Setup Requirements

### OpenAI API (for AI generation)

```bash
# Set environment variable
export OPENAI_API_KEY=your_key

# Or add to config file
# v2/config/openai-api-key.php
```

### Dry-Run Mode

All scripts support `--dry-run` for testing:

```bash
php v2/scripts/blog/generate-faqs-complete.php --post=slug --category=category --dry-run
```

## Common Workflows

### Workflow 1: New Post with FAQs

```bash
# 1. Generate planning checklist
php v2/scripts/blog/faq-planning-checklist.php --post=slug --category=category

# 2. Complete FAQ generation
php v2/scripts/blog/generate-faqs-complete.php --post=slug --category=category

# 3. Validate
php v2/scripts/blog/validate-faq-schema.php --post=slug --category=category
```

### Workflow 2: Improve Existing FAQs

```bash
# 1. Check priority
php v2/scripts/blog/prioritize-faq-improvements.php

# 2. Enhance FAQs
php v2/scripts/blog/automate-faq-enhancement.php --post=slug --category=category

# 3. Validate quality
php v2/scripts/blog/validate-expansion-quality.php --post=slug --category=category
```

### Workflow 3: Batch Processing

```bash
# Process all posts
php v2/scripts/blog/automate-faq-enhancement.php --all

# Validate all
php v2/scripts/blog/validate-expansion-quality.php --all

# Audit all
php v2/scripts/blog/audit-faq-quality.php
```

## Output Files

### Planning
- `docs/content/blog/posts/{category}/{slug}/FAQ_PLANNING_CHECKLIST.md`

### Data Files
- `docs/content/blog/posts/{category}/{slug}/data/faq-questions.json`
- `docs/content/blog/posts/{category}/{slug}/data/faq-answers-ai.json`
- `docs/content/blog/posts/{category}/{slug}/data/faq-research.json`

### Reports
- `docs/content/blog/FAQ_IMPROVEMENT_PRIORITY.md`
- `docs/content/blog/FAQ_PERFORMANCE_AGGREGATE.json`
- `docs/content/blog/FAQ_EXPANSION_ANALYSIS.md`
- `docs/content/blog/FAQ_ENHANCEMENT_REPORT.md`

## Troubleshooting

### OpenAI API Errors
- Check API key is set: `echo $OPENAI_API_KEY`
- Verify API key is valid
- Check rate limits

### Script Errors
- Run with `--dry-run` first
- Check file permissions
- Verify post files exist
- Check PHP version (7.4+)

### Quality Issues
- Run validation scripts
- Check word counts (40-80 target)
- Verify keyword integration
- Review link quality

## Help

For detailed documentation:
- `FAQ_AUTOMATION_IMPLEMENTATION_SUMMARY.md` - Complete feature overview
- `CONTENT_CREATION_WORKFLOW.md` - Workflow guide
- `FAQ_WORKFLOW.md` - Detailed workflow
- `FAQ_BEST_PRACTICES.md` - Content guidelines
