My Tone Of Voice
March 25, 2026 · View on GitHub
A curated corpus of writing samples, annotated with metadata, intended to serve as an objective ground truth for a personal writing style.
Note: This repository is shared publicly as an example of how to build a tone-of-voice reference for AI agents. To use this approach for your own writing, fork the repo, replace the samples in
samples/with your own articles, and re-run the analysis. The methodology, structure, and tooling are reusable — the samples and outputs here are specific to the author (Daniel Rosehill) and serve only as a demonstration.
Purpose
This repo is designed to be consumed by AI agents that need to write in a specific author's voice. By collecting real articles across different formats (longform narrative, opinion essays, technical writeups, etc.) and preserving their original formatting, agents can analyse parametric data like typical paragraph length, heading structure, sentence rhythm, and stylistic patterns — then consolidate it into a single reference profile.
Outputs
The analysis/ directory contains discrete research outputs that feed into the final writing style instruction set:
| File | Description |
|---|---|
analysis/01-stylistic-analysis.md | Qualitative analysis of voice, tone, rhetorical devices, and prose style (n=15) |
analysis/02-parametric-analysis.md | Programmatic metrics: paragraph length, heading frequency, word counts, sentence structure, punctuation density (n=15) |
analysis/03-format-differentiation.md | How style inflects across 5 format categories (narrative, opinion, technical, guide, proposal) with per-format parametric profiles (n=15) |
writing-style.md | The synthesised instruction set — a comprehensive document AI agents can consume to emulate the author's voice, including biographical context, parametric targets, device deployment rules, argumentative architecture, format-specific instructions, and anti-patterns (n=15) |
As the sample corpus grows, these outputs will be regenerated to reflect a larger and more representative dataset, including historical evolution of the writing style over time.
Structure
samples/
1/
article.md # Full article text with original formatting
metadata.yaml # Title, URL, publication, type, why it's included
images/ # (optional) embedded images
2/
...
template.yaml # Metadata template for new samples
Each sample folder contains:
- article.md — the article text in markdown, with headers and formatting preserved exactly as published
- metadata.yaml — structured metadata including the type/format of writing and why it was selected as representative
Adding New Samples
- Create a new numbered folder under
samples/ - Scrape the article:
trafilatura -u "URL" --formatting > samples/N/article.md - Add a title as an H1 if trafilatura doesn't capture it
- Copy
template.yamltosamples/N/metadata.yamland fill it in
Scraping Tool
Articles are scraped using trafilatura (Python), which extracts article content while preserving markdown formatting (headers, lists, emphasis, code blocks). It strips navigation, ads, and boilerplate.
pip install trafilatura
trafilatura -u "https://example.com/article" --formatting
This was chosen over alternatives because it:
- Preserves heading hierarchy (H1-H6) faithfully
- Outputs clean markdown natively (no HTML-to-markdown conversion needed)
- Handles a wide range of site layouts reliably
- Is actively maintained and well-documented