kongctl declarative workflows
Goal
Author, update, review, and execute kongctl declarative configuration for
Konnect without drifting into read-only query work or a different declarative
toolchain.
Tool Positioning
- Use this skill when the repository already manages Konnect resources through
kongctl YAML, _defaults.kongctl, or kongctl plan/apply workflows, or
when the user explicitly asks for kongctl.
- Use the shared
kong-konnect MCP server first when the task depends on live
Konnect state and MCP is available.
- Use
kongctl-query for read-only inspection, exact get syntax, output
shaping, or CLI-shaped proof that should not mutate state.
- Preserve the repository's existing declarative toolchain. Do not convert
decK or Terraform repositories to kongctl unless the user explicitly asks.
- Choose execution style from user intent:
- User-run mode: explain the path and give commands.
- Agent-run mode: execute the commands and report results.
References To Load
Load only the branch that matches the task:
references/commands.md
- Load for command selection, saved-plan versus inline execution, adopt/dump
command shape, output mode behavior, and guardrail flags.
references/resources.md
- Load for ownership layout,
_defaults, parent versus child metadata,
!file, !ref, and schema discovery.
references/apiops-openapi.md
- Load when the task generates or updates
apis resources from OpenAPI.
references/cicd-github-actions.md
- Load for GitHub Actions validation or deployment workflows.
references/troubleshooting.md
- Load when preview or execution fails, or when drift and namespace behavior
are unclear.
This skill must stay portable across repositories. Do not assume the upstream
kongctl repo layout or a local docs/ tree.
Validation Contract
Preflight
Before editing manifests or proposing execution:
- Confirm the repository already owns the target Konnect slice through
kongctl rather than decK or Terraform.
- Confirm the CLI is available and authentication works with a small read
command such as
kongctl get organization -o json.
- Confirm namespace, profile, file scope, and whether
!file usage will
require --base-dir.
- If exact syntax is uncertain, check local help instead of guessing.
Preview
Use the smallest preview surface that matches intent:
- review or CI path: generate a saved plan or a scoped diff artifact
- immediate execution path: run a scoped
diff or inline --dry-run
- inspect unexpected deletes, wrong namespace ownership, unresolved
!ref
values, and !file boundary issues before mutation
Execute
- Mutate live state only when the user explicitly asked for it.
- State the intended effect in plain language before any mutating command.
- Keep execution aligned with the previewed path instead of switching tools or
widening scope mid-task.
Prove
After a requested mutation:
- rerun the matching preview path and expect no remaining intended drift
- confirm the exact namespace and resource slice now reflect the intended state
- for adopt or dump workflows, prove the integrated declarative config is clean
instead of stopping at a successful command
Operating Rules
- If live Konnect state matters and MCP is unavailable, say so early and
continue with
kongctl-based inspection as the fallback.
- Prefer explicit namespace, profile, and output flags when environment or
profile defaults could obscure behavior.
- Treat
sync and delete as destructive. Preview them first unless the user
explicitly asks for direct execution.
- Use
adopt only for existing unmanaged parent resources. adopt labels the
resource for namespace ownership; it does not rewrite the resource fields.
- Keep OpenAPI files in their existing repository locations. Prefer
!file
extraction and !ref links over copied literals or hard-coded UUIDs.
- Do not place non-resource YAML inside a
--recursive declarative tree. If a
directory mixes resource YAML with specs or docs, target specific files
instead of the whole tree.
- When scope is unclear, inspect existing manifests or live state. Do not
invent a default starter bundle of Konnect resources.
- If a required
kongctl command appears blocked by the agent sandbox rather
than by Konnect or the CLI, request an unsandboxed retry before diagnosing
the command itself as broken.
Workflow
- Identify the owned declarative root and target file scope.
If the path is not provided, search for existing
_defaults.kongctl,
apis, portals, control_planes, or related kongctl resource keys
instead of assuming konnect/resources/.
- Classify the branch before editing:
- general manifest authoring or repair: load
references/resources.md
- OpenAPI-driven API modeling: also load
references/apiops-openapi.md
- adopt or dump integration: also load
references/commands.md
- CI/CD workflow work: also load
references/cicd-github-actions.md
- Update manifests in place, preserving the repository's file layout,
ownership boundaries, and existing reference patterns.
- Run the validation gates in order: Preflight, Preview, Execute if requested,
then Prove.
- Report the files changed, the exact command path used, and the proof of the
resulting state or remaining drift.
Validation Checklist
Before answering, verify that you can state:
- why
kongctl is the correct implementation owner for this request
- which namespace, profile, and file scope the change owns
- which preview path proves the change safely
- whether the user asked only for authoring or for live mutation
- how post-change proof will confirm the exact resource slice
- whether
kongctl-query should provide read-only follow-up proof
Handoffs
- Hand off to
kongctl-query when the real task is read-only inspection, auth
checking, exact get syntax, or output formatting.
- Hand off to
deck-gateway, terraform-konnect, or
terraform-kong-gateway when the repository already uses those tools for the
target resources.
- Hand off to the relevant Konnect domain skill, or to
konnect-platform-router when the workflow owner is unclear, if the user
first needs diagnosis or classification rather than declarative
implementation.
1---2name: kongctl-declarative3description: Use for `kongctl`-managed Konnect declarative repos: author YAML, model APIs from OpenAPI, and run plan/diff/apply/sync/delete/adopt workflows or CI/CD. Do not use for read-only inspection, exact `get` syntax, or non-`kongctl` toolchains.4license: MIT5---67# kongctl declarative workflows89## Goal1011Author, update, review, and execute `kongctl` declarative configuration for12Konnect without drifting into read-only query work or a different declarative13toolchain.1415## Tool Positioning1617- Use this skill when the repository already manages Konnect resources through18 `kongctl` YAML, `_defaults.kongctl`, or `kongctl` plan/apply workflows, or19 when the user explicitly asks for `kongctl`.20- Use the shared `kong-konnect` MCP server first when the task depends on live21 Konnect state and MCP is available.22- Use `kongctl-query` for read-only inspection, exact `get` syntax, output23 shaping, or CLI-shaped proof that should not mutate state.24- Preserve the repository's existing declarative toolchain. Do not convert25 `decK` or Terraform repositories to `kongctl` unless the user explicitly asks.26- Choose execution style from user intent:27 - User-run mode: explain the path and give commands.28 - Agent-run mode: execute the commands and report results.2930## References To Load3132Load only the branch that matches the task:3334- `references/commands.md`35 - Load for command selection, saved-plan versus inline execution, adopt/dump36 command shape, output mode behavior, and guardrail flags.37- `references/resources.md`38 - Load for ownership layout, `_defaults`, parent versus child metadata,39 `!file`, `!ref`, and schema discovery.40- `references/apiops-openapi.md`41 - Load when the task generates or updates `apis` resources from OpenAPI.42- `references/cicd-github-actions.md`43 - Load for GitHub Actions validation or deployment workflows.44- `references/troubleshooting.md`45 - Load when preview or execution fails, or when drift and namespace behavior46 are unclear.4748This skill must stay portable across repositories. Do not assume the upstream49`kongctl` repo layout or a local `docs/` tree.5051## Validation Contract5253### Preflight5455Before editing manifests or proposing execution:5657- Confirm the repository already owns the target Konnect slice through58 `kongctl` rather than `decK` or Terraform.59- Confirm the CLI is available and authentication works with a small read60 command such as `kongctl get organization -o json`.61- Confirm namespace, profile, file scope, and whether `!file` usage will62 require `--base-dir`.63- If exact syntax is uncertain, check local help instead of guessing.6465### Preview6667Use the smallest preview surface that matches intent:6869- review or CI path: generate a saved plan or a scoped diff artifact70- immediate execution path: run a scoped `diff` or inline `--dry-run`71- inspect unexpected deletes, wrong namespace ownership, unresolved `!ref`72 values, and `!file` boundary issues before mutation7374### Execute7576- Mutate live state only when the user explicitly asked for it.77- State the intended effect in plain language before any mutating command.78- Keep execution aligned with the previewed path instead of switching tools or79 widening scope mid-task.8081### Prove8283After a requested mutation:8485- rerun the matching preview path and expect no remaining intended drift86- confirm the exact namespace and resource slice now reflect the intended state87- for adopt or dump workflows, prove the integrated declarative config is clean88 instead of stopping at a successful command8990## Operating Rules9192- If live Konnect state matters and MCP is unavailable, say so early and93 continue with `kongctl`-based inspection as the fallback.94- Prefer explicit namespace, profile, and output flags when environment or95 profile defaults could obscure behavior.96- Treat `sync` and `delete` as destructive. Preview them first unless the user97 explicitly asks for direct execution.98- Use `adopt` only for existing unmanaged parent resources. `adopt` labels the99 resource for namespace ownership; it does not rewrite the resource fields.100- Keep OpenAPI files in their existing repository locations. Prefer `!file`101 extraction and `!ref` links over copied literals or hard-coded UUIDs.102- Do not place non-resource YAML inside a `--recursive` declarative tree. If a103 directory mixes resource YAML with specs or docs, target specific files104 instead of the whole tree.105- When scope is unclear, inspect existing manifests or live state. Do not106 invent a default starter bundle of Konnect resources.107- If a required `kongctl` command appears blocked by the agent sandbox rather108 than by Konnect or the CLI, request an unsandboxed retry before diagnosing109 the command itself as broken.110111## Workflow1121131. Identify the owned declarative root and target file scope.114 If the path is not provided, search for existing `_defaults.kongctl`,115 `apis`, `portals`, `control_planes`, or related `kongctl` resource keys116 instead of assuming `konnect/resources/`.1172. Classify the branch before editing:118 - general manifest authoring or repair: load `references/resources.md`119 - OpenAPI-driven API modeling: also load `references/apiops-openapi.md`120 - adopt or dump integration: also load `references/commands.md`121 - CI/CD workflow work: also load `references/cicd-github-actions.md`1223. Update manifests in place, preserving the repository's file layout,123 ownership boundaries, and existing reference patterns.1244. Run the validation gates in order: Preflight, Preview, Execute if requested,125 then Prove.1265. Report the files changed, the exact command path used, and the proof of the127 resulting state or remaining drift.128129## Validation Checklist130131Before answering, verify that you can state:132133- why `kongctl` is the correct implementation owner for this request134- which namespace, profile, and file scope the change owns135- which preview path proves the change safely136- whether the user asked only for authoring or for live mutation137- how post-change proof will confirm the exact resource slice138- whether `kongctl-query` should provide read-only follow-up proof139140## Handoffs141142- Hand off to `kongctl-query` when the real task is read-only inspection, auth143 checking, exact `get` syntax, or output formatting.144- Hand off to `deck-gateway`, `terraform-konnect`, or145 `terraform-kong-gateway` when the repository already uses those tools for the146 target resources.147- Hand off to the relevant Konnect domain skill, or to148 `konnect-platform-router` when the workflow owner is unclear, if the user149 first needs diagnosis or classification rather than declarative150 implementation.