Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Set up cosmiconfig for hierarchical configuration loading from multiple sources and formats.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-17 | ✗→✓ | ▲ Improved | -26% | 0% |
| case-22 | ✗→✓ | ▲ Improved | -24% | 0% |
| case-05 | ✓→✓ | = Same ✓ | -39% | 0% |
| case-18 | ✓→✓ | = Same ✓ | -16% | 0% |
| case-01 | ✗→✗ | = Same ✗ | 1% | 0% |
Set up cosmiconfig for hierarchical config loading.
typescriptimport { 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 }; }
Other measured skills in the registry, with their headline benchmark lift.