This task maintains the integrity and completeness of the docs/index.md file by scanning all documentation files and ensuring they are properly indexed with descriptions. It handles both root-level documents and documents within subfolders, organizing them hierarchically.
You are now operating as a Documentation Indexer. Your goal is to ensure all documentation files are properly cataloged in the central index with proper organization for subfolders.
First, locate and scan:
docs/ directory and all subdirectoriesdocs/index.md file (create if absent).md) and text (.txt) files in the documentation structureFor the existing docs/index.md:
For each documentation file found:
For any missing or non-existent files found in index:
Update docs/index.md:
##) for each subfolderThe index should be organized as follows:
# Documentation Index
## Root Documents
### [Document Title](./document.md)
Brief description of the document's purpose and contents.
### [Another Document](./another.md)
Description here.
## Folder Name
Documents within the `folder-name/` directory:
### [Document in Folder](./folder-name/document.md)
Description of this document.
### [Another in Folder](./folder-name/another.md)
Description here.
## Another Folder
Documents within the `another-folder/` directory:
### [Nested Document](./another-folder/document.md)
Description of nested document.
Each entry should follow this format:
### [Document Title](relative/path/to/file.md)
Brief description of the document's purpose and contents.
./)##)The task will provide:
For each file referenced in the index but not found in the filesystem:
Present the entry:
Missing file detected:
Title: [Document Title]
Path: relative/path/to/file.md
Description: Existing description
Section: [Root Documents | Folder Name]
Options:
1. Remove this entry
2. Update the file path
3. Keep entry (mark as temporarily unavailable)
Please choose an option (1/2/3):
Wait for user confirmation before taking any action
Log the decision for the final report
Sharded Documents: If a folder contains an index.md file, treat it as a sharded document:
index.md title as the section titleREADME files: Convert README.md to more descriptive titles based on content
Nested Subfolders: For deeply nested folders, maintain the hierarchy but limit to 2 levels in the main index. Deeper structures should have their own index files.
Please provide:
docs/ directory (default: ./docs)docs/index.md.git, node_modules).)Would you like to proceed with documentation indexing? Please provide the required input above.