/ballerina-libdev:generate-connector-docsfrom Ballerina Library Development
Generates WSO2 Integrator connector documentation from a Ballerina Central package coordinate, including overview, setup guide, action reference, validated example with screenshots, and sample project. Publishes into a local docs checkout or preview directory.
Ships in Ballerina Library Development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Create the integration and documentation directly in the current agent. Never start a nested agent, publish artifacts, or run git commands. The one exception is the connector-doc-generator step below, which itself calls the claude CLI — treat that as a separate, already-reviewed tool the user explicitly opts into, not something this skill's own scripts do.
Require only a full Central coordinate:
organization/packageorganization/package:versionReject a bare package name. Treat an omitted version as latest. Accept optional user guidance for operation, authentication, or category choices; it overrides the workflow's default selection heuristics. Everything else — category, GitHub repo name, and the docs-integrator/connector-doc-generator/integration-samples locations — is resolved automatically per Steps 2–4 and 13 below; only fall back to asking the user when auto-resolution genuinely can't find an answer.
playwright MCP server's browser_* tools are available. If they are unavailable, stop before creating artifacts. Tell the user to inspect /mcp and run /reload-plugins; do not run claude mcp add or modify personal Claude settings.python3 "${CLAUDE_SKILL_DIR}/scripts/prepare_run.py" "ORGANIZATION/PACKAGE[:VERSION]" --root "${CLAUDE_PROJECT_DIR}" --docs-repo-root DOCS_REPO_ROOT, where DOCS_REPO_ROOT is resolved as follows, in order, before this call: an explicit path the user already gave in this conversation; a docs-integrator directory the agent already knows about from earlier context; a sibling of ${CLAUDE_PROJECT_DIR}'s parent named docs-integrator; otherwise ask once with the "2+1" pattern (most likely candidate, a second plausible one, or a custom path). If no docs-integrator checkout exists or the user wants a scratch-only preview, omit --docs-repo-root entirely — the workflow then behaves exactly as a local preview: everything stays under artifacts/<organization>-<package>/ in ${CLAUDE_PROJECT_DIR} and nothing is written outside it. prepare_run.py auto-derives the catalog category from the resolved package's own Central metadata (its Area/... keyword) and the GitHub repo name (module-<organization>-<package>, using the coordinate's own organization) — pass --category or --github-repo explicitly only to override a wrong or missing derivation. Stop on invalid input, missing Central metadata, or an existing completed or nonempty output directory.run_dir, sample_dir, screenshots_dir, and doc_path values throughout the run. When a docs-integrator target was resolved, also note category_slug, module_slug, docs_connector_dir, docs_overview_path, and github_repo for later steps. If category_slug came back empty (the package has no Area/... keyword), ask the user for one of connector-doc-generator's fixed slugs (ai-ml, built-in, cloud-infrastructure, communication, crm-sales, database, developer-tools, ecommerce, erp-business, finance-accounting, healthcare, hrms, marketing-social, messaging, productivity-collaboration, security-identity, storage-file) and re-run Step 2 with --category before continuing.connector-doc-generator checkout the same way as Step 2 (already known from context, a sibling of DOCS_REPO_ROOT's parent, or ask once) and offer to run it before continuing — unless docs_overview_path already exists, in which case connector-doc-generator has already run for this connector and this step can be skipped. State plainly that it calls the claude CLI directly (real Anthropic API cost, roughly $0.50–$1.00 for a single-client connector per its own README, a few minutes of runtime) and wait for explicit confirmation — do not run it silently. On confirmation, from the connector-doc-generator directory:
bal run -- -CgithubRepo=<github_repo> -Ccategory=<category_slug> -CdocsRepoRoot=<DOCS_REPO_ROOT>
This writes overview.md, an applicable setup-guide.md, and action-reference.md (and trigger-reference.md if the connector has a listener) into docs_connector_dir, and patches sidebars.ts and the catalog index.mdx with the connector's own entry. Publishing the example page in Step 12 requires overview.md to exist — if the user declines this step and no overview.md is already present, skip Step 12 too and report the example as scratch-only; do not invent a standalone sidebar entry for it.
Read the generated pages afterward and fix two known mechanical rough edges by hand before moving on: the display name connector-doc-generator derives from the module slug is naive title-casing (e.g. "Hubspot" instead of "HubSpot") — correct it in overview.md's frontmatter title, and in sidebars.ts/index.mdx's new entries, to match the connector's real brand capitalization; and its prompt templates sometimes still slip the raw Ballerina package identifier ({{org}}/{{package}}) into prose sentences in overview.md or action-reference.md — reword any such sentence to name the connector instead, the same rule already applied to this skill's own example-page template and to generating-connectors' README templates. Leave the identifier alone inside code blocks, import statements, and the GitHub repository link, and leave the frontmatter description field alone — every sibling connector's description already includes its raw package identifier by established site convention.node, npx, python3, Pillow (python3 -c "import PIL"), code-server, and the wso2.wso2-integrator code-server extension (code-server --list-extensions). Ask before installing a missing prerequisite or downloading Chromium. Install Pillow only from ${CLAUDE_SKILL_DIR}/scripts/requirements.txt. Do not install silently.CODE_SERVER_CREDENTIAL only in the current agent's context and use them to authenticate the browser session. Otherwise generate a per-run CODE_SERVER_TOKEN with python3 -c 'import secrets; print(secrets.token_urlsafe(32))', keep it only in the current agent's context, and start PASSWORD="$CODE_SERVER_TOKEN" code-server --auth password --bind-addr 127.0.0.1:PORT SAMPLE_PARENT; use that token to authenticate the browser session. Redirect output from a run-started server to run-log/code-server.log and record its PID. Never copy either credential into artifacts, logs, screenshots, or the final report. Stop only a server started by this run, then discard the applicable credential.playwright MCP tools. Limit DOM evaluation to the reference's narrowly scoped scrolling and nested-canvas procedures; do not run arbitrary or page-wide browser code.browser_take_screenshot call, immediately run python3 "${CLAUDE_SKILL_DIR}/scripts/collect_screenshot.py" RETURNED_PATH SCREENSHOTS_DIR/FILENAME. Keep filenames sequential from 01 through 06.sample_name at sample_dir. Make sample_dir the project root: Ballerina.toml and the generated .bal files must live directly within it. Do not rename the directory or add a suffix. If the UI creates the project elsewhere or one level deeper, copy its contents into sample_dir before finalization.${CLAUDE_SKILL_DIR}/assets/templates/connector-example-doc.md to doc_path, then replace every placeholder with facts from the completed workflow. Remove template comments and inapplicable conditional sections. Always author with the ../screenshots/... relative image links from the template — never hand-write the docs-integrator site's absolute /img/... form; that rewrite happens mechanically in Step 12. Do not author from a blank file, create an intermediate execution prompt, or use a second model for enforcement.python3 "${CLAUDE_SKILL_DIR}/scripts/finalize_run.py" --context CONTEXT_PATH. It deterministically injects Try it yourself, calls append_central_examples.py to append examples from the cached Central API response, and validates the output. If it reports failures, correct the guide or artifacts and rerun until it succeeds.docs_overview_path exists (connector-doc-generator has already produced overview.md, whether just now in Step 4 or in an earlier run), publish the example page through connector-doc-generator's own shared integration scripts rather than reimplementing that logic in this skill:
python3 <connector-doc-generator>/scripts/integrate_example.py \
--docs-repo DOCS_REPO_ROOT --artifacts-dir RUN_DIR \
--category CATEGORY_SLUG --module MODULE_SLUG --mode connector
python3 <connector-doc-generator>/scripts/validate_docs.py \
--docs-repo DOCS_REPO_ROOT --category CATEGORY_SLUG --module MODULE_SLUG \
--reference --examples
integrate_example.py reads the single guide under RUN_DIR/workflow-docs/ and the six PNGs under RUN_DIR/screenshots/ (exactly run_dir, doc_path, and screenshots_dir from context.json), rewrites the guide's ../screenshots/... links to the site's absolute /img/connectors/catalog/<category>/<module>/... form, copies the screenshots into the static image tree, writes the guide to docs_connector_dir/example.md (adding a title: "<Name> Example" frontmatter block first, since the guide's own template is deliberately site-agnostic and never writes one itself), reconciles sidebars.ts so the connector's existing category block lists the example page, and adds an Example bullet to overview.md's Documentation section if one isn't already there — it fails loudly if overview.md is missing, by design, so do not attempt this step without it. Every generated page's title follows WSO2's own <Connector Name> <Section> convention (Title Case, confirmed against mi.docs.wso2.com and docs-integrator's pre-existing Twilio/HTTP pages) — overview.md/setup-guide.md/action-reference.md/trigger-reference.md get this from connector-doc-generator's templates directly; only example.md's title is this skill's own responsibility, via integrate_example.py as just described. validate_docs.py then re-confirms the whole page set and sidebar are internally consistent, but it has no trigger-aware check: if Step 4 generated trigger-reference.md (the connector has a listener), separately confirm that file still exists and is non-empty in docs_connector_dir before reporting success — a missing or emptied trigger reference can otherwise pass validate_docs.py silently. If either script fails, fix the reported issue and rerun rather than hand-patching docs-integrator files directly. Leave every docs-integrator change as an uncommitted working-tree edit — never commit, push, or open a pull request against it.wso2/integration-samples. Step 11's "Try it yourself" section always links to integrator-default-profile/connectors/<sample_name> in that repo whether or not anything has ever been published there — until this step runs (and its PR merges), that link 404s. Resolve SAMPLE_REPO_ROOT the same way as DOCS_REPO_ROOT in Step 2 (already known from context, a sibling directory, or ask once with "2+1"). If the user has no local checkout, fork wso2/integration-samples to their account (gh repo fork wso2/integration-samples --clone=false) and clone the fork fresh into a scratch location — forking a public repo is low-risk and reversible, unlike the push/PR at the end of this step, so it doesn't need the same explicit confirmation. Then:
python3 "${CLAUDE_SKILL_DIR}/scripts/prepare_sample_publish.py" \
--sample-dir SAMPLE_DIR --target-dir SAMPLE_REPO_ROOT/integrator-default-profile/connectors/SAMPLE_NAME
This copies only .gitignore, Ballerina.toml, and the .bal files — never .vscode/, target/, Dependencies.toml, or Config.toml, none of which any existing sample commits — and sets [package] org to wso2, matching every sibling sample (a WSO2 Integrator project is created locally under whatever org the developer's own environment happens to use). Run bal build in the target directory afterward to confirm it still compiles before going further; fix any issue by re-running Step 9 rather than hand-editing the copy. From there this follows the exact same boundary as the docs-integrator steps above: create a branch and commit freely, but only push and open the PR with the user's explicit confirmation, having disclosed that doing so opens a real pull request against a public WSO2 repository. Never treat generating the docs as implied consent to publish the sample — always ask, every time.artifacts/ scratch location, its published location under docs_connector_dir when applicable, whether the sample was published to wso2/integration-samples and its PR URL if so, screenshot directory, sample directory, resolved package version, and validation status.artifacts/<organization>-<package>/ in ${CLAUDE_PROJECT_DIR} unless a docs-integrator or integration-samples target was resolved per Steps 2 and 13, in which case the example page, its screenshots, the sidebars.ts reconciliation, and the published sample project are the only things written outside it — everything else (the local sample project copy, run log, scratch copy of the guide) still stays under artifacts/.append_central_examples.py. Never author, summarize, or alter Central example content manually.connector-doc-generator without first disclosing its real Claude API cost and getting explicit confirmation; never run it silently as an implied side effect of resolving a docs-integrator target.overview.md — integrate_example.py enforces this; do not work around it with a standalone sidebar entry.wso2/integration-samples (or docs-integrator) without the user's explicit, per-run confirmation — forking is the one exception, since it's low-risk and reversible.assets/templates/connector-example-doc.md (opens in a new tab)references/connector-ui-workflow.md (opens in a new tab)references/documentation-contract.md (opens in a new tab)references/microsoft-writing-style.md (opens in a new tab)scripts/append_central_examples.py (opens in a new tab)scripts/collect_screenshot.py (opens in a new tab)scripts/crop_screenshots.py (opens in a new tab)scripts/finalize_run.py (opens in a new tab)scripts/inject_try_it_yourself.py (opens in a new tab)scripts/prepare_run.py (opens in a new tab)scripts/prepare_sample_publish.py (opens in a new tab)scripts/requirements.txt (opens in a new tab)scripts/tests/test_prepare_sample_publish.py (opens in a new tab)scripts/tests/test_workflow.py (opens in a new tab)scripts/validate_output.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
ballerina-libdev@ballerina-skills is listed by ballerina-platform/skills — review the source before installing
npx claudepluginhub ballerina-platform/skills --plugin ballerina-libdev4 skills in this plugin
/generating-connectorsGenerates a complete Ballerina connector from an OpenAPI specification. Use when the user wants to create, generate, or build a Ballerina connector from an OpenAPI or Swagger spec; run the connector creation pipeline; generate a Ballerina client from an API spec; or produce connector tests, examples, and documentation./generating-sap-s4hana-connectorsBuild Ballerina connectors for SAP S/4HANA OData APIs (ballerinax/sap.s4hana.* packages in the module-ballerinax-sap.s4hana.<area> repos) from an api.sap.com spec, end to end - spec sanitization, operation IDs, client generation on ballerinax/sap 1.4.0, mock service and tests, docs.json/README with the communication-scenario setup guide, and repo registration (Gradle, workflows, README). Use this whenever the user wants a new S/4HANA connector or package (API_*_SRV, CE_*_0001, OData V2 or V4), wants to add an S/4HANA API to the inventory/qm/delivery/procurement/sales repos or a new area repo, wants to regenerate or re-sanitize an existing S/4HANA client, or mentions an S/4HANA API ID with "connector", even if they do not say "skill" or "generate"./making-graalvm-compatibleMakes a Ballerina library GraalVM-compatible by running the native build/test workflow, sourcing reachability metadata, and marking the package compatible. Use when the user wants to make a Ballerina library or package GraalVM compatible; build or test a Ballerina package with `bal build --graalvm` / `bal test --graalvm`; fix GraalVM native-image class-initialization or reflection/JNI/resource errors in a Ballerina project; run the GraalVM tracing agent for Ballerina tests or a service; pack native-image reachability metadata into META-INF for a Ballerina module; resolve the "Package is not verified with GraalVM" warning; or set graalvmCompatible = true in Ballerina.toml.Other plugins' skills for the same job