/gaia-index-docs
user-facingWhat it does
/gaia-index-docs generates or updates an index.md file that links to every document in a target folder. It scans .md, .xml, .yaml, and .csv files, extracts titles, sorts logically, and produces a linked table of contents with a file count and timestamp.
When to use it
- You added new files to a documentation folder and want to update the index.
- You want a navigable table of contents for a folder of documents.
Prerequisites
- The target folder must exist. If not provided as an argument, the command asks which folder to index.
How to invoke
/gaia-index-docs .gaia/artifacts/planning-artifacts/
What it does step by step
- Identify target Resolves the target folder from the argument or by asking.
- Scan files Lists all indexable files (top-level plus one level deep) and extracts titles.
- Check existing index Preserves any manual sections in an existing index.md.
- Generate index Writes the index with a linked table of contents using relative paths.
- Report Shows the generated index and highlights any untitled files.
Inputs
| Input | Source | Description |
|---|---|---|
target-folder | Command argument | The folder to index. If omitted, the command asks. |
Outputs
| Output | Location | Description |
|---|---|---|
| Index file | {target-folder}/index.md | Linked table of contents for the folder. |
Example session
> /gaia-index-docs .gaia/artifacts/planning-artifacts/
Scanning .gaia/artifacts/planning-artifacts/...
8 files found.
Generated index.md with 8 entries.
What to run next
- Keep the index updated when adding or removing documents.
Troubleshooting
Target folder not found
The folder path does not exist. Provide a valid path.
No documents found
The folder exists but contains no indexable files. An index is still created with a note.