Keep a service's configuration and its dependency graph under control. Covers configuration as environment rather than code, separating config from secrets, fail-fast validation of typed config at startup, feature flags and blast radius, environment parity and drift, plus dependency selection, semantic versioning, lockfiles, transitive bloat, automated updates, and internal shared libraries. Use when adding or changing a setting, wiring an environment, introducing a feature flag, adding or upgrading a library, or when the user says 'config', 'environment variable', 'feature flag', 'dependency', 'upgrade', 'lockfile', or 'shared library'. This skill governs what varies per deployment and what the service is built from — secret storage rules belong to secure-service.
Two quiet sources of production incidents share a chapter because they share a cause: things that
differ between environments, and things that change without anyone deciding.
A service that reads a setting halfway through a request and finds it missing has already accepted
traffic it cannot serve. A service that resolves a floating version range at build time is running
code nobody reviewed. Both are preventable at startup, by a build, or by a check — never by
vigilance.
Config Resolution
Read .msskills/config.yaml in the repo root; look up paths.config.
A custom document exists at that path → read its frontmatter mode:
override → use it alone; ignore the defaults below.
overlay (default, or no mode key) → read defaults first, then
apply the custom document's sections on top, matched by exact heading; new sections append.
A path is configured but no file exists there → say which path is missing, then use the defaults.
No config file or no paths.config key → use defaults.
.msskills/stack.md exists → use its package manager, lockfile format, configuration mechanism,
secret manager, and flag system.
Self-Validation Checklist
STOP after adding or changing a setting, a flag, or a dependency. Verify every check. Fix
failures before presenting.
VARIES PER DEPLOYMENT: Does this value actually differ between environments? If it is the
same everywhere → it is a constant; put it in code where it can be reviewed and typed.
NOT A SECRET: Is this a credential, key, or token? → secret manager, never config (see
secure-service).
VALIDATED AT STARTUP: Is the value parsed, typed, range-checked, and required at boot, so a
misconfigured instance fails to start rather than failing mid-request?
TYPED AT THE EDGE: Is it converted into a typed object once at the boundary, or read as a
raw string deep in business logic? Domain code must never read the environment.
NO ENVIRONMENT BRANCHING: Does any code test if (env == "production")? → express the
difference as a setting, not as a branch. Branches make production the least-tested path.
DOCUMENTED: Is every setting listed with its type, whether it is required, its default, and
what it affects? An undocumented setting is discovered during an incident.
SAFE DEFAULT: Does the default work for local development and fail closed for anything
security- or cost-relevant?
FLAG HAS AN END: Does every new feature flag have an owner and a removal condition? A flag
with neither becomes permanent branching.
FLAG DEFAULTS OFF: Does the flag's absence or its lookup failure produce the current
behaviour, not the new one?
DEPENDENCY JUSTIFIED: For a new library — does the standard library or an existing
dependency already do this? What does it pull in transitively? Is it maintained?
PINNED AND LOCKED: Is the version exact, with a committed lockfile, so the build is
reproducible?
UPGRADE PATH: For a major upgrade, are the breaking changes read and the affected code
identified — not just "tests pass"?
SHARED LIBRARY DISCIPLINE: For an internal shared library — does it contain only stable,
genuinely common code, with no business logic that ties services together? (see
service-boundaries)
All checks pass → state "Config holds: validated at startup, no secrets, documented."
Active Anti-Pattern Scan
Any box you can check is a defect. Fix it before presenting.
Config in the Image: environment-specific values baked into the artefact, so promoting a
build means rebuilding it → externalise; one artefact, many environments.
Environment Branching: if (isProd) in application code → make it a setting.
Late Failure: a missing or malformed setting discovered on first use rather than at
startup → validate everything at boot.
Stringly-Typed Config: raw strings read and parsed at each call site → parse once into a
typed object.
Config Read in the Domain: business logic reaching for the environment → inject the
typed value (see clean-architecture).
Secret in Config: credentials in a config file, chart, or environment listing checked into
the repository → secret manager, and rotate what leaked.
Undocumented Setting: a value only discoverable by grepping → document it.
Zombie Flag: a flag on for everyone for months, both branches still present → remove the
flag and the dead branch.
Flag as Config: a permanent behaviour switch modelled as a feature flag → make it a
setting; flags are temporary by definition.
Dynamic Config Without Blast Radius Control: a value changeable at runtime for the whole
fleet at once, with no staged rollout or audit trail → stage it and log who changed what.
Floating Version: a range or latest in a manifest, or a missing lockfile → pin and lock.
Mutable Tag: a container base image referenced by tag rather than digest → pin the digest.
Dependency for a One-Liner: a package pulling a transitive tree to do what ten lines of
standard library would → write the ten lines.
Abandoned Dependency: no release or security fix in years, on a critical path → plan a
replacement now, not during the advisory.
Shared Business Library: domain logic in a library several services depend on → they now
release in lockstep; that is a distributed monolith.
Ambiguity Signals
Route these through collaborative-judgment. Each has two defensible answers.
Environment variables or a configuration service. Variables are simple, auditable, and
require a restart to change. A config service allows runtime change and adds a runtime dependency
and a new failure mode.
Which settings may change at runtime. Timeouts and thresholds benefit from being tunable
during an incident; the ability to change behaviour without a deploy is also the ability to break
production without a review.
Flag granularity. Per-user targeting enables gradual rollout and makes behaviour hard to
reproduce; a global boolean is predictable and blunt.
How aggressively to auto-merge dependency updates. Automatic patch updates keep you current
and occasionally ship someone else's regression; manual review is safer and, in practice, means
falling behind.
Vendoring versus depending. Copying a small utility removes a supply-chain risk and forfeits
upstream fixes.
Whether a shared library is worth it. Duplication across services is often cheaper than the
coupling a shared library creates — but not for cross-cutting concerns like tracing or auth
clients, where consistency matters more.
1---2name: config-and-dependencies3description: Keep a service's configuration and its dependency graph under control. Covers configuration as environment rather than code, separating config from secrets, fail-fast validation of typed config at startup, feature flags and blast radius, environment parity and drift, plus dependency selection, semantic versioning, lockfiles, transitive bloat, automated updates, and internal shared libraries. Use when adding or changing a setting, wiring an environment, introducing a feature flag, adding or upgrading a library, or when the user says 'config', 'environment variable', 'feature flag', 'dependency', 'upgrade', 'lockfile', or 'shared library'. This skill governs what varies per deployment and what the service is built from — secret storage rules belong to secure-service.4license: MIT5---67# Configuration and Dependencies89Two quiet sources of production incidents share a chapter because they share a cause: things that10differ between environments, and things that change without anyone deciding.1112A service that reads a setting halfway through a request and finds it missing has already accepted13traffic it cannot serve. A service that resolves a floating version range at build time is running14code nobody reviewed. Both are preventable at startup, by a build, or by a check — never by15vigilance.1617## Config Resolution18191. Read `.msskills/config.yaml` in the repo root; look up `paths.config`.202. A custom document exists at that path → read its frontmatter `mode`:21 - `override` → use it alone; ignore the defaults below.22 - `overlay` (default, or no `mode` key) → read [defaults](./references/defaults.md) first, then23 apply the custom document's sections on top, matched by exact heading; new sections append.243. A path is configured but no file exists there → say which path is missing, then use the defaults.254. No config file or no `paths.config` key → use [defaults](./references/defaults.md).265. `.msskills/stack.md` exists → use its package manager, lockfile format, configuration mechanism,27 secret manager, and flag system.2829## Self-Validation Checklist3031**STOP after adding or changing a setting, a flag, or a dependency. Verify every check. Fix32failures before presenting.**33341. **VARIES PER DEPLOYMENT**: Does this value actually differ between environments? If it is the35 same everywhere → it is a constant; put it in code where it can be reviewed and typed.362. **NOT A SECRET**: Is this a credential, key, or token? → secret manager, never config (see37 `secure-service`).383. **VALIDATED AT STARTUP**: Is the value parsed, typed, range-checked, and required at boot, so a39 misconfigured instance fails to start rather than failing mid-request?404. **TYPED AT THE EDGE**: Is it converted into a typed object once at the boundary, or read as a41 raw string deep in business logic? Domain code must never read the environment.425. **NO ENVIRONMENT BRANCHING**: Does any code test `if (env == "production")`? → express the43 difference as a setting, not as a branch. Branches make production the least-tested path.446. **DOCUMENTED**: Is every setting listed with its type, whether it is required, its default, and45 what it affects? An undocumented setting is discovered during an incident.467. **SAFE DEFAULT**: Does the default work for local development and fail closed for anything47 security- or cost-relevant?488. **FLAG HAS AN END**: Does every new feature flag have an owner and a removal condition? A flag49 with neither becomes permanent branching.509. **FLAG DEFAULTS OFF**: Does the flag's absence or its lookup failure produce the current51 behaviour, not the new one?5210. **DEPENDENCY JUSTIFIED**: For a new library — does the standard library or an existing53 dependency already do this? What does it pull in transitively? Is it maintained?5411. **PINNED AND LOCKED**: Is the version exact, with a committed lockfile, so the build is55 reproducible?5612. **UPGRADE PATH**: For a major upgrade, are the breaking changes read and the affected code57 identified — not just "tests pass"?5813. **SHARED LIBRARY DISCIPLINE**: For an internal shared library — does it contain only stable,59 genuinely common code, with no business logic that ties services together? (see60 `service-boundaries`)6162All checks pass → state "Config holds: validated at startup, no secrets, documented."6364## Active Anti-Pattern Scan6566Any box you can check is a defect. Fix it before presenting.6768- [ ] **Config in the Image**: environment-specific values baked into the artefact, so promoting a69 build means rebuilding it → externalise; one artefact, many environments.70- [ ] **Environment Branching**: `if (isProd)` in application code → make it a setting.71- [ ] **Late Failure**: a missing or malformed setting discovered on first use rather than at72 startup → validate everything at boot.73- [ ] **Stringly-Typed Config**: raw strings read and parsed at each call site → parse once into a74 typed object.75- [ ] **Config Read in the Domain**: business logic reaching for the environment → inject the76 typed value (see `clean-architecture`).77- [ ] **Secret in Config**: credentials in a config file, chart, or environment listing checked into78 the repository → secret manager, and rotate what leaked.79- [ ] **Undocumented Setting**: a value only discoverable by grepping → document it.80- [ ] **Zombie Flag**: a flag on for everyone for months, both branches still present → remove the81 flag and the dead branch.82- [ ] **Flag as Config**: a permanent behaviour switch modelled as a feature flag → make it a83 setting; flags are temporary by definition.84- [ ] **Dynamic Config Without Blast Radius Control**: a value changeable at runtime for the whole85 fleet at once, with no staged rollout or audit trail → stage it and log who changed what.86- [ ] **Floating Version**: a range or `latest` in a manifest, or a missing lockfile → pin and lock.87- [ ] **Mutable Tag**: a container base image referenced by tag rather than digest → pin the digest.88- [ ] **Dependency for a One-Liner**: a package pulling a transitive tree to do what ten lines of89 standard library would → write the ten lines.90- [ ] **Abandoned Dependency**: no release or security fix in years, on a critical path → plan a91 replacement now, not during the advisory.92- [ ] **Shared Business Library**: domain logic in a library several services depend on → they now93 release in lockstep; that is a distributed monolith.9495## Ambiguity Signals9697Route these through `collaborative-judgment`. Each has two defensible answers.9899- **Environment variables or a configuration service.** Variables are simple, auditable, and100 require a restart to change. A config service allows runtime change and adds a runtime dependency101 and a new failure mode.102- **Which settings may change at runtime.** Timeouts and thresholds benefit from being tunable103 during an incident; the ability to change behaviour without a deploy is also the ability to break104 production without a review.105- **Flag granularity.** Per-user targeting enables gradual rollout and makes behaviour hard to106 reproduce; a global boolean is predictable and blunt.107- **How aggressively to auto-merge dependency updates.** Automatic patch updates keep you current108 and occasionally ship someone else's regression; manual review is safer and, in practice, means109 falling behind.110- **Vendoring versus depending.** Copying a small utility removes a supply-chain risk and forfeits111 upstream fixes.112- **Whether a shared library is worth it.** Duplication across services is often cheaper than the113 coupling a shared library creates — but not for cross-cutting concerns like tracing or auth114 clients, where consistency matters more.
Run npx skillmds@latest add parvez3019/config-and-dependencies in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Keep a service's configuration and its dependency graph under control. Covers configuration as environment rather than code, separating config from secrets, fail-fast validation of typed config at startup, feature flags and blast radius, environment parity and drift, plus dependency selection, semantic versioning, lockfiles, transitive bloat, automated updates, and internal shared libraries. Use when adding or changing a setting, wiring an environment, introducing a feature flag, adding or upgrading a library, or when the user says 'config', 'environment variable', 'feature flag', 'dependency', 'upgrade', 'lockfile', or 'shared library'. This skill governs what varies per deployment and what the service is built from — secret storage rules belong to secure-service. It is listed under Security on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
parvez3019 (@parvez3019) published this skill. Their other Agent Skills are listed on their SkillMD profile.