Guest User

Readability Skill

a guest
Sep 17th, 2026
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. ---
  2. name: readability-analysis
  3. description: Measure and improve the readability of prose or Markdown using objective metrics (Flesch Reading Ease, Flesch-Kincaid grade, Gunning Fog, SMOG) and per-sentence flagging. Use this whenever judging whether writing is clear or accessible, checking a document's reading level or grade level, deciding if a sentence or paragraph is too dense or hard to read, before finalizing a report/policy/SOP/email/article, or any time the user questions readability or asks for something to be made "more readable", "simpler", or "clearer" - do not eyeball readability, run this skill and cite the numbers.
  4. ---
  5.  
  6. # Readability Analysis
  7.  
  8. Judging readability by feel is unreliable and easy to argue with. This skill replaces
  9. opinion with measured scores and pinpoints the specific sentences that drag a document
  10. down, so edits are targeted rather than vibes-based.
  11.  
  12. ## When to use
  13.  
  14. - The user questions whether something is readable, clear, or accessible.
  15. - The user asks to make text "more readable", "simpler", "plainer", or "clearer".
  16. - Before finalizing any prose deliverable (report, policy, SOP, article, email).
  17. - To compare a draft against a rewrite and prove the rewrite is better.
  18. - To pick the worst sentences in a long document to rewrite first.
  19.  
  20. ## What it measures
  21.  
  22. Formula metrics, computed with `textstat` (consistent syllable/complex-word counts,
  23. not estimates): Flesch Reading Ease, Flesch-Kincaid grade, Gunning Fog, SMOG, plus
  24. Dale-Chall (word-familiarity based, catches jargon syllable counts miss), Coleman-Liau
  25. and Automated Readability Index (character-based), and Linsear Write (tuned for
  26. technical manuals). A consensus grade (text_standard) summarizes them all, and the
  27. difficult-word count/list names the actual unfamiliar words. Plus structural stats:
  28. words, sentences, words/sentence, syllables/word. See `references/thresholds.md` for
  29. formulas, interpretation bands, and source links.
  30.  
  31. Flagged sentences also carry grammar notes from a spaCy dependency parse
  32. (en_core_web_sm): passive voice, nominalizations (verb-derived nouns to rewrite as
  33. verbs), and clause nesting depth 3 or more. The notes name the fault, so a rewrite
  34. knows what to fix; the scores only say a threshold was exceeded. A document-level
  35. count of passive sentences is also reported.
  36.  
  37. The script strips Markdown (fenced and inline code, tables, links, headings, list
  38. markers, bare URLs) before measuring, and terminates list items so a bulleted list is
  39. not scored as one giant run-on sentence. Inline code spans are neutralized: a plain
  40. word in code font (`` `signed` ``) stays, but an identifier or path
  41. (`` `patient_data_export` ``, `` `evidence_summary.py` ``) counts as one generic noun
  42. instead of one enormous polysyllabic "word" that inflates the grade. This matters:
  43. scoring a Markdown table, a list of URLs, or code identifiers as prose yields garbage.
  44. Use `--raw` only for genuine plain text.
  45.  
  46. For text pulled from Jira (or any raw Jira wiki markup -- `{code}` / `{noformat}` blocks,
  47. `{{monospace}}`, `hN.` headings, `[text|url]` links, `{color}`/`{panel}` macros, `\\`
  48. breaks), add `--jira`: it neutralizes that markup before the Markdown pass so identifier-
  49. and macro-heavy issue text measures as prose, not syntax. Text fetched from the Jira API
  50. as Markdown already benefits from the default inline-code and list handling; `--jira`
  51. additionally covers native wiki markup.
  52.  
  53. ## How to run
  54.  
  55. The script is standalone (dependencies declared inline) and runs with uv:
  56.  
  57. ```bash
  58. uv run scripts/analyze_readability.py <file.md>
  59. ```
  60.  
  61. Useful options:
  62.  
  63. - `--max-words-per-sentence N` (default 25), `--max-grade N` (default 14),
  64. `--max-fog N` (default 14): tighten or loosen the sentence-flagging thresholds.
  65. - `--jira`: pre-process raw Jira wiki markup before the Markdown pass.
  66. - `--json`: machine-readable output for further processing.
  67. - `--raw`: skip Markdown stripping (plain text input).
  68.  
  69. Analyze stdin by passing `-` as the path.
  70.  
  71. ## How to interpret and act
  72.  
  73. 1. Read the document-level metrics. A Flesch Reading Ease near or below 0, or a grade
  74. far above the audience level, signals a problem. For technical or regulatory prose,
  75. target roughly grade 10-12 / Fog ~12 / Reading Ease 40-50; do not expect the 60-70
  76. "general public" band, because domain vocabulary sets a floor.
  77.  
  78. 2. Work the flagged-sentence list, worst first. Each flag shows word count and per-
  79. sentence grade/fog. The usual cause is one sentence doing too much.
  80.  
  81. 3. Fix structurally, not by dumbing down vocabulary. The grammar notes point at the
  82. specific fault:
  83. - one idea per sentence; split compound sentences;
  84. - unnest parentheticals (a parenthetical inside a parenthetical is a rewrite signal);
  85. - convert inline "(a)/(b)/(c)" or semicolon-chained runs into a bulleted list;
  86. - "passive voice" -> rewrite active, naming the actor;
  87. - "nominalizations" -> rewrite the noun as its verb ("make a determination" ->
  88. "determine"), after checking the word is genuinely verb-derived;
  89. - "N nested clauses" -> split or unnest;
  90. - keep necessary domain terms - the goal is clearer structure, not simpler concepts.
  91. The difficult-word list shows which terms a reader is least likely to know, so
  92. define those rather than deleting them.
  93.  
  94. 4. Re-run the script on the rewrite and report before/after numbers. State the metric
  95. and its source rather than asserting the text "reads better".
  96.  
  97. ## Reporting format
  98.  
  99. When presenting results, lead with a compact before/after table of the metrics, then
  100. the rewritten text. Always name the metric and cite `references/thresholds.md` (or its
  101. linked sources) so the judgment is verifiable, not subjective.
  102.  
Advertisement
Add Comment
Please, Sign In to add comment