
build-integration
Build, develop, and publish GitBook integrations — apps that run inside GitBook to add custom blocks, react to events, connect external services via OAuth, and extend the editor. Use this skill whenever a task involves the GitBook integrations platform: scaffolding an integration with the GitBook CLI (gitbook new), writing or editing an integration's code (createIntegration, createComponent, ContentKit TSX), configuring gitbook-manifest.yaml (scopes, blocks, configurations, secrets), building custom editor blocks or link unfurlers, handling GitBook events like spacecontentupdated, setting up an integration's OAuth flow, running gitbook dev, or publishing an integration (private/unlisted/public, marketplace submission). Trigger this even if the user just says they want to 'build an app for GitBook', 'add a custom block', or 'connect to GitBook' without saying the word 'integration'.
- Installs
- 569
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/gitbookio/gitbook-skills --skill build-integration- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads build-integration automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Build a GitBook Integration
A skill for building integrations on GitBook's developer platform: apps that run inside GitBook itself. An integration can render custom blocks in the editor, show configuration UI, listen to events (content updated, Git sync completed, space viewed), authenticate against external services with OAuth, and talk to anything over HTTP.
This skill covers the integration lifecycle — scaffold, code, develop, publish. For creating or restructuring the docs site an integration might be installed into, defer to configure-site; for authoring page content, defer to write-docs.
What an integration is (mental model)
An integration is a small TypeScript app executed by GitBook's runtime — not a script injected into pages, and not code running on the user's server. Three consequences shape everything else:
- Rendering happens on GitBook's backend. Your component's
renderfunction runs server-side on every interaction and returns ContentKit markup (a JSX-like UI description). There is no client-side React tree you control, no DOM access, and UI updates flow through the action → new state → re-render loop. - You cannot inject JavaScript into a site. The
site:script:injectandsite:script:cookiesscopes you'll see in GitBook-owned integrations are internal-only. If the user's plan amounts to "add a script tag to their docs", stop and say so early — the supported paths are custom blocks, webframes, and events. - Local development is a proxy, not a server you visit.
gitbook devroutes the installed integration's traffic to your machine. You never open the dev server's port in a browser; you interact with the integration inside app.gitbook.com.
The project
gitbook new scaffolds this shape:
my-integration/
├── gitbook-manifest.yaml # identity, scopes, blocks, configuration schema
├── .gitbook-dev.yaml # local dev config (generated by `gitbook dev`)
├── package.json
└── src/
└── index.tsx # entry file — default-exports createIntegration()
The entry file (whatever script: in the manifest points to) default-exports createIntegration({ fetch, components, events }):
import { createIntegration, createComponent } from '@gitbook/runtime';
const helloBlock = createComponent({
componentId: 'hello-world', // must match a block id in the manifest
initialState: { message: 'Say hello!' },
action: async (element, action, context) => {
switch (action.action) {
case 'say':
return { state: { message: 'Hello world' } };
default:
return {};
}
},
render: async (element, context) => (
<block>
<button label={element.state.message} onPress={{ action: 'say' }} />
</block>
),
});
export default createIntegration({
components: [helloBlock],
events: {
space_content_updated: async (event, context) => {
// react to content changes
},
},
});
A custom block only appears in the editor's insert palette (⌘ + /) if it is declared in both places: createComponent in the code and a blocks: entry in the manifest whose id matches the componentId. Forgetting one half is the most common "my block doesn't show up" cause.
The manifest, briefly
gitbook-manifest.yaml is the integration's identity and permission grant. Required: name (globally unique across all of GitBook — pick something namespaced like acme-changelog, not test), title, description, organization (org id or subdomain), visibility, scopes, and script. Request only the scopes the code actually uses — installers see them.
The manifest also declares blocks, installer-facing configurations (account-level and site-level property schemas rendered as a settings form), and secrets (e.g. CLIENT_ID: ${{ env.CLIENT_ID }}, loaded at publish time — use dotenv-cli so gitbook publish sees your .env).
Full field-by-field schema, scope list, and configuration property types: references/manifest.md. Read it whenever you're editing the manifest beyond the basics.
The development loop
The loop has a non-obvious order — publish comes before local development:
- Prerequisites. Node 18+, a personal access token from https://app.gitbook.com/account/developer, and the CLI:
npm install @gitbook/cli -g, thengitbook auth(orgitbook auth --token=<token>). If a token needs to be pasted into the conversation, export it to the environment and never echo it back or commit it. - Scaffold.
gitbook new <dir>— prompts for name, title, organization, and scopes. - Publish once.
gitbook publishin the project root. This registers the integration (private by default) and prints an install link. - Install it into at least one space or site via that link. Local dev doesn't work until it's installed somewhere.
- Develop.
gitbook devstarts the proxy: all traffic for the installed integration is served from your local code instead of the published version. Interact with it in the GitBook editor, not at the server URL. UI changes need a browser refresh; disable browser caching for a smoother loop. Logs surface in the browser console or your terminal depending on where the code runs — check both before concluding logging is broken. - Re-publish with
gitbook publishwhenever you want the hosted version updated.gitbook unpublish <name>removes it.
CLI command reference (including gitbook whoami and gitbook openapi publish): references/manifest.md.
Runtime: fetch, events, environment, OAuth
Details and full tables live in references/runtime.md — read it when writing event handlers, OAuth flows, or anything touching context.environment. The essentials:
fetchhandles incoming HTTP requests to the integration's public endpoint using standard Fetch APIRequest/Responseobjects. Outgoing HTTP is plainfetchtoo.eventsmaps event names (installation_setup,space_installation_setup,space_view,ui_render,space_content_updated,space_visibility_updated,space_gitsync_started,space_gitsync_completed) to handlers. Some events require matching scopes.context.environmentexposesapiEndpoint,apiTokens, installation info (space, status, per-installationconfigurationvalues entered by the installer),secrets, and public URLs (environment.integration.urls.publicEndpoint).- OAuth against an external provider is a fixed pattern: a
button-type configuration property whosecallback_urlroutes to acreateOAuthHandler({...})in your fetch handler, with client id/secret coming fromsecrets. Don't hand-roll the redirect/token exchange. - Calling the GitBook API from inside the integration: use
context.api(an authenticated@gitbook/apiclient) rather than constructing your own client from raw tokens.
ContentKit: building the UI
ContentKit is the component vocabulary render can return: layout (block, vstack, hstack, divider), display (box, card, text, image, markdown), and interactive elements (button, textinput, select, switch, checkbox, radio, codeblock, webframe, modal). Interactivity model in one line: inputs bind their value to a state key; buttons dispatch actions; your action reducer returns new state; GitBook re-renders.
Read references/contentkit.md before writing any component beyond a trivial button — it has the full prop tables plus the patterns that are hard to guess: dynamic state binding for live previews, webframe postMessage communication, modals with returnValue, persisting props with @editor.node.updateProps, link unfurling via @link.unfurl + urlUnfurl manifest patterns, and markdown code-block serialization of blocks.
Publishing and sharing
Visibility in the manifest controls reach:
private(default) — installable only by members of the owning org. Right for internal tools; stay here during development.unlisted— installable by any org, but only via the shared install link. Right for sharing with specific customers or beta testers.public— installable by anyone; required before submitting to the integration marketplace (which is a separate review process — see GitBook's "submit your app for review" docs).
Re-run gitbook publish after changing visibility. Before suggesting public, sanity-check the manifest is presentable: icon, summary (Markdown, ≤2048 chars), previewImages (1600×800), categories, externalLinks.
Working style
- Scaffold with the CLI rather than by hand when starting fresh —
gitbook newwires up the manifest, TypeScript config, and@gitbook/runtimeversions correctly. - Trace a block's id chain (manifest
blocks[].id↔componentId) whenever a component misbehaves. - Keep secrets out of the manifest file itself — always the
${{ env.X }}indirection, never literal values. - When the user's goal is content or site automation from outside GitBook (scripts hitting the REST API, CI pipelines), an integration may be the wrong tool — the plain API with a personal token is simpler. Integrations earn their keep when code must run inside GitBook: blocks, config UI, event reactions, OAuth on behalf of installers.
References
references/manifest.md— everygitbook-manifest.yamlfield, all scopes, configuration property types, secrets, CLI command reference, installation/configuration flow.references/runtime.md—createIntegration/createComponent/createOAuthHandlersignatures, event catalog,context.environmentshape, HTTP in and out.references/contentkit.md— full component reference with props, built-in actions, and interactivity recipes (dynamic binding, webframes, modals, unfurling, markdown serialization).
FAQ
What does the build-integration skill do?
Build, develop, and publish GitBook integrations — apps that run inside GitBook to add custom blocks, react to events, connect external services via OAuth, and extend the editor. Use this skill whenever a task involves the GitBook integrations platform: scaffolding an integration with the GitBook CLI (gitbook new), writing or editing an integration's code (createIntegration, createComponent, ContentKit TSX), configuring gitbook-manifest.yaml (scopes, blocks, configurations, secrets), building custom editor blocks or link unfurlers, handling GitBook events like spacecontentupdated, setting up an integration's OAuth flow, running gitbook dev, or publishing an integration (private/unlisted/public, marketplace submission). Trigger this even if the user just says they want to 'build an app for GitBook', 'add a custom block', or 'connect to GitBook' without saying the word 'integration'.
How do I install build-integration?
Run npx skills add https://github.com/gitbookio/gitbook-skills --skill build-integration in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/build-integration/ (personal) or .claude/skills/build-integration/ (project).
Which AI agents can use build-integration?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is build-integration safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains build-integration?
It is published by gitbookio in gitbookio/gitbook-skills. It has 569 recorded installs.
More from gitbookio/gitbook-skills
write-docs
gitbookio/gitbook-skills
Write, author, edit, and format GitBook documentation pages in Git-synced repos, IDEs, or any text editor. Use whenever a task involves creating or editing a GitBook markdown page, writing or updating a README.md or SUMMARY.md, inserting a hint, tab, stepper, card, or other GitBook block, configuring page frontmatter or layout options, setting up variables or expressions, or formatting content for GitBook outside the GitBook UI.
configure-site
gitbookio/gitbook-skills
Create and maintain GitBook documentation sites end-to-end — design structure from source content, scaffold a Git monorepo, set up the GitHub/GitLab remote, drive the GitBook API (REST or MCP) to create the site/sections/spaces, apply branding, and hand off the one UI step (Git Sync) that GitBook does not expose programmatically. Prefer site-level Git Sync (gitbook-docs.yaml mapping every space) over per-space sync unless a space needs its own repo or branch. Use when spinning up a new docs site, restructuring or extending one, linking a site or spaces to Git, changing branding (logo, colors, fonts, header/footer), or programmatically managing spaces, sections, or site-spaces. Defers page authoring to the companion write-docs skill.
cr-review
gitbookio/gitbook-skills
Review GitBook change requests from Claude Code by calling the GitBook REST API directly with curl (no CLI) — the reviewer-side companion to cr-create (the authoring side over the same API). Discover the change requests that need review (filter by who opened them, by space, or across a whole org), get the GitBook app link to review the diff, summarize what actually changed in a CR, then leave comments and optionally submit a review verdict (approve / request changes). Use this whenever someone wants to review docs change requests over the raw API (curl/HTTP), asks "what CRs are open / waiting on me / opened by ", "show me the change requests in / ", "summarize what changed in this CR", "review this change request", "leave a comment on a CR", or "approve / request changes on a CR". For the authoring side (create a CR, push content, request reviewers, fix comments) over the API, use cr-create instead.
cr-create
gitbookio/gitbook-skills
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.
write-openapi
gitbookio/gitbook-skills
Author, configure, structure, and troubleshoot OpenAPI/Swagger API reference documentation in GitBook. Use this whenever a task involves a GitBook OpenAPI block or {% openapi %} block, adding or updating an OpenAPI/Swagger spec in GitBook (by file or URL, via the API, MCP, CLI, or app UI), generating API reference pages from a spec, configuring the interactive "Test it" runner (auth, servers, CORS, proxy), customizing pages with GitBook x- extensions (icons, titles, navigation hierarchy, code samples, enum descriptions), marking operations experimental/deprecated/hidden, or automating spec updates in CI/CD. Trigger even when the user only mentions GitBook plus OpenAPI, puts an x- extension on a spec destined for GitBook, or asks "why isn't my spec loading" or "why doesn't Test it work", without naming this skill.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.