Skip to content
Back to skills

Sdk Config

ASecurity

Use when writing, reviewing, or refactoring code that checks an environment variable before calling an SDK — `if (process.env.X)`, `os.environ.get`, `os.Getenv` around analytics, auth tokens, OIDC, cloud clients, or API clients — or when a call is skipped because a key "might be missing". Checks whether the SDK already reads and validates its own credentials; drops the duplicate guard where it does, and keeps or adds one where it does not.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 5, 2026
ai-agentspythongorefactoringapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add tartinerlabs/skills --skill sdk-config --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sdk Config?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sdk Config
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tartinerlabs-sdk-config/badge)](https://www.skillsdirectory.com/skills/tartinerlabs-sdk-config)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sdk-config
description: Use when writing, reviewing, or refactoring code that checks an environment variable before calling an SDK — `if (process.env.X)`, `os.environ.get`, `os.Getenv` around analytics, auth tokens, OIDC, cloud clients, or API clients — or when a call is skipped because a key "might be missing". Checks whether the SDK already reads and validates its own credentials; drops the duplicate guard where it does, and keeps or adds one where it does not.
license: MIT
allowed-tools: Read Glob Grep Edit
compatibility: Any language whose SDKs read credentials from the environment; JS/TS first-class, Python and Go via references/
metadata:
  short-description: Drop env checks the SDK already does.
  title: Let SDKs check their own settings
  goal: keep-code-tidy
  audience: developers
---

You remove configuration logic that an SDK already owns. Most SDKs resolve their own credentials (environment variables, token files, profiles, instance roles) and fail fast or do nothing when there are none. A `process.env` check in front of the call copies part of that logic, goes stale when the SDK learns a new source, and hides the SDK's own error. Where the SDK does not check, a guard is the right call — so check first, then decide.

## 1. Pick the Mode

Decide from the request; do not ask.

- **Build mode** — the task adds or changes code that calls an SDK. Apply the rules while writing it, and mention one only when it changed a decision.
- **Review mode** — the user asks to review, audit, or tidy env checks, or points at one. Work through Step 4.

## 2. Detect the Ecosystem

Read the manifest as prose (`package.json`, `pyproject.toml`, `go.mod`, …) and use that ecosystem's SDKs and error types.

| Ecosystem | Detected by | Load |
|---|---|---|
| **JS/TS** | `package.json` | the rules below |
| **Python** | `pyproject.toml`, `requirements*.txt` | [references/python.md](references/python.md) |
| **Go** | `go.mod` | [references/go.md](references/go.md) |

For another language, apply the same rules with its SDKs' credential chains.

## 3. Check What the SDK Does

For each guard, find out what the SDK does when the value is missing. Read its docs, its types, or its source in the installed package, or call it once without the variable. Never decide from memory: SDKs change how they find credentials between versions.

| Without the value, the SDK… | Then |
|---|---|
| throws a clear, typed error quickly | drop the guard; catch the error once ([rules/sdk-owned-config.md](rules/sdk-owned-config.md), [rules/handle-once.md](rules/handle-once.md)) |
| does nothing, by design | drop the guard ([rules/sdk-owned-config.md](rules/sdk-owned-config.md)) |
| sends a request with `undefined`, fails late or obscurely, retries, or bills | keep the guard, or add one ([rules/keep-real-guards.md](rules/keep-real-guards.md)) |
| is not an SDK (a raw `fetch`, the app's own setting) | keep the guard ([rules/keep-real-guards.md](rules/keep-real-guards.md)) |

## Rules

| Rule | Impact | Applies to | File |
|---|---|---|---|
| Let the SDK own its config | HIGH | env checks in front of SDK calls | [rules/sdk-owned-config.md](rules/sdk-owned-config.md) |
| Handle the failure once | HIGH | the call site whose guard was removed | [rules/handle-once.md](rules/handle-once.md) |
| Keep the guards that matter | MEDIUM | raw requests, app settings, costly or noisy calls | [rules/keep-real-guards.md](rules/keep-real-guards.md) |

## 4. Review Mode

1. **Inventory** — every env check whose only job is to skip an SDK call, with the SDK and version it guards. Report the count before editing
2. **Check each SDK** — classify each guard with the table in Step 3, and cite where you saw the behaviour (doc page, file in the package, or a run)
3. **Fix** — remove the guards the SDK makes redundant and route the failure to one handler; keep the rest, with a short comment where the reason is not obvious
4. **Test** — run the project's build and tests, or ask the user to, and report real results

End with what was removed, what was kept and why, and any guard whose SDK behaviour you could not confirm.

## Boundaries

- **Validating config at startup** (a schema over the whole environment) is a separate choice; it is fine to keep, and these rules apply to the call sites behind it.
- **Secrets** found in code are reported, never printed; rotating them belongs to `security`.

Files in this skill

  • SKILL.md4.3 KB
  • references/go.md1 KB
  • references/python.md1.5 KB
  • rules/handle-once.md2 KB
  • rules/keep-real-guards.md2.5 KB
  • rules/sdk-owned-config.md2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.