Skip to content

cloudthinker-ai/CloudSkills / skills/connections/managing-config-cat

managing-config-cat

Verified

Use when working with Config Cat — configCat feature flag management, remote configuration, A/B testing, targeting rules, and percentage-based rollouts. Covers flag listing, targeting rule management, environment overrides, audit log review, and SDK integration status. Use when managing feature flags, reviewing targeting rules, analyzing flag usage, or auditing configuration changes in ConfigCat.

ConfigCat Management Skill

Manage and analyze feature flags, configurations, targeting rules, and environments in ConfigCat.

API Conventions

Authentication

All API calls use Basic Auth with $CONFIGCAT_USERNAME:$CONFIGCAT_PASSWORD (Management API credentials). Never hardcode tokens.

Base URL

https://api.configcat.com/v1

Core Helper Function

#!/bin/bash

cc_api() {
    local method="$1"
    local endpoint="$2"
    local data="${3:-}"

    if [ -n "$data" ]; then
        curl -s -X "$method" \
            -u "${CONFIGCAT_USERNAME}:${CONFIGCAT_PASSWORD}" \
            -H "Content-Type: application/json" \
            "https://api.configcat.com/v1${endpoint}" \
            -d "$data"
    else
        curl -s -X "$method" \
            -u "${CONFIGCAT_USERNAME}:${CONFIGCAT_PASSWORD}" \
            -H "Content-Type: application/json" \
            "https://api.configcat.com/v1${endpoint}"
    fi
}

Output Rules

  • TOKEN EFFICIENCY: Extract only needed fields with jq
  • Target <=50 lines per script output
  • Never dump full API responses

Discovery Phase

List Products and Configs

#!/bin/bash
echo "=== Products ==="
cc_api GET "/products" \
    | jq -r '.[] | "\(.productId[0:12])\t\(.name)"' | column -t

echo ""
PRODUCT_ID="${1:?Product ID required}"
echo "=== Configs ==="
cc_api GET "/products/${PRODUCT_ID}/configs" \
    | jq -r '.[] | "\(.configId[0:12])\t\(.name)"' | column -t

echo ""
echo "=== Environments ==="
cc_api GET "/products/${PRODUCT_ID}/environments" \
    | jq -r '.[] | "\(.environmentId[0:12])\t\(.name)"' | column -t

List Feature Flags

#!/bin/bash
CONFIG_ID="${1:?Config ID required}"

echo "=== Feature Flags ==="
cc_api GET "/configs/${CONFIG_ID}/settings" \
    | jq -r '.[] | "\(.settingType)\t\(.key)\t\(.name[0:40])"' | column -t | head -25

Analysis Phase

Flag Values by Environment

#!/bin/bash
CONFIG_ID="${1:?Config ID required}"
ENVIRONMENT_ID="${2:?Environment ID required}"

echo "=== Flag Values ==="
cc_api GET "/configs/${CONFIG_ID}/environments/${ENVIRONMENT_ID}/values" \
    | jq -r '.[] | "\(.setting.key)\t\(.defaultValue.value)\t\(.rolloutRules | length) rules\t\(.percentageRules | length) %rules"' \
    | column -t | head -25

Audit Log

#!/bin/bash
PRODUCT_ID="${1:?Product ID required}"

echo "=== Recent Changes ==="
cc_api GET "/products/${PRODUCT_ID}/auditlogs?count=20" \
    | jq -r '.items[] | "\(.auditLogDateTime[0:16])\t\(.userName)\t\(.actionTarget)\t\(.details[0:40])"' \
    | column -t

echo ""
echo "=== Flag Change Summary ==="
cc_api GET "/products/${PRODUCT_ID}/auditlogs?count=50" \
    | jq -r '.items[] | .actionTarget' | sort | uniq -c | sort -rn | head -10

Output Format

  • Use tab-separated columns with column -t
  • Limit lists to 15-25 items
  • Show summaries before details

Anti-Hallucination Rules

  1. NEVER assume resource names — always discover via CLI/API in Phase 1 before referencing in Phase 2.
  2. NEVER fabricate metric names or dimensions — verify against the service documentation or --help output.
  3. NEVER mix CLI commands between service versions — confirm which version/API you are targeting.
  4. ALWAYS use the discovery → verify → analyze chain — every resource referenced must have been discovered first.
  5. ALWAYS handle empty results gracefully — an empty response is valid data, not an error to retry.

Counter-Rationalizations

ShortcutCounterWhy
"I'll skip discovery and check known resources"Always run Phase 1 discovery firstResource names change, new resources appear — assumed names cause errors
"The user only asked for a quick check"Follow the full discovery → analysis flowQuick checks miss critical issues; structured analysis catches silent failures
"Default configuration is probably fine"Audit configuration explicitlyDefaults often leave logging, security, and optimization features disabled
"Metrics aren't needed for this"Always check relevant metrics when availableAPI/CLI responses show current state; metrics reveal trends and intermittent issues
"I don't have access to that"Try the command and report the actual errorAssumed permission failures prevent useful investigation; actual errors are informative

Common Pitfalls

  • Basic Auth: Management API uses Basic Auth, not Bearer tokens
  • Setting types: boolean, string, int, double -- type determines value format
  • Targeting rules: Rules are evaluated top-to-bottom, first match wins
  • Percentage rollouts: Percentages must sum to 100 -- validation is client-side
  • Config vs environment: Flags are defined in configs, values are set per environment
  • Rate limits: 5 management API requests per second
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 467kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 467kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 467kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 193kUpdated Claude CodeCodexVerifiedInstall