Skip to content

Free, open source blog writer for Claude Code. Researches current sources, writes answer-first posts for Google and AI answers, has an independent reviewer score each one out of 100 and ships only after five delivery gates. 32 skills, 30 /blog commands, 5 agents. Active development at AI-Marketing-Hub/claude-blog; public releases ship here.

feat: align with official plugin standard, add tests and CI

Claude1c9edd19eec5
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
new file mode 100644
index 0000000..dfceb3b
--- /dev/null
+++ b/.claude-plugin/plugin.json
@@ -0,0 +1,7 @@
+{
+ "name": "claude-blog",
+ "description": "AI-powered blog creation and optimization skill with 12 commands, 5-category 100-point scoring, and 4 specialized agents. Optimized for Google rankings (December 2025 Core Update, E-E-A-T) and AI citations (GEO/AEO). Writes, rewrites, analyzes, outlines, audits, and repurposes blog content.",
+ "author": {
+ "name": "AgriciDaniel"
+ }
+}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..aa96f4d
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,99 @@
+name: CI
+
+on:
+ push:
+ branches: [main, master]
+ pull_request:
+ branches: [main, master]
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.11", "3.12"]
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v5
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install pytest textstat beautifulsoup4
+
+ - name: Run tests
+ run: python -m pytest tests/ -v
+
+ validate-skills:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Validate SKILL.md frontmatter
+ run: |
+ echo "Checking all SKILL.md files have required frontmatter..."
+ errors=0
+ for file in $(find skills -name "SKILL.md"); do
+ if ! head -1 "$file" | grep -q "^---"; then
+ echo "ERROR: $file missing YAML frontmatter"
+ errors=$((errors + 1))
+ fi
+ if ! grep -q "^name:" "$file"; then
+ echo "ERROR: $file missing 'name' field"
+ errors=$((errors + 1))
+ fi
+ if ! grep -q "^description:" "$file" && ! grep -q "description: >" "$file"; then
+ echo "ERROR: $file missing 'description' field"
+ errors=$((errors + 1))
+ fi
+ done
+ if [ $errors -gt 0 ]; then
+ echo "Found $errors validation errors"
+ exit 1
+ fi
+ echo "All SKILL.md files valid"
+
+ - name: Validate plugin.json
+ run: |
+ python3 -c "
+ import json, sys
+ with open('.claude-plugin/plugin.json') as f:
+ data = json.load(f)
+ required = ['name', 'description', 'author']
+ missing = [k for k in required if k not in data]
+ if missing:
+ print(f'Missing required fields: {missing}')
+ sys.exit(1)
+ print('plugin.json is valid')
+ "
+
+ lint-markdown:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Check for broken internal references
+ run: |
+ echo "Checking for stale blog/ path references..."
+ errors=0
+ # Check that no SKILL.md or doc references the old blog/ path for references/templates
+ for file in $(find skills docs -name "*.md"); do
+ if grep -n "blog/references/" "$file" 2>/dev/null; then
+ echo "WARNING: $file still references old 'blog/references/' path"
+ errors=$((errors + 1))
+ fi
+ if grep -n "blog/templates/" "$file" 2>/dev/null; then
+ echo "WARNING: $file still references old 'blog/templates/' path"
+ errors=$((errors + 1))
+ fi
+ done
+ if [ $errors -gt 0 ]; then
+ echo "Found $errors stale path references"
+ exit 1
+ fi
+ echo "No stale path references found"
diff --git a/.mcp.json b/.mcp.json
new file mode 100644
index 0000000..da39e4f
--- /dev/null
+++ b/.mcp.json
@@ -0,0 +1,3 @@
+{
+ "mcpServers": {}
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b8ba3c3..76d1be7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -45,11 +45,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Full documentation suite** (docs/): Installation, Commands, Architecture, Templates, Troubleshooting, MCP Integration
### Architecture
-- Main orchestrator: `blog/SKILL.md` (routes all 12 commands)
+- Main orchestrator: `skills/blog/SKILL.md` (routes all 12 commands)
- 12 sub-skills in `skills/blog-*/SKILL.md`
- 4 subagents in `agents/blog-*.md`
-- 12 reference docs in `blog/references/` (loaded on-demand)
-- 12 content templates in `blog/templates/`
+- 12 reference docs in `skills/blog/references/` (loaded on-demand)
+- 12 content templates in `skills/blog/templates/`
### Fixed
- Corrected phantom "January 2026 Authenticity Update" references to verified **December 2025 Core Update** (Dec 11-29, 2025)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..ed0c287
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,47 @@
+# Contributing to claude-blog
+
+Thank you for your interest in contributing to claude-blog!
+
+## Getting Started
+
+1. Fork and clone the repository
+2. Install dev dependencies: `pip install -e ".[dev]"`
+3. Run tests: `python -m pytest tests/ -v`
+
+## Development
+
+### Project Structure
+
+```
+claude-blog/
+├── .claude-plugin/ # Plugin metadata
+│ └── plugin.json
+├── skills/
+│ ├── blog/ # Main orchestrator + references + templates
+│ ├── blog-write/ # Sub-skills (12 user-facing + 1 internal)
+│ ├── blog-rewrite/
+│ └── ...
+├── agents/ # 4 specialized agents
+├── scripts/ # Python analysis script
+├── tests/ # pytest test suite
+├── docs/ # Documentation
+└── .github/workflows/ # CI pipeline
+```
+
+### Making Changes
+
+- **SKILL.md files** must have `name` and `description` in YAML frontmatter
+- **Reference paths** in sub-skills use `references/` (relative to installed location)
+- **Template paths** in sub-skills use `templates/` (relative to installed location)
+- Run `python -m pytest tests/ -v` before submitting
+
+### Pull Requests
+
+1. Create a feature branch from `main`
+2. Make your changes with clear commit messages
+3. Ensure all tests pass
+4. Submit a PR with a description of what changed and why
+
+## Reporting Issues
+
+Open an issue at https://github.com/AgriciDaniel/claude-blog/issues
diff --git a/README.md b/README.md
index 750feb1..306ac7c 100644
--- a/README.md
+++ b/README.md
@@ -18,13 +18,19 @@ Strategy, briefs, calendars, writing, optimization, schema, repurposing, and ful
## Quick Start
-One-command install (Unix/macOS):
+**Plugin install (recommended):**
+
+```bash
+/plugin install claude-blog@AgriciDaniel
+```
+
+**Or one-command install (Unix/macOS):**
```bash
curl -fsSL https://raw.githubusercontent.com/AgriciDaniel/claude-blog/main/install.sh | bash
```
-Or clone and install manually:
+**Or clone and install manually:**
```bash
git clone https://github.com/AgriciDaniel/claude-blog.git
@@ -32,7 +38,7 @@ cd claude-blog
chmod +x install.sh && ./install.sh
```
-Windows (PowerShell):
+**Windows (PowerShell):**
```powershell
.\install.ps1
```
@@ -93,36 +99,14 @@ Next.js/MDX, Astro, Hugo, Jekyll, WordPress, Ghost, 11ty, Gatsby, and static HTM
```
claude-blog/
-├── blog/
-│ ├── SKILL.md # Main orchestrator (12 commands)
-│ ├── references/ # 12 on-demand reference docs
-│ │ ├── google-landscape-2026.md
-│ │ ├── geo-optimization.md
-│ │ ├── content-rules.md
-│ │ ├── visual-media.md
-│ │ ├── quality-scoring.md
-│ │ ├── platform-guides.md
-│ │ ├── distribution-playbook.md
-│ │ ├── content-templates.md
-│ │ ├── eeat-signals.md
-│ │ ├── ai-crawler-guide.md
-│ │ ├── schema-stack.md
-│ │ └── internal-linking.md
-│ └── templates/ # 12 content type templates
-│ ├── how-to-guide.md
-│ ├── listicle.md
-│ ├── case-study.md
-│ ├── comparison.md
-│ ├── pillar-page.md
-│ ├── product-review.md
-│ ├── thought-leadership.md
-│ ├── roundup.md
-│ ├── tutorial.md
-│ ├── news-analysis.md
-│ ├── data-research.md
-│ └── faq-knowledge.md
-├── skills/ # 13 sub-skills
-│ ├── blog-write/SKILL.md
+├── .claude-plugin/
+│ └── plugin.json # Plugin metadata (name, description, author)
+├── skills/
+│ ├── blog/ # Main orchestrator
+│ │ ├── SKILL.md # Routes all 12 commands
+│ │ ├── references/ # 12 on-demand reference docs
+│ │ └── templates/ # 12 content type templates
+│ ├── blog-write/SKILL.md # Sub-skills (12 user-facing + 1 internal)
│ ├── blog-rewrite/SKILL.md
│ ├── blog-analyze/SKILL.md
│ ├── blog-brief/SKILL.md
@@ -142,24 +126,17 @@ claude-blog/
│ └── blog-reviewer.md
├── scripts/
│ └── analyze_blog.py # Python quality analysis (5-category scoring)
+├── tests/ # pytest test suite
+│ ├── conftest.py
+│ └── test_analyze_blog.py
├── docs/ # 6 documentation files
-│ ├── INSTALLATION.md
-│ ├── COMMANDS.md
-│ ├── ARCHITECTURE.md
-│ ├── TEMPLATES.md
-│ ├── TROUBLESHOOTING.md
-│ └── MCP-INTEGRATION.md
-├── assets/ # Images and demo GIFs
-│ ├── header.jpeg
-│ ├── blog-write-demo.gif
-│ └── blog-command-demo.gif
-├── install.sh # Unix/macOS installer
+├── .github/workflows/ci.yml # CI pipeline
+├── install.sh # Unix/macOS installer (fallback)
├── install.ps1 # Windows PowerShell installer
-├── uninstall.sh # Unix/macOS uninstaller
-├── uninstall.ps1 # Windows PowerShell uninstaller
+├── pyproject.toml # Python project config
├── requirements.txt # Python dependencies
+├── CONTRIBUTING.md
├── CHANGELOG.md
-├── TODO.md
├── LICENSE
└── README.md
```
@@ -207,10 +184,7 @@ Detailed documentation is available in [docs/](docs/):
## Contributing
-Contributions welcome! Please:
-1. Fork the repository
-2. Create a feature branch
-3. Submit a pull request
+Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## License
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 87db066..c60f0ef 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -16,7 +16,7 @@ data flow, scoring methodology, file conventions, and extension points.
v
+-----------------------------+
| Main Orchestrator |
- | blog/SKILL.md |
+ | skills/blog/SKILL.md |
| |
| - Command parsing |
| - Platform detection |
@@ -29,8 +29,8 @@ data flow, scoring methodology, file conventions, and extension points.
v v
+----------------------------+ +---------------------------+
| 12 Sub-Skills | | On-Demand References |
-| skills/blog-*/SKILL.md | | blog/references/*.md |
-| | | blog/templates/*.md |
+| skills/blog-*/SKILL.md | | skills/blog/references/*.md |
+| | | skills/blog/templates/*.md |
| write rewrite | | |
| analyze brief | | Loaded as needed |
| calendar strategy | | (RAG-style pattern) |
@@ -57,7 +57,7 @@ data flow, scoring methodology, file conventions, and extension points.
### 1. Main Orchestrator
-**File**: `blog/SKILL.md`
+**File**: `skills/blog/SKILL.md`
The entry point for all `/blog` commands. Responsibilities:
@@ -115,7 +115,7 @@ name, description, and available tools.
### 4. Reference Files (12)
-**Location**: `blog/references/*.md`
+**Location**: `skills/blog/references/*.md`
Knowledge documents loaded on demand (not preloaded). Each reference covers
a specific optimization domain:
@@ -137,7 +137,7 @@ a specific optimization domain:
### 5. Content Templates (12)
-**Location**: `blog/templates/*.md`
+**Location**: `skills/blog/templates/*.md`
Structural templates for different content types. Each template defines
section structure, word count targets, and format-specific guidance.
@@ -171,7 +171,7 @@ Code's context as a CLI tool. Provides:
/blog write "topic"
|
v
- Orchestrator (blog/SKILL.md)
+ Orchestrator (skills/blog/SKILL.md)
|
+-- Loads: references/content-rules.md
| references/visual-media.md
@@ -326,11 +326,11 @@ Platform detection affects:
| Component | Location | Naming |
|-----------|----------|--------|
-| Main skill | `blog/SKILL.md` | Fixed name |
+| Main skill | `skills/blog/SKILL.md` | Fixed name |
| Sub-skills | `skills/blog-<command>/SKILL.md` | Prefix `blog-` + command name |
| Agents | `agents/blog-<role>.md` | Prefix `blog-` + role name |
-| References | `blog/references/<topic>.md` | Kebab-case topic name |
-| Templates | `blog/templates/<type>.md` | Kebab-case content type |
+| References | `skills/blog/references/<topic>.md` | Kebab-case topic name |
+| Templates | `skills/blog/templates/<type>.md` | Kebab-case content type |
| Scripts | `scripts/<name>.py` | Snake-case script name |
---
@@ -340,7 +340,7 @@ Platform detection affects:
### Adding a New Command
1. Create `skills/blog-<name>/SKILL.md` with YAML frontmatter
-2. Add routing logic to `blog/SKILL.md` orchestrator
+2. Add routing logic to `skills/blog/SKILL.md` orchestrator
3. Update `install.sh` and `install.ps1` to copy the new sub-skill
4. Update `uninstall.sh` to remove it
@@ -352,13 +352,13 @@ Platform detection affects:
### Adding a New Reference
-1. Create `blog/references/<topic>.md`
+1. Create `skills/blog/references/<topic>.md`
2. Document when to load it in the orchestrator
3. Update `install.sh` to copy the new reference file
### Adding a New Template
-1. Create `blog/templates/<type>.md`
+1. Create `skills/blog/templates/<type>.md`
2. Define section structure, markers, and word count targets
3. Add template selection logic to `blog-write`
diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md
index cc1a941..fe1e226 100644
--- a/docs/COMMANDS.md
+++ b/docs/COMMANDS.md
@@ -1,7 +1,7 @@
# Command Reference
Complete reference for all 12 `/blog` slash commands. Every command is invoked
-through the main orchestrator (`blog/SKILL.md`), which routes to the appropriate
+through the main orchestrator (`skills/blog/SKILL.md`), which routes to the appropriate
sub-skill.
## Command Overview
@@ -521,7 +521,7 @@ changes and focuses on updating data and signals.
## Command Routing
-The main orchestrator (`blog/SKILL.md`) parses user input and routes to
+The main orchestrator (`skills/blog/SKILL.md`) parses user input and routes to
the correct sub-skill:
```
diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md
index 54ab9b1..9a09bcd 100644
--- a/docs/INSTALLATION.md
+++ b/docs/INSTALLATION.md
@@ -17,6 +17,18 @@ other commands work without it.
---
+## Plugin Install (Recommended)
+
+The simplest way to install claude-blog is via the Claude Code plugin system:
+
+```bash
+/plugin install claude-blog@AgriciDaniel
+```
+
+This automatically installs all skills, agents, references, and templates.
+
+---
+
## Quick Install (One Command)
### Linux / macOS
@@ -128,13 +140,13 @@ mkdir -p ~/.claude/skills/blog-{write,rewrite,analyze,brief,calendar,strategy,ou
mkdir -p ~/.claude/agents
# Main skill
-cp blog/SKILL.md ~/.claude/skills/blog/SKILL.md
+cp skills/blog/SKILL.md ~/.claude/skills/skills/blog/SKILL.md
# References
-cp blog/references/*.md ~/.claude/skills/blog/references/
+cp skills/blog/references/*.md ~/.claude/skills/skills/blog/references/
# Templates
-cp blog/templates/*.md ~/.claude/skills/blog/templates/
+cp skills/blog/templates/*.md ~/.claude/skills/skills/blog/templates/
# Sub-skills
for d in skills/blog-*/; do
@@ -160,7 +172,7 @@ After installation, verify everything is in place:
```bash
# Main skill
-ls ~/.claude/skills/blog/SKILL.md
+ls ~/.claude/skills/skills/blog/SKILL.md
# Sub-skills (should list 12)
ls ~/.claude/skills/blog-*/SKILL.md | wc -l
@@ -169,7 +181,7 @@ ls ~/.claude/skills/blog-*/SKILL.md | wc -l
ls ~/.claude/agents/blog-*.md | wc -l
# References (should list 5+)
-ls ~/.claude/skills/blog/references/*.md | wc -l
+ls ~/.claude/skills/skills/blog/references/*.md | wc -l
# Python script
ls ~/.claude/skills/blog/scripts/analyze_blog.py
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 9c93b47..9764715 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -175,17 +175,17 @@ for the content type.
1. **Templates not installed**: Verify the templates directory exists:
```bash
- ls ~/.claude/skills/blog/templates/
+ ls ~/.claude/skills/skills/blog/templates/
```
If empty or missing, re-run `./install.sh`.
2. **Wrong install path**: Templates must be in
- `~/.claude/skills/blog/templates/`, not in the repository's
- `blog/templates/` directory.
+ `~/.claude/skills/skills/blog/templates/`, not in the repository's
+ `skills/blog/templates/` directory.
3. **Template file corrupted**: Re-copy from the repository:
```bash
- cp blog/templates/*.md ~/.claude/skills/blog/templates/
+ cp skills/blog/templates/*.md ~/.claude/skills/skills/blog/templates/
```
### Wrong template selected
@@ -242,11 +242,11 @@ before spawning the agent. If the issue persists:
1. Verify reference files exist:
```bash
- ls ~/.claude/skills/blog/references/
+ ls ~/.claude/skills/skills/blog/references/
```
2. Re-install references:
```bash
- cp blog/references/*.md ~/.claude/skills/blog/references/
+ cp skills/blog/references/*.md ~/.claude/skills/skills/blog/references/
```
---
@@ -377,7 +377,7 @@ If your issue is not listed here:
2. **Verify file integrity**: Compare installed files with the repository:
```bash
- diff ~/.claude/skills/blog/SKILL.md blog/SKILL.md
+ diff ~/.claude/skills/skills/blog/SKILL.md skills/blog/SKILL.md
```
3. **Reset installation**: Remove and reinstall:
diff --git a/install.sh b/install.sh
index 04a71a4..9808a04 100755
--- a/install.sh
+++ b/install.sh
@@ -21,7 +21,7 @@ main() {
echo ""
# Determine source directory (local clone or piped from curl)
- if [ -f "${BASH_SOURCE[0]:-}" ] && [ -d "$(dirname "${BASH_SOURCE[0]}")/blog" ]; then
+ if [ -f "${BASH_SOURCE[0]:-}" ] && [ -d "$(dirname "${BASH_SOURCE[0]}")/skills/blog" ]; then
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
else
echo "→ Cloning claude-blog..."
@@ -43,6 +43,7 @@ main() {
mkdir -p "${SKILL_DIR}/blog/references"
mkdir -p "${SKILL_DIR}/blog/templates"
mkdir -p "${SKILL_DIR}/blog/scripts"
+ mkdir -p "${SKILL_DIR}/blog"
for skill in blog-write blog-rewrite blog-analyze blog-brief blog-calendar blog-strategy blog-outline blog-seo-check blog-schema blog-repurpose blog-geo blog-audit blog-chart; do
mkdir -p "${SKILL_DIR}/${skill}"
done
@@ -50,18 +51,18 @@ main() {
# Copy main skill
echo "→ Installing main skill: blog..."
- cp "${SCRIPT_DIR}/blog/SKILL.md" "${SKILL_DIR}/blog/SKILL.md"
+ cp "${SCRIPT_DIR}/skills/blog/SKILL.md" "${SKILL_DIR}/blog/SKILL.md"
# Copy references
echo "→ Installing reference files..."
- if ls "${SCRIPT_DIR}/blog/references/"*.md &>/dev/null; then
- cp "${SCRIPT_DIR}/blog/references/"*.md "${SKILL_DIR}/blog/references/"
+ if ls "${SCRIPT_DIR}/skills/blog/references/"*.md &>/dev/null; then
+ cp "${SCRIPT_DIR}/skills/blog/references/"*.md "${SKILL_DIR}/blog/references/"
fi
# Copy templates
- if ls "${SCRIPT_DIR}/blog/templates/"*.md &>/dev/null; then
+ if ls "${SCRIPT_DIR}/skills/blog/templates/"*.md &>/dev/null; then
echo "→ Installing content templates..."
- cp "${SCRIPT_DIR}/blog/templates/"*.md "${SKILL_DIR}/blog/templates/"
+ cp "${SCRIPT_DIR}/skills/blog/templates/"*.md "${SKILL_DIR}/blog/templates/"
fi
# Copy sub-skills
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..297bcec
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,32 @@
+[project]
+name = "claude-blog"
+version = "1.2.0"
+description = "AI-powered blog creation and optimization skill for Claude Code"
+readme = "README.md"
+license = {text = "MIT"}
+requires-python = ">=3.11"
+authors = [
+ {name = "AgriciDaniel"},
+]
+
+[project.optional-dependencies]
+core = [
+ "textstat>=0.7.3",
+ "beautifulsoup4>=4.12.0",
+]
+advanced = [
+ "lxml",
+ "jsonschema",
+ "spacy",
+ "sentence-transformers",
+ "scikit-learn",
+ "language-tool-python",
+]
+dev = [
+ "pytest>=8.0",
+ "textstat>=0.7.3",
+ "beautifulsoup4>=4.12.0",
+]
+
+[tool.pytest.ini_options]
+testpaths = ["tests"]
diff --git a/skills/blog-brief/SKILL.md b/skills/blog-brief/SKILL.md
index f8abe78..8ec0fc8 100644
--- a/skills/blog-brief/SKILL.md
+++ b/skills/blog-brief/SKILL.md
@@ -77,7 +77,7 @@ criteria.
1. Match search intent to template strength
2. Check what format top-ranking competitors use
3. Consider the user's available assets (data, expertise, tools)
-4. Load the matching template file from `blog/templates/[type].md`
+4. Load the matching template file from `templates/[type].md`
5. Include the template name in the brief output
### Step 3: Competitive Analysis
@@ -109,7 +109,7 @@ Output format:
## Template
**Recommended**: [template-name] -- [1-sentence rationale]
-**Template file**: `blog/templates/[type].md`
+**Template file**: `templates/[type].md`
## Target Keywords
- **Primary**: [keyword] -- [estimated monthly search volume if available]
diff --git a/skills/blog-write/SKILL.md b/skills/blog-write/SKILL.md
index e9f82d5..4ad9c5c 100644
--- a/skills/blog-write/SKILL.md
+++ b/skills/blog-write/SKILL.md
@@ -46,7 +46,7 @@ follows the 6 pillars of dual optimization (Google rankings + AI citations).
### Phase 1.5: Template Selection
-Select the appropriate content template from the 12 templates in `blog/templates/`.
+Select the appropriate content template from the 12 templates in `templates/`.
1. **Auto-detect content type** from the topic and search intent:
| Signal | Template |
@@ -64,7 +64,7 @@ Select the appropriate content template from the 12 templates in `blog/templates
| Survey results, experiment, original data | `data-research` |
| Q&A, knowledge base, "What is X" | `faq-knowledge` |
-2. **Load the matching template** — Read from `blog/templates/<type>.md`
+2. **Load the matching template** — Read from `templates/<type>.md`
3. **Adapt the outline** — Use the template's section structure, heading patterns,
and word count guidance to shape Phase 3's outline
4. **Fallback** — If no template clearly fits, use the generic outline structure
diff --git a/blog/SKILL.md b/skills/blog/SKILL.md
similarity index 100%
rename from blog/SKILL.md
rename to skills/blog/SKILL.md
diff --git a/blog/references/ai-crawler-guide.md b/skills/blog/references/ai-crawler-guide.md
similarity index 100%
rename from blog/references/ai-crawler-guide.md
rename to skills/blog/references/ai-crawler-guide.md
diff --git a/blog/references/content-rules.md b/skills/blog/references/content-rules.md
similarity index 100%
rename from blog/references/content-rules.md
rename to skills/blog/references/content-rules.md
diff --git a/blog/references/content-templates.md b/skills/blog/references/content-templates.md
similarity index 98%
rename from blog/references/content-templates.md
rename to skills/blog/references/content-templates.md
index 34e075d..deee1a8 100644
--- a/blog/references/content-templates.md
+++ b/skills/blog/references/content-templates.md
@@ -1,6 +1,6 @@
# Content Type Template Reference
-Index and guide to the 12 content templates in `blog/templates/`. These
+Index and guide to the 12 content templates in `templates/`. These
templates are structural blueprints that `/blog write` uses to generate
consistently optimized content. This reference explains when to use each
template, how the template system works, and how to customize it.
@@ -504,7 +504,7 @@ of the scoring rubric. The template ensures nothing is forgotten.
### Modifying an Existing Template
-Templates are editable markdown files in `~/.claude/skills/blog/templates/`.
+Templates are editable markdown files in `~/.claude/skills/templates/`.
Changes take effect immediately -- no restart needed.
1. Open the template file you want to modify
@@ -515,8 +515,8 @@ Changes take effect immediately -- no restart needed.
1. Copy an existing template as a starting point:
```bash
- cp ~/.claude/skills/blog/templates/how-to-guide.md \
- ~/.claude/skills/blog/templates/my-custom-type.md
+ cp ~/.claude/skills/templates/how-to-guide.md \
+ ~/.claude/skills/templates/my-custom-type.md
```
2. Define the section structure for your content type:
diff --git a/blog/references/distribution-playbook.md b/skills/blog/references/distribution-playbook.md
similarity index 100%
rename from blog/references/distribution-playbook.md
rename to skills/blog/references/distribution-playbook.md
diff --git a/blog/references/eeat-signals.md b/skills/blog/references/eeat-signals.md
similarity index 100%
rename from blog/references/eeat-signals.md
rename to skills/blog/references/eeat-signals.md
diff --git a/blog/references/geo-optimization.md b/skills/blog/references/geo-optimization.md
similarity index 100%
rename from blog/references/geo-optimization.md
rename to skills/blog/references/geo-optimization.md
diff --git a/blog/references/google-landscape-2026.md b/skills/blog/references/google-landscape-2026.md
similarity index 100%
rename from blog/references/google-landscape-2026.md
rename to skills/blog/references/google-landscape-2026.md
diff --git a/blog/references/internal-linking.md b/skills/blog/references/internal-linking.md
similarity index 100%
rename from blog/references/internal-linking.md
rename to skills/blog/references/internal-linking.md
diff --git a/blog/references/platform-guides.md b/skills/blog/references/platform-guides.md
similarity index 100%
rename from blog/references/platform-guides.md
rename to skills/blog/references/platform-guides.md
diff --git a/blog/references/quality-scoring.md b/skills/blog/references/quality-scoring.md
similarity index 100%
rename from blog/references/quality-scoring.md
rename to skills/blog/references/quality-scoring.md
diff --git a/blog/references/schema-stack.md b/skills/blog/references/schema-stack.md
similarity index 100%
rename from blog/references/schema-stack.md
rename to skills/blog/references/schema-stack.md
diff --git a/blog/references/visual-media.md b/skills/blog/references/visual-media.md
similarity index 100%
rename from blog/references/visual-media.md
rename to skills/blog/references/visual-media.md
diff --git a/blog/templates/case-study.md b/skills/blog/templates/case-study.md
similarity index 100%
rename from blog/templates/case-study.md
rename to skills/blog/templates/case-study.md
diff --git a/blog/templates/comparison.md b/skills/blog/templates/comparison.md
similarity index 100%
rename from blog/templates/comparison.md
rename to skills/blog/templates/comparison.md
diff --git a/blog/templates/data-research.md b/skills/blog/templates/data-research.md
similarity index 100%
rename from blog/templates/data-research.md
rename to skills/blog/templates/data-research.md
diff --git a/blog/templates/faq-knowledge.md b/skills/blog/templates/faq-knowledge.md
similarity index 100%
rename from blog/templates/faq-knowledge.md
rename to skills/blog/templates/faq-knowledge.md
diff --git a/blog/templates/how-to-guide.md b/skills/blog/templates/how-to-guide.md
similarity index 100%
rename from blog/templates/how-to-guide.md
rename to skills/blog/templates/how-to-guide.md
diff --git a/blog/templates/listicle.md b/skills/blog/templates/listicle.md
similarity index 100%
rename from blog/templates/listicle.md
rename to skills/blog/templates/listicle.md
diff --git a/blog/templates/news-analysis.md b/skills/blog/templates/news-analysis.md
similarity index 100%
rename from blog/templates/news-analysis.md
rename to skills/blog/templates/news-analysis.md
diff --git a/blog/templates/pillar-page.md b/skills/blog/templates/pillar-page.md
similarity index 100%
rename from blog/templates/pillar-page.md
rename to skills/blog/templates/pillar-page.md
diff --git a/blog/templates/product-review.md b/skills/blog/templates/product-review.md
similarity index 100%
rename from blog/templates/product-review.md
rename to skills/blog/templates/product-review.md
diff --git a/blog/templates/roundup.md b/skills/blog/templates/roundup.md
similarity index 100%
rename from blog/templates/roundup.md
rename to skills/blog/templates/roundup.md
diff --git a/blog/templates/thought-leadership.md b/skills/blog/templates/thought-leadership.md
similarity index 100%
rename from blog/templates/thought-leadership.md
rename to skills/blog/templates/thought-leadership.md
diff --git a/blog/templates/tutorial.md b/skills/blog/templates/tutorial.md
similarity index 100%
rename from blog/templates/tutorial.md
rename to skills/blog/templates/tutorial.md
diff --git a/tests/conftest.py b/tests/conftest.py
new file mode 100644
index 0000000..876893e
--- /dev/null
+++ b/tests/conftest.py
@@ -0,0 +1,115 @@
+"""Shared fixtures for claude-blog tests."""
+
+import sys
+from pathlib import Path
+
+import pytest
+
+# Add scripts directory to path so we can import analyze_blog
+sys.path.insert(0, str(Path(__file__).parent.parent / "scripts"))
+
+
+def sample_blog_post():
+ """A minimal blog post with frontmatter and content."""
+ return """---
+title: How to Optimize Your Blog for AI Citations
+description: Learn proven techniques for AI citation optimization.
+author: Jane Doe
+datePublished: 2026-01-15
+dateModified: 2026-02-10
+---
+
+# How to Optimize Your Blog for AI Citations
+
+According to a 2025 Ahrefs study, 43.8% of AI citations come from well-structured blog content. This guide covers the essential techniques.
+
+## What Are AI Citations?
+
+AI citations occur when platforms like ChatGPT, Perplexity, or Google AI Overviews reference your content. A 2025 study found that answer-first formatting increases citation rates by 340%.
+
+### Why They Matter
+
+AI citations drive significant organic traffic. Sites with high citation rates see 2.5x more engagement.
+
+## How Do You Optimize for AI Citations?
+
+Follow these five steps to improve your AI citation readiness:
+
+1. Use answer-first formatting in every section
+2. Include sourced statistics from tier 1-3 sources
+3. Structure content in 50-150 word chunks
+4. Add FAQ schema markup
+5. Keep content fresh with regular updates
+
+## What Tools Should You Use?
+
+Several tools help monitor AI citations. Ahrefs, Semrush, and Google Search Console provide citation tracking.
+
+![AI Citation Dashboard](https://images.unsplash.com/photo-example.jpg)
+
+## FAQ
+
+### How often should I update my blog posts?
+
+Update blog posts at least every 30 days. According to research, 76% of top-cited content was updated within the last month.
+
+### What is the ideal paragraph length?
+
+Keep paragraphs between 50-150 words for optimal readability and AI extractability.
+"""
+
+
+def sample_post_no_frontmatter():
+ """A blog post without frontmatter."""
+ return """# Simple Blog Post
+
+This is a simple blog post without any frontmatter.
+
+## Section One
+
+Some content here with enough words to be counted as a real paragraph in the analyzer.
+"""
+
+
+def sample_post_with_schema():
+ """A blog post with JSON-LD schema."""
+ return """---
+title: Test Post
+---
+
+# Test Post
+
+Some content.
+
+<script type="application/ld+json">
+{
+ "@context": "https://schema.org",
+ "@type": "BlogPosting",
+ "headline": "Test Post",
+ "author": {
+ "@type": "Person",
+ "name": "Jane Doe"
+ }
+}
+</script>
+
+<script type="application/ld+json">
+{
+ "@context": "https://schema.org",
+ "@type": "FAQPage",
+ "mainEntity": [
+ {
+ "@type": "Question",
+ "name": "What is this?",
+ "acceptedAnswer": {
+ "@type": "Answer",
+ "text": "This is a test post."
+ }
+ }
+ ]
+}
+</script>
+"""
diff --git a/tests/test_analyze_blog.py b/tests/test_analyze_blog.py
new file mode 100644
index 0000000..5b53817
--- /dev/null
+++ b/tests/test_analyze_blog.py
@@ -0,0 +1,353 @@
+"""Tests for the blog quality analyzer script."""
+
+import sys
+from pathlib import Path
+
+import pytest
+
+sys.path.insert(0, str(Path(__file__).parent.parent / "scripts"))
+
+import analyze_blog
+
+
+# ---------------------------------------------------------------------------
+# Frontmatter parsing
+# ---------------------------------------------------------------------------
+
+
+class TestExtractFrontmatter:
+ def test_extracts_yaml_frontmatter(self, sample_blog_post):
+ fm = analyze_blog.extract_frontmatter(sample_blog_post)
+ assert fm["title"] == "How to Optimize Your Blog for AI Citations"
+ assert fm["author"] == "Jane Doe"
+
+ def test_returns_empty_dict_without_frontmatter(self, sample_post_no_frontmatter):
+ fm = analyze_blog.extract_frontmatter(sample_post_no_frontmatter)
+ assert fm == {}
+
+ def test_strips_quotes_from_values(self):
+ content = '---\ntitle: "Quoted Title"\nauthor: \'Single Quoted\'\n---\n'
+ fm = analyze_blog.extract_frontmatter(content)
+ assert fm["title"] == "Quoted Title"
+ assert fm["author"] == "Single Quoted"
+
+
+class TestStripFrontmatter:
+ def test_removes_frontmatter(self, sample_blog_post):
+ stripped = analyze_blog.strip_frontmatter(sample_blog_post)
+ assert "---" not in stripped.split("\n")[0]
+ assert "# How to Optimize" in stripped
+
+ def test_no_frontmatter_returns_unchanged(self, sample_post_no_frontmatter):
+ stripped = analyze_blog.strip_frontmatter(sample_post_no_frontmatter)
+ assert stripped == sample_post_no_frontmatter
+
+
+# ---------------------------------------------------------------------------
+# Heading analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeHeadings:
+ def test_counts_heading_levels(self, sample_blog_post):
+ result = analyze_blog.analyze_headings(sample_blog_post)
+ assert result["h1_count"] == 1
+ assert result["h2_count"] >= 3
+ assert result["h3_count"] >= 1
+
+ def test_detects_question_headings(self, sample_blog_post):
+ result = analyze_blog.analyze_headings(sample_blog_post)
+ assert result["h2_question_count"] >= 2
+ assert result["h2_question_ratio"] > 0
+
+ def test_clean_hierarchy(self):
+ content = "# Title\n\n## Section\n\n### Sub\n\n## Another\n"
+ result = analyze_blog.analyze_headings(content)
+ assert result["hierarchy_clean"] is True
+
+ def test_dirty_hierarchy(self):
+ content = "# Title\n\n### Skipped H2\n\n## Section\n"
+ result = analyze_blog.analyze_headings(content)
+ assert result["hierarchy_clean"] is False
+
+ def test_empty_content(self):
+ result = analyze_blog.analyze_headings("")
+ assert result["total"] == 0
+
+
+# ---------------------------------------------------------------------------
+# Paragraph analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeParagraphs:
+ def test_counts_paragraphs(self, sample_blog_post):
+ result = analyze_blog.analyze_paragraphs(sample_blog_post)
+ assert result["total_paragraphs"] > 0
+
+ def test_calculates_avg_word_count(self, sample_blog_post):
+ result = analyze_blog.analyze_paragraphs(sample_blog_post)
+ assert result["avg_word_count"] > 0
+
+ def test_ignores_short_paragraphs(self):
+ content = "One.\n\nTwo.\n\nThree words here.\n\n" + (
+ "This is a paragraph with enough words to be counted by the analyzer. " * 3
+ )
+ result = analyze_blog.analyze_paragraphs(content)
+ assert result["total_paragraphs"] == 1
+
+ def test_detects_over_150(self):
+ long_para = " ".join(["word"] * 160)
+ content = f"\n\n{long_para}\n\n"
+ result = analyze_blog.analyze_paragraphs(content)
+ assert result["over_150_words"] >= 1
+
+ def test_empty_content(self):
+ result = analyze_blog.analyze_paragraphs("")
+ assert result["total_paragraphs"] == 0
+ assert result["avg_word_count"] == 0
+
+
+# ---------------------------------------------------------------------------
+# Image analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeImages:
+ def test_detects_markdown_images(self):
+ content = "![Alt text](image.jpg)\n![Another](photo.png)\n"
+ result = analyze_blog.analyze_images(content)
+ assert result["count"] == 2
+
+ def test_detects_missing_alt_text(self):
+ content = "![](image.jpg)\n![Good alt](photo.png)\n"
+ result = analyze_blog.analyze_images(content)
+ assert result["without_alt_text"] >= 1
+
+ def test_no_images(self):
+ result = analyze_blog.analyze_images("No images here.")
+ assert result["count"] == 0
+
+
+# ---------------------------------------------------------------------------
+# AI content detection
+# ---------------------------------------------------------------------------
+
+
+class TestAISignals:
+ def test_detects_ai_phrases(self):
+ content = "In today's digital landscape, it's important to note that we must dive into this topic."
+ sentences_info = analyze_blog.analyze_sentences(content)
+ result = analyze_blog.analyze_ai_signals(content, sentences_info)
+ assert result["ai_phrase_count"] > 0
+
+ def test_clean_content_low_signals(self):
+ content = "Blog optimization requires structured content. Statistics from Ahrefs show 43% improvement."
+ sentences_info = analyze_blog.analyze_sentences(content)
+ result = analyze_blog.analyze_ai_signals(content, sentences_info)
+ assert result["ai_phrase_count"] == 0
+
+
+class TestAITriggerWords:
+ def test_detects_trigger_words(self):
+ text = "We must delve into this multifaceted topic to illuminate the nuanced landscape."
+ result = analyze_blog.analyze_ai_trigger_words(text)
+ assert result["trigger_count"] > 0
+ assert len(result["found"]) > 0
+
+ def test_clean_text(self):
+ text = "This article explains how to write better blog posts using data."
+ result = analyze_blog.analyze_ai_trigger_words(text)
+ assert result["trigger_count"] == 0
+
+
+# ---------------------------------------------------------------------------
+# Citation analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeCitations:
+ def test_detects_inline_citations(self):
+ content = "According to a study (Source, 2025), AI citations increased by 340%."
+ result = analyze_blog.analyze_citations(content)
+ assert result["total_statistics"] >= 1
+
+ def test_no_statistics(self):
+ content = "No numbers or statistics in this text at all."
+ result = analyze_blog.analyze_citations(content)
+ assert result["total_statistics"] == 0
+
+
+# ---------------------------------------------------------------------------
+# FAQ analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeFAQ:
+ def test_detects_faq_section(self, sample_blog_post):
+ result = analyze_blog.analyze_faq(sample_blog_post)
+ assert result["has_faq_section"] is True
+ assert result["faq_item_count"] >= 2
+
+ def test_no_faq(self):
+ content = "# Title\n\n## Section\n\nJust regular content."
+ result = analyze_blog.analyze_faq(content)
+ assert result["has_faq_section"] is False
+
+
+# ---------------------------------------------------------------------------
+# Freshness analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeFreshness:
+ def test_detects_dates(self):
+ fm = {"date": "2026-01-15", "lastUpdated": "2026-02-10"}
+ result = analyze_blog.analyze_freshness(fm)
+ assert result["has_date"] is True
+ assert result["has_last_updated"] is True
+
+ def test_no_dates(self):
+ result = analyze_blog.analyze_freshness({})
+ assert result["has_date"] is False
+ assert result["has_last_updated"] is False
+
+
+# ---------------------------------------------------------------------------
+# Readability analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeReadability:
+ def test_flesch_score(self, sample_blog_post):
+ stripped = analyze_blog.strip_frontmatter(sample_blog_post)
+ result = analyze_blog.analyze_readability(stripped)
+ assert "flesch_reading_ease" in result
+
+ def test_reading_time(self, sample_blog_post):
+ stripped = analyze_blog.strip_frontmatter(sample_blog_post)
+ result = analyze_blog.analyze_readability(stripped)
+ assert result["reading_time_minutes"] > 0
+
+
+# ---------------------------------------------------------------------------
+# Sentence analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeSentences:
+ def test_detects_over_25_word_sentences(self):
+ long = "This is a very " + "very " * 20 + "long sentence that goes on and on."
+ short = "Short one."
+ text = f"{long} {short}"
+ result = analyze_blog.analyze_sentences(text)
+ assert result["over_25_count"] >= 1
+
+ def test_burstiness(self):
+ text = "Short. Also short. This one is a bit longer than the others. Tiny."
+ result = analyze_blog.analyze_sentences(text)
+ assert "burstiness" in result
+
+
+# ---------------------------------------------------------------------------
+# Link analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeLinks:
+ def test_counts_internal_and_external(self):
+ content = "[internal](/about) and [external](https://example.com/page)"
+ result = analyze_blog.analyze_links(content)
+ assert result["internal_count"] >= 1
+ assert result["external_count"] >= 1
+
+ def test_no_links(self):
+ result = analyze_blog.analyze_links("No links here.")
+ assert result["internal_count"] == 0
+ assert result["external_count"] == 0
+
+
+# ---------------------------------------------------------------------------
+# Schema analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeSchema:
+ def test_detects_json_ld(self, sample_post_with_schema):
+ result = analyze_blog.analyze_schema(sample_post_with_schema)
+ assert result["schema_count"] >= 1
+ assert result["has_blogposting"] is True
+
+ def test_no_schema(self):
+ result = analyze_blog.analyze_schema("# Simple post\n\nNo schema here.")
+ assert result["schema_count"] == 0
+
+
+# ---------------------------------------------------------------------------
+# Self-promotion analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeSelfPromotion:
+ def test_no_promotions(self):
+ result = analyze_blog.analyze_self_promotion("Generic content without brands.")
+ assert result["exceeds_limit"] is False
+ assert result["self_promotion_patterns"] == 0
+
+ def test_returns_expected_keys(self):
+ result = analyze_blog.analyze_self_promotion("Some content.", brand_name="Acme")
+ assert "self_promotion_patterns" in result
+ assert "exceeds_limit" in result
+
+
+# ---------------------------------------------------------------------------
+# Passive voice analysis
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzePassiveVoice:
+ def test_detects_passive(self):
+ text = "The report was written by the team. The data was analyzed carefully."
+ result = analyze_blog.analyze_passive_voice(text)
+ assert result["passive_count"] >= 1
+
+ def test_active_voice(self):
+ text = "The team wrote the report. Analysts reviewed the data."
+ result = analyze_blog.analyze_passive_voice(text)
+ assert result["passive_count"] == 0
+
+
+# ---------------------------------------------------------------------------
+# Transition words
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeTransitionWords:
+ def test_detects_transitions(self):
+ text = "First, set up your blog. However, you should also consider SEO. Therefore, optimize early."
+ result = analyze_blog.analyze_transition_words(text)
+ assert result["transition_count"] >= 2
+
+ def test_no_transitions(self):
+ text = "Set up blog. Consider SEO. Optimize."
+ result = analyze_blog.analyze_transition_words(text)
+ assert result["transition_count"] == 0
+
+
+# ---------------------------------------------------------------------------
+# File analysis (integration)
+# ---------------------------------------------------------------------------
+
+
+class TestAnalyzeFile:
+ def test_analyzes_real_file(self, tmp_path, sample_blog_post):
+ post_file = tmp_path / "test-post.md"
+ post_file.write_text(sample_blog_post)
+ result = analyze_blog.analyze_file(str(post_file))
+ assert "score" in result
+ assert "headings" in result
+ assert result["score"]["total"] >= 0
+
+ def test_nonexistent_file(self):
+ result = analyze_blog.analyze_file("/nonexistent/file.md")
+ assert "error" in result