style-learner
Scannednpx machina-cli add skill athola/claude-night-market/style-learner --openclawStyle Learning Skill
Extract and codify writing style from exemplar text for consistent application.
Approach: Feature Extraction + Exemplar Reference
This skill combines two complementary methods:
- Feature Extraction: Quantifiable style metrics (sentence length, vocabulary complexity, structural patterns)
- Exemplar Reference: Specific passages that demonstrate desired style
Together, these create a comprehensive style profile that can guide content generation and editing.
Required TodoWrite Items
style-learner:exemplar-collected- Source texts gatheredstyle-learner:features-extracted- Quantitative metrics computedstyle-learner:exemplars-selected- Representative passages identifiedstyle-learner:profile-generated- Style guide createdstyle-learner:validation-complete- Profile tested against new content
Step 1: Collect Exemplar Text
Gather representative samples of the target style.
Minimum requirements:
- At least 1000 words of exemplar text
- Multiple samples preferred (shows consistency)
- Same genre/context as target output
## Exemplar Sources
| Source | Word Count | Type |
|--------|------------|------|
| README.md | 850 | Technical |
| blog-post-1.md | 1200 | Narrative |
| api-guide.md | 2100 | Reference |
Step 2: Feature Extraction
Load: @modules/feature-extraction.md
Vocabulary Metrics
| Metric | How to Measure | What It Indicates |
|---|---|---|
| Average word length | chars/word | Complexity level |
| Unique word ratio | unique/total | Vocabulary breadth |
| Jargon density | technical terms/100 words | Audience level |
| Contraction rate | contractions/sentences | Formality |
Sentence Metrics
| Metric | How to Measure | What It Indicates |
|---|---|---|
| Average length | words/sentence | Complexity |
| Length variance | std dev of lengths | Natural variation |
| Question frequency | questions/100 sentences | Engagement style |
| Fragment usage | fragments/100 sentences | Stylistic punch |
Structural Metrics
| Metric | How to Measure | What It Indicates |
|---|---|---|
| Paragraph length | sentences/paragraph | Density |
| List ratio | bullet lines/total lines | Format preference |
| Header depth | max header level | Organization style |
| Code block frequency | code blocks/1000 words | Technical density |
Punctuation Profile
| Metric | Normal Range | Style Indicator |
|---|---|---|
| Em dash rate | 0-3/1000 words | Parenthetical style |
| Semicolon rate | 0-2/1000 words | Formal complexity |
| Exclamation rate | 0-1/1000 words | Enthusiasm level |
| Ellipsis rate | 0-1/1000 words | Trailing thought style |
Step 3: Exemplar Selection
Load: @modules/exemplar-reference.md
Select 3-5 passages (50-150 words each) that best represent the target style.
Selection criteria:
- Demonstrates characteristic sentence rhythm
- Shows typical vocabulary choices
- Represents the desired tone
- Avoids atypical or exceptional passages
Exemplar Template
### Exemplar 1: [Label]
**Source**: [filename, lines X-Y]
**Demonstrates**: [what aspect of style]
> [Quoted passage]
**Key characteristics**:
- [Observation 1]
- [Observation 2]
Step 4: Generate Style Profile
Combine extracted features and exemplars into a usable style guide.
Profile Format
# Style Profile: [Name]
# Generated: [Date]
# Exemplar sources: [List]
voice:
tone: [professional/casual/academic/conversational]
perspective: [first-person/third-person/second-person]
formality: [formal/neutral/informal]
vocabulary:
average_word_length: X.X
jargon_level: [none/light/moderate/heavy]
contractions: [avoid/occasional/frequent]
preferred_terms:
- "use" over "utilize"
- "help" over "facilitate"
avoided_terms:
- delve
- leverage
- comprehensive
sentences:
average_length: XX words
length_variance: [low/medium/high]
fragments_allowed: [yes/no/sparingly]
questions_used: [yes/no/sparingly]
structure:
paragraphs: [short/medium/long] (X-Y sentences)
lists: [prefer prose/balanced/prefer lists]
headers: [descriptive/terse/question-style]
punctuation:
em_dashes: [avoid/sparingly/freely]
semicolons: [avoid/sparingly/freely]
oxford_comma: [yes/no]
exemplars:
- label: "[Exemplar 1 label]"
text: |
[Quoted passage]
- label: "[Exemplar 2 label]"
text: |
[Quoted passage]
anti_patterns:
- [Pattern to avoid 1]
- [Pattern to avoid 2]
Step 5: Validation
Test the profile against new content:
- Generate sample content using the profile
- Compare metrics to extracted features
- Have user evaluate voice/tone match
- Refine profile based on feedback
Validation Checklist
- Metrics within 20% of exemplar averages
- No anti-pattern violations
- Tone matches user expectation
- Vocabulary aligns with exemplars
- Structure follows profile guidelines
Usage in Generation
When generating new content, reference the profile:
Generate [content type] following the style profile:
- Voice: [from profile]
- Sentence length: target ~[X] words, vary between [Y-Z]
- Use exemplar passage as tone reference:
> [exemplar quote]
- Avoid: [anti-patterns from profile]
Module Reference
- See
modules/style-application.mdfor applying learned styles to new content
Integration with slop-detector
After generating content, run slop-detector to verify:
- No AI markers introduced
- Style metrics match profile
- Anti-patterns avoided
Exit Criteria
- Style profile document created
- At least 3 exemplar passages included
- Quantitative metrics extracted
- Anti-patterns from slop-detector integrated
- Validation test passed
Source
git clone https://github.com/athola/claude-night-market/blob/master/plugins/scribe/skills/style-learner/SKILL.mdView on GitHub Overview
Style-learner extracts writing style from exemplar text to create a reusable style profile. It combines feature extraction with exemplar references to capture metrics like sentence length, vocabulary breadth, and tone. The resulting profile guides AI output and editing for consistency across documents.
How This Skill Works
The skill uses two methods: feature extraction and exemplar reference. Users collect 1000+ words of exemplar text, run feature extraction to compute metrics, and select 3-5 representative passages to form a style profile. The profile is then applied by the style-application workflow to guide content generation and editing.
When to Use It
- Create a style guide from existing content to ensure cross-document consistency.
- Learn and replicate a specific author's voice for new material.
- Customize AI-generated output to match a brand's tone and audience.
- Quantify style metrics and compare them across documents for governance.
- Prepare content for editing by aligning it to a target style before publication.
Quick Start
- Step 1: Collect exemplar texts that match your target style (minimum 1000 words).
- Step 2: Run feature extraction and select 3-5 representative passages to form the style profile.
- Step 3: Apply the resulting style guide with the style-application workflow during generation and editing.
Best Practices
- Use at least 1000 words of exemplar text per style and include multiple samples.
- Choose exemplars from the same genre and context as the target output.
- Select 3-5 representative passages that capture characteristic rhythm and vocabulary.
- Validate the resulting profile on new content and iterate as needed.
- Document and version the style profile for governance and reuse.
Example Use Cases
- A tech blog standardizes its tone to match a renowned author by building a style profile from exemplar posts.
- A marketing team aligns blog, product pages, and social content to a single brand voice using the generated style guide.
- A software API guide adopts clearer, reader-friendly language derived from exemplar passages.
- An internal knowledge base harmonizes documentation across departments to maintain consistent terminology and cadence.
- Editorial teams preserve a formal yet approachable voice across multiple manuals by applying the style profile to edits.