Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Pattern documentation for configuring settings in Claude Code plugins (from the official Anthropic claude-code repo).
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
scripts/parse-frontmatter.sh
1#!/bin/bash2# Frontmatter Parser Utility3# Extracts YAML frontmatter from .local.md files45set -euo pipefail67# Usage8show_usage() {9echo "Usage: $0 <settings-file.md> [field-name]"10echo ""11echo "Examples:"12echo " # Show all frontmatter"13echo " $0 .claude/my-plugin.local.md"14echo ""15echo " # Extract specific field"16echo " $0 .claude/my-plugin.local.md enabled"17echo ""18echo " # Extract and use in script"19echo " ENABLED=\$($0 .claude/my-plugin.local.md enabled)"20exit 021}2223if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then24show_usage25fi2627FILE="$1"28FIELD="${2:-}"2930# Validate file31if [ ! -f "$FILE" ]; then32echo "Error: File not found: $FILE" >&233exit 134fi3536# Extract frontmatter37FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$FILE")3839if [ -z "$FRONTMATTER" ]; then40echo "Error: No frontmatter found in $FILE" >&241exit 142fi4344# If no field specified, output all frontmatter45if [ -z "$FIELD" ]; then46echo "$FRONTMATTER"47exit 048fi4950# Extract specific field51VALUE=$(echo "$FRONTMATTER" | grep "^${FIELD}:" | sed "s/${FIELD}: *//" | sed 's/^"\(.*\)"$/\1/' | sed "s/^'\\(.*\\)'$/\\1/")5253if [ -z "$VALUE" ]; then54echo "Error: Field '$FIELD' not found in frontmatter" >&255exit 156fi5758echo "$VALUE"59exit 060