agentleFS
caidanwcaidanw/skills/update-readme/SKILL.md

update-readme

Skill9 starsChanged 4 months agoMITView on GitHub

Use when adding, removing, or renaming a skill in this repository to keep the Available Skills table in README.md current.

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After any change to a skill's name, description, or directory, regenerate the Available Skills table by running the script below from the …

    line 8
  2. Distinctive:

    After adding a new skill directory

    line 16
  3. Very specific:

    After editing the name or description field in any SKILL.md

    line 17
  4. Distinctive:

    After renaming or deleting a skill directory

    line 18

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Update README

After any change to a skill's name, description, or directory, regenerate the Available Skills table by running the script below from the repo root:

bash update-readme/update-readme.sh

When to run

  • After adding a new skill directory
  • After editing the name or description field in any SKILL.md
  • After renaming or deleting a skill directory

Script

Save as update-readme/update-readme.sh:

#!/usr/bin/env bash
# Regenerates the Available Skills table in README.md from SKILL.md frontmatters.
# Usage: bash update-readme/update-readme.sh
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
README="$ROOT/README.md"

skills_file=$(mktemp)
table_file=$(mktemp)
trap 'rm -f "$skills_file" "$table_file"' EXIT

# Parse name and description from a SKILL.md file.
# Handles inline values (quoted or unquoted) and block scalars (> and >-).
# Outputs: <name><TAB><description>
parse_skill() {
    awk '
    BEGIN { cnt=0; name=""; desc=""; in_desc=0 }
    /^---[[:space:]]*$/ {
        cnt++
        if (cnt == 2) exit
        next
    }
    cnt != 1 { next }
    /^description:[[:space:]]*[>|]/ { in_desc=1; next }
    /^description:[[:space:]]/ {
        in_desc=0
        val=$0; sub(/^description:[[:space:]]*/, "", val)
        gsub(/^[[:space:]"]+|[[:space:]"]+$/, "", val)
        desc=val
        next
    }
    /^name:[[:space:]]/ {
        in_desc=0
        val=$0; sub(/^name:[[:space:]]*/, "", val)
        gsub(/^[[:space:]"]+|[[:space:]"]+$/, "", val)
        name=val
        next
    }
    /^[a-zA-Z]/ { in_desc=0; next }
    in_desc && /^[[:space:]]/ {
        line=$0; sub(/^[[:space:]]+/, "", line)
        desc=(desc=="" ? line : desc " " line)
        next
    }
    END { printf "%s\t%s\n", name, desc }
    ' "$1"
}

# Return the first sentence of a string (up to the first .!?).
first_sentence() {
    awk '{
        if (match($0, /^[^.!?]+[.!?]/))
            print substr($0, RSTART, RLENGTH)
        else
            print $0
        exit
    }' <<< "$1"
}

# Collect one tab-separated line per skill: name <TAB> dir <TAB> description
for dir in "$ROOT"/*/; do
    skill_file="$dir/SKILL.md"
    [ -f "$skill_file" ] || continue

    result=$(parse_skill "$skill_file")
    name=$(printf '%s' "$result" | cut -f1)
    desc=$(printf '%s' "$result" | cut -f2-)

    if [ -z "$name" ] || [ -z "$desc" ]; then
        continue
    fi

    short=$(first_sentence "$desc")
    dirname=$(basename "$dir")
    printf '%s\t%s\t%s\n' "$name" "$dirname" "$short" >> "$skills_file"
done

# Sort case-insensitively by skill name
sort -f -o "$skills_file" "$skills_file"

# Build the Markdown table
printf '| Skill | Description |\n| --- | --- |\n' > "$table_file"
while IFS=$'\t' read -r name dirname desc; do
    printf '| [`%s`](./%s/) | %s |\n' "$name" "$dirname" "$desc" >> "$table_file"
done < "$skills_file"

# Replace the region between <!-- skills-start --> and <!-- skills-end --> in README.md
awk -v table="$table_file" '
    /<!-- skills-start -->/ { print; while ((getline line < table) > 0) print line; skip=1; next }
    /<!-- skills-end -->/ { skip=0 }
    !skip { print }
' "$README" > "$README.tmp" && mv "$README.tmp" "$README"

count=$(wc -l < "$skills_file" | tr -d ' ')
echo "✓ Updated README.md with $count skills"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.