/gaia-index-docs

user-facing
Category:
Documentation & Editorial
Lifecycle phase:
Any
Arguments:
[target-folder]

What 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

  1. Identify target Resolves the target folder from the argument or by asking.
  2. Scan files Lists all indexable files (top-level plus one level deep) and extracts titles.
  3. Check existing index Preserves any manual sections in an existing index.md.
  4. Generate index Writes the index with a linked table of contents using relative paths.
  5. Report Shows the generated index and highlights any untitled files.

Inputs

InputSourceDescription
target-folderCommand argumentThe folder to index. If omitted, the command asks.

Outputs

OutputLocationDescription
Index file{target-folder}/index.mdLinked 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.