Agent Skill · ConfigDirector

configdirector-validate-in-ci

Add configdirector validate to this repository's CI, so the build fails when the code reads a config key that does not exist, was renamed, or has the wrong type, with a CI-only API token the user creates and the agent never sees. On GitHub it adds the ConfigDirector Code Scan action, which also uploads where each config is read on pushes to the default branch. Use when the user asks to check config keys in CI, to add configdirector validate, the ConfigDirector CLI or the ConfigDirector GitHub Action to a pipeline, to upload code references from GitHub Actions, or to fail the build on wrong flag keys.

Provider: ConfigDirector Path in repo: configdirector-validate-in-ci/SKILL.md

Skill body

Check config keys in CI

Work through the steps in order. The result is a CI job that runs configdirector validate, which fails the build when the code reads a key no config in the project has, the old key of a renamed config, or a config in a way ConfigDirector does not serve it. On GitHub, unless the user asks for the npx command, the job runs the ConfigDirector Code Scan action, ConfigDirector/scan-code@v1, which can also upload the scan on pushes to the default branch.

The CI job needs an API token of its own, which the user creates for CI only in step 3. Its permissions are named there as the ConfigDirector dashboard shows them under API tokens. The commands you run yourself in steps 2 and 6 use the token already set where you run commands, which configdirector-connect sets up.

Both tokens are the user’s. Never ask for one, never read one from a file, and never write one anywhere, the workflow and configdirector.json included: CI reads its token from the secret CONFIGDIRECTOR_TOKEN. If the user pastes a token into the conversation, tell them it is now in the transcript, ask them to revoke it on the API tokens page and create another, and go on without it.

1. Read the CLI docs page

Fetch https://docs.configdirector.com/integrations/cli. It is the source for the install line, the configdirector.json fields, the GitHub Actions workflow and the action’s inputs, the GitLab job, the problems validate reports, and the exit codes. Copy them from the page, never from memory.

Run configdirector --version. When the CLI is not installed, write npx --yes @configdirector/cli in place of configdirector in every command below.

When configdirector.json already exists, at the repository root or in the app’s directory of a monorepo, read its project and go on to step 3. init only adds organization to an existing file, so edit the file when anything else needs to change.

Otherwise:

  1. Ask for the project’s slug, shown as Project slug on the project’s Project details page in the dashboard. When the ConfigDirector MCP server is connected, call list_projects and offer the slugs it returns.
  2. Run configdirector init --project <slug> from the repository root. It looks for the project through every organization the CLI is signed in to, and writes configdirector.json with the project’s slug and its organization’s id.
  3. Read the result:
    • Exit 0: the file is written. It is committed with the CI change, so every run and every CI job uses the same project.
    • Exit 2 with No API token found: no token is set where you run commands. Send the user to configdirector-connect for one with Projects: Read and Configs: Read, then run init again.
    • Exit 2 with both have a project with the slug: several organizations the CLI is signed in to have a project with that slug. Ask the user which organization, offering the names the message lists, and run configdirector init --project <slug> --organization <name>.
    • Exit 2 with No project has the slug or No project in the API token's organization has the slug: ask for the slug again, and whether the CLI is signed in to the organization that holds the project. When it is not, send the user to configdirector-connect.
    • Exit 2 with The Admin API refused the request: the token was rejected, or it lacks the permission the message names in its short form, such as projects:read. Tell the user which one in the dashboard’s wording, Projects: Read, and send them to configdirector-connect.
    • Exit 2 with any other message, such as a suspended service or an unreachable API: report the message, which says what to do, and stop.

3. The user creates the CI token

Find the CI system first: .github/workflows/ is GitHub Actions, .gitlab-ci.yml is GitLab. When the repository has both or neither, ask which one runs its checks.

On GitHub, unless the user asked for the npx command rather than the action, ask whether the action should also upload the scan on pushes to the default branch, which it does by default. The upload lets each config’s Code references tab in the dashboard show the code that reads it, and marks the configs no scanned repository reads outside tests as Not in code on the project’s configs list. When they want the upload, tell them it also sends a few lines of code around each reference, and that the page’s What leaves your repository lists everything it sends; ask whether to leave those lines out with snippets: false. The answers decide the token’s permissions here and the action’s inputs in step 4.

Tell the user to create a token used only by CI, in the dashboard under API tokens, and to save it as a secret named CONFIGDIRECTOR_TOKEN. The token needs Projects: Read and Configs: Read, and Code references: Update as well when the action uploads. With upload: false, on GitLab, on another CI system or with the npx command of step 4, the two read permissions are enough, and the token cannot change anything. The secret goes:

Tell them why a token used only by CI, rather than their own: it can be replaced or revoked without affecting anything else. Tell them too that a token belongs to the member who created it and stops working when that member leaves the organization; CI then fails with API_TOKEN_OWNER_REMOVED until another member creates a new one.

The user adds the secret themselves, now or before the first CI run. Go on with step 4.

4. Add the job

The check runs from the directory that holds configdirector.json; when that is not the repository root, set the action’s working-directory input to it, or the working directory of the step or job that runs the npx command. Copy the page’s versions as they stand, the actions, the Node version and @configdirector/cli, and pin nothing else.

5. Scope the check

init writes an include of every file. When the repository holds more than the app, such as other apps, documentation or vendored code, narrow the scan with include and exclude as the page’s field table describes.

When the user says the app also reads configs another ConfigDirector project serves, or names such a key among the findings of step 6, add those keys to ignoreKeys, so validate does not report them as unknown.

6. Run it once

Run configdirector validate from the directory that holds configdirector.json. This run uses the token where you run commands; CI uses its own. Report what it printed, and what the exit code means:

Tell the user the codes mean the same in CI. There, exit 2 is a missing CONFIGDIRECTOR_TOKEN secret (No API token found), a rejected token, a token of another organization than the one configdirector.json names, a missing permission or an outage, so a build that fails with 2 is never a wrong key: the token or the service needs looking at, not the code.

When the summary counts dynamic references, tell the user they are never checked, so a wrong key in one passes the build; configdirector-use-configs-in-code shows how to read a key so it is checked.

7. Hand over

In a few lines, tell the user:

Skill frontmatter

license: MIT metadata: {"author" => "ConfigDirector", "version" => "0.15.0"}

Work with this as data

Every skill here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for agent skills

4 MCP tools reach this
  • find_skillsBrowse and filter every skill in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This skill
curl "https://apis.io/api/v1/skills/configdirector-validate-in-ci"
All agent skills
curl "https://apis.io/api/v1/skills?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.