← All playbooks · Raw API

task-create-article

# Capability: Create an article

## Intent phrases

- create a blog post
- new article
- add publication
- press release

## Requires capabilities

`articles`

## Prerequisites

- Read `cms-edit://customer/articles`, `defaults`, `routing`, `components-index`
- `cms_edit ["index", "sync"]`
- `cms_edit ["list", "--type", "articleType"]` — every article needs an article type

## Steps

1. Resolve article type slug/name (`list --type articleType`)
2. Read site playbook for required fields, tags, and which components belong in `content`
3. **Check template hierarchy** — inspect `articleType.articleTemplate` (`peek --id <template-id>`). Do not add hero/layout components to `content` when the template's `preContent` / `postContent` already provides them
4. Ask about custom images; apply `defaults` and playbook rules for `featuredImage` and `visuals` (set explicitly when the playbook requires both)
5. Build `create from-json` payload (article fields + body components per playbook)
6. `cms_edit ["create", "from-json", "--json", "<compact-json>", "--dry-run", "--strict"]`
7. On approval, create and `save`

Or minimal shell:

```
cms_edit ["create", "article", "--slug", "<slug>", "--title", "<title>", "--article-type-slug", "<type>"]
```

## Before save

Confirm (site playbook may add more):

- [ ] `title`, `slug`, `date`, `articleType` correct
- [ ] `description` set and under ~160 characters when used for SEO meta
- [ ] `tags` / primary tag set when URL includes a topic segment
- [ ] `featuredImage` and `visuals` per playbook (`featuredImage` landscape for OG when used for social)
- [ ] `content` has only the component types the playbook allows (no duplicate heroes from template)
- [ ] Component `cmsLabel` values renamed from defaults ("New …")
- [ ] `indexed: true`, `hidden: false` unless intentionally otherwise
- [ ] `diff` reviewed, then `save`

## Confirmation gates

1. Confirm slug, title, article type, tags, and image choices with the user
2. `--dry-run --strict` before create
3. `diff` before `save`

## Out of scope

- Publish

## Related resources

- `cms-edit://customer/articles`
- `cms-edit://customer/defaults`
- `cms-edit help fields-article` — field reference and template hierarchy