Skip to main content

Compile your AI chat history into a writing-style skill.

Project description

chatlectify

Compile your AI chat history into a writing-style skill.

CI CodeQL License: MIT Python

chatlectify turns your exported AI conversations (Claude, ChatGPT, Gemini) or any corpus of your own writing into a portable SKILL.md file. Drop that file into a Claude skill folder, paste the system_prompt.txt into any LLM, and the model writes like you — not like the factory-default assistant.

It's a small, local CLI. Your chat data never leaves your machine except when it makes the single LLM call that distills the style file.


Why

Every large model speaks the same corporate-cheerful dialect out of the box: "Certainly!", "Great question!", "In conclusion...". If you've spent a year chatting with it, you have a voice and it has no idea. chatlectify mines that voice from your own messages and hands you back a reusable style artifact.

What you get

Running the pipeline on one export produces:

File Purpose
SKILL.md Claude-compatible skill file (frontmatter + rules + exemplars + anti-patterns + quantified targets)
system_prompt.txt Drop-in system prompt for any LLM
style_metrics.json Raw stylometric features (TTR, sentence length, punctuation histograms, …)
exemplars.json Stratified sample of your best messages
gate_report.json Quality-gate pass/fail reasons
pipeline_report.json End-to-end run summary
benchmark_report.json (optional) Fidelity measurement vs. a baseline prompt

Install

pip install chatlectify

Or from source:

git clone https://github.com/0x1Adi/chatlectify
cd chatlectify
pip install -e ".[dev]"

Requires Python 3.11+.

Auth

The synth step needs one LLM call. chatlectify auto-detects either:

  • An API key: ANTHROPIC_API_KEY (default) or OPENAI_API_KEY.
  • A local CLI: the claude CLI (default) or codex CLI.

If neither is available, the pipeline still runs and emits a deterministic fallback skill using your extracted features.


Quick start

1. Export your chat history

  • Claude — Settings → Privacy → Export data. Unzip; you need conversations.json.
  • ChatGPT — Settings → Data Controls → Export. Unzip; you need conversations.json.
  • Gemini — Takeout; the .html file works.
  • Your own writing — any folder of .txt / .md / .markdown / .rst files.

2. Build the skill

chatlectify all ./conversations.json --out-dir ./skill

That's it. Open ./skill/SKILL.md.

3. Use the skill

With Claude Code / Claude Desktop: Copy the folder into ~/.claude/skills/<skill_name>/.

With any other LLM: Paste ./skill/system_prompt.txt as the system prompt.


CLI

chatlectify ingest <input>    Normalize an export into messages.
chatlectify features <input>  Extract stylometric features only.
chatlectify build <input>     Build SKILL.md (skip benchmark).
chatlectify benchmark ...     Measure fidelity vs. baseline.
chatlectify all <input>       Full pipeline.

Common options:

  • --out-dir PATH — where to write artifacts.
  • --provider {anthropic,openai} — default anthropic.
  • --model MODEL — override the default model.
  • --benchmark — opt in to fidelity measurement (makes 2N extra LLM calls).
  • --n N — benchmark sample size (default 100).
  • --force — bypass quality gates (use at your own risk).

Run chatlectify <cmd> --help for full flags.


Pipeline

  ingest  ->  clean  ->  features  ->  gates  ->  synth  ->  (benchmark)  ->  emit
  • ingest — parses export formats (Claude, ChatGPT, Gemini, plaintext) into a normalized Message[].
  • clean — strips code fences, URLs, emails; dedupes near-duplicates; flags pastes.
  • features — computes 20+ stylometric metrics (lexical, syntactic, structural).
  • gates — blocks low-quality runs: <200 messages, <20k characters, >50% pastes.
  • synth — asks one LLM call to distill features + exemplars + anti-patterns into a SKILL.md. Falls back to a deterministic template if the call fails or produces invalid output.
  • benchmark (optional) — generates N pairs of baseline vs. skill-prompted completions and measures (a) char-n-gram ROC-AUC between your text and each (lower = more indistinguishable from you) and (b) feature-distance reduction.
  • emit — writes all artifacts to --out-dir.

Privacy

  • Everything runs locally. The only egress is the single synth call (and optional benchmark calls) to your chosen provider.
  • Default .gitignore excludes conversations.json, SKILL.md, and all intermediate JSON — your data and voice stay yours.
  • Nothing is telemetered; no analytics; no cloud component.

Development

pip install -e ".[dev]"
ruff check src/ tests/
pytest -ra
pytest --cov=chatlectify --cov-report=term-missing

See CONTRIBUTING.md for contribution guidelines and SECURITY.md to report vulnerabilities.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatlectify-0.1.0.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chatlectify-0.1.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file chatlectify-0.1.0.tar.gz.

File metadata

  • Download URL: chatlectify-0.1.0.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatlectify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f9e4f8ac3c2167a9e91a5dece3492fe319cd2a03c4323bde0f53bf8642dfb96
MD5 af95e8fe8f00168b3685d14c78205315
BLAKE2b-256 b2e346dac8b49455259278f93869610679379dde567647b5829b7a961ba47ff4

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatlectify-0.1.0.tar.gz:

Publisher: release.yml on 0x1Adi/chatlectify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chatlectify-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chatlectify-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatlectify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6851ef821952d157e8ee51d1a7bc11f6fecb46ca7a8a50088521ecc9d113887b
MD5 9ccd3fe2ed1f15fb13be64252e43e2e9
BLAKE2b-256 fc20f77dc28416b39403237052723440972d4e1e81a95cf5d45c53f5dc2757e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatlectify-0.1.0-py3-none-any.whl:

Publisher: release.yml on 0x1Adi/chatlectify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page