Skip to content
Skillpedia
Writing40k · #5408

update-markdown-file-index

Creates an index of files within a document. It helps organize and list files from a specific folder within a Markdown file.

What it does

This tool automatically creates a list or table of files from a specific folder within a text document (Markdown file). It organizes the files, showing their names, types, and descriptions.

When to use it

  • ✓When you want to list all project files in a document.
  • ✓When creating a README to organize directory documentation.
  • ✓To generate an index of code examples in a notes file.

Example of what to ask your AI

“Create an index of files from the 'documents' folder in my 'README.md' file.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/github/awesome-copilot/blob/main/skills/update-markdown-file-index/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/update-markdown-file-index/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The AI reads your main file, looks for the folder you specified, lists the files inside it, and creates an organized list or table with information about each file, inserting it into your document.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add github/awesome-copilot --skill update-markdown-file-index

Or download just the file:

curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/update-markdown-file-index/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Update Markdown File Index

Update markdown file ${file} with an index/table of files from folder ${input:folder}.

Process

  1. Scan: Read the target markdown file ${file} to understand existing structure
  2. Discover: List all files in the specified folder ${input:folder} matching pattern ${input:pattern}
  3. Analyze: Identify if an existing table/index section exists to update, or create new structure
  4. Structure: Generate appropriate table/list format based on file types and existing content
  5. Update: Replace existing section or add new section with file index
  6. Validate: Ensure markdown syntax is valid and formatting is consistent

File Analysis

For each discovered file, extract:

  • Name: Filename with or without extension based on context
  • Type: File extension and category (e.g., .md, .js, .py)
  • Description: First line comment, header, or inferred purpose
  • Size: File size for reference (optional)
  • Modified: Last modified date (optional)

Table Structure Options

Choose format based on file types and existing content:

Option 1: Simple List

## Files in ${folder}

- [filename.ext](path/to/filename.ext) - Description
- [filename2.ext](path/to/filename2.ext) - Description

Option 2: Detailed Table

| File | Type | Description |
|------|------|-------------|
| [filename.ext](path/to/filename.ext) | Extension | Description |
| [filename2.ext](path/to/filename2.ext) | Extension | Description |

Option 3: Categorized Sections

Group files by type/category with separate sections or sub-tables.

Update Strategy

  • 🔄 Update existing: If table/index section exists, replace content while preserving structure
  • ➕ Add new: If no existing section, create new section using best-fit format
  • 📋 Preserve: Maintain existing markdown formatting, heading levels, and document flow
  • 🔗 Links: Use relative paths for file links within the repository

Section Identification

Look for existing sections with these patterns:

  • Headings containing: "index", "files", "contents", "directory", "list"
  • Tables with file-related columns
  • Lists with file links
  • HTML comments marking file index sections

Requirements

  • Preserve existing markdown structure and formatting
  • Use relative paths for file links
  • Include file descriptions when available
  • Sort files alphabetically by default
  • Handle special characters in filenames
  • Validate all generated markdown syntax
FAQ

What is a Markdown file?

Markdown is a simple text format that allows you to format text using special characters, like asterisks for bold or lists. It's widely used for documentation on the internet.

How does the AI know which files to list?

You tell the AI which folder to look in. It can also use a 'pattern' to filter which file types to include, such as only '.txt' or '.py' files.

Will the AI delete existing content in my file?

No, the AI tries to be smart. If a file list already exists, it updates that list. If it doesn't exist, it creates a new section for the list without messing up the rest of your document.

Details

Original description by the author

Update a markdown file section with an index/table of files from a specified folder.

repo: github/awesome-copilot

Popularity

GitHub stars
40k
Ranking position
#5408
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills