Set up cosmiconfig for hierarchical configuration loading from multiple sources and formats.
Scanned 9/2/2026
Install to Claude Code
npx -y skills add a5c-ai/babysitter --skill cosmiconfig-setup --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Cosmiconfig Setup?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/a5c-ai-cosmiconfig-setup-babysitter)More formats (shields.io, HTML) on the badges page.
---
name: cosmiconfig-setup
description: Set up cosmiconfig for hierarchical configuration loading from multiple sources and formats.
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
graph:
domains: [domain:software-engineering]
specializations: [specialization:cli-mcp-development]
skillAreas: [skill-area:cli-design, skill-area:configuration-management]
roles: [role:backend-engineer, role:platform-engineer]
workflows: [workflow:feature-development]
topics: [topic:developer-experience]
---
# Cosmiconfig Setup
Set up cosmiconfig for hierarchical config loading.
## Capabilities
- Configure cosmiconfig search paths
- Set up format loaders (JSON, YAML, TOML)
- Create TypeScript config support
- Implement config caching
- Handle config validation
## Generated Patterns
```typescript
import { cosmiconfig, cosmiconfigSync } from 'cosmiconfig';
import { TypeScriptLoader } from 'cosmiconfig-typescript-loader';
const moduleName = 'myapp';
const explorer = cosmiconfig(moduleName, {
searchPlaces: [
'package.json',
`.${moduleName}rc`,
`.${moduleName}rc.json`,
`.${moduleName}rc.yaml`,
`.${moduleName}rc.yml`,
`.${moduleName}rc.js`,
`.${moduleName}rc.ts`,
`.${moduleName}rc.cjs`,
`${moduleName}.config.js`,
`${moduleName}.config.ts`,
`${moduleName}.config.cjs`,
],
loaders: {
'.ts': TypeScriptLoader(),
},
});
export async function loadConfig(searchFrom?: string) {
const result = await explorer.search(searchFrom);
if (!result || result.isEmpty) {
return { config: getDefaultConfig(), filepath: null };
}
return { config: { ...getDefaultConfig(), ...result.config }, filepath: result.filepath };
}
```
## Target Processes
- configuration-management-system
- cli-application-bootstrap
- mcp-server-bootstrap
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!