Skip to content
Skills Library
Programming · Building & coding

ballerina

/ballerina

Writes, runs, tests, debugs, and deploys Ballerina programs and integrations. Use when the user asks to write, create, implement, update, or fix Ballerina code; create or set up a new Ballerina project or package; build an HTTP service, API, GraphQL service, or integration in Ballerina; run, test, or build a Ballerina project; add a library or dependency; debug, diagnose, or explain a Ballerina compile error, runtime panic, stack trace, or failing integration; work with a .bal file, Ballerina.toml, Dependencies.toml, or Config.toml; run a bal command; generate Ballerina code from an OpenAPI or

Repository
skills ↗
Licence
Apache-2.0
Last repository change
12.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
24
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Writes, runs, tests, debugs, and deploys Ballerina programs and integrations. Use when the user asks to write, create, implement, update, or fix Ballerina code; create or set up a new Ballerina project or package; build an HTTP service, API, GraphQL service, or integration in Ballerina; run, test, or build a Ballerina project; add a library or dependency; debug, diagnose, or explain a Ballerina compile error, runtime panic, stack trace, or failing integration; work with a .bal file, Ballerina.toml, Dependencies.toml, or Config.toml; run a bal command; generate Ballerina code from an OpenAPI or

Original author description

Writes, runs, tests, debugs, and deploys Ballerina programs and integrations. Use when the user asks to write, create, implement, update, or fix Ballerina code; create or set up a new Ballerina project or package; build an HTTP service, API, GraphQL service, or integration in Ballerina; run, test, or build a Ballerina project; add a library or dependency; debug, diagnose, or explain a Ballerina compile error, runtime panic, stack trace, or failing integration; work with a .bal file, Ballerina.toml, Dependencies.toml, or Config.toml; run a bal command; generate Ballerina code from an OpenAPI or

How it works

  1. Creating a New Project
  2. Writing Ballerina Code
  3. Running and Testing
  4. Ballerina Not Installed
  5. Errors and Unexpected Behavior
Original SKILL.md headings · 48 lines, 686 words
SKILL.md preview
---
name: ballerina
description: Writes, runs, tests, debugs, and deploys Ballerina programs and integrations.
  Use when the user asks to write, create, implement, update, or fix Ballerina code; create
  or set up a new Ballerina project or package; build an HTTP service, API, GraphQL service,
  or integration in Ballerina; run, test, or build a Ballerina project; add a library or
  dependency; debug, diagnose, or explain a Ballerina compile error, runtime panic, stack
  trace, or failing integration; work with a .bal file, Ballerina.toml, Dependencies.toml,
  or Config.toml; run a bal command; generate Ballerina code from an OpenAPI or proto
  specification; deploy a Ballerina service to Docker, Kubernetes, or a GraalVM native
  image; or when the user does not have Ballerina installed and needs help setting it up.
---

## Creating a New Project

When the user asks to create a new project, service, or program from scratch:

```bash
bal new <project-name>   # scaffolds main.bal + Ballerina.toml
cd <project-name>
```

- Read the generated `Ballerina.toml` to understand the package (name, org, version)
- For a workspace (multiple packages in one repo), see [code-rules.md](code-rules.md) and the workspace rules it routes to

## Writing Ballerina Code

**Step 1 — Read existing code and plan file layout**: Read `.bal` files and `Ballerina.toml` to understand the project and its existing layout. Place new code in the file that fits its concern rather than everything in `main.bal` (see [code-rules.md](code-rules.md) for file organization).

**Step 2 — Discover libraries if needed**: If the task needs an external connector or library you don't know, invoke the `library` agent — give it the full task (including auth and trigger/event details) so its first summary already covers the client or `listener` constructor and the auth/connection config you'll need. Add the returned `import` to your `.bal` file; `bal build` resolves the dependency from Central. Trust the summary's API shapes — don't `bal pull` or read package source to double-check them; if a detail is genuinely missing, ask the `library` agent rather than guessing.
- Need several libraries? Invoke the `library` agent for each **in parallel** (multiple agent calls in one step, or run them in the background) — the lookups are independent. Meanwhile keep doing other independent work (scaffold the project, read existing `.bal` files, plan the file layout), and fold in each summary as it returns. Don't block on one lookup before starting the next.
- When both a `ballerinax/*` connector (with its own listener) and a standalone `trigger.*` package cover the same events, always prefer the connector — `trigger.*` packages are being superseded (don't judge by modified date).
- No `library` agent available? Use `bal` directly: `bal search <keyword>`, then `bal pull <org/name>` and read its sources under `~/.ballerina/repositories/central.ballerina.io/bala/<org>/<name>/<version>/<platform>/modules/<name>/` — glob both `<version>` and `<platform>` (`any` for pure-Ballerina packages, otherwise a JDK target such as `java21`, `java17` or `java11`), and grep for the symbol rather than assuming a filename.

**Step 3 — Write the code**: **Strictly follow the rules in [code-rules.md](code-rules.md)** — check your code against them as you write. That file covers every Ballerina program and ends with a table routing to domain rules (`rules/http.md`, `rules/messaging.md`, `rules/sql.md`, `rules/workspace.md`, `rules/tests.md`); read the ones your task touches **before** writing that part, and only those. If the Ballerina language server (LSP) is available, use it while writing — `hover` to confirm a symbol's type/signature, `goToDefinition`/`goToImplementation` to inspect an API's real shape, `documentSymbol`/`workspaceSymbol` to locate declarations. It provides navigation/intelligence; `bal build` in Step 4 is the error check. Key rules:
- Use records for all data — never `json` or `map<json>` directly
- Descriptive identifiers — no single letters or bare abbreviations; two-word camelCase is the norm
- Named arguments for every function/method call

**Step 4 — Validate**: Run `bal build`. Fix every error before moving on. Repeat until clean. If an error is about a library's own API (wrong method, listener, or service signature), re-consult the `library` agent's API summary — or ask it for the specific detail you're missing — rather than re-guessing.

For langlib API quick reference: [langlib-reference.md](langlib-reference.md)

## Running and Testing

- Test request → `bal test`; otherwise → `bal run`
- Always run `bal build` first — if errors, stop and report each one with file and line number
- A service started with `bal run` does not exit on its own — stop it when done
- On test: fix failures and re-run until clean

When the program needs a broker, database, or other server, see [rules/integration-testing.md](rules/integration-testing.md) before calling the work done.

## Ballerina Not Installed

If a `bal` command fails because Ballerina is not installed, read [setup.md](setup.md) for installation instructions.

## Errors and Unexpected Behavior

When `bal build` reports an error, a program panics at runtime, or behavior is unexpected, read [troubleshooting/index.md](troubleshooting/index.md) to find the matching topic file. **Do not preload every troubleshooting file** — the index is a router that points to the one relevant file for the symptom.
Files in this package (24)
  • SKILL.md 5 KB
  • code-rules.md 7 KB
  • langlib-reference.md 5 KB
  • setup.md 2 KB
  • rules/http.md 2 KB
  • rules/integration-testing.md 2 KB
  • rules/messaging.md 5 KB
  • rules/sql.md 3 KB
  • rules/tests.md 1 KB
  • rules/workspace.md 1 KB
  • troubleshooting/auth.md 6 KB
  • troubleshooting/compiler.md 8 KB
  • troubleshooting/data-binding.md 4 KB
  • troubleshooting/deployment.md 8 KB
  • troubleshooting/graphql.md 7 KB
  • troubleshooting/grpc-websocket.md 3 KB
  • troubleshooting/http.md 11 KB
  • troubleshooting/index.md 6 KB
  • troubleshooting/messaging.md 12 KB
  • troubleshooting/packages.md 5 KB
  • troubleshooting/performance.md 11 KB
  • troubleshooting/runtime.md 11 KB
  • troubleshooting/sql.md 10 KB
  • troubleshooting/tooling.md 12 KB

Versions

The database has no other skills named ballerina.

Database snapshot: 13.11.2026 · package version db7c7b45959d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90integrator
    Entry point for WSO2 Integrator work. Use only when the user names WSO2 Integrator — to add an integration, automation, service, or library integration to their project, or to change one. Applies WSO2 Integrator conventions and hands the code work to the Ballerina skill, or…
  • 100making-graalvm-compatible
    Makes 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…
  • 100generating-connectors
    Generates 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…
  • 100mirth-to-ballerina
    Migrates a Mirth Connect channel XML to a compilable Ballerina project built on ballerina/workflow (Temporal-backed durable orchestration), not xlibb/pipeline. Each destination connector becomes a separate, individually durable @workflow:Activity invoked via ctx->callActivity,…
  • 95shopify-admin
    Write or explain **Admin GraphQL** queries and mutations for apps and integrations that extend the Shopify admin. Use when the user wants to **understand, design, or generate** the operation itself—even before deciding how to run it. Do **not** choose `admin` first for **app or…
  • 100bal-devnet-ab-test
    A/B test erigon's BAL parallel-execution scheduling on any BAL devnet (bal-devnet-N). Uses launch-devnet to bring up the primary instance, then spins up a second instance with IGNORE_BAL=true on a different port offset so throughput can be compared head-to-head. Use this when…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.