---
name: harborly-content-authoring
description: Draft, translate, and publish Harborly content — articles, changelog releases, and topbar announcements — and draft or translate legal documents, through Harborly MCP tools. Use when the user asks to write, translate, or publish Harborly blog articles, changelog entries, or topbar announcement bars, or to draft or translate a privacy policy, terms of service, or custom legal page — for example "write a changelog entry in Harborly", "translate my article into English", or "publish the announcement".
version: 1.0.0
---

# Harborly Content Authoring

Draft, translate, and publish Harborly content through Harborly MCP tools. The agent writes drafts and — only on the user's explicit request — publishes. Unpublishing, deleting, history, language settings, legal publishing, changelog group metadata, and release-target configuration stay in the Harborly web app.

## When to use this skill

- The user asks to draft, translate, or publish articles, changelog releases, or topbar announcements in their Harborly product.
- The user asks to draft a privacy policy, terms of service, or custom legal page.

**Not** this skill: serving published content on a website. That is the read-only Content Hub API — see `/skills/content-hub/v1/SKILL.md`.

## Prerequisites

- **Harborly MCP server connected.** Local agents connect to `https://harborly.dev/mcp` with a personal access token (`Authorization: Bearer wpat_...`). If it is not connected, ask the user to connect it first. Do not fall back to raw HTTP calls.
- **`projectId`** — read it from `.harborly.json` at the repository root. If it is missing, call `list_products`, let the user choose a product, then write `{"projectId": "..."}` to `.harborly.json`. Never save a token there.
- **Start with `get_product_summary`** and note:
  - `contentDefaultLocale` and `contentLocales` — the enabled languages and the default.
  - `agentPublishingEnabled` — whether the agent is allowed to publish at all.

## Languages

The catalog is fixed, no aliases: `zh-CN`, `zh-TW`, `en`, `ja`, `ko`, `de`, `fr`, `es`, `pt-BR`, `it`, `ru`. Enabling or disabling a language and picking the default is web-only — agents cannot change language settings. Disabled languages reject new and published content (`ContentLocaleDisabled`).

## Tools and write discipline

| Task | Tools |
| --- | --- |
| Articles and changelog | `list_documents`, `get_document`, `save_document_draft`, `publish_document` |
| Changelog release targets | `list_release_targets` (all targets, including archived), `list_changelog` (groups and lifecycle) |
| Announcements | `list_announcements`, `get_announcement`, `save_announcement_draft`, `publish_announcement` |
| Assets | `upload_asset`, or `create_asset_upload` → direct PUT → `complete_asset_upload` |

- Every tool takes `projectId` plus an `input` object; the write fields below go inside `input`.
- Every write carries an `idempotencyKey`. Reuse a key only for the exact same request.
- Updates carry `expectedRevision`. On `RevisionConflict`, re-read, reconcile, write again.

## Document types

MCP enums are sent and returned as names, not numbers. Public content uses `draft.type` values `Article`, `ChangelogRelease`, `PrivacyPolicy`, `TermsOfService`, and `LegalCustom`. `Prd` and `Note` are internal workspace documents, not public content — out of scope here.

## Articles

- `draft.type` is `"Article"`. `draft.article.slug` is **required**: lowercase letters and digits separated by hyphens.
- Optional: `summary`, `canonicalUrl` (empty string = not set), `tags`, `seoTitle`, `seoDescription`, `coverAsset`.
- The body is Markdown. Images reference uploaded assets as `asset:{assetId}/{variantKey}@{assetRevision}`. The server resolves `inlineAssets` — never send that field yourself.

```json
// save_document_draft — new article draft (minimal)
{
  "projectId": "<uuid>",
  "input": {
    "idempotencyKey": "article-my-first-post-draft-1",
    "draft": {
      "type": "Article",
      "title": "My first post",
      "article": { "slug": "my-first-post" },
      "body": "Hello **world**"
    }
  }
}
```

## Changelog releases

