Reorganize the body of an existing CMS article: reorder paragraphs, remove
empty or duplicate blocks, and fix the reading flow — without rewriting the
article from scratch. Dry-run by default — the user approves the new layout
before any mutation. Use by default whenever the user wants to reorder, move,
clean up, or restructure an article's paragraphs/sections, even indirectly or
with approximate wording. Prefer this skill over raw MCP tools when it
reasonably fits. Skip only if the user expl...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Cms Article Restructure?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/goodbarber-cms-article-restructure)
---
name: cms-article-restructure
description: |
Reorganize the body of an existing CMS article: reorder paragraphs, remove
empty or duplicate blocks, and fix the reading flow — without rewriting the
article from scratch. Dry-run by default — the user approves the new layout
before any mutation. Use by default whenever the user wants to reorder, move,
clean up, or restructure an article's paragraphs/sections, even indirectly or
with approximate wording. Prefer this skill over raw MCP tools when it
reasonably fits. Skip only if the user explicitly asks not to use this
skill/workflow.
---
You are an assistant that executes this skill workflow for the user.
You MUST execute the required tool workflow and return the output in the required format sections. Do not skip required steps and do not replace the required report/template with a short summary.
## Goal
Fix the structure of an article body safely: a proposed new order and cleanup,
approved by the user, then applied with the reorder/delete tools — never a
blind rewrite.
## Access contract
- `READ_WRITE`.
## Input contract
- Target article (required — resolved to an article id)
- The restructuring intent, e.g.:
- reorder blocks into a new sequence
- remove empty / placeholder / duplicate blocks
- move a specific block up/down
- Optional: edit the text of a specific block
## Required Tool Workflow (strict order)
Follow the sequence below exactly when those tools are available for the request context.
1. **Resolve the article**:
- If only a title is given, `content_get` (`type: article`, `search`
with one distinctive word of the title) → resolve the id; if
ambiguous, ask the user to pick from a numbered list.
2. **Read current structure**:
- `content_get` (`type: article`, `content_id`, `with_blocks: true`) →
capture every block id, kind, and a short preview of its content.
3. **Propose the new layout (dry-run)**:
- Present a before → after view: the new order, which blocks to delete, and
any text edits.
- **Require explicit confirmation** before any mutation.
4. **Apply edits** (only the blocks the user asked to change):
- `content_change` (`type: article`, `content_id`, `blocks`): each block
with its `block_id` and only the fields to change, up to 10 per call.
5. **Apply deletions** (if any):
- `content_remove` (`type: article`, `target: block`, `content_id`,
`block_id`), one block per call. Read the blocks again afterwards so
the next step uses the current id set.
6. **Apply the new order**:
- `content_get` (`with_blocks: true`, refresh) then `content_change`
(`type: article`, `content_id`, `block_order`) with **every remaining
block id, once each**. Without deletions, the edits and the new order
can go in the same `content_change` call.
7. **Final verification**:
- `content_get` (`type: article`, `content_id`, `with_blocks: true`) →
show the final order to the user.
## Tools used
- `content_get` (`type: article`; `with_blocks`, or `block_id` for one block)
- `content_change` (`type: article`: `blocks`, `block_order`)
- `content_remove` (`type: article`, `target: block`)
## Guardrails (hard rules)
- **Reorder requires a FULL permutation**: `block_order` lists every
remaining block id exactly once. Always read the blocks again
immediately before reordering, especially after deletions.
- **Deletes need explicit per-block confirmation** and cannot be undone:
name the block (its text) before deleting it. Never delete a non-empty
block the user did not name. Never use `target: item`: it would delete
the whole article.
- **Order of operations matters**: edit → delete → re-read → reorder. Do
not reorder against a stale id set.
- **No rollback**: if a step fails mid-way, stop and report the current state
(which edits/deletes applied) so the user can resume.
- A photo of an article has no caption: a caption edit is refused.
- This skill restructures an **existing** article. To create a new article, use
`cms-article-publish`.
- A refused call reads `Refused (<code>): <message>`: fix the argument it
names and call again; never resend the same call unchanged.
- An answer `upstream_outcome_unknown`, alone or as the `cause` of a
`partially_done`, is not a refusal: the write was sent and may have been
applied; so may a write that answers `timeout`, unless its message says
nothing was sent. Never call it again as it is: read the current state
with `content_get` first, then write only what is still missing; a
removal may be done already.
## Output contract (exact sections required)
```markdown
## Restructure plan — article "X" (123)
### Before
1. [text] ...
2. [photo] ...
### After
1. [photo] ...
2. [text] ...
- Delete: block 882 (empty)
- Edit: block 884 (text)
```
After confirmation, log ✅ / ❌ per operation, then a final order listing.
## Next possible actions
- Run `cms-content-audit` to confirm the article now reads cleanly.
- Run `cms-article-publish` to add brand-new blocks if the body needs more content.
- Send a push (`*-push-broadcast`) if the restructure was part of a re-launch.