voice-analyze
Reverse-engineer voice profiles from sample content by analyzing writing patterns.
Triggers
- "analyze this writing style"
- "extract voice from..."
- "what voice is this?"
- "create profile from this sample"
- "match this writing style"
Behavior
When triggered, this skill:
Analyzes text samples for:
- Sentence structure and length patterns
- Vocabulary sophistication and domain
- Tone markers (formality, confidence, warmth)
- Structural patterns (lists, examples, questions)
- Perspective and voice choices
Extracts measurable features:
- Average sentence length
- Vocabulary complexity (syllables, word length)
- Contraction usage
- Personal pronoun frequency
- Question density
- List/bullet usage
Maps features to voice dimensions:
- Statistical analysis → tone scale values (0-1)
- Pattern detection → structure preferences
- Vocabulary extraction → prefer/avoid lists
Generates voice profile matching the analyzed style
Usage Examples
Analyze Existing Documentation
User: "Analyze this writing style" + [paste technical docs]
Analysis:
- Formality: 0.7 (no contractions, structured sentences)
- Confidence: 0.85 (direct statements, few hedges)
- Warmth: 0.25 (impersonal, third-person)
- Complexity: 0.8 (technical vocabulary, long sentences)
Output: analyzed-technical-docs.yaml
Match Brand Voice
User: "Extract voice from our marketing copy" + [paste samples]
Analysis:
- Formality: 0.3 (conversational, contractions)
- Confidence: 0.7 (benefit claims, but some hedging)
- Warmth: 0.85 (second person, friendly tone)
- Energy: 0.8 (exclamation points, action verbs)
Output: brand-marketing-voice.yaml
Capture Personal Style
User: "Create profile from my blog posts" + [paste samples]
Analysis:
- Identifies personal writing quirks
- Extracts signature phrases
- Maps to voice dimensions
Output: personal-blog-voice.yaml
Analysis Methodology
Feature Extraction
| Feature |
Measurement |
Maps To |
| Sentence length |
Avg words/sentence |
complexity |
| Contractions |
Frequency per 100 words |
formality (inverse) |
| First person ("I", "we") |
Frequency |
warmth |
| Second person ("you") |
Frequency |
warmth |
| Passive voice |
Percentage of sentences |
confidence (inverse) |
| Questions |
Per paragraph |
warmth, engagement |
| Hedging words |
"might", "perhaps", "could" |
confidence (inverse) |
| Exclamation marks |
Frequency |
energy |
| Technical terms |
Domain vocabulary density |
complexity |
Dimension Calibration
Formality (0-1):
- 0.0-0.3: Contractions frequent, casual language, fragments okay
- 0.4-0.6: Mixed style, professional but accessible
- 0.7-1.0: No contractions, complete sentences, formal structure
Confidence (0-1):
- 0.0-0.3: Many hedges ("might", "perhaps"), questions, qualifiers
- 0.4-0.6: Balanced certainty, occasional hedges
- 0.7-1.0: Direct statements, conclusions first, few qualifiers
Warmth (0-1):
- 0.0-0.3: Third person, passive voice, clinical tone
- 0.4-0.6: Professional but personable
- 0.7-1.0: Second person, inclusive language, empathetic
Energy (0-1):
- 0.0-0.3: Calm, measured, understated
- 0.4-0.6: Balanced engagement
- 0.7-1.0: Exclamation marks, action verbs, dynamic phrasing
Complexity (0-1):
- 0.0-0.3: Short sentences, simple vocabulary, accessible
- 0.4-0.6: Moderate complexity, clear but nuanced
- 0.7-1.0: Long sentences, technical vocabulary, layered ideas
Vocabulary Extraction
Signature phrases - Identified by:
- Repeated patterns across samples
- Distinctive constructions
- Opening/closing patterns
Domain vocabulary - Extracted by:
- Technical term frequency
- Specialized jargon
- Industry-specific language
Avoid patterns - Detected by:
- Conspicuous absence of common phrases
- Consistent avoidance of certain constructions
Output Format
name: analyzed-sample-voice
version: 1.0.0
description: Voice profile extracted from sample content
analysis_source:
sample_size: 1500 # words analyzed
sample_count: 3 # number of samples
confidence: 0.85 # analysis confidence score
tone:
formality: 0.65
confidence: 0.8
warmth: 0.4
energy: 0.5
complexity: 0.7
vocabulary:
prefer:
- "extracted signature phrase 1"
- "detected domain terminology"
avoid:
- "patterns not found in samples"
signature_phrases:
- "The key point is..."
- "This demonstrates..."
structure:
sentence_length: medium # avg 15-20 words
paragraph_length: medium # avg 4-6 sentences
sentence_variety: high # varied structure detected
use_lists: when-appropriate
use_examples: frequently
use_questions: rarely
perspective:
person: third
voice: active
tense: present
extracted_patterns:
opening_style: "context-first"
closing_style: "conclusion-summary"
transition_style: "logical-flow"
CLI Usage
# Analyze from file
python voice_analyzer.py --input sample.txt
# Analyze from multiple files
python voice_analyzer.py --input "sample1.txt,sample2.txt,sample3.txt"
# Analyze from stdin (pipe content)
cat sample.txt | python voice_analyzer.py --stdin
# Specify output name
python voice_analyzer.py --input sample.txt --name my-extracted-voice
# Output to specific directory
python voice_analyzer.py --input sample.txt --output .aiwg/voices/
# JSON output for inspection
python voice_analyzer.py --input sample.txt --json
Integration
- Output: Creates profiles usable by
voice-apply
- Chain:
voice-analyze → voice-create (to refine) → voice-apply
- Chain:
voice-analyze + voice-analyze → voice-blend (combine styles)
Accuracy Considerations
- Minimum sample: 500+ words for reliable analysis
- Multiple samples: 3+ samples improve accuracy
- Consistent genre: Mixing genres reduces accuracy
- Confidence score: Output includes analysis confidence (0-1)
References
- Schema:
../../../schemas/voice-profile.schema.json
- Dimensions guide:
../voice-apply/references/voice-dimensions.md
- Generator:
../voice-create/scripts/voice_generator.py
1---2name: voice-analyze3description: Reverse-engineer voice profiles from sample content by analyzing writing patterns. Use when relevant to the task.4---5
6# voice-analyze
7
8Reverse-engineer voice profiles from sample content by analyzing writing patterns.
9
10## Triggers
11
12- "analyze this writing style"
13- "extract voice from..."
14- "what voice is this?"
15- "create profile from this sample"
16- "match this writing style"
17
18## Behavior
19
20When triggered, this skill:
21
221. **Analyzes text samples** for:
23 - Sentence structure and length patterns
24 - Vocabulary sophistication and domain
25 - Tone markers (formality, confidence, warmth)
26 - Structural patterns (lists, examples, questions)
27 - Perspective and voice choices
28
292. **Extracts measurable features**:
30 - Average sentence length
31 - Vocabulary complexity (syllables, word length)
32 - Contraction usage
33 - Personal pronoun frequency
34 - Question density
35 - List/bullet usage
36
373. **Maps features to voice dimensions**:
38 - Statistical analysis → tone scale values (0-1)
39 - Pattern detection → structure preferences
40 - Vocabulary extraction → prefer/avoid lists
41
424. **Generates voice profile** matching the analyzed style
43
44## Usage Examples
45
46### Analyze Existing Documentation
47```
48User: "Analyze this writing style" + [paste technical docs]
49
50Analysis:
51- Formality: 0.7 (no contractions, structured sentences)
52- Confidence: 0.85 (direct statements, few hedges)
53- Warmth: 0.25 (impersonal, third-person)
54- Complexity: 0.8 (technical vocabulary, long sentences)
55
56Output: analyzed-technical-docs.yaml
57```
58
59### Match Brand Voice
60```
61User: "Extract voice from our marketing copy" + [paste samples]
62
63Analysis:
64- Formality: 0.3 (conversational, contractions)
65- Confidence: 0.7 (benefit claims, but some hedging)
66- Warmth: 0.85 (second person, friendly tone)
67- Energy: 0.8 (exclamation points, action verbs)
68
69Output: brand-marketing-voice.yaml
70```
71
72### Capture Personal Style
73```
74User: "Create profile from my blog posts" + [paste samples]
75
76Analysis:
77- Identifies personal writing quirks
78- Extracts signature phrases
79- Maps to voice dimensions
80
81Output: personal-blog-voice.yaml
82```
83
84## Analysis Methodology
85
86### Feature Extraction
87
88| Feature | Measurement | Maps To |
89|---------|-------------|---------|
90| Sentence length | Avg words/sentence | complexity |
91| Contractions | Frequency per 100 words | formality (inverse) |
92| First person ("I", "we") | Frequency | warmth |
93| Second person ("you") | Frequency | warmth |
94| Passive voice | Percentage of sentences | confidence (inverse) |
95| Questions | Per paragraph | warmth, engagement |
96| Hedging words | "might", "perhaps", "could" | confidence (inverse) |
97| Exclamation marks | Frequency | energy |
98| Technical terms | Domain vocabulary density | complexity |
99
100### Dimension Calibration
101
102**Formality** (0-1):
103- 0.0-0.3: Contractions frequent, casual language, fragments okay
104- 0.4-0.6: Mixed style, professional but accessible
105- 0.7-1.0: No contractions, complete sentences, formal structure
106
107**Confidence** (0-1):
108- 0.0-0.3: Many hedges ("might", "perhaps"), questions, qualifiers
109- 0.4-0.6: Balanced certainty, occasional hedges
110- 0.7-1.0: Direct statements, conclusions first, few qualifiers
111
112**Warmth** (0-1):
113- 0.0-0.3: Third person, passive voice, clinical tone
114- 0.4-0.6: Professional but personable
115- 0.7-1.0: Second person, inclusive language, empathetic
116
117**Energy** (0-1):
118- 0.0-0.3: Calm, measured, understated
119- 0.4-0.6: Balanced engagement
120- 0.7-1.0: Exclamation marks, action verbs, dynamic phrasing
121
122**Complexity** (0-1):
123- 0.0-0.3: Short sentences, simple vocabulary, accessible
124- 0.4-0.6: Moderate complexity, clear but nuanced
125- 0.7-1.0: Long sentences, technical vocabulary, layered ideas
126
127### Vocabulary Extraction
128
129**Signature phrases** - Identified by:
130- Repeated patterns across samples
131- Distinctive constructions
132- Opening/closing patterns
133
134**Domain vocabulary** - Extracted by:
135- Technical term frequency
136- Specialized jargon
137- Industry-specific language
138
139**Avoid patterns** - Detected by:
140- Conspicuous absence of common phrases
141- Consistent avoidance of certain constructions
142
143## Output Format
144
145```yaml
146name: analyzed-sample-voice
147version: 1.0.0
148description: Voice profile extracted from sample content
149analysis_source:
150 sample_size: 1500 # words analyzed
151 sample_count: 3 # number of samples
152 confidence: 0.85 # analysis confidence score
153tone:
154 formality: 0.65
155 confidence: 0.8
156 warmth: 0.4
157 energy: 0.5
158 complexity: 0.7
159vocabulary:
160 prefer:
161 - "extracted signature phrase 1"
162 - "detected domain terminology"
163 avoid:
164 - "patterns not found in samples"
165 signature_phrases:
166 - "The key point is..."
167 - "This demonstrates..."
168structure:
169 sentence_length: medium # avg 15-20 words
170 paragraph_length: medium # avg 4-6 sentences
171 sentence_variety: high # varied structure detected
172 use_lists: when-appropriate
173 use_examples: frequently
174 use_questions: rarely
175perspective:
176 person: third
177 voice: active
178 tense: present
179extracted_patterns:
180 opening_style: "context-first"
181 closing_style: "conclusion-summary"
182 transition_style: "logical-flow"
183```
184
185## CLI Usage
186
187```bash
188# Analyze from file
189python voice_analyzer.py --input sample.txt
190
191# Analyze from multiple files
192python voice_analyzer.py --input "sample1.txt,sample2.txt,sample3.txt"
193
194# Analyze from stdin (pipe content)
195cat sample.txt | python voice_analyzer.py --stdin
196
197# Specify output name
198python voice_analyzer.py --input sample.txt --name my-extracted-voice
199
200# Output to specific directory
201python voice_analyzer.py --input sample.txt --output .aiwg/voices/
202
203# JSON output for inspection
204python voice_analyzer.py --input sample.txt --json
205```
206
207## Integration
208
209- **Output**: Creates profiles usable by `voice-apply`
210- **Chain**: `voice-analyze` → `voice-create` (to refine) → `voice-apply`
211- **Chain**: `voice-analyze` + `voice-analyze` → `voice-blend` (combine styles)
212
213## Accuracy Considerations
214
215- **Minimum sample**: 500+ words for reliable analysis
216- **Multiple samples**: 3+ samples improve accuracy
217- **Consistent genre**: Mixing genres reduces accuracy
218- **Confidence score**: Output includes analysis confidence (0-1)
219
220## References
221
222- Schema: `../../../schemas/voice-profile.schema.json`
223- Dimensions guide: `../voice-apply/references/voice-dimensions.md`
224- Generator: `../voice-create/scripts/voice_generator.py`