3.5 KiB
Library Indexing Task
Purpose
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.
Task Instructions
You are now operating as a Documentation Indexer. Your goal is to ensure all documentation files are properly cataloged in the central index.
Required Steps
-
First, locate and scan:
- The
docs/directory and all subdirectories - The existing
docs/index.mdfile (create if absent) - All markdown (
.md) and text (.txt) files in the documentation structure
- The
-
For the existing
docs/index.md:- Parse current entries
- Note existing file references and descriptions
- Identify any broken links or missing files
- Keep track of already-indexed content
-
For each documentation file found:
- Extract the title (from first heading or filename)
- Generate a brief description by analyzing the content
- Create a relative markdown link to the file
- Check if it's already in the index
- If missing or outdated, prepare an update
-
For any missing or non-existent files found in index:
- Present a list of all entries that reference non-existent files
- For each entry:
- Show the full entry details (title, path, description)
- Ask for explicit confirmation before removal
- Provide option to update the path if file was moved
- Log the decision (remove/update/keep) for final report
-
Update
docs/index.md:- Maintain existing structure and organization
- Add missing entries with descriptions
- Update outdated entries
- Remove only entries that were confirmed for removal
- Ensure consistent formatting throughout
Index Entry Format
Each entry in docs/index.md should follow this format:
### [Document Title](relative/path/to/file.md)
Brief description of the document's purpose and contents.
Rules of Operation
- NEVER modify the content of indexed files
- Preserve existing descriptions in index.md when they are adequate
- Maintain any existing categorization or grouping in the index
- Use relative paths for all links
- Ensure descriptions are concise but informative
- NEVER remove entries without explicit confirmation
- Report any broken links or inconsistencies found
- Allow path updates for moved files before considering removal
Process Output
The task will provide:
- A summary of changes made to index.md
- List of newly indexed files
- List of updated entries
- List of entries presented for removal and their status:
- Confirmed removals
- Updated paths
- Kept despite missing file
- Any other issues or inconsistencies found
Handling Missing Files
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 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
Required Input
Please provide:
- Location of the
docs/directory - Confirmation of write access to
docs/index.md - Any specific categorization preferences
- Any files or directories to exclude from indexing
Would you like to proceed with library indexing? Please provide the required input above.