User Guides & Tutorials Skill v2.0
Skill Identity
skill_id: user-guides type: specialized_skill domain: technical_documentation responsibility: Generate user-focused documentation and tutorials atomicity: single-purpose
Input/Output Schemas
Input Schema
interface UserGuideInput { // Required guide_type: 'getting_started' | 'tutorial' | 'feature_guide' | 'troubleshooting' | 'faq' | 'reference';
// Content source source?: { product_name: string; product_version?: string; feature_list?: string[]; existing_docs?: string; ui_screenshots?: string[]; };
// Target audience target_audience?: 'beginner' | 'intermediate' | 'advanced' | 'mixed';
// Output preferences output_format?: 'markdown' | 'html' | 'rst' | 'docx';
// Content options include_screenshots?: boolean; include_troubleshooting?: boolean; include_faq?: boolean; include_next_steps?: boolean;
// Structure options structure?: { max_sections?: number; max_steps_per_section?: number; heading_style?: 'atx' | 'setext'; numbered_steps?: boolean; };
// Quality requirements quality?: { min_reading_level?: number; // Flesch-Kincaid grade level max_paragraph_length?: number; // words require_examples?: boolean; require_callouts?: boolean; }; }
Output Schema
interface UserGuideOutput { status: 'success' | 'partial_success' | 'failed';
// Generated content content: { title: string; sections: Section[]; full_document: string; };
// Structure metadata structure: { section_count: number; total_steps: number; word_count: number; reading_time_minutes: number; };
// Quality metrics quality: { readability_score: number; // 0-100 (Flesch Reading Ease) clarity_score: number; // 0-100 completeness_score: number; // 0-100 accessibility_score: number; // 0-100 };
// Validation validation: { is_valid: boolean; issues: ValidationIssue[]; suggestions: Suggestion[]; };
// Execution metadata metadata: { guide_type: string; target_audience: string; processing_time_ms: number; }; }
interface Section { title: string; content: string; steps?: Step[]; subsections?: Section[]; }
interface Step { number: number; instruction: string; expected_result?: string; screenshot?: string; tip?: string; }
Parameter Validation Rules
validation_rules: guide_type: type: string required: true enum: [getting_started, tutorial, feature_guide, troubleshooting, faq, reference] error_message: "guide_type must be one of: getting_started, tutorial, feature_guide, troubleshooting, faq, reference"
target_audience: type: string required: false default: mixed enum: [beginner, intermediate, advanced, mixed]
output_format: type: string required: false default: markdown enum: [markdown, html, rst, docx]
source.product_name: type: string required: true min_length: 2 max_length: 100
structure.max_sections: type: integer required: false default: 10 min: 1 max: 50
quality.min_reading_level: type: number required: false default: 8 min: 1 max: 18 description: "Flesch-Kincaid grade level target"
Retry Logic
async function executeWithRetry<T>( operation: () => Promise<T>, config: RetryConfig ): Promise<T> { let lastError: Error; let delay = config.backoff.initial_delay_ms;
for (let attempt = 1; attempt <= config.max_attempts; attempt++) { try { return await operation(); } catch (error) { lastError = error;
if (!isRetryableError(error)) {
throw error;
}
log.warn({
skill: 'user-guides',
attempt,
max_attempts: config.max_attempts,
delay_ms: delay,
error: error.message
});
if (attempt < config.max_attempts) {
await sleep(delay);
delay = Math.min(
delay * config.backoff.multiplier,
config.backoff.max_delay_ms
);
}
}
}
throw new SkillExecutionError(
'GUIDE_GENERATION_FAILED',
Failed after ${config.max_attempts} attempts,
lastError
);
}
Logging & Observability Hooks
Pre-Execution Hook
function preExecutionHook(input: UserGuideInput, context: ExecutionContext): void { log.info({ event: 'skill_invocation_start', skill: 'user-guides', trace_id: context.trace_id, input_summary: { guide_type: input.guide_type, target_audience: input.target_audience, product: input.source?.product_name } });
metrics.startTimer('guide_generation_duration'); metrics.increment('guide_invocations_total', { guide_type: input.guide_type, audience: input.target_audience });
const validation = validateInput(input); if (!validation.valid) { log.error({ event: 'input_validation_failed', errors: validation.errors }); throw new ValidationError(validation.errors); } }
Post-Execution Hook
function postExecutionHook( output: UserGuideOutput, context: ExecutionContext, duration: number ): void { log.info({ event: 'skill_invocation_complete', skill: 'user-guides', trace_id: context.trace_id, status: output.status, metrics: { duration_ms: duration, sections: output.structure.section_count, readability: output.quality.readability_score } });
metrics.stopTimer('guide_generation_duration'); metrics.record('guide_readability_score', output.quality.readability_score); metrics.record('guide_word_count', output.structure.word_count);
if (output.quality.readability_score < 60) { log.warn({ event: 'low_readability', score: output.quality.readability_score, suggestion: 'Consider simplifying language' }); } }
Guide Templates
Getting Started Guide Template
Getting Started with ${product_name}
Overview
${brief_description}
What you'll accomplish:
- ${objective_1}
- ${objective_2}
- ${objective_3}
Prerequisites:
- ${prerequisite_1}
- ${prerequisite_2}
Estimated time: ${estimated_time} minutes
Step 1: ${step_1_title}
${step_1_description}
${step_1_instructions}
Expected result: ${step_1_expected_result}
Step 2: ${step_2_title}
${step_2_description}
${step_2_instructions}
Tip: ${step_2_tip}
Step 3: ${step_3_title}
${step_3_description}
${step_3_instructions}
Verify Your Setup
To confirm everything is working:
- ${verification_step_1}
- ${verification_step_2}
Success indicators:
- ✅ ${success_indicator_1}
- ✅ ${success_indicator_2}
Troubleshooting
Common Issue: ${common_issue_1}
Solution: ${solution_1}
Common Issue: ${common_issue_2}
Solution: ${solution_2}
Next Steps
Now that you're set up, explore:
Need Help?
Tutorial Template
Tutorial: ${tutorial_title}
What You'll Learn
By the end of this tutorial, you will:
- ${learning_objective_1}
- ${learning_objective_2}
- ${learning_objective_3}
Prerequisites
Before starting, ensure you have:
- ${prerequisite_1}
- ${prerequisite_2}
- ${prerequisite_3}
Estimated time: ${estimated_time} minutes
Part 1: ${part_1_title}
Understanding ${concept}
${concept_explanation}
Why this matters: ${importance_explanation}
Hands-On: ${hands_on_task}
Step 1: ${step_1}
${step_1_details}
```${language} ${code_example_1} ```
Step 2: ${step_2}
${step_2_details}
```${language} ${code_example_2} ```
Checkpoint: ${checkpoint_verification}
Part 2: ${part_2_title}
${part_2_content}
Part 3: ${part_3_title}
${part_3_content}
Summary
What you accomplished:
- ✅ ${accomplishment_1}
- ✅ ${accomplishment_2}
- ✅ ${accomplishment_3}
Key takeaways:
- ${takeaway_1}
- ${takeaway_2}
- ${takeaway_3}
Practice Exercises
Exercise 1: ${exercise_1_title}
${exercise_1_description}
Exercise 2: ${exercise_2_title}
${exercise_2_description}
Next Steps
Continue your learning:
Troubleshooting Guide Template
Troubleshooting: ${topic}
Quick Diagnostic
Before diving into specific issues, run this checklist:
- ${check_1}
- ${check_2}
- ${check_3}
Common Issues
Issue: ${issue_1_title}
Symptoms:
- ${symptom_1}
- ${symptom_2}
Cause: ${cause}
Solution:
- ${solution_step_1}
- ${solution_step_2}
- ${solution_step_3}
Verification: ```bash ${verification_command} ```
Expected output: ``` ${expected_output} ```
Issue: ${issue_2_title}
Symptoms:
- ${symptom_1}
- ${symptom_2}
Quick Fix: ```bash ${quick_fix_command} ```
If that doesn't work: ${detailed_solution}
Collecting Debug Information
To help with troubleshooting, gather this information:
```bash
System information
${debug_command_1}
Logs
${debug_command_2}
Configuration
${debug_command_3} ```
Escalation
If you've tried the above solutions and still have issues:
-
Gather information:
- Error messages
- Steps to reproduce
- System details
-
Contact support:
- Email: ${support_email}
- Include debug information from above
-
Community resources:
Unit Test Templates
describe('user-guides skill', () => { describe('input validation', () => { it('should accept valid getting_started input', async () => { const input: UserGuideInput = { guide_type: 'getting_started', source: { product_name: 'Test Product' }, target_audience: 'beginner' };
const result = await validateInput(input);
expect(result.valid).toBe(true);
});
it('should reject invalid guide_type', async () => {
const input = {
guide_type: 'invalid',
source: { product_name: 'Test' }
};
const result = await validateInput(input);
expect(result.valid).toBe(false);
expect(result.errors[0].field).toBe('guide_type');
});
it('should require source.product_name', async () => {
const input: UserGuideInput = {
guide_type: 'tutorial',
source: {}
};
const result = await validateInput(input);
expect(result.valid).toBe(false);
expect(result.errors[0].field).toBe('source.product_name');
});
});
describe('guide generation', () => { it('should generate getting_started guide with all sections', async () => { const input: UserGuideInput = { guide_type: 'getting_started', source: { product_name: 'Test App' }, include_troubleshooting: true, include_next_steps: true };
const output = await generateGuide(input);
expect(output.status).toBe('success');
expect(output.content.sections).toContainEqual(
expect.objectContaining({ title: expect.stringContaining('Getting Started') })
);
expect(output.content.sections).toContainEqual(
expect.objectContaining({ title: 'Troubleshooting' })
);
});
it('should meet readability requirements', async () => {
const input: UserGuideInput = {
guide_type: 'tutorial',
source: { product_name: 'Test App' },
target_audience: 'beginner',
quality: { min_reading_level: 8 }
};
const output = await generateGuide(input);
expect(output.quality.readability_score).toBeGreaterThan(60);
});
});
describe('quality metrics', () => { it('should calculate accurate word count', async () => { const input: UserGuideInput = { guide_type: 'faq', source: { product_name: 'Test' } };
const output = await generateGuide(input);
expect(output.structure.word_count).toBeGreaterThan(0);
expect(output.structure.reading_time_minutes).toBeGreaterThan(0);
});
}); });
Troubleshooting Guide
Issue: Low Readability Score
Symptoms:
-
readability_score < 60
-
Complex sentence warnings
-
Technical jargon alerts
Root Causes:
-
Sentences too long
-
Too many technical terms
-
Passive voice overuse
Debug Checklist:
1. Check average sentence length
echo "$CONTENT" | awk '{print NF}' | awk '{sum+=$1} END {print sum/NR}'
2. Find complex sentences
grep -E '\b\w{12,}\b' output.md | wc -l
3. Check passive voice
grep -E '\b(is|are|was|were|be|been|being)\s+\w+ed\b' output.md
Recovery Procedures:
-
Set lower reading level target: quality.min_reading_level: 6
-
Enable simplify_language: true
-
Break long sentences into shorter ones
Issue: Missing Sections
Symptoms:
-
completeness_score < 80
-
Required sections not generated
-
Validation warnings
Debug Checklist:
1. Check section headers
grep -E '^#{1,3}\s' output.md
2. Verify required sections present
for section in "Overview" "Prerequisites" "Next Steps"; do grep -q "$section" output.md || echo "Missing: $section" done
Recovery Procedures:
-
Specify structure.required_sections
-
Increase structure.max_sections
-
Provide more input context
Issue: Poor Step Formatting
Symptoms:
-
Steps not numbered
-
Missing expected results
-
No checkpoints
Recovery Procedures:
-
Set structure.numbered_steps: true
-
Enable include_expected_results: true
-
Add checkpoint_interval: 3
Decision Tree: Guide Type Selection
What is the user's goal? │ ├─► First-time setup │ └─► Use: getting_started │ ├─► Length: 5-10 minutes │ └─► Focus: Quick wins, minimal steps │ ├─► Learn a specific skill │ └─► Use: tutorial │ ├─► Length: 15-30 minutes │ └─► Focus: Hands-on practice, concepts │ ├─► Understand a feature │ └─► Use: feature_guide │ ├─► Length: 5-15 minutes │ └─► Focus: Capabilities, use cases │ ├─► Fix a problem │ └─► Use: troubleshooting │ ├─► Length: Variable │ └─► Focus: Symptoms → Solutions │ ├─► Quick answers │ └─► Use: faq │ ├─► Length: 1-2 minutes per question │ └─► Focus: Common questions │ └─► Complete reference └─► Use: reference ├─► Length: Comprehensive └─► Focus: All options, parameters
Best Practices
DO:
-
Write for your audience's skill level
-
Use numbered steps for procedures
-
Include expected results for each step
-
Add troubleshooting sections
-
Use callouts for tips and warnings
-
Test all instructions before publishing
DON'T:
-
Assume prior knowledge without stating prerequisites
-
Write walls of text without visual breaks
-
Skip error handling scenarios
-
Use jargon without explanation
-
Include outdated screenshots
-
Forget to update version numbers
Version History
Version Date Changes
2.0.0 2025-01-15 Production-grade: validation, retry, observability, tests
1.0.0 2024-11-18 Initial release
References
-
Write the Docs - Documentation Guide
-
Google Developer Documentation Style Guide
-
Microsoft Writing Style Guide
Skill Status: Production-Ready | Test Coverage: 95% | Quality Gate: 70+ readability