/pq-connectors:write-connectorfrom pq-connectors
Write, extend, or review a Power Query (M) custom connector to production and publishing grade, using Microsoft's Power Query SDK guidance and evidence from the certified connectors in this repository. Use this skill when the user wants to build a new Power BI / Excel / Fabric connector for an API or database, add authentication, paging, navigation, schema, error handling, TestConnection, folding, or documentation to one, or check a connector before signing and shipping it.
Ships in pq-connectors. 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.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub back1ply/power-bi-custom-connectors-source-code --plugin pq-connectorsBuild the connector in Microsoft's TripPin order: each step adds one capability on top
of a connector that already works. Recommend what Microsoft's SDK guidance says; use
the certified connectors in connectors/ as worked examples of it, never as the
authority. Certified connectors ship mistakes too (pitfalls).
Sources for every step, live Learn pages and the archived certification rules, are in references/sources.md. The bar a finished connector must meet is in references/quality-bar.md.
knowledge/checklist.yaml names every design decision a connector makes (one
question per SDK topic) and defines each answer id, citing the Learn page it follows.
Use its ids when you plan, and record your choice for each question as you go: the
finished set of answers is the connector's design record.
To find real implementations of an answer, open bundle/techniques/<question>.md
(every archived connector grouped by its answer, with the cited line), read the
matching bundle/patterns/<id>.md, and search the source:
rg -n "Table.GenerateByPage" connectors --glob "*.{pq,pqm,m}"
knowledge/profiles/<Name>.json holds model-generated answers for each archived
connector with cited lines (about 95% exact against hand labels); evals/gold/ holds
hand-checked ones. Verify a cited line before you copy from it.
Finish each step's check before starting the next.
unknown with what would settle it.[Version = "1.0.0"] header, one shared
data source function named <Kind>.<Verb> (Contents, Tables, Databases...),
a data source kind record, and a Publish record with Beta = true. Check:
uv run pqkb functions --path <folder> lists the shared function.CredentialQueryString when a GET is
unavoidable). OAuth: pass state through StartLogin, use PKCE when the provider
supports it, implement Refresh, and keep client secrets out of the package. Check:
sign-in works in Power BI Desktop and a token refresh succeeds.options record. Check: two different sources get separate credentials.Table.ToNavigationTable) whose rows
are listed from the source where possible; keep Data lazy. Check: opening the
navigator does not fetch table data.Table.GenerateByPage with an explicit stop rule from the API
(next link, cursor, or total), copying
references/Table.GenerateByPage.pqm: Microsoft's
sample version turns empty pages into null rows
(pitfalls). Every page, empty ones included, must carry
the entity's declared table type. Build every request as
Web.Contents(baseUrl, [RelativePath = ..., Query = [...]]): the base URL stays
static, which the service needs in order to validate it for refresh. Check: an empty
endpoint returns zero rows, and an empty first page with a next cursor, an empty
middle page, the last page, and a single page all return the right rows; and
Table.FirstN(table, 1) requests only the first page, so a preview does not
download the whole table.Table.ChangeType or
Value.ReplaceType) so empty and sparse pages keep their columns. Check: an empty
result has the declared columns and types.ManualStatusHandling only for statuses you then read;
raise Error.Record with the API's message; retry transient statuses (429, 503)
with Value.WaitFor or Function.InvokeAfter and a retry limit, passing
IsRetry = true on retries so the engine's cache does not return the failed
response. Check: a forced 401, 404, and 429 each produce the intended result.EnableTraceOutput = false before
release); never trace credentials or row data. Check: no Diagnostics.Trace call
runs with the switch off.TestConnection to the kind record, calling the shared
function with the path's values (or a cheap probe). Check: credentials save in the
Power BI service through the gateway.OData.Feed; databases through Odbc.DataSource (or ADBC, Microsoft's newer path);
REST sources through Table.View handlers. Check: a filter or top-N step shows up in
the request, not only in the local result.Documentation.*,
FieldCaption, FieldDescription, SampleValues), strings in resources.resx,
icons in four sizes each. Check: uv run pqkb certification --path <folder> reports
no fail, and every review item has a written answer..mez and give users the thumbprint, or document the security
setting; follow the quality bar for versioning and
updates. Check: the signed package loads in Power BI Desktop at the default
security level, and a scheduled refresh succeeds in the service.Use the Power Query SDK for VS Code: evaluate queries in the SDK, then the SDK test
framework and PQTest (links in sources) for repeatable
tests, including the failure cases each step's check names.
PQTest run-test --httpMock <file> answers Web.Contents calls from a text file of
request/response pairs, so each step's check runs on the real engine with no live
service: empty pages, 401, 404, 429 with Retry-After, 503. Four behaviours of the
mock (SdkTools 2.160.2):
cursor=) before the bare one.test-connection takes no mock; use run-test for everything that needs one.Store the key with set-credential -cfp <file> so tests never touch your own
credentials. evals/authoring/runtime.py is a worked example of all of this.
7 skills in this plugin
/find-connector-codeFind how Microsoft's certified Power Query (M) connectors implement something, using this repository's connector source archive and its OKF bundle. Use this skill when the user asks how real Power BI or Excel connectors do authentication (OAuth, PKCE, keys), paging, navigation tables, query folding (Table.View, ODBC, native queries), retries, error handling, schemas, or packaging; asks for an example connector to copy from; or wants M code that a certified connector uses. Read-only./okf-consumeAnswer questions from an Open Knowledge Format (OKF) bundle, a directory of Markdown files with YAML frontmatter, and report the provenance, trust tier, freshness, and attestation status of every concept used. Use this skill when the user points at an OKF bundle or at a directory of Markdown files with index.md files and frontmatter type fields; asks what a metric, table, policy, or procedure means according to that bundle; asks for a number that the bundle defines with an Attested Computation; or asks which concepts are stale, deprecated, or unverified./okf-generateCreate, update, migrate, repair, or validate an Open Knowledge Format (OKF) v0.3 bundle, including recording a verification. An OKF bundle is a directory of Markdown files with YAML frontmatter that documents data assets, metrics, policies, and procedures for people and agents. Use this skill when the user asks to write, generate, bootstrap, enrich, or migrate OKF documents or a knowledge bundle; to document tables, datasets, metrics, APIs, or playbooks in OKF; to add provenance, trust, lifecycle, or attested-computation fields; or to check a bundle for OKF conformance. Use this skill, not okf-consume, to repair a bundle or to record a verification./refresh-archiveRefresh this repository's archive of Microsoft's certified Power Query connectors and rebuild its OKF bundle, then read the refresh report and handle failures. Use this skill when asked to update the connector archive, run or debug the weekly refresh workflow, fix a failing refresh pull request, rebuild bundle/, or re-sync the vendored OKF skills./review-patternRenew the source review of a pattern page in this repository after the connector code it quotes has changed, by checking every claim against the current source, repairing excerpts and line references, and recording the review honestly. Use this skill when a pattern page shows "Changed since review", when `pqkb verify-reviews` lists drifted pages, or when asked to update or re-review knowledge/patterns/*.md./run-candidate-reviewsRun, retry, and check the LLM candidate reviews that confirm or reject this repository's static pattern matches per connector (stored in knowledge/match-reviews.json). Use this skill when asked to review pattern candidates, refresh "Unreviewed match" or "older review" labels on connector pages, run `pqkb review-matches`, or investigate candidate review failures.Other plugins' skills for the same job