Text format organizer

From aipoch/medical-research-skills · View interactive version

Text format organizer is an AI agent skill from the GitHub repository aipoch/medical-research-skills. A local text formatting organizer for biomedical/academic writing; use it when you need to clean whitespace/line endings while preserving Markdown structures or when normalizing .docx/.md/.txt before submission or proofreading.

How to use this skill

Skill file

Source: https://github.com/aipoch/medical-research-skills

Validation Shortcut

Run this minimal command first to verify the supported execution path:

python scripts/init_run.py --help

When to Use

Key Features

Dependencies

Example Usage

1) Format a Markdown or text file

python scripts/init_run.py --input input.md --output output.md

2) Format a Word document

python scripts/init_run.py -i paper.docx -o paper_clean.docx

3) Preview changes without writing output

python scripts/init_run.py -i input.md --preview

4) Programmatic usage (core module)

from scripts.text_formatter import TextFormatter, FormatOptions

text = "Line with trailing spaces   \n\n\n- item 1\n\t- item 2\n"
options = FormatOptions(
    line_ending="unix",
    indent="spaces",
    indent_size=4,
)

formatter = TextFormatter(options=options)
formatted = formatter.format(text)
print(formatted)

5) Workflow with an academic proofreading tool

# Step 1: Format organization
python scripts/init_run.py -i paper.docx -o paper_clean.docx

# Step 2: Content/format checking (separate project)
cd ../academic-proofreader
python scripts/init_run.py -i paper_clean.docx

Implementation Details

CLI parameters

| Parameter | Description | Default |

|---|---|---|

| --input / -i | Input file path (.txt / .md / .docx) | Required |

| --output / -o | Output file path | Auto-generated |

| --line-ending | Line ending: unix / windows / mac | unix |

| --indent | Indentation type: spaces / tabs | spaces |

| --indent-size | Number of spaces per indent level | 4 |

| --preview | Preview mode (no output written) | false |

| --docx-font | Font used for Word output | Times New Roman |

| --docx-size | Font size used for Word output | 12 |

Formatting rules (high level)

When Not to Use

Required Inputs

Recommended Workflow

  1. Validate the request against the skill boundary and confirm all required inputs are present.
  2. Select the documented execution path and prefer the simplest supported command or procedure.
  3. Produce the expected output using the documented file format, schema, or narrative structure.
  4. Run a final validation pass for completeness, consistency, and safety before returning the result.

Output Contract

Validation and Safety Rules

Failure Handling

Input Validation

This skill accepts requests that match the documented purpose of text-format-organizer and include enough context to complete the workflow safely.

Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:

text-format-organizer only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.

Quick Validation

Run this minimal verification path before full execution when possible:

python scripts/init_run.py --help

Expected output format:

Result file: text_format_organizer_result.md
Validation summary: PASS/FAIL with brief notes
Assumptions: explicit list if any

Deterministic Output Rules

Completion Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.