perplexity-improver
Skill112 starsChanged 10 months agoMITView on GitHub
Improve chapter perplexity score by rewriting AI-suspect sentences. Use after writing a chapter to reduce detectable AI patterns.
In this repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bible-mergerSkill
- book-analyzerSkill
- story-ideatorSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Use at the end of a writing session, not after each edit
- Distinctive: line 30
After writing a chapter, before final validation
- Distinctive: line 31
When perplexity analysis shows a warning (⚠️)
- Distinctive: line 47
If language not supported → report error and exit
- Distinctive: line 72
If no warning (⚠️) in output → PASS, report and exit
- Distinctive: line 73
If warning displayed (flagged rate > 25%) → proceed to Phase 3
- Distinctive: line 86
CRITICAL: Verify that meaning is preserved and rewrites integrate naturally.
- Distinctive: line 90
Run perplexity script on modified chapter.
- Distinctive: line 108
Ask for validation before applying changes to chapter file.
- Very specific: line 112
All thresholds are defined in scripts/detection/detection.py (constants at top of file).
- Distinctive: line 119
Ask for validation before applying changes to file
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Perplexity Improver Skill
Reduce AI-detectable patterns in chapters by rewriting low-perplexity sentences while preserving narrative integrity.
Quick Start
/perplexity-improver story/chapters/chapitre-05.mdMultiple chapters can be analyzed in one run:
/perplexity-improver story/chapters/chapitre-01.md story/chapters/chapitre-02.mdPerformance Warning
⚠️ The analysis script is SLOW (several minutes for model loading and analysis).
- Accumulate several corrections before re-running
- Use at the end of a writing session, not after each edit
When to Use
- After writing a chapter, before final validation
- When perplexity analysis shows a warning (⚠️)
Supported Languages
| Code | Language | Techniques File |
fr | Français | references/rewriting-techniques-fr.md |
en | English | references/rewriting-techniques-en.md |
Workflow
Phase 1: Analyze Chapter
1. Detect language from chapter content (first 500 characters):
- Identify language code (
fr,en, etc.) - Load corresponding techniques file:
references/rewriting-techniques-{lang}.md - If language not supported → report error and exit
2. Run perplexity analysis from the script directory (required for uv to find dependencies):
cd scripts/detection && uv run python detection.py ../../<path/to/chapter.md>Important: The uv run command must be executed from scripts/detection/ where the pyproject.toml is located.
3. Extract from output:
- Median perplexity score
- Warning status (median below threshold)
- Suspect rate (percentage of suspect sentences)
- List of suspect sentences sorted by ascending perplexity
Phase 2: Evaluate Need
The script flags sentences using multiple criteria:
- low_perplexity: individually predictable sentence
- low_std: passage with uniform perplexity (no surprises)
- adjacent_low: extended stretch without friction
- low_ppl_density: cumulative boredom signal
- forbidden_word: AI-signal vocabulary
Decision tree:
- If no warning (⚠️) in output → PASS, report and exit
- If warning displayed (flagged rate > 25%) → proceed to Phase 3
Priority: Sentences with multiple flags (multi-flagged) should be rewritten first using techniques from references/rewriting-techniques-{lang}.md.
Phase 3: Rewrite Sentences
Process sentences from lowest perplexity first (most predictable = most suspect).
For each suspect sentence:
- Locate in original chapter
- Rewrite using techniques from
references/rewriting-techniques-{lang}.md - Preserve exact meaning and narrative function
CRITICAL: Verify that meaning is preserved and rewrites integrate naturally.
Phase 4: Re-analyze
Run perplexity script on modified chapter.
Compare before/after:
- Median perplexity: target ≥ threshold (no warning)
- Suspect rate: target ≤ 20%
- Suspect sentence count: target reduction
If still warning:
- Iterate (max 3 loops)
- Try different rewriting techniques
- Focus on remaining lowest-perplexity sentences
Phase 5: Finalize
Generate reports in .work/:
perplexity-report.md: before/after stats, PASS/FAIL statusperplexity-changes.md: each rewritten sentence with technique used
Ask for validation before applying changes to chapter file.
Thresholds Reference
All thresholds are defined in scripts/detection/detection.py (constants at top of file).
Interaction Style
- Show progress after each phase
- Present before/after comparisons
- Explain technique choices
- Ask for validation before applying changes to file
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

