Scan the target markdown file.
Discover files in the specified folder matching the pattern.
Analyze the markdown file for existing index sections.
Structure the file index in an appropriate format (list or table).
Update the markdown file with the new or updated file index.
Validate the generated markdown syntax.
Save the updated markdown file.