infrastructure-prose
Prose analysis utilities for research manuscripts and prose-focused projects. Provides readability metrics (Flesch, Flesch-Kincaid, Gunning Fog), heading-outline structural analysis, editorial quality flags (passive voice, hedge words, citation density, long sentences), aggregate ManuscriptReport across a manuscript directory, and a CLI (metrics/outline/quality/report). Use when analyzing manuscripts for readability, building editorial dashboards, validating heading structure, extracting citation keys from prose, or wiring prose-quality gates into the pipeline.
Best use case
infrastructure-prose is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Prose analysis utilities for research manuscripts and prose-focused projects. Provides readability metrics (Flesch, Flesch-Kincaid, Gunning Fog), heading-outline structural analysis, editorial quality flags (passive voice, hedge words, citation density, long sentences), aggregate ManuscriptReport across a manuscript directory, and a CLI (metrics/outline/quality/report). Use when analyzing manuscripts for readability, building editorial dashboards, validating heading structure, extracting citation keys from prose, or wiring prose-quality gates into the pipeline.
Teams using infrastructure-prose should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/prose/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How infrastructure-prose Compares
| Feature / Agent | infrastructure-prose | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Prose analysis utilities for research manuscripts and prose-focused projects. Provides readability metrics (Flesch, Flesch-Kincaid, Gunning Fog), heading-outline structural analysis, editorial quality flags (passive voice, hedge words, citation density, long sentences), aggregate ManuscriptReport across a manuscript directory, and a CLI (metrics/outline/quality/report). Use when analyzing manuscripts for readability, building editorial dashboards, validating heading structure, extracting citation keys from prose, or wiring prose-quality gates into the pipeline.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Prose Module
Editorial-grade prose analysis: readability, structure, quality flags,
and manuscript-wide aggregation.
```mermaid
flowchart LR
MD[Markdown manuscript] --> NORM[normalise_for_prose<br/>strip front-matter · fences ·<br/>inline code · links]
NORM --> METRICS[ProseMetrics<br/>Flesch · FKGL · Gunning Fog]
NORM --> QUALITY[QualityReport<br/>passive · hedges · citations ·<br/>long sentences]
MD --> STRUCT[StructureReport<br/>headings · sections · word counts]
METRICS --> AGG[ManuscriptReport]
QUALITY --> AGG
STRUCT --> AGG
classDef io fill:#0f766e,stroke:#0f172a,color:#fff
classDef proc fill:#1e3a8a,stroke:#0f172a,color:#fff
classDef out fill:#7c2d12,stroke:#0f172a,color:#fff
class MD io
class NORM,METRICS,QUALITY,STRUCT proc
class AGG out
```
## Readability metrics
```python
from infrastructure.prose import compute_metrics, normalise_for_prose
text = "The cat sat on the mat. Dogs run fast."
metrics = compute_metrics(normalise_for_prose(text))
print(metrics.flesch_reading_ease) # 100+ — very easy
print(metrics.flesch_kincaid_grade) # ~1
print(metrics.gunning_fog) # ~1.6
```
## Heading structure
```python
from infrastructure.prose import analyze_structure, render_outline
report = analyze_structure(open("manuscript/02_methodology.md").read())
print(report.has_h1, report.max_depth, report.has_skipped_level)
print(render_outline(report))
```
## Quality flags
```python
from infrastructure.prose import analyze_quality
q = analyze_quality(text)
q.passive_count, q.hedge_count, q.citation_count, q.long_sentence_count
q.citation_density_per_1000 # citations per 1000 words
```
## Whole-manuscript report
```python
from infrastructure.prose import analyze_manuscript, write_report
report = analyze_manuscript("projects/my_project/manuscript")
write_report(report, "output/prose_report.json")
print(report.total_words, report.avg_flesch_kincaid_grade)
```
## CLI
```bash
# Metrics for a single file
uv run python -m infrastructure.prose.cli metrics path/to/section.md
# Heading outline
uv run python -m infrastructure.prose.cli outline path/to/section.md
# Editorial quality
uv run python -m infrastructure.prose.cli quality path/to/section.md \
--long-sentence-threshold 30
# Whole-manuscript JSON report
uv run python -m infrastructure.prose.cli report \
projects/my_project/manuscript \
--output output/prose_report.json
```
## Design notes
* **Pure functions, deterministic.** No I/O outside the `report` and
`cli` layers. `compute_metrics`, `analyze_structure`, `analyze_quality`
are stable across versions.
* **Heuristics only.** Passive-voice detection uses "be + past
participle"; hedge detection is a fixed word list; syllable counting
is a vowel-group rule. Each is good enough for a writer-friendly
signal, not for linguistic research.
* **Handles Markdown.** `normalise_for_prose` strips front-matter,
fenced code, inline code, and link URLs so metrics reflect prose, not
scaffolding.
* **Citation extraction.** `extract_citation_keys` recognises both
`[@key1; @key2]` and bare `@key` forms used by Pandoc.Related Skills
infrastructure-validation
Skill for the validation infrastructure module providing PDF validation, markdown validation, output integrity checks, link verification, documentation audits, issue categorization, and repository scanning. Use when validating research outputs, checking document quality, running audits, or verifying cross-references.
infrastructure-steganography
Skill for the steganography infrastructure module providing QR code generation with dynamic mailto links, hash manifests, metadata payloads, and document-wide overlay processing. Use this module to insert opt-in cryptographic and steganographic provenance data onto PDFs.
infrastructure-skills
Programmatic discovery of first-party agent SKILL.md files under configured public repo roots (infrastructure, projects, docs/prompts, and .cursor/skills). Use when enumerating skills, validating .cursor/skill_manifest.json, writing docs/_generated/skills_index.md, checking docs/prompts workflow contracts, or wiring editor automation. Exposes discover_skills, write_skill_manifest, manifest_matches_discovery, and check_skill_contracts.
infrastructure-search-literature
Paperclip-style multi-source literature search across arXiv, Crossref, local JSON corpora, and (opt-in) the Paperclip API. Provides Paper/SearchQuery/SearchResult data models, a LiteratureClient aggregator with per-backend failure isolation, DOI/arXiv-aware deduplication via merge_papers, deterministic JSON caching via SearchCache, an HttpClient protocol for test injection, and a CLI (search/to-bibtex). Use when finding papers by topic, building reading lists, populating references.bib from a query, or replaying a prior search reproducibly.
infrastructure-search
Discovery utilities for academic literature. Currently exposes the `literature` submodule — Paperclip-style multi-source search across arXiv, Crossref, local JSON corpora, and (opt-in) the Paperclip API, with deterministic JSON caching, a `LiteratureClient` aggregator, normalised `Paper` records, and a CLI. Use when the user wants to find papers, build reading lists, populate references.bib from a query, or replay a prior search reproducibly. Designed to host additional discovery workflows without breaking the public API.
infrastructure-scientific
Skill for the scientific infrastructure module providing numerical stability checks, performance benchmarking, scientific documentation generation, implementation validation, and module/workflow templates. Use when benchmarking functions, checking numerical stability, validating scientific implementations, or creating scientific module scaffolds.
infrastructure-reporting
Skill for the reporting infrastructure module providing pipeline reporting, error aggregation, executive summaries, dashboard generation, test reporting, and multi-project reports. Use when generating build reports, aggregating errors, creating visual dashboards, or producing executive summaries across projects.
infrastructure-rendering
Skill for the rendering infrastructure module providing multi-format output generation including PDF manuscripts, HTML web pages, Beamer/Reveal.js slides, and posters. Use when rendering research outputs, converting markdown to PDF, generating slides, or configuring LaTeX rendering.
infrastructure-reference-citation
BibTeX read/write/convert that matches the syntax/semantics of projects/template_code_project/manuscript/references.bib (consumed by Pandoc with --natbib -- see infrastructure/rendering/_pdf_combined_renderer.py). Provides BibEntry/BibDatabase models, parse_bibfile/render_database functions, paper_to_bibentry conversion from literature search results, generate_citation_key in the project's house style (firstauthorlastname+year+firsttitleword), LaTeX-special-character escape helpers, and a CLI (validate/format/convert). Use when reading or writing .bib files, exporting search results to BibTeX, or generating citation keys.
infrastructure-reference
Bibliographic-reference utilities for research projects. Read, write, and convert BibTeX entries that match the syntax/semantics of projects/template_code_project/manuscript/references.bib (consumed by Pandoc with --natbib during PDF render -- see infrastructure/rendering/_pdf_combined_renderer.py). Currently exposes the `citation` submodule (BibTeX I/O + Paper→BibEntry conversion); designed to host additional reference workflows (e.g. CSL-JSON export, ORCID lookups) without breaking the public API.
infrastructure-publishing
Skill for the publishing infrastructure module providing academic publishing workflows including BibTeX CLI citation generation, APA/MLA citation helper functions, DOI management, Zenodo publication, arXiv submission preparation, GitHub releases, and publication readiness validation. Use when publishing research, generating citations, minting DOIs, or preparing submissions.
infrastructure-project
Skill for the project management infrastructure module providing multi-project discovery, structure validation, and metadata extraction. Use when discovering active projects, validating project directory structure, or extracting project configuration metadata.