feat: Merge PR #249 - Bootstrap skill with fixes and MCP optionality

Merged PR #249 from @MiaoDX with enhancements:

Bootstrap Feature:
- Self-bootstrap: Generate skill-seekers as Claude Code skill
- Robust frontmatter detection (dynamic line finding)
- SKILL.md validation (YAML + Markdown structure)
- Comprehensive error handling (uv check, permission checks)
- 6 E2E tests with venv isolation

MCP Optionality (User Feature):
- MCP removed from core dependencies
- Optional install: pip install skill-seekers[mcp]
- Lazy loading with helpful error messages
- Interactive setup wizard on first run
- Backward compatible

Bug Fixes:
- Fixed codebase_scraper.py AttributeError (line 1193)
- Fixed test_bootstrap_skill_e2e.py Path vs str issue
- Updated test version expectations to 2.7.0
- Added httpx to core (required for async scraping)
- Added anthropic to core (required for AI enhancement)

Testing:
- 6 new bootstrap E2E tests (all passing)
- 1207/1217 tests passing (99.2% pass rate)
- All bootstrap and enhancement tests pass
- Remaining failures are pre-existing test infrastructure issues

Documentation:
- Updated CHANGELOG.md with v2.7.0 notes
- Updated README.md with bootstrap and installation options
- Added setup wizard guide

Files Modified (9):
- CHANGELOG.md, README.md - Documentation updates
- pyproject.toml - MCP optional, httpx/anthropic core, markers, entry points
- scripts/bootstrap_skill.sh - Dynamic frontmatter, validation, error handling
- src/skill_seekers/cli/install_skill.py - Lazy MCP loading
- tests/test_cli_paths.py - Version 2.7.0
- uv.lock - Dependency updates

New Files (2):
- src/skill_seekers/cli/setup_wizard.py - Interactive installation guide (95 lines)
- tests/test_bootstrap_skill_e2e.py - E2E bootstrap tests (169 lines)

Credits: @MiaoDX for PR #249

Co-Authored-By: MiaoDX <MiaoDX@hotmail.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-01-17 19:51:11 +03:00
parent 6d4ef0f13b
commit 38e8969ae7
9 changed files with 553 additions and 22 deletions

View File

@@ -34,12 +34,29 @@ from pathlib import Path
# Add parent directory to path to import MCP server
sys.path.insert(0, str(Path(__file__).parent.parent))
# Import the MCP tool function
from skill_seekers.mcp.server import install_skill_tool
# Import the MCP tool function (with lazy loading)
try:
from skill_seekers.mcp.server import install_skill_tool
MCP_AVAILABLE = True
except ImportError:
MCP_AVAILABLE = False
install_skill_tool = None
def main():
"""Main entry point for CLI"""
# Check MCP availability first
if not MCP_AVAILABLE:
print("\n❌ Error: MCP package not installed")
print("\nThe 'install' command requires MCP support.")
print("Install with:")
print(" pip install skill-seekers[mcp]")
print("\nOr use these alternatives:")
print(" skill-seekers scrape --config react")
print(" skill-seekers package output/react/")
print()
sys.exit(1)
parser = argparse.ArgumentParser(
description="Complete skill installation workflow (fetch → scrape → enhance → package → upload)",
formatter_class=argparse.RawDescriptionHelpFormatter,

View File

@@ -0,0 +1,94 @@
"""
Interactive Setup Wizard for Skill Seekers
Guides users through installation options on first run.
"""
import sys
from pathlib import Path
def show_installation_guide():
"""Show installation options"""
print("""
╔═══════════════════════════════════════════════════════════╗
║ ║
║ Skill Seekers Setup Guide ║
║ ║
╚═══════════════════════════════════════════════════════════╝
Choose your installation profile:
1⃣ CLI Only (Skill Generation)
pip install skill-seekers
Features:
• Scrape documentation websites
• Analyze GitHub repositories
• Extract from PDFs
• Package skills for all platforms
2⃣ MCP Integration (Claude Code, Cursor, Windsurf)
pip install skill-seekers[mcp]
Features:
• Everything from CLI Only
• MCP server for Claude Code
• One-command skill installation
• HTTP/stdio transport modes
3⃣ Multi-LLM Support (Gemini, OpenAI)
pip install skill-seekers[all-llms]
Features:
• Everything from CLI Only
• Google Gemini support
• OpenAI ChatGPT support
• Enhanced AI features
4⃣ Everything
pip install skill-seekers[all]
Features:
• All features enabled
• Maximum flexibility
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Current installation: pip install skill-seekers
Upgrade with: pip install -U skill-seekers[mcp]
For configuration wizard:
skill-seekers config
For help:
skill-seekers --help
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
""")
def check_first_run():
"""Check if this is first run"""
flag_file = Path.home() / ".config" / "skill-seekers" / ".setup_shown"
if not flag_file.exists():
show_installation_guide()
# Create flag to not show again
flag_file.parent.mkdir(parents=True, exist_ok=True)
flag_file.touch()
response = input("\nPress Enter to continue...")
return True
return False
def main():
"""Show wizard"""
show_installation_guide()
if __name__ == "__main__":
main()