Proofread the text of a Markdown document based on guidelines.
Procedure
Step 1: Identifying the target file
Determine the target file according to the specified arguments.
When a file path is specified
Use the specified file as the target.
When targeting the branch diff
Run the following with the Bash tool to identify changed Markdown files:
git diff --name-only main...HEAD -- '*.md'
If no target file is found, report to the user and exit.
When there are no arguments
Use the AskUserQuestion tool to confirm how to specify the target file.
Step 2: Loading the guidelines
Read GUIDELINES.md located in the same directory as this SKILL.md using the Read tool.
Step 3: Detecting violations
Read the target files one by one and detect violations against each rule in the guidelines.
Detection policy
- Only suggest high-confidence items that can be improved naturally without changing the meaning
- Skip when in doubt
Exclusions
The following are excluded from detection:
- Code inside code fences
- inline code
- URL
- frontmatter
- Quoted text
- Text presented as bad examples
If no violations are found, report "No guideline violations were found" and exit.
Step 4: Presenting suggested corrections and confirmation
Present suggested corrections for each violation using the AskUserQuestion tool. Use one question per violation.
Standard form of AskUserQuestion
- Show the rule number/name and the relevant line in question
- Show the suggested correction in preview
- If there are multiple correction methods, separate them into options
- Always make the last option "Skip"
If the user approves the correction, apply it with the Edit tool. If Skip is selected, proceed to the next violation.
Step 5: Completion report
After processing all violations, report the number of corrected locations and the number of skipped locations.