Files
our-claude-skills/ourdigital-custom-skills/32-ourdigital-presentation/code/scripts/run_workflow.py
Andrew Yim eea49f9f8c refactor(skills): Restructure skills to dual-platform architecture
Major refactoring of ourdigital-custom-skills with new numbering system:

## Structure Changes
- Each skill now has code/ (Claude Code) and desktop/ (Claude Desktop) versions
- New progressive numbering: 01-09 General, 10-19 SEO, 20-29 GTM, 30-39 OurDigital, 40-49 Jamie

## Skill Reorganization
- 01-notion-organizer (from 02)
- 10-18: SEO tools split into focused skills (technical, on-page, local, schema, vitals, gsc, gateway)
- 20-21: GTM audit and manager
- 30-32: OurDigital designer, research, presentation
- 40-41: Jamie brand editor and audit

## New Files
- .claude/commands/: Slash command definitions for all skills
- CLAUDE.md: Updated with new skill structure documentation
- REFACTORING_PLAN.md: Migration documentation
- COMPATIBILITY_REPORT.md, SKILLS_COMPARISON.md: Analysis docs

## Removed
- Old skill directories (02-05, 10-14, 20-21 old numbering)
- Consolidated into new structure with _archive/ for reference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 01:58:24 +09:00

139 lines
4.3 KiB
Python

#!/usr/bin/env python3
"""
Main workflow orchestrator for Research to Presentation
Coordinates the complete pipeline from Notion to final presentation
"""
import json
import argparse
import subprocess
import sys
from pathlib import Path
from datetime import datetime
def run_workflow(notion_url, output_format='pptx', brand_config=None):
"""
Execute the complete research to presentation workflow
Args:
notion_url: URL of Notion page or database
output_format: 'pptx' or 'figma'
brand_config: Path to brand configuration JSON
"""
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
work_dir = Path(f"/tmp/r2p_{timestamp}")
work_dir.mkdir(parents=True, exist_ok=True)
print("🚀 Starting Research to Presentation Workflow")
print(f"📍 Source: {notion_url}")
print(f"📄 Output Format: {output_format}")
print("-" * 50)
try:
# Step 1: Extract Notion content
print("\n📚 Step 1: Extracting Notion research...")
research_file = work_dir / "research.json"
subprocess.run([
sys.executable, "scripts/extract_notion.py",
notion_url,
"--output", str(research_file)
], check=True)
print(f"✅ Research extracted to {research_file}")
# Step 2: Synthesize content
print("\n🔍 Step 2: Synthesizing content and extracting topics...")
synthesis_file = work_dir / "synthesis.json"
subprocess.run([
sys.executable, "scripts/synthesize_content.py",
str(research_file),
"--output", str(synthesis_file)
], check=True)
print(f"✅ Synthesis completed: {synthesis_file}")
# Step 3: Generate presentation
print(f"\n🎨 Step 3: Generating {output_format.upper()} presentation...")
if output_format == 'pptx':
output_file = f"presentation_{timestamp}.pptx"
subprocess.run([
"node", "scripts/generate_pptx.js",
str(synthesis_file),
output_file
], check=True)
print(f"✅ PowerPoint created: {output_file}")
elif output_format == 'figma':
output_file = f"figma_slides_{timestamp}.json"
subprocess.run([
"node", "scripts/export_to_figma.js",
str(synthesis_file),
"--output", output_file
], check=True)
print(f"✅ Figma slides exported: {output_file}")
# Step 4: Apply branding (if config provided)
if brand_config and output_format == 'pptx':
print("\n🎨 Step 4: Applying brand styles...")
subprocess.run([
sys.executable, "scripts/apply_brand.py",
output_file,
"--config", brand_config
], check=True)
print("✅ Brand styling applied")
print("\n" + "=" * 50)
print(f"🎉 Workflow completed successfully!")
print(f"📁 Output: {output_file}")
print(f"🗂️ Work files: {work_dir}")
return output_file
except subprocess.CalledProcessError as e:
print(f"\n❌ Error in workflow: {e}")
print(f"💡 Check work directory for debugging: {work_dir}")
raise
except Exception as e:
print(f"\n❌ Unexpected error: {e}")
raise
def main():
parser = argparse.ArgumentParser(
description="Transform Notion research into presentations"
)
parser.add_argument(
"--notion-url",
required=True,
help="URL of Notion page or database"
)
parser.add_argument(
"--output-format",
choices=['pptx', 'figma'],
default='pptx',
help="Output format (default: pptx)"
)
parser.add_argument(
"--brand-config",
help="Path to brand configuration JSON"
)
parser.add_argument(
"--preview",
action='store_true',
help="Generate HTML preview only"
)
args = parser.parse_args()
if args.preview:
print("🔍 Preview mode - generating HTML only")
# Preview implementation here
else:
run_workflow(
args.notion_url,
args.output_format,
args.brand_config
)
if __name__ == "__main__":
main()