---
name: frase-playbook-automation
description: Automate multi-step content workflows using Frase playbooks, templates, and content rules — chain research to publish with quality gates. Works via MCP or CLI.
---

# Frase Playbook Automation

This skill teaches you how to automate content workflows using Frase's playbooks, templates, and content rules — chain multi-step operations with quality gates and human review points.

**Works with:** Frase MCP server (`@frase/mcp-server`) OR Frase CLI (`@frase/cli`)

## Prerequisites

- Frase MCP server connected OR `frase` CLI installed (`npx @frase/cli`)
- `FRASE_API_KEY` environment variable set (get from https://next.frase.io/settings/api)
- A Frase site with content (check: `list_sites` / `frase sites list`)
- Scale plan or higher (for playbook features)

## Concepts

### Playbooks
Multi-step workflow chains: research → brief → generate → optimize → rule check → human review → publish. Steps run sequentially, passing outputs between them via `{{outputs.briefId}}`.

### Templates
Structured blueprints applied to briefs: section definitions, boilerplate blocks, field defaults, word count targets. Ensure consistent content structure across articles.

### Content Rules
Quality gates with 9 condition types: score thresholds (SEO/GEO), term compliance (brand terminology), word count, meta tags, link counts, section requirements, regex patterns, competitor mention filters, and verify chip limits.

### Rule Sets
Groups of rules applied together. Max 3 enabled rule sets per organization. Evaluate content against all rules in a set before publishing.

## Workflow

### Step 1: Set Up Content Rules

Define quality standards your content must meet before publishing.

**Via MCP:**
```
1. Use `list_rule_sets` to see existing rule sets
2. Use `get_rule_set` to inspect a specific rule set's rules and configuration
3. Use `evaluate_rules` to check content against a rule set
4. Rule sets and rules can be created via MCP (`create_rule_set`, `create_rule`), the CLI, or the Frase UI
5. Rule types (condition_type values):
   - score_threshold: minimum SEO/GEO/EEAT score (config: {"scoreType":"seo","operator":">=","threshold":70})
   - term_compliance: brand terminology (never/avoid terms)
   - verify_chips: cap unverified-claim markers
   - word_count: min/max word count
   - meta_required: require title, description, etc.
   - link_count: min internal/external links
   - section_required: required headings
   - regex_pattern: custom pattern matching (matches the stored text — markdown patterns like `^#` do not match a CMS post's HTML)
   - competitor_filter: block competitor brand mentions
```

**Via CLI:**
```bash
frase rules list
frase rules set create "Blog Quality Standards"
frase rules create --name "SEO >= 70" --condition-type score_threshold --config '{"scoreType":"seo","operator":">=","threshold":70}'
frase rules set add-rule --set-id <set-id> --rule-id <rule-id>
```

### Step 2: Create or Choose a Template

Templates ensure consistent content structure.

**Via MCP:**
```
1. Use `list_templates` to see available templates
2. Use `apply_template` to apply a template when creating a brief
3. Or use `extract_template` from an existing high-performing brief to reuse its structure
```

**Via CLI:**
```bash
frase template list --site-id <id>
frase template get <template-id>
frase template apply <template-id> --brief-id <brief-id>
frase template extract --brief-id <brief-id>   # create template from existing brief
```

### Step 3: Create a Playbook

Chain multiple steps into an automated workflow.

**Via MCP:**
```
1. Use `list_playbooks` to see existing playbooks
2. Use `get_playbook` to review a playbook's steps
3. Playbook steps can include:
   - research: Run research on a topic
   - brief: Create a brief (with optional template)
   - generate: Generate content from brief
   - optimize: Run optimization
   - rule_check: Evaluate content against rule set
   - human_review: Pause for human approval
   - publish: Publish to CMS
4. Steps chain via output references: {{outputs.briefId}}, {{outputs.contentId}}
```

**Via CLI:**
```bash
frase playbook list --site-id <id>
frase playbook get <playbook-id>
```

### Step 4: Run the Playbook

**Via MCP:**
```
1. Use `run_playbook` with:
   - playbook_id: the playbook to execute
   - topic: the target keyword or topic (optional)
   - content_id: existing content ID to run against, e.g. for optimization playbooks (optional)
2. Poll `get_playbook_run_status` for progress
3. Each step completes before the next begins
4. Human review steps pause until approved
5. If a step fails, onFail config determines behavior:
   - "retry_previous": retry the failed step
   - "stop": halt the playbook
   - "skip": skip and continue
```

**Via CLI:**
```bash
frase playbook run <playbook-id> --topic "keyword research tools" --site-id <id>
frase playbook status <run-id>           # poll progress
frase playbook status <run-id> --compact  # short status for polling
```

### Step 5: Monitor and Iterate

**Via MCP:**
```
1. Use `get_playbook_run_status` to check each step's outcome
2. Review any rule failures — they indicate content quality issues
3. Use `provide_playbook_input` to respond to human review steps or provide required input
4. Note: Cancelling runs is available via CLI (`frase playbook cancel`) but not via MCP
```

**Via CLI:**
```bash
frase playbook status <run-id>
frase playbook cancel <run-id>
```

### Step 6: Evaluate Content Against Rules (Standalone)

You can evaluate any content against rules without running a full playbook:

**Via MCP:**
```
1. Use `evaluate_rules` with content_id (rule_set_id optional — omit to evaluate
   every enabled set; post_id and raw text are also accepted)
2. Review pass/fail per rule — a "fail" means publishing would refuse (rules_blocked)
3. Fix error-severity failures before publishing; warning-only refusals accept
   force (force: true on publish_content / write_cms_post, --force on the CLI)
```

**Via CLI:**
```bash
frase rules evaluate --content-id <id>          # --set-id optional
frase rules evaluate --post <post-id>
frase rules evaluate --file draft.html --site-id <site-id>
```

## Example Playbook Flow

```
┌──────────┐    ┌───────┐    ┌──────────┐    ┌──────────┐    ┌────────────┐    ┌─────────┐
│ Research  │ →  │ Brief │ →  │ Generate │ →  │ Optimize │ →  │ Rule Check │ →  │ Publish │
│          │    │       │    │          │    │ (≥70)    │    │ (pass all) │    │         │
└──────────┘    └───────┘    └──────────┘    └──────────┘    └────────────┘    └─────────┘
                                                  ↑               │
                                                  └── retry ──────┘ (if score < 70)
```

## Key Principles

1. **Rules before publishing** — the platform enforces this server-side: every publish surface (editor, API, MCP, CLI, scheduled) refuses error-severity rule failures with `rules_blocked`. Playbook `rule_check` steps evaluate mid-pipeline; warnings pass a step unless it sets "Warning-severity violations: treat as failing"
2. **Templates for consistency** — reuse templates across similar content types
3. **Extract from winners** — create templates from your best-performing content
4. **Human review for high-stakes** — add review gates for commercial and legal content
5. **Start simple** — begin with 3-4 step playbooks, add complexity as needed
6. **Monitor run failures** — failed steps reveal process issues to fix
