feat: Add unlimited local repository analysis with bug fixes (PR #195)

Merges PR #195 by @jimmy058910 with conflict resolution.

**New Features:**
- Local repository analysis via `local_repo_path` configuration
- Bypass GitHub API rate limits (50 → unlimited files)
- Auto-exclusion of virtual environments and build artifacts
- Support for analyzing large codebases (323 files vs 50 before)

**Improvements:**
- Code analysis coverage: 14% → 93.6% (+79.6pp)
- Files analyzed: 50 → 323 (+546%)
- Classes extracted: 55 → 585 (+964%)
- Functions extracted: 512 → 2,784 (+444%)
- AST parsing errors: 95 → 0 (-100%)

**Conflict Resolution:**
- Preserved logger initialization fix from development (Issue #190)
- Kept relative imports from development (Task 1.2 fix)
- Integrated EXCLUDED_DIRS and local repo features from PR
- Combined best of both implementations

**Testing:**
-  All 22 GitHub scraper tests passing
-  Syntax validation passed
-  Local repo analysis feature intact
-  Bug fixes from development preserved

Original implementation by @jimmy058910 in PR #195.
Conflict resolution preserves all bug fixes while adding local repo feature.

Co-authored-by: jimmy058910 <jimmy058910@users.noreply.github.com>
This commit is contained in:
yusyus
2025-11-29 22:46:31 +03:00
24 changed files with 1350 additions and 160 deletions

View File

@@ -1506,7 +1506,9 @@ def setup_argument_parser() -> argparse.ArgumentParser:
parser.add_argument('--enhance', action='store_true',
help='Enhance SKILL.md using Claude API after building (requires API key)')
parser.add_argument('--enhance-local', action='store_true',
help='Enhance SKILL.md using Claude Code in new terminal (no API key needed)')
help='Enhance SKILL.md using Claude Code (no API key needed, runs in background)')
parser.add_argument('--interactive-enhancement', action='store_true',
help='Open terminal window for enhancement (use with --enhance-local)')
parser.add_argument('--api-key', type=str,
help='Anthropic API key for --enhance (or set ANTHROPIC_API_KEY)')
parser.add_argument('--resume', action='store_true',
@@ -1752,16 +1754,25 @@ def execute_enhancement(config: Dict[str, Any], args: argparse.Namespace) -> Non
# Optional enhancement with Claude Code (local, no API key)
if args.enhance_local:
logger.info("\n" + "=" * 60)
logger.info("ENHANCING SKILL.MD WITH CLAUDE CODE (LOCAL)")
if args.interactive_enhancement:
logger.info("ENHANCING SKILL.MD WITH CLAUDE CODE (INTERACTIVE)")
else:
logger.info("ENHANCING SKILL.MD WITH CLAUDE CODE (HEADLESS)")
logger.info("=" * 60 + "\n")
try:
enhance_cmd = ['python3', 'cli/enhance_skill_local.py', f'output/{config["name"]}/']
subprocess.run(enhance_cmd, check=True)
enhance_cmd = ['skill-seekers-enhance', f'output/{config["name"]}/']
if args.interactive_enhancement:
enhance_cmd.append('--interactive-enhancement')
result = subprocess.run(enhance_cmd, check=True)
if result.returncode == 0:
logger.info("\n✅ Enhancement complete!")
except subprocess.CalledProcessError:
logger.warning("\n⚠ Enhancement failed, but skill was still built")
except FileNotFoundError:
logger.warning("\nenhance_skill_local.py not found. Run manually:")
logger.warning("\nskill-seekers-enhance command not found. Run manually:")
logger.info(" skill-seekers-enhance output/%s/", config['name'])
# Print packaging instructions
@@ -1771,10 +1782,11 @@ def execute_enhancement(config: Dict[str, Any], args: argparse.Namespace) -> Non
# Suggest enhancement if not done
if not args.enhance and not args.enhance_local:
logger.info("\n💡 Optional: Enhance SKILL.md with Claude:")
logger.info(" API-based: skill-seekers-enhance output/%s/", config['name'])
logger.info(" or re-run with: --enhance")
logger.info(" Local (no API key): skill-seekers-enhance output/%s/", config['name'])
logger.info(" or re-run with: --enhance-local")
logger.info(" Local (recommended): skill-seekers-enhance output/%s/", config['name'])
logger.info(" or re-run with: --enhance-local")
logger.info(" API-based: skill-seekers-enhance-api output/%s/", config['name'])
logger.info(" or re-run with: --enhance")
logger.info("\n💡 Tip: Use --interactive-enhancement with --enhance-local to open terminal window")
def main() -> None: