/kbagent:kbagent-promotion-pipelinefrom kbagent
Generates a GitHub Actions pipeline that promotes Keboola configurations from a source project (e.g. dev) to a destination project (e.g. prod) using kbagent sync, with PR-based review gates and cross-project diff validation.
Ships in kbagent. 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.
Generates a from-scratch GitHub Actions setup (not a migration -- see
kbagent-cicd-migration for porting an
existing kbc repo) that promotes Keboola configuration changes from a named
source project to a named destination project, with a human-reviewed
PR gate in between.
kbagent's sync targets one registered project alias per invocation
(--project ALIAS) -- it has no "this git branch is bound to that project"
magic the way some kbc-era setups do. This skill builds the promotion loop
directly out of that primitive, using one shared directory per pipeline and
two Storage API tokens (source, destination):
kbagent-promote-pull.yml, manual + optional schedule) runs
sync pull --project __env__ --directory <scratch-dir> --force against
the source project's token into a throwaway scratch directory, merges
its content (everything except .keboola/manifest.json) into the
tracked <dir>, then opens (or updates) one PR against main with
the combined diff via
peter-evans/create-pull-request
(using a PAT, not the default token -- see
references/secrets-setup.md).kbagent-promote-validate.yml, on the PR) runs
sync push --dry-run --force --project __env__ --directory <dir> against the
destination project's token, once per configured pipeline (the
paths: trigger only gates whether the workflow runs at all, not which
pipeline steps execute inside it -- every pipeline's dry-run always runs)
-- this is the cross-project diff: if this PR merges, here is exactly what
changes in the destination project. Read this before approving.kbagent-promote-push.yml, on push to main) runs, in a
separate job per pipeline, `sync push --force --project env --directory
` against the **destination** project's token, each job gated by the
`prod` GitHub Environment (add required reviewers there -- every job run
gets its own separate approval, so approving one pipeline never approves
another).
Both steps pass --force, so a config deleted in the source is deleted in
the destination too. Without it sync push deletes nothing (since 0.96.1,
#792); a pipeline generated before that relied on push deleting without
--force, so regenerate it or add --force to both steps by hand.
main therefore always represents "the last thing approved and pushed to
every destination project" -- the reviewable source of truth the whole repo
is built around. A promotion is: pull opens a PR -> validate shows the
destination-side diff -> a human approves and merges -> push ships it.
Why pull goes through a scratch directory instead of pulling <dir>
directly: <dir>'s .keboola/manifest.json is bootstrapped once from the
destination project (Step 4) and must stay bound to the destination's
config IDs forever after -- that ID mapping is what lets sync push
recognize "this is config X I already created" instead of creating a
duplicate every time. Pulling straight into <dir> with the source
token would overwrite that manifest with the source project's IDs, and the
next push would then fail to match anything in the destination and create
duplicates on every single promotion cycle. Pulling into a scratch
directory and merging only the content keeps the destination's ID mapping
stable while still picking up the source's changes.
Every step uses KBAGENT_PROJECT_FROM_ENV=1 + the reserved --project __env__
alias (kbagent's headless/CI auth model) -- no token is ever written to
config.json or committed to the repo. See
references/env-injection.md if you need the
background on why this exists.
A single repo can host several unrelated promotion pipelines (e.g. one per
data source, or one per business unit) -- each is a
{name, directory, source_stack_url, dest_stack_url} tuple, all generated
into the same three workflow files as extra per-pipeline steps. Use --config pipelines.json (a JSON list of these tuples) for more than one; the
single-pipeline CLI flags (--name/--directory/--source-stack-url/
--dest-stack-url) are a shortcut for exactly one.
Same discipline as every other skill that touches a customer's live Keboola projects and their CI/CD: stop and ask before you:
--write (Step 3) -- show the dry-run inventory first.main from it.For each pipeline: a name, the directory to sync, and the source + destination projects' stack URLs (usually the same stack, different project ids -- the project id itself comes from the token, not a CLI flag). Ask for a config file up front if there's more than one pipeline; it's much easier to review as a single JSON list than to re-run the generator repeatedly.
Same guidance as the migration skill: --version X.Y.Z (PyPI) pinned for a
prod lane, unpinned only for a scratch/experiment repo.
# Inspect what would be generated:
python <skill_dir>/scripts/generate_promotion_pipeline.py /path/to/repo \
--name SALESFORCE --directory salesforce \
--source-stack-url connection.keboola.com \
--dest-stack-url connection.keboola.com
# Then, once reviewed, write the files:
python <skill_dir>/scripts/generate_promotion_pipeline.py /path/to/repo --write \
--config pipelines.json --version X.Y.Z --schedule "0 6 * * 1"
Produces .github/workflows/kbagent-promote-{pull,validate,push}.yml and
prints the exact gh secret set / gh api commands for Step 5.
main from the destination project (one-time, per pipeline)main should start out representing what's already live in the
destination project, not an empty tree -- otherwise the first promotion PR
would show every single config as "new," which is both wrong and a scary
first review. Locally, with the destination project's token:
export KBAGENT_PROJECT_FROM_ENV=1 KBC_TOKEN=<dest-token> KBC_STORAGE_API_URL=<dest-stack-url>
kbagent sync pull --project __env__ --directory <dir>
git add <dir> && git commit -m "Bootstrap <dir> from destination project" && git push
(sync pull auto-initializes when no manifest exists yet -- no separate
sync init needed.) Do this directly on main, not through a PR -- there
is nothing to review yet, it's just establishing the starting baseline. This
step is what binds <dir>'s manifest to the destination project's config
IDs -- see "Why pull goes through a scratch directory" above for why that
binding must never be overwritten by a later source pull.
prod environmentTwo Storage API token secrets per pipeline (KBC_TOKEN_<NAME>_SOURCE,
KBC_TOKEN_<NAME>_DEST), one repo-wide PROMOTION_PR_TOKEN (a PAT --
the default GITHUB_TOKEN cannot open a PR that triggers validate), and
the prod GitHub Environment with required reviewers -- the generator
prints the exact gh commands. See
references/secrets-setup.md.
kbagent-promote-pull.yml (workflow_dispatch, or wait for the
schedule) -- it opens/updates the promote/update PR against main.kbagent-promote-validate.yml check's dry-run output on that
PR -- confirm it matches what you expect to land in each destination
project.kbagent-promote-push.yml fires; each pipeline is its own
job, each waiting for its own prod environment approval, then pushing
to that pipeline's destination project.--allow-plaintext-on-encrypt-failure to the push workflow --
it silently uploads #-secrets in cleartext if the Encryption API is down.#-secret values through sync pull/sync push across
projects -- source-encrypted ciphertext cannot be decrypted by the
destination project. Set destination secrets independently, directly on
the destination project. See
references/secrets-setup.md.prod environment's required-reviewer gate applies to push-triggered
jobs too, not just workflow_dispatch -- confirm the reviewers are actually
configured, since a repo without them makes the "gate" a no-op. Each
pipeline gets its own job/approval (see secrets-setup.md), but every job
still needs those reviewers configured to mean anything.validate on main's branch
protection -- without it, a PR can merge even if validate never ran or
failed, silently degrading "PR-gated" to "PR-gated only if someone
happened to wait for the check."branch: promote/update).
If pipelines are unrelated and reviewed by different people, consider
splitting them into separate repos or separate pull workflows instead of
forcing one combined review. (Push is already split per-pipeline; only
pull's PR is still combined.)peter-evans/create-pull-request is a third-party action -- pin it to a
full commit SHA (not just @v7) for a security-sensitive prod pipeline,
and mention this to the customer rather than silently leaving the tag pin.PROMOTION_PR_TOKEN PAT, not the default GITHUB_TOKEN --
otherwise the validate check never triggers on the PR it opens. See
references/secrets-setup.md.gh commands.KBAGENT_PROJECT_FROM_ENV/__env__ exists and how it differs from a registered project add.scripts/generate_promotion_pipeline.py -- the generator (stdlib only).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
3 skills in this plugin
/kbagentUse for Keboola projects via the kbagent CLI. Covers: searching configurations, job history, data lineage, dev branches, merge requests, workspace SQL debugging, GitOps sync, bucket sharing/linking, encrypting secrets, Storage tables/files/snapshots, large (200 GB) file uploads, data apps, flows/schedules, invitations, feature flags, OTLP data streams, scoped Storage tokens, semantic layer, Developer Portal, first-time setup and logout. Triggers: kbagent, Keboola, keboola config, keboola job, keboola lineage, keboola sync, gitops, dev branch, merge request, data app, python-js app, semantic layer, sl, dev-portal, data stream, OTLP, scoped token, encrypt secrets, feature flag, flow schedule, invite member, SQL transformation edit, sync action, keboola docs, table snapshot, auth, login, sign in, PAYG credits, flow notifications, alert recipients, config trash, restore config, zero-copy clone, workspace load type, multipart, import job, job-detail, upload-table no-wait, set up keboola, connect project, logout.
/kbagent-cicd-migrationUse when migrating an existing kbc (keboola-as-code) GitHub CI/CD pipeline to the new kbagent (keboola-cli) sync engine. Covers: converting per-project pull/push PR workflows, multi-project repos (e.g. L0/L1 dev->prod promotion), branch->environment mapping, GitHub secrets/variables/environments setup, the install step (uv tool install instead of downloading a Go binary), and the kbc->kbagent command/flag/env-var mapping. Triggers: migrate CI/CD, migrate pipeline, kbc to kbagent, port GitHub Actions, CLI-based-sync-demo, kbc pull push CI, project-as-code CI migration, replace kbc binary in CI, gitops migration, multi-project promotion, dev to prod Keboola, KBC_STORAGE_API_TOKEN to KBC_TOKEN, sync push CI, sync pull CI.
npx claudepluginhub keboola/cli --plugin kbagentOther plugins' skills for the same job