cr-create
БесплатноБез исполняемых скриптовНе проверенDrive an end-to-end GitBook docs review flow from Claude Code by calling the GitBook REST API directly with curl (no CLI) — create a change request, push…
от GitbookIO★ 27 звёзд на GitHubОб этом скилле
GitBook Review Flow (direct API)
Run a documentation review loop against a GitBook space entirely through the
GitBook REST API (https://api.gitbook.com/v1, hit with curl), so an engineer
never has to leave Claude Code (plus Slack) to propose docs changes and get them
reviewed. This is the authoring-side companion to cr-review (the reviewer side over the
same API). Every action here is a plain HTTP call — there is no CLI and no helper script.
The same actions serve three purposes with no separate code paths:
- CR-creation demo — create a change request and push content (one existing page updated, one new page created).
- Notify/review demo — request reviewers, drop a Slack link, pull comments, fix, re-push, resolve.
- Real use — the identical actions against the user's own content.
Because the demo is just a scripted sequence of the real actions, it cannot show something that doesn't actually work. Keep it that way: never fake an output.
Auth and the gbapi helper
Every call is a Bearer-authenticated request to https://api.gitbook.com/v1. The token
lives in GITBOOK_TOKEN in the repo-root .env (create one at
https://app.gitbook.com/account/developer).
Never print the token; never write it to a tracked file. If it's missing, prompt the
user for it and write it to .env; don't invent one.
Define this shell helper once per session and use it for every call below. It loads the
token from .env, sets the base URL and headers, and — critically for the "never fake
output" rule — fails loudly on any non-2xx, printing the API's error body (curl --fail-with-body, curl ≥ 7.76 / stock on current macOS):
set -a; [ -f .env ] && . ./.env; set +a # load GITBOOK_TOKEN (and SLACK_WEBHOOK_URL)
gbapi() { # gbapi METHOD /path [extra curl args…]
local method="$1" apipath="$2"; shift 2 # NB: not `path` — in zsh that is tied to $PATH
curl -sS --fail-with-body -X "$method" \
"https://api.gitbook.com/v1${apipath}" \
-H "Authorization: Bearer ${GITBOOK_TOKEN}" \
-H "Content-Type: application/json" "$@"
}
Every response is JSON — pipe it through jq and read whole objects. Never hand-parse
by grepping/line-pairing fields (bind the wrong title↔id and you act on the wrong
space/CR). If gbapi exits non-zero, surface the printed error — do not report success.
Endpoint map (verified against api.gitbook.com/openapi.json)
<space>, <cr>, <pageId>, <commentId> are the relevant IDs. Base URL is
https://api.gitbook.com/v1; all paths below are relative to it.
| Step | Method + path | Notes |
|---|---|---|
| Who am I | GET /user |
returns {id, displayName, email} — your own user ID is .id |
| List pages | GET /spaces/<space>/content/pages |
flat-ish tree with id, title, type |
| Get a page (base) | GET /spaces/<space>/content/page/<pageId>?format=markdown |
current markdown of a page on the live space |
| Create CR (GATE) | POST /spaces/<space>/change-requests body {"subject":"…"} |
returns the CR object with id and urls.app (also a Location header) — urls.app is only the editor/diff link, not a rendered preview; see "Surfacing the preview link" |
| Get CR | GET /spaces/<space>/change-requests/<cr> |
subject, status, createdBy, comments, urls.app |
| Push content | POST /spaces/<space>/change-requests/<cr>/content body {"changes":[…]} |
1–50 ops, applied sequentially in one new revision; all-or-nothing |
| Find the site behind a space | GET /spaces/<space> → .organization; GET /orgs/<org>/sites; GET /orgs/<org>/sites/<site>/site-spaces → match .items[].space.id |
needed only to resolve the site preview link (see below); a space isn't required to belong to a site |
| Get a site (for its preview link) | GET /orgs/<org>/sites/<site> |
urls.preview (draft/CR content), urls.published (only once live) — not part of the change-request response at all |
| Get a page (CR side) | GET /spaces/<space>/change-requests/<cr>/content/page/<pageId>?format=markdown |
verify what actually landed in the CR |
| Request reviewers (GATE) | POST /spaces/<space>/change-requests/<cr>/requested-reviewers body {"users":["…"]} |
array of user IDs; optional subject/description |
| List comments | GET /spaces/<space>/change-requests/<cr>/comments?format=markdown&status=all |
bodies at body.markdown; location under target.page/target.node; poster at postedBy.id |
| Reply to a comment | POST /spaces/<space>/change-requests/<cr>/comments/<commentId>/replies body {"body":{"markdown":"…"}} |
|
| Resolve a comment (GATE) | PUT /spaces/<space>/change-requests/<cr>/comments/<commentId> body {"resolved":true} |
resolves unconditionally — no reply-first guard (enforce it yourself) |
| Reply list (verify) | GET /spaces/<space>/change-requests/<cr>/comments/<commentId>/replies |
confirm a reply exists before |
Установить cr-create в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл cr-create?
Drive an end-to-end GitBook docs review flow from Claude Code by calling the GitBook REST API directly with curl (no CLI) — create a change request, push content (update an existing page AND create a new page), request reviewers, notify Slack, then pull review comments back in, fix them, re-push, and resolve. This is the authoring-side companion to cr-review (the reviewer side over the same API). Use this whenever someone wants to run a "docs review in GitBook" loop from the terminal/agent against the raw API (curl/HTTP), mentions creating a change request via the API, pushing content into a CR, "pull in the latest comments and fix them," requesting review on docs, or showing engineers how to collaborate on GitBook docs from Claude + Slack without a CLI.
Как установить скилл cr-create?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cr-create запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic