Skip to content

Add readability revision capability for clearer technical docs#264

Open
abeltrano wants to merge 6 commits into
mainfrom
add-readability-revision
Open

Add readability revision capability for clearer technical docs#264
abeltrano wants to merge 6 commits into
mainfrom
add-readability-revision

Conversation

@abeltrano

Copy link
Copy Markdown
Collaborator

Summary

Add a readability-revision capability to PromptKit so technical documents can be
revised into clear, plain prose without changing their technical meaning. The
capability targets the Flesch readability scales, diagnoses named clarity
defects, and revises with established plain-language methods.

New Components

Type Name Path Description
persona plain-language-editor personas/plain-language-editor.md Plain-language technical editor; preserves precision; measures readability.
protocol (guardrail) readability-gate protocols/guardrails/readability-gate.md Lightweight final-pass prose check with a bounded corpus, proxy thresholds, and accuracy carve-outs.
protocol (reasoning) readability-revision-workflow protocols/reasoning/readability-revision-workflow.md Corrective methodology: measure, diagnose, revise, re-measure, verify meaning.
format readability-revision-report formats/readability-revision-report.md Revised document, measurement scope, before/after scorecard, accuracy attestation, residual issues.
template revise-for-readability templates/revise-for-readability.md Revise an existing document for readability and produce a readability revision report.

Design Decisions

  • Split the methodology by role. The guardrail (readability-gate) is a lightweight
    final-pass check that can later be composed into authoring templates to make
    their default output readable. The reasoning protocol
    (readability-revision-workflow) carries the heavy corrective work for the
    standalone template and delegates its acceptance check to the gate. One
    methodology, no duplication.
  • Flesch scores are script-computed for pass/fail; an LLM cannot count syllables
    reliably. When a code-execution tool is available (the common agentic launch
    path), the gate computes the scores with a script — preferring textstat, else
    the formulas with an embedded standard-library syllable heuristic. With no code
    environment it reports Flesch as "not measured" and gates on reliably-countable
    proxies (sentence length, passive share, expletives, filler, undefined terms),
    which are always the primary gate.
  • The Flesch target band is audience-tiered. The gate owns a three-tier table
    (broad FRE ≥ 60 / FKGL ≤ 10; general-technical FRE ≥ 50 / FKGL ≤ 12; expert
    FRE ≥ 40 / FKGL ≤ 14). The tier is selected by a ladder — a stated audience,
    else inferred from the document's purpose via genre cues (never the draft's
    current complexity, which would be circular), else general-technical — and the
    report records which basis chose it. Proxy thresholds are audience-independent.
  • A readability corpus boundary excludes code, YAML, tables, identifiers,
    normative keywords, requirement IDs, citations, and quoted text from both
    measurement and rewriting.
  • Precedence carve-outs keep the capability additive: it preserves the epistemic
    labels and citations required by anti-hallucination, and the register and
    cadence preserved by human-voice-fidelity.
  • No taxonomy yet. The defect categories live in the reasoning protocol; extract
    a taxonomy later if a second consumer or cross-document aggregation needs
    shared labels.
  • Corrective first. This change adds a standalone template. Wiring the gate into
    existing authoring templates is a separate follow-up PR (this workflow does not
    modify existing components).

Follow-up (separate PR)

Wire guardrails/readability-gate into the author-* template frontmatter so new
documents are readable by default. The gate is designed for this: it performs
only a final-pass prose check and preserves each template's own format and
semantics.

Validation

  • python tests/validate-manifest.py — pass.
  • python tests/validate-graph-integrity.py — pass.
  • CLI dry-run smoke steps (copilot, claude) — pass.
  • One pre-existing, unrelated CLI test (launch.test.js gh-copilot variant) times
    out on Windows local runs; reproduced identically with these changes stashed.

Checklist

  • All files have SPDX license headers
  • YAML frontmatter is valid and complete
  • Component names match file names (kebab-case)
  • manifest.yaml updated with all new components
  • No vague instructions in protocols or templates
  • Protocols have numbered, ordered phases
  • Templates have a quality checklist section
  • New components do not conflict with existing ones

Adds a plain-language editing capability so PromptKit-generated technical
documents can be revised into clear, readable prose without changing
technical meaning.

New components:
- personas/plain-language-editor.md: editor persona that preserves precision
- protocols/guardrails/readability-gate.md: lightweight final-pass gate with
  a bounded corpus, proxy thresholds, and an audience-tiered Flesch band
- protocols/reasoning/readability-revision-workflow.md: corrective methodology
  (measure, diagnose, revise, re-measure, verify meaning)
- formats/readability-revision-report.md: revised doc, scorecard, accuracy
  attestation, and residual issues
- templates/revise-for-readability.md: standalone corrective template
- manifest.yaml: index the five new components

Flesch scores are script-computed for gating, with reliably-countable proxy
fallbacks. Accuracy carve-outs preserve normative keywords, identifiers,
requirement IDs, epistemic labels, and quoted text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 9, 2026 12:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a “revise-for-readability” capability (template + persona + protocols + report format) to support measured, meaning-preserving readability revisions of technical documents.

Changes:

  • Introduces a new revise-for-readability template driven by a plain-language editor persona.
  • Adds a readability gate guardrail and a step-by-step readability revision workflow protocol.
  • Defines a structured “readability revision report” output format and wires everything into manifest.yaml.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
templates/revise-for-readability.md New template that composes the persona, gate, workflow, and report format.
protocols/reasoning/readability-revision-workflow.md New reasoning protocol defining the phased revision process.
protocols/guardrails/readability-gate.md New guardrail describing corpus boundary, measurement rules, and pass criteria.
personas/plain-language-editor.md New persona focused on measurable readability improvements without meaning drift.
formats/readability-revision-report.md New output format for reporting the revised document + before/after metrics and attestations.
manifest.yaml Registers the new persona, protocols, format, and template.

Comment thread protocols/guardrails/readability-gate.md Outdated
Comment thread formats/readability-revision-report.md Outdated
Comment thread formats/readability-revision-report.md Outdated
Comment thread formats/readability-revision-report.md
Comment thread formats/readability-revision-report.md Outdated
- readability-gate: remove duplicated "Target band by audience" heading
- readability-revision-report: drop the "Estimated" metric source and the
  "estimated" formatting-rule path; Flesch is computed or not measured
- readability-revision-report: remove stray ">" line in the Change Summary
- align "Flesch-Kincaid Grade" -> "Flesch-Kincaid Grade Level" in the gate
  tier table and the report scorecard row

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 9, 2026 15:05
@abeltrano abeltrano requested a review from Alan-Jowett July 9, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread templates/revise-for-readability.md Outdated
Comment thread protocols/guardrails/readability-gate.md Outdated
Comment thread templates/revise-for-readability.md Outdated
- revise-for-readability: drop "estimated" from the quality-checklist metric
  source (computed / not measured)
- revise-for-readability: use scalar `input_contract: null` to match the
  convention used by all other no-input templates
- readability-gate: clarify the Output note — do not inject the gate block
  verbatim, but a format MAY populate its own scorecard fields from the metrics

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 9, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Comment thread personas/plain-language-editor.md Outdated
Comment thread protocols/reasoning/readability-revision-workflow.md Outdated
Comment thread protocols/guardrails/readability-gate.md Outdated
Comment thread templates/revise-for-readability.md Outdated
Comment thread protocols/reasoning/readability-revision-workflow.md Outdated
Address third round of PR review feedback by removing divergent, narrower
copies of the protected-token / corpus-boundary list so they cannot drift
from the gate's canonical Rule 1.

- readability-gate: state the metrics block is chat/meta output only and must
  not be injected into an artifact (not even its change-summary/scorecard);
  formats populate their own fields instead
- readability-revision-workflow: accuracy lock now defers to Rule 1 as
  authoritative and restates it non-exhaustively; Phase 1 corpus summary marked
  non-exhaustive with Rule 1 as the operative exclusion set
- revise-for-readability: corpus-boundary reminder marked non-exhaustive,
  pointing to Rule 1 as operative
- plain-language-editor: normative-keyword list expanded (REQUIRED/OPTIONAL and
  negations) and marked illustrative
- readability-revision-report: protected-token enumerations marked non-exhaustive

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 9, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread protocols/guardrails/readability-gate.md Outdated
Comment thread formats/readability-revision-report.md
Address fourth round of PR review feedback and a self-audit for internal
contradictions.

- readability-gate: reconcile the pass criteria with the Expert-tier
  "loose floor" note — for the Expert tier the proxy thresholds are
  authoritative and a missed Flesch band is recorded as a residual issue
  rather than failing the gate
- readability-revision-report: rename "Metric source" to "Flesch metric
  source" and note that proxy metrics are always measured
- revise-for-readability: align the quality-checklist wording to "Flesch
  metric source"

Self-audit confirmed proxy thresholds and Flesch bands are otherwise
consistent across the gate, workflow, format, and template.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 9, 2026 16:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread templates/revise-for-readability.md Outdated
Comment thread protocols/reasoning/readability-revision-workflow.md
Comment thread formats/readability-revision-report.md
Comment thread formats/readability-revision-report.md
Address the internal contradiction between the "do not add or remove content"
constraint and the requirement to eliminate undefined terms on first use.

- revise-for-readability: clarify Non-Goals so a minimal definition or acronym
  expansion that restates existing meaning counts as prose revision, not new
  content
- readability-revision-workflow: plain-language rule 4 now allows definitions
  only when they restate meaning already present; otherwise the undefined term
  is recorded as a residual issue

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 9, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants