agentsclimarketplace

Yaml json toml loader

Skill a5c-ai/babysitter/library/specializations/cli-mcp-development/skills/yaml-json-toml-loader

Generate multi-format configuration file loaders for YAML, JSON, and TOML formats.From its SKILL.md

Install
npx -y skills add a5c-ai/babysitter --skill yaml-json-toml-loader

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.8 KB, 336 tokens by cl100k_base, as published. Nobody here has run it

YAML/JSON/TOML Loader

Generate multi-format config file loaders.

Generated Patterns

import fs from 'fs';
import path from 'path';
import yaml from 'yaml';
import toml from '@iarna/toml';

type ConfigFormat = 'json' | 'yaml' | 'toml' | 'auto';

export function loadConfigFile(filepath: string, format: ConfigFormat = 'auto'): unknown {
  const content = fs.readFileSync(filepath, 'utf-8');
  const ext = format === 'auto' ? path.extname(filepath).toLowerCase() : `.${format}`;

  switch (ext) {
    case '.json': return JSON.parse(content);
    case '.yaml': case '.yml': return yaml.parse(content);
    case '.toml': return toml.parse(content);
    default: throw new Error(`Unknown config format: ${ext}`);
  }
}

export function saveConfigFile(filepath: string, data: unknown, format: ConfigFormat = 'auto'): void {
  const ext = format === 'auto' ? path.extname(filepath).toLowerCase() : `.${format}`;
  let content: string;

  switch (ext) {
    case '.json': content = JSON.stringify(data, null, 2); break;
    case '.yaml': case '.yml': content = yaml.stringify(data); break;
    case '.toml': content = toml.stringify(data as any); break;
    default: throw new Error(`Unknown format: ${ext}`);
  }

  fs.writeFileSync(filepath, content);
}

Target Processes

  • configuration-management-system
  • cli-application-bootstrap

What ships with it: 1 file

349 B alongside SKILL.md

Keep looking

Skills are one crate of 326,059. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.