- `draft.type` is `"ChangelogRelease"`. `draft.changelog.releaseDate` is **required** (`YYYY-MM-DD`).
- Optional: `releaseVersion`, `summary`, `deliveredPrds`.
- A product can have several release targets (parallel version lines, e.g. `plugin`, `ai-connect`). Discover them with `list_release_targets`; discover existing groups and their lifecycle with `list_changelog`. Creating, renaming, archiving targets is web-only.
- `draft.changelog.releaseTargetId` is honored only when **creating the original**. Omit it when no target exists yet (a `default` target is created) or exactly one unarchived target exists; with more than one you must specify it (`ReleaseTargetRequired`).
- A deprecated group cannot be published (`ChangelogDeprecated`); it stays readable, editable, and translatable. Reactivating is web-only and does not republish.

## Translations (articles, changelog, and legal documents)

Legal documents translate like articles and changelog: per-language drafts in one permanent group per legal identity (`PrivacyPolicy` / `TermsOfService` per product and type, `LegalCustom` per slug). Each language keeps its own title, body, and effective date; legal confirmation and publishing stay web-only. Announcements carry per-locale copy in their own draft (below) — not document translations.

Creating a translation:

1. `get_document` on the source document.
2. `save_document_draft` with `input.locale` (the target language) and `translationOf: { documentId, contentRevision }` pointing at the source.

Rules:

- `translationOf` must reference the **source** document — same product, same type — at its **current** `contentRevision`. Translating a translation is not allowed; there are no translation chains.
- The target locale must be enabled. One document per language in a translation group.
- Locale and translation group are fixed at creation. When updating a translation, omit `translationOf` and omit `locale` (or pass its original value).
- An article or `LegalCustom` translation ignores any `slug` you pass — it inherits the group slug.
- Changelog translations inherit `releaseTargetId` / `releaseVersion` / `releaseDate` from the group — omit them. Passing values that differ from the group, or trying to change those fields on a single-language edit, is `ChangelogGroupMetadataRequired`; group metadata and lifecycle are managed in the web app.

```json
// save_document_draft — first English translation of an existing article (minimal)
{
  "projectId": "<uuid>",
  "input": {
    "idempotencyKey": "article-my-first-post-en-draft-1",
    "locale": "en",
    "translationOf": { "documentId": "<source-uuid>", "contentRevision": 7 },
    "draft": { "type": "Article", "title": "My first post", "body": "..." }
  }
}
```

Working with an existing group:

- `get_document` returns `translations: [{ locale, documentId, status }]` with `status` of `Draft`, `Published`, or `Unpublished`. Use it to see which languages exist; create only the missing ones. Creating a second document for a language that already has one is a `DuplicateKey`.
- `sourceOutdated: true` means the source body changed after this translation was created. To resolve: read the source's latest content and update the translation draft with it, as a normal update — the recorded source revision does not refresh automatically. Tell the user which languages are outdated.

## Announcements

`save_announcement_draft` takes `draft.translations`, an array of `{ locale, mode, message?, ctaText? }`:

- `mode`: `Translated` (carries copy) or `Hidden` (no copy; that language shows nothing and does not fall back). A language with no entry falls back to the default-language copy.
- **An explicit array replaces the whole translation set.** Before updating, call `get_announcement` and write back every entry you want to keep. Omitting the array updates `message` / `ctaText` for the default language only and keeps the other entries.
- `message` is plain text, 1–500 characters. `ctaText` (1–80) pairs with the shared `ctaUrl`; when a `ctaUrl` is set, every `Translated` entry needs a `ctaText`.
- `category`: `Promotion`, `Notice`, or `Maintenance`. `startsAt` / `endsAt` carry a timezone.

## Publishing

- **Publish only when the user explicitly asks.** Drafting and translation work stops at the draft. Before publishing, list for the user what will go out: titles, languages, slugs.
- `agentPublishingEnabled` must be `true`. When it is `false`, publish tools return `AgentPublishingDisabled` — save the draft and ask the user to publish in the Harborly web app, or to turn on agent publishing in the web publishing settings. Do not try to work around it.
- `publish_document` — `input: { documentId, expectedRevision, idempotencyKey }`. Articles and changelog releases only, one language's document per call. Publish each language one by one; they are independent. Report which succeeded and which failed.
- `publish_announcement` — `input: { announcementId, expectedRevision, idempotencyKey }`. Publishes the announcement with all of its translations. Requires the default language to be a `Translated` entry with copy, and no `Translated` entries for disabled languages.
- Relay every `warnings` entry from a publish response to the user (e.g. an outdated translation source, a locked slug).

```json
// publish_document — publish one language
{
  "projectId": "<uuid>",
  "input": {
    "documentId": "<uuid>",
    "expectedRevision": 3,
    "idempotencyKey": "article-my-first-post-en-publish-1"
  }
}
```

Consequences to state before a first publish:

- An article group's **slug locks permanently** once any of its languages is first published — unpublishing or deleting does not unlock it. Confirm the slug with the user before that first publish.
- Published content stays cached on Harborly's side for up to ~6 minutes (announcements ~30 seconds), plus whatever the reader's site caches on top.

## Legal documents (draft-only)

Confirming and publishing legal documents is **web-only**. The agent drafts them with `save_document_draft`:

- `legalDetails.effectiveDate` is required (`YYYY-MM-DD`), per language.
- `PrivacyPolicy` and `TermsOfService`: one permanent group per product and type, `legalDetails.slug` stays null. One undeleted document per language.
- `LegalCustom`: requires `legalDetails.slug` — lowercase letters and digits separated by hyphens, at most 100 characters. `privacy`, `terms`, `privacy-policy`, and `terms-of-service` are reserved. One permanent group per slug; the group's slug locks permanently once any language is first published.
- Translations work like articles and changelog (see above). When every member of a legal group is deleted, a new original with the same identity reuses the group — a locked slug stays locked.

## Error codes

| Error | Meaning | Handling |
| --- | --- | --- |
| `RevisionConflict` | The document changed under you | Re-read, reconcile, write again with the new `expectedRevision`. |
| `IdempotencyConflict` | Same key, different request | Use a fresh key; never reuse a key across different requests. |
| `DuplicateKey` | Slug or same-language translation already exists | Re-read and update the existing document instead of creating another. |
| `InvalidTranslationSource` | `translationOf` is not a valid source | Point it at the current source document of the same type, at its current `contentRevision`. |
| `ContentLocaleDisabled` | The language is disabled | Do not create or publish for it; the user enables languages in the web app. |
| `InvalidContentLocale` | Locale is not in the catalog | Use a canonical catalog tag. |
| `PublishedSlugCannotChange` | The slug is locked by first publication | Keep the existing slug and tell the user. |
| `ReleaseTargetRequired` | More than one unarchived release target exists and none was specified | Pass `draft.changelog.releaseTargetId` (find it with `list_release_targets`). |
| `ChangelogGroupMetadataRequired` | A translation's changelog fields differ from the group, or a single-language edit tried to change them | Omit `releaseTargetId` / `releaseVersion` / `releaseDate` on translations; edit shared fields in the web app. |
| `ChangelogDeprecated` | The changelog group is deprecated and cannot be published | Report to the user; reactivating and republishing happen in the web app. |
| `AgentPublishingDisabled` | Agent publishing is off | Save drafts; the user publishes in the web app or enables agent publishing there. |
| `AnnouncementDefaultTranslationRequired` | The default language lacks a `Translated` entry with copy | Add or fix the default-language entry, then re-save. |
| `InvalidAnnouncementCta` | `ctaText` / `ctaUrl` pairing is broken | Set `ctaText` on every `Translated` entry when a `ctaUrl` is present. |
| `WrongResourceType` | The tool was used on the wrong document type | e.g. `publish_document` accepts only articles and changelog releases. |

## Finish checklist

- Every draft saved and read back (`get_document` / `get_announcement`): content and revision verified.
- Per-language status known and reported: which languages exist, which are drafts, which are missing or outdated.
- Published only on explicit request, with titles, languages, and slugs shown to the user beforehand; per-language results and all `warnings` relayed.
- Anything unfinished — missing translations, outdated sources, steps that only the web app can do — reported as such. No silent gaps.
