feat(#191): Smart description generation for skill descriptions
Implements hybrid smart extraction + improved fallback templates for
skill descriptions across all scrapers.
Changes:
- github_scraper.py:
* Added extract_description_from_readme() helper
* Extracts from README first paragraph (60 lines)
* Updates description after README extraction
* Fallback: "Use when working with {name}"
* Updated 3 locations (GitHubScraper, GitHubToSkillConverter, main)
- doc_scraper.py:
* Added infer_description_from_docs() helper
* Extracts from meta tags or first paragraph (65 lines)
* Tries: meta description, og:description, first content paragraph
* Fallback: "Use when working with {name}"
* Updated 2 locations (create_enhanced_skill_md, get_configuration)
- pdf_scraper.py:
* Added infer_description_from_pdf() helper
* Extracts from PDF metadata (subject, title)
* Fallback: "Use when referencing {name} documentation"
* Updated 3 locations (PDFToSkillConverter, main x2)
- generate_router.py:
* Updated 2 locations with improved router descriptions
* "Use when working with {name} development and programming"
All changes:
- Only apply to NEW skill generations (don't modify existing)
- No API calls (free/offline)
- Smart extraction when metadata/README available
- Improved "Use when..." fallbacks instead of generic templates
- 612 tests passing (100%)
Fixes #191
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,7 @@ class RouterGenerator:
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
{self.base_config.get('description', f'Use for {self.router_name} development and programming.')}
|
||||
{self.base_config.get('description', f'Use when working with {self.router_name} development and programming')}
|
||||
|
||||
This is a router skill that directs your questions to specialized sub-skills for efficient, focused assistance.
|
||||
|
||||
@@ -156,7 +156,7 @@ Simply ask your question and mention the topic. The router will find the right s
|
||||
|
||||
router_config = {
|
||||
"name": self.router_name,
|
||||
"description": self.base_config.get('description', f'{self.router_name.title()} documentation router'),
|
||||
"description": self.base_config.get('description', f'Use when working with {self.router_name} documentation (router for multiple sub-skills)'),
|
||||
"base_url": self.base_config['base_url'],
|
||||
"selectors": self.base_config.get('selectors', {}),
|
||||
"url_patterns": self.base_config.get('url_patterns', {}),
|
||||
|
||||
Reference in New Issue
Block a user