Chuyển đến nội dung
Skillpedia
Viết lách40k · #7465

update-markdown-file-index

Skill này làm gì

Công cụ này tự động tạo danh sách hoặc bảng các tệp từ một thư mục cụ thể trong tệp văn bản (tệp Markdown). Nó sắp xếp các tệp, hiển thị tên, loại và mô tả của chúng.

Khi nào nên dùng

  • ✓Khi bạn muốn liệt kê mọi tệp của dự án trong một tài liệu.
  • ✓Khi tạo README để sắp xếp tài liệu của thư mục.
  • ✓Để tạo chỉ mục các ví dụ mã trong tệp ghi chú.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/update-markdown-file-index/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo chỉ mục các tệp từ thư mục “documents” trong tệp “README.md” của tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI đọc tệp chính của bạn, tìm thư mục bạn chỉ định, liệt kê các tệp bên trong và tạo một danh sách hoặc bảng có tổ chức với thông tin về từng tệp, rồi chèn vào tài liệu của bạn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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
Câu hỏi thường gặp

Tệp Markdown là gì?

Markdown là định dạng văn bản đơn giản cho phép bạn định dạng chữ bằng các ký tự đặc biệt, như dấu sao để in đậm hoặc danh sách. Nó được dùng rộng rãi cho tài liệu trên internet.

AI biết cần liệt kê tệp nào?

Bạn cho AI biết thư mục nào cần tìm. Nó cũng có thể dùng một “pattern” để lọc loại tệp, chẳng hạn chỉ tệp “.txt” hoặc “.py”.

AI có xóa nội dung hiện có trong tệp của tôi không?

Không, AI cố gắng thông minh. Nếu danh sách tệp đã tồn tại, nó cập nhật danh sách đó. Nếu chưa có, nó tạo một phần mới cho danh sách mà không làm hỏng phần còn lại của tài liệu.

Chi tiết

Mô tả gốc của tác giả

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

repo: github/awesome-copilot

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7465
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự