update-markdown-file-index
它能做什么
这个工具可以自动从文本文档(Markdown 文件)中指定的文件夹里生成一份文件列表或表格。它会整理这些文件,展示每个文件的名称、类型和描述。
适用场景
- ✓当你想在文档中列出项目的所有文件时。
- ✓创建 README,用来整理目录文档时。
- ✓需要在笔记文件中生成代码示例索引时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/update-markdown-file-index/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我的 README.md 文件中,为 documents 文件夹里的文件创建一份索引。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会读取你的主文件,找到你指定的文件夹,列出里面的文件,然后生成一份有条理的列表或表格,包含每个文件的相关信息,并将其插入到你的文档中。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Update Markdown File Index
Update markdown file ${file} with an index/table of files from folder ${input:folder}.
Process
- Scan: Read the target markdown file
${file}to understand existing structure - Discover: List all files in the specified folder
${input:folder}matching pattern${input:pattern} - Analyze: Identify if an existing table/index section exists to update, or create new structure
- Structure: Generate appropriate table/list format based on file types and existing content
- Update: Replace existing section or add new section with file index
- 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
常见问题
什么是 Markdown 文件?
Markdown 是一种简单的文本格式,可以用一些特殊符号来设置文字格式,比如用星号表示加粗,或者创建列表。它在网络文档中被广泛使用。
AI 怎么知道该列出哪些文件?
你需要告诉 AI 去哪个文件夹查找。它还可以使用“模式”来筛选文件类型,比如只列出 `.txt` 或 `.py` 文件。
AI 会删除我文件中已有的内容吗?
不会。AI 会比较聪明地处理:如果文件中已经有文件列表,它会更新这个列表;如果没有,它会新建一个列表部分,不影响文档的其他内容。
详情
作者的原始描述
Update a markdown file section with an index/table of files from a specified folder.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7465
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。