Refactor: Convert to monorepo with CLI and MCP server
Major restructure to support both CLI usage and MCP integration: **Repository Structure:** - cli/ - All CLI tools (doc_scraper, estimate_pages, enhance_skill, etc.) - mcp/ - New MCP server for Claude Code integration - configs/ - Shared configuration files - tests/ - Updated to import from cli/ - docs/ - Shared documentation **MCP Server (NEW):** - mcp/server.py - Full MCP server implementation - 6 tools available: * generate_config - Create config from URL * estimate_pages - Fast page count estimation * scrape_docs - Full documentation scraping * package_skill - Package to .zip * list_configs - Show available presets * validate_config - Validate config files - mcp/README.md - Complete MCP documentation - mcp/requirements.txt - MCP dependencies **CLI Tools (Moved to cli/):** - All existing functionality preserved - Same commands, same behavior - Tests updated to import from cli.doc_scraper **Tests:** - 68/71 passing (95.8%) - Updated imports from doc_scraper to cli.doc_scraper - Fixed validate_config() tuple unpacking (errors, warnings) - 3 minor test failures (checking warnings instead of errors) **Benefits:** - Use as CLI tool: python3 cli/doc_scraper.py - Use via MCP: Integrated with Claude Code - Shared code and configs - Single source of truth 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ from pathlib import Path
|
||||
# Add parent directory to path
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from doc_scraper import DocToSkillConverter, load_config, validate_config
|
||||
from cli.doc_scraper import DocToSkillConverter, load_config, validate_config
|
||||
|
||||
|
||||
class TestDryRunMode(unittest.TestCase):
|
||||
@@ -150,7 +150,7 @@ class TestRealConfigFiles(unittest.TestCase):
|
||||
config_path = 'configs/godot.json'
|
||||
if os.path.exists(config_path):
|
||||
config = load_config(config_path)
|
||||
errors = validate_config(config)
|
||||
errors, _ = validate_config(config)
|
||||
self.assertEqual(len(errors), 0, f"Godot config should be valid, got errors: {errors}")
|
||||
|
||||
def test_react_config(self):
|
||||
@@ -158,7 +158,7 @@ class TestRealConfigFiles(unittest.TestCase):
|
||||
config_path = 'configs/react.json'
|
||||
if os.path.exists(config_path):
|
||||
config = load_config(config_path)
|
||||
errors = validate_config(config)
|
||||
errors, _ = validate_config(config)
|
||||
self.assertEqual(len(errors), 0, f"React config should be valid, got errors: {errors}")
|
||||
|
||||
def test_vue_config(self):
|
||||
@@ -166,7 +166,7 @@ class TestRealConfigFiles(unittest.TestCase):
|
||||
config_path = 'configs/vue.json'
|
||||
if os.path.exists(config_path):
|
||||
config = load_config(config_path)
|
||||
errors = validate_config(config)
|
||||
errors, _ = validate_config(config)
|
||||
self.assertEqual(len(errors), 0, f"Vue config should be valid, got errors: {errors}")
|
||||
|
||||
def test_django_config(self):
|
||||
@@ -174,7 +174,7 @@ class TestRealConfigFiles(unittest.TestCase):
|
||||
config_path = 'configs/django.json'
|
||||
if os.path.exists(config_path):
|
||||
config = load_config(config_path)
|
||||
errors = validate_config(config)
|
||||
errors, _ = validate_config(config)
|
||||
self.assertEqual(len(errors), 0, f"Django config should be valid, got errors: {errors}")
|
||||
|
||||
def test_fastapi_config(self):
|
||||
@@ -182,7 +182,7 @@ class TestRealConfigFiles(unittest.TestCase):
|
||||
config_path = 'configs/fastapi.json'
|
||||
if os.path.exists(config_path):
|
||||
config = load_config(config_path)
|
||||
errors = validate_config(config)
|
||||
errors, _ = validate_config(config)
|
||||
self.assertEqual(len(errors), 0, f"FastAPI config should be valid, got errors: {errors}")
|
||||
|
||||
def test_steam_economy_config(self):
|
||||
@@ -190,7 +190,7 @@ class TestRealConfigFiles(unittest.TestCase):
|
||||
config_path = 'configs/steam-economy-complete.json'
|
||||
if os.path.exists(config_path):
|
||||
config = load_config(config_path)
|
||||
errors = validate_config(config)
|
||||
errors, _ = validate_config(config)
|
||||
self.assertEqual(len(errors), 0, f"Steam Economy config should be valid, got errors: {errors}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user