Skip to content

JordanGunn/nunchuck / skills/md/md-split

md-split

Verified

Splits a Markdown file by H2 headings into numbered documents and generates an index file.

FileKindSize
SKILL.mdskill md529 B
assets/EXAMPLE.mdmarkdown445 B
references/00_ROUTER.mdmarkdown468 B
references/01_SUMMARY.mdmarkdown1023 B
references/02_TRIGGERS.mdmarkdown831 B
references/03_ALWAYS.mdmarkdown696 B
references/04_NEVER.mdmarkdown569 B
references/05_PROCEDURE.mdmarkdown1.3 KB
references/06_FAILURES.mdmarkdown973 B
scripts/index.ps1script818 B
scripts/index.shexecutablescript1.2 KB
scripts/skill.ps1script1.9 KB
scripts/skill.shscript2.1 KB
scripts/split.ps1script5.7 KB
scripts/split.shexecutablescript8.3 KB

scripts/index.sh

View on GitHub
#!/bin/bash
set -e

# md-index: Generate .INDEX.md from split docs

show_help() {
    echo "Usage: index.sh --dir <path> [options]"
    echo ""
    echo "Options:"
    echo "  --dir <path>     Directory containing split docs (Required)"
    echo "  --out <path>     Output path for index (Default: <dir>/.INDEX.md)"
    exit 0
}

DIR=""
OUT_FILE=""

while [[ "$#" -gt 0 ]]; do
    case $1 in
        --dir) DIR="$2"; shift ;;
        --out) OUT_FILE="$2"; shift ;;
        --help) show_help ;;
        *) echo "Unknown parameter: $1"; exit 1 ;;
    esac
    shift
done

if [[ -z "$DIR" ]]; then
    echo "Error: --dir is required"
    exit 1
fi

if [[ ! -d "$DIR" ]]; then
    echo "Error: Directory '$DIR' not found"
    exit 1
fi

if [[ -z "$OUT_FILE" ]]; then
    OUT_FILE="$DIR/.INDEX.md"
fi

echo "# Index" > "$OUT_FILE"
echo "" >> "$OUT_FILE"

# Find files matching NN_*.md, excluding .INDEX.md and .SUMMARY.md
# Sort by filename
FILES=$(ls "$DIR" | grep -E "^[0-9][0-9]_.+\.md$" | sort)

for f in $FILES; do
    # Read first H1 title
    TITLE=$(grep -m 1 "^# " "$DIR/$f" | sed 's/^# //')
    if [[ -z "$TITLE" ]]; then
        TITLE="$f" # Fallback to filename
    fi
    echo "- [$TITLE]($f)" >> "$OUT_FILE"
done

echo "Index generated at: $OUT_FILE"
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall