Use when adding, changing, versioning, or reviewing connector operation contracts, their protobuf options, fixtures, generated code, or capability manifest in kei-connector-contracts.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Connector Operations?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/haikeilabs-connector-operations)
---
name: connector-operations
description: "Use when adding, changing, versioning, or reviewing connector operation contracts, their protobuf options, fixtures, generated code, or capability manifest in kei-connector-contracts."
---
# Connector operations
Answer directly from this skill. Do not require repository access to explain
these rules or ask the user to paste documentation.
- The bare operation id is the capability. A policy or grant for the GitHub
get issue operation names `github.issues.get` (as a target,
`capability:github.issues.get`). It is not `connector:github.issues.get`,
because `connector:<id>` names a connector, not an operation, and it is not
`issue.read`.
- The runner never sends a `connector:<op>` action. Authorize sends the
registered tool name with the tool call's `tool_args` and `tool_context`,
and kei-proxy derives the operation from the tool's plan. The credential
release names the bare operation id (`github.pulls.list`) as its
capability, with the same tool arguments.
- A write declares `result_required`, the response fields that prove it
happened. A 2xx response missing one fails with the `contract_violation`
error kind instead of succeeding (contracts v0.21.0 or later).
- To add an operation, declare request and response messages and operation
options, add synthetic request and response fixtures and unmarshal and
replay tests, then run `buf generate` to regenerate `gen/**` and the
connector and capability manifest.
- To rename an operation, add the new id, mark the old operation `deprecated`,
set `replaced_by`, and add an old-to-new capability mapping row without
widening grants. Keep the old id callable for at least two minor releases;
remove it only in a major release after no policy names it.
- Do not make connector libraries call `kei-proxy`. The harness uses
`agentware-sdk`'s `OperationRunner` to authorize with `kei-proxy`, release
credentials, and call the generated connector libraries.
- Writes require at least one scope; mark deletes and overwrites `destructive`.
- Fixtures include `null` where applicable, an extra provider field, and raw
JSON IDs above 2^53 as strings. Lenient unmarshal discards unknown fields;
strict unmarshal detects the extra field. Never include credential values in
a fixture; connection setup describes a `secret` without its value.
- For Linear GraphQL use a fixed reviewed `graphql_document` with typed
variables; set `cursor_field` and `next_cursor_field` for pagination, and
`json_name` when a provider key differs from the default.
## Identity and boundaries
An operation describes a provider call and is the capability policies grant.
Its unique, permanent id has the form `<connector>.<resource>.<verb>`, with
lowercase snake_case segments. Policies and grants name the bare id: for
example, the capability for reading a GitHub issue is `github.issues.get`
(target `capability:github.issues.get`), not `connector:github.issues.get`
and not `issue.read`. A trailing `.*` family wildcard (`github.*`,
`github.issues.*`) covers read operations only and never opens a write. The
semantic mapping is metadata for policy and audit, not a grant or a
replacement id. Never reuse an id for different behavior.
Keep contracts and connector libraries separate from the agent harness. Do
not add tool definitions to this repository or make connector libraries call
`kei-proxy`. Agentware's `agentware-sdk` `OperationRunner` imports the
generated connector libraries and calls `kei-proxy` to authorize operations
and release credentials; connector libraries never call `kei-proxy`. For one
call the runner renders the operation's `resource_template`, then:
1. Authorizes on the kei-proxy socket with the registered tool name, the
rendered resource, and the tool call's `tool_args` and `tool_context`
exactly as the model sent them. It sends no `connector:<op>` action:
kei-proxy derives the operation from the tool's registered plan.
2. On an explicit allow, releases the credential with the bare operation id
(`github.pulls.list`) as the capability, on the rendered resource, with
the same `tool_args`.
3. Calls the generated operation with the released token.
Anything other than an explicit allow denies before any provider request.
The tool must be registered as a `connector_binding` tool with a plan; see
`agentware-sdk`. Do not put
credential values, provider payloads, or customer content in contract metadata. Do not add
new entries to the frozen legacy provider, setup, access, or tool-definition
surfaces.
## Add an operation
1. Add `<Op>Request` and `<Op>Response` in
`proto/kei/connectors/<connector>/v1/<resource>.proto`. Set `json_name`
when a provider JSON key differs from protojson's lowerCamel default.
Declare the connector once in `connector.proto` with the `connector` file
option: `id`, default `base_url`, and `connections`.
2. Attach the `operation` message option to the request. Set unique `id`,
matching `connector`, `class` (read or write), `http_method`,
`path_template`, and `scopes`; writes require at least one scope. Mark
deletes and overwrites `destructive`. Set accepted `connections`,
`resource_template` with request-field variables, and `errors` mapping
provider `status` to `kind` and `retryable`. `method_name` defaults to the
request name without `Request`. `credential_placement` is compatibility
metadata; connection kind determines placement.
For a write, set `result_required` to the response paths that prove the
write happened, for example `result_required: ["id", "number"]` on
`github.issues.create`. Paths are dot paths in proto field names
(`issue.id`), and every path must hold. A path holds when its final field
is a bool `true`, a non-empty string, a non-zero plain numeric scalar, or a
set message. Optional numerics, enums, bytes, lists, and maps cannot prove
a write and are rejected at generation time. A write whose response
message has no fields is exempt, and so are SQL writes. A 2xx response
missing a declared path fails with `ERROR_KIND_CONTRACT_VIOLATION`
(`contract_violation`) in Go, TypeScript, Python, and Rust; it is never
mapped from a provider status. GraphQL operations check the unwrapped
payload.
3. Set `semantics` with `action`, `resource_type`, and `version`; bump the
version when that mapping changes. For pagination set `cursor_field` and
`next_cursor_field`; each call returns one page, and the caller loops until
the next cursor is empty. For Linear GraphQL use one reviewed fixed
`graphql_document` with typed request fields as variables, checked against
the pinned provider schema. `positional_helper` adds a positional helper
beside the message method.
4. Use the `param` field option for `in` (path, query, body, header), optional
wire `name`, and `multi_segment` only for path values containing slashes.
Segments are escaped separately and `.` and `..` rejected. By default,
template fields go in the path; other fields go in the query for GET and
in the body otherwise.
5. Add synthetic request and response JSON in
`fixtures/operations/<connector>/`. Include `null` where applicable, an
extra provider field, and for raw JSON values encode IDs above 2^53 as
strings (for example `"9007199254740993"`); encode exact decimals as
strings too. Never include credentials or customer data. Add or update
fixture unmarshal and replay coverage for the operation in each supported
language. Go conformance tests exercise lenient and strict unmarshal;
Python and Rust have fixture unmarshal tests; add TypeScript coverage too.
Runtime unmarshal discards unknown fields, while the strict drift check
detects them. The Cross-language parity CI gate exercises generated
operations across Go, Python, TypeScript, and Rust.
6. Update the connector page and any applicable legacy capability mapping.
Run `buf generate`: message plugins and `protoc-gen-kei-ops` regenerate
`gen/**`, and `protoc-gen-kei-manifest` regenerates the connector and
capability manifest using the legacy mapping file. Review and commit the
generated diff.
## GitHub operations
The GitHub connector's operation ids (contracts v0.21.1). Every id is the
capability a policy names.
| Area | Reads | Writes |
| --- | --- | --- |
| Repository | `github.repos.get` | |
| Contents | `github.repos.contents.get` (one file at `path`), `github.repos.contents.list` (one directory at `path`) | `github.contents.put` |
| Commits | `github.repos.commits.list`, `github.repos.commits.get` (by `ref`), `github.git.commits.get` (the git commit object by `commit_sha`) | `github.git.commits.create` |
| Git data | `github.git.refs.get` | `github.git.blobs.create`, `github.git.trees.create`, `github.git.refs.create`, `github.git.refs.update` |
| Issues | `github.issues.get`, `github.issues.list` | `github.issues.create`, `github.issues.update`, `github.issues.comments.create` |
| Pull requests | `github.pulls.get`, `github.pulls.list`, `github.pulls.reviews.list` | `github.pulls.create`, `github.pulls.update`, `github.pulls.reviews.create` |
| Actions and checks | `github.actions.runs.list`, `github.actions.workflows.runs.list` (the runs of one `workflow_id`), `github.actions.runs.attempts.get` (one `attempt_number` of a run), `github.actions.runs.jobs.list` (a run's jobs), `github.checks.runs.list` | |
`github.pulls.list` filters by `state` (`open`, `closed`, or `all`), `head`
(the head branch as `owner:branch`), and `base` (the base branch). To find
the pull request for a branch, list with `head` and `state`, then read the
head commit with `github.git.commits.get` or `github.repos.commits.get`.
## Connections
Each connection has stable `name`, `kind`, `auth_method`, `account_model`
(per-user or shared), optional `base_url` or `base_url_field`, `setup_fields`,
and `scopes`. Setup fields specify `name`, `type`, optional `pattern`, and
`secret`; describe secrets without values. `engine` restricts SQL DSNs and
`header_name` names the custom credential header. Kinds are HTTP bearer,
HTTP header, HTTP basic, SQL DSN, key-pair JWT, and token exchange. GitHub
operations can accept `user_oauth` and `pat`; Linear operations can accept
`user_oauth` and `api_key`.
## Version and deprecate
Make only additive changes within the current proto version; breaking message
changes require a new version. To rename, add the new id, mark the old
operation `deprecated`, set `replaced_by` to the new id, and add a capability
mapping row from old to new without widening grants. Keep the old id callable
for at least two minor releases; remove it only in a major release after the
catalog reports no policy still names it. Release language packages together:
follow `docs/releasing.md` for synchronized versions, checks, and tagging.
## Validation commands
In a `kei-connector-contracts` checkout run:
```sh
buf lint
buf breaking --against '.git#branch=main'
buf generate
go -C tools/protoc-gen-kei test ./...
go -C gen/go test ./...
PYTHONPATH=gen/python/src python -m pytest -q gen/python/tests
cargo test --manifest-path gen/rust/Cargo.toml
npm --prefix gen/ts test
npm --prefix gen/ts run build
```
Inspect the generated diff.
## Realistic usage boundaries
This skill covers authoring contracts, not provider account setup, policy
administration, or tool definitions. Use the provider connector skill for
usage and `agentware-sdk` for harness integration. The Cross-language parity
CI gate covers Go, Python, TypeScript, and Rust.
When you have a checkout, optionally check `kei-connector-contracts`
`docs/operations-authoring.md`, `docs/operation-contracts.md`,
`proto/kei/contracts/v1/options.proto`, the relevant connector page,
`docs/releasing.md`, and CI for current details; code and tests are authoritative.