Update Markdown File Index

Update Markdown File Index

Updates a section of a markdown file with an index or table of the files in a chosen folder, picking a list, table or grouped format.

Skill files1 file
SKILL.md79 lines
1
---
2
name: update-markdown-file-index
3
description: 'Update a markdown file section with an index/table of files from a specified folder.'
4
---
5
6
# Update Markdown File Index
7
8
Update markdown file `${file}` with an index/table of files from folder `${input:folder}`.
9
10
## Process
11
12
1. **Scan**: Read the target markdown file `${file}` to understand existing structure
13
2. **Discover**: List all files in the specified folder `${input:folder}` matching pattern `${input:pattern}`
14
3. **Analyze**: Identify if an existing table/index section exists to update, or create new structure
15
4. **Structure**: Generate appropriate table/list format based on file types and existing content
16
5. **Update**: Replace existing section or add new section with file index
17
6. **Validate**: Ensure markdown syntax is valid and formatting is consistent
18
19
## File Analysis
20
21
For each discovered file, extract:
22
23
- **Name**: Filename with or without extension based on context
24
- **Type**: File extension and category (e.g., `.md`, `.js`, `.py`)
25
- **Description**: First line comment, header, or inferred purpose
26
- **Size**: File size for reference (optional)
27
- **Modified**: Last modified date (optional)
28
29
## Table Structure Options
30
31
Choose format based on file types and existing content:
32
33
### Option 1: Simple List
34
35
```markdown
36
## Files in ${folder}
37
38
- [filename.ext](path/to/filename.ext) - Description
39
- [filename2.ext](path/to/filename2.ext) - Description
40
```
41
42
### Option 2: Detailed Table
43
44
```markdown
45
| File | Type | Description |
46
|------|------|-------------|
47
| [filename.ext](path/to/filename.ext) | Extension | Description |
48
| [filename2.ext](path/to/filename2.ext) | Extension | Description |
49
```
50
51
### Option 3: Categorized Sections
52
53
Group files by type/category with separate sections or sub-tables.
54
55
## Update Strategy
56
57
- 🔄 **Update existing**: If table/index section exists, replace content while preserving structure
58
- ➕ **Add new**: If no existing section, create new section using best-fit format
59
- 📋 **Preserve**: Maintain existing markdown formatting, heading levels, and document flow
60
- 🔗 **Links**: Use relative paths for file links within the repository
61
62
## Section Identification
63
64
Look for existing sections with these patterns:
65
66
- Headings containing: "index", "files", "contents", "directory", "list"
67
- Tables with file-related columns
68
- Lists with file links
69
- HTML comments marking file index sections
70
71
## Requirements
72
73
- Preserve existing markdown structure and formatting
74
- Use relative paths for file links
75
- Include file descriptions when available
76
- Sort files alphabetically by default
77
- Handle special characters in filenames
78
- Validate all generated markdown syntax
79

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…