Files
our-claude-skills/ourdigital-custom-skills/15-seo-core-web-vitals/code/CLAUDE.md
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

118 lines
2.6 KiB
Markdown

# CLAUDE.md
## Overview
Core Web Vitals analyzer using Google PageSpeed Insights API: LCP, FID, CLS, INP, TTFB, FCP measurement and recommendations.
## Quick Start
```bash
pip install -r scripts/requirements.txt
# Requires API key
export PAGESPEED_API_KEY=your_api_key
python scripts/pagespeed_client.py --url https://example.com
```
## Scripts
| Script | Purpose |
|--------|---------|
| `pagespeed_client.py` | PageSpeed Insights API client |
| `base_client.py` | Shared utilities |
## Usage
```bash
# Mobile analysis (default)
python scripts/pagespeed_client.py --url https://example.com
# Desktop analysis
python scripts/pagespeed_client.py --url https://example.com --strategy desktop
# Both strategies
python scripts/pagespeed_client.py --url https://example.com --strategy both
# JSON output
python scripts/pagespeed_client.py --url https://example.com --json
# Batch analysis
python scripts/pagespeed_client.py --urls urls.txt --output results.json
```
## Core Web Vitals Metrics
| Metric | Good | Needs Improvement | Poor |
|--------|------|-------------------|------|
| LCP (Largest Contentful Paint) | ≤2.5s | 2.5s-4s | >4s |
| FID (First Input Delay) | ≤100ms | 100ms-300ms | >300ms |
| CLS (Cumulative Layout Shift) | ≤0.1 | 0.1-0.25 | >0.25 |
| INP (Interaction to Next Paint) | ≤200ms | 200ms-500ms | >500ms |
## Additional Metrics
| Metric | Description |
|--------|-------------|
| TTFB | Time to First Byte |
| FCP | First Contentful Paint |
| SI | Speed Index |
| TBT | Total Blocking Time |
## Output
```json
{
"url": "https://example.com",
"strategy": "mobile",
"score": 85,
"core_web_vitals": {
"lcp": {"value": 2.1, "rating": "good"},
"fid": {"value": 50, "rating": "good"},
"cls": {"value": 0.05, "rating": "good"},
"inp": {"value": 180, "rating": "good"}
},
"opportunities": [
{
"id": "render-blocking-resources",
"title": "Eliminate render-blocking resources",
"savings_ms": 1200
}
],
"diagnostics": []
}
```
## Configuration
Environment variables:
```bash
PAGESPEED_API_KEY=AIza... # Required for higher quotas
GOOGLE_API_KEY=AIza... # Alternative key name
```
## Rate Limits
| Tier | Limit |
|------|-------|
| No API key | 25 queries/day |
| With API key | 25,000 queries/day |
## Common Recommendations
| Issue | Fix |
|-------|-----|
| Large LCP | Optimize images, preload critical resources |
| High CLS | Set image dimensions, avoid injected content |
| Poor INP | Reduce JavaScript, optimize event handlers |
| Slow TTFB | Improve server response, use CDN |
## Dependencies
```
google-api-python-client>=2.100.0
requests>=2.31.0
python-dotenv>=1.0.0
rich>=13.7.0
```