---
name: flawed-skill
description: Processes files by extracting key sections, applying structural transformations, and generating summary output. Use when the user wants to batch-process files for section extraction and reformatting.
allowed-tools: Read, Glob, Grep, Edit, Write, Bash
argument-hint: <file-path-or-glob>
---

This skill processes files provided via `$ARGUMENTS` and generates transformed output.

If `$ARGUMENTS` is empty or missing, ask the user which files to process before proceeding.

**Stop after each stage and have changes reviewed with the user.**

> See `style-guide.md` for output style guidelines and `responsibilities.md` for agent vs developer ownership at each stage.

0. **Understand and confirm**
   - Read the files specified by `$ARGUMENTS`. If any file does not exist, report the missing files and ask the user how to proceed.
   - Summarize what was found: how many files, what kind of content, what sections were detected.
   - Confirm the plan with the user before proceeding.

1. **Gather inputs**
   - Parse each file and identify key sections (headers, delimited blocks, and tagged regions).
   - List the sections found and flag any files that could not be parsed.

2. **Process and transform**
   - Apply structural transformations to extracted sections: normalize heading levels, convert loose notes to bullet lists, and reformat code blocks with language tags.
   - Generate a summary of changes made per file.
   - Write output files to a `output/` directory within the project. If the directory does not exist, create it.

3. **Final report**
   - Print a summary of what was done: files processed, sections transformed, output locations.
   - List any warnings encountered (unparseable files, empty sections, skipped content).
