json-config-loader-4-multi-section-ini-parsing

Sub-skill of json-config-loader: 4. Multi-Section INI Parsing.

5 stars

Best use case

json-config-loader-4-multi-section-ini-parsing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Sub-skill of json-config-loader: 4. Multi-Section INI Parsing.

Teams using json-config-loader-4-multi-section-ini-parsing should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/4-multi-section-ini-parsing/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_core/bash/json-config-loader/4-multi-section-ini-parsing/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/4-multi-section-ini-parsing/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How json-config-loader-4-multi-section-ini-parsing Compares

Feature / Agentjson-config-loader-4-multi-section-ini-parsingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Sub-skill of json-config-loader: 4. Multi-Section INI Parsing.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 4. Multi-Section INI Parsing

## 4. Multi-Section INI Parsing


Parse INI-style files with sections:

```bash
#!/bin/bash
# ABOUTME: Parse INI-style configuration with sections
# ABOUTME: Supports [section] headers and section.key access

declare -A INI_CONFIG
declare -a INI_SECTIONS=()

parse_ini() {
    local file="$1"
    local current_section="default"

    if [[ ! -f "$file" ]]; then
        echo "Error: INI file not found: $file" >&2
        return 1
    fi

    INI_SECTIONS=("default")

    while IFS= read -r line || [[ -n "$line" ]]; do
        # Skip comments and empty lines
        [[ "$line" =~ ^[[:space:]]*[#\;] ]] && continue
        [[ -z "${line// /}" ]] && continue

        # Section header
        if [[ "$line" =~ ^\[([^\]]+)\] ]]; then
            current_section="${BASH_REMATCH[1]}"
            INI_SECTIONS+=("$current_section")
            continue
        fi

        # Key=value within section
        if [[ "$line" =~ ^([^=]+)=(.*)$ ]]; then
            local key="${BASH_REMATCH[1]}"
            local value="${BASH_REMATCH[2]}"

            # Trim whitespace
            key="${key#"${key%%[![:space:]]*}"}"
            key="${key%"${key##*[![:space:]]}"}"
            value="${value#"${value%%[![:space:]]*}"}"
            value="${value%"${value##*[![:space:]]}"}"

            # Store as section.key
            INI_CONFIG["${current_section}.${key}"]="$value"
        fi
    done < "$file"
}

# Get INI value
ini_get() {
    local section="$1"
    local key="$2"
    local default="${3:-}"

    echo "${INI_CONFIG["${section}.${key}"]:-$default}"
}

# Get all keys in a section
ini_section_keys() {
    local section="$1"
    local prefix="${section}."

    for key in "${!INI_CONFIG[@]}"; do
        if [[ "$key" == "${prefix}"* ]]; then
            echo "${key#$prefix}"
        fi
    done
}

# List all sections
ini_sections() {
    printf '%s\n' "${INI_SECTIONS[@]}" | sort -u
}

# Usage
parse_ini "settings.ini"

# Access values
DB_HOST=$(ini_get "database" "host" "localhost")
DB_PORT=$(ini_get "database" "port" "5432")
LOG_LEVEL=$(ini_get "logging" "level" "INFO")

echo "Database: $DB_HOST:$DB_PORT"
echo "Log Level: $LOG_LEVEL"

# Iterate section keys
echo "Database settings:"
for key in $(ini_section_keys "database"); do
    echo "  $key = $(ini_get "database" "$key")"
done
```

Related Skills

toml-section-scoping-debug

5
from vamseeachanta/workspace-hub

Identify and fix TOML configuration errors caused by misplaced keys inside section headers

toml-section-scoping-config-debug

5
from vamseeachanta/workspace-hub

Diagnose TOML config errors caused by misplaced keys in table sections

portable-config-baseline-pattern

5
from vamseeachanta/workspace-hub

Extract machine-agnostic settings into portable template files while keeping machine-specific hooks and plugins separate

portable-baseline-configuration-pattern

5
from vamseeachanta/workspace-hub

Separate portable/universal config from machine-specific settings to enable safe template reuse across environments

portable-baseline-config-pattern

5
from vamseeachanta/workspace-hub

Separate machine-portable baseline config from environment-specific hooks and plugins

multi-year-tax-filing-verification-workflow

5
from vamseeachanta/workspace-hub

Verify and reconcile complex multi-form tax filings by cross-referencing source documents, identifying data dependencies, and validating line-by-line against authoritative records.

multi-source-tax-document-reconciliation

5
from vamseeachanta/workspace-hub

Verify generated tax forms against source documents by line-by-line comparison, not just totals

multi-role-agent-contract-review-pipeline

5
from vamseeachanta/workspace-hub

Execute a 4-role agent team (Planner/Architect/Reviewer/Integrator) pipeline for self-reviewing knowledge artifacts before delivery

multi-repo-sync-diagnosis-repair

5
from vamseeachanta/workspace-hub

Diagnose and repair failed pulls across multi-repo ecosystems with stale locks, submodule conflicts, and untracked files

multi-repo-sync-diagnosis-and-repair

5
from vamseeachanta/workspace-hub

Systematic approach to diagnosing and repairing failures across a multi-repo workspace

multi-repo-stale-lock-recovery

5
from vamseeachanta/workspace-hub

Diagnose and recover from stale git lock files in multi-repo workspaces, especially with submodules

multi-repo-pull-with-untracked-conflict-recovery

5
from vamseeachanta/workspace-hub

Diagnose and resolve multi-repo pull failures caused by untracked files conflicting with remote changes