fix: Fix 2 critical CLI issues blocking production (Kimi QA)

**Critical Issues Fixed:**

Issue #1: CLI Commands Were BROKEN ⚠️ CRITICAL
- Problem: 4 CLI commands existed but failed at runtime with ImportError
- Root Cause: Modules had example_usage() instead of main() functions
- Impact: Users couldn't use quality, stream, update, multilang features

**Fixed Files:**
- src/skill_seekers/cli/quality_metrics.py
  - Renamed example_usage() → main()
  - Added argparse with --report, --output flags
  - Proper exit codes and error handling

- src/skill_seekers/cli/streaming_ingest.py
  - Renamed example_usage() → main()
  - Added argparse with --chunk-size, --batch-size, --checkpoint flags
  - Supports both file and directory inputs

- src/skill_seekers/cli/incremental_updater.py
  - Renamed example_usage() → main()
  - Added argparse with --check-changes, --generate-package, --apply-update flags
  - Proper error handling and exit codes

- src/skill_seekers/cli/multilang_support.py
  - Renamed example_usage() → main()
  - Added argparse with --detect, --report, --export flags
  - Loads skill documents from directory

Issue #2: Haystack Missing from Package Choices ⚠️ CRITICAL
- Problem: Haystack adaptor worked but couldn't be used via CLI
- Root Cause: package_skill.py missing "haystack" in --target choices
- Impact: Users got "invalid choice" error when packaging for Haystack

**Fixed:**
- src/skill_seekers/cli/package_skill.py:188
  - Added "haystack" to --target choices list
  - Now matches main.py choices (all 11 platforms)

**Verification:**
 All 4 CLI commands now work:
   $ skill-seekers quality --help
   $ skill-seekers stream --help
   $ skill-seekers update --help
   $ skill-seekers multilang --help

 Haystack now available:
   $ skill-seekers package output/skill --target haystack

 All 164 adaptor tests still passing
 No regressions detected

**Credits:**
- Issues identified by: Kimi QA Review
- Fixes implemented by: Claude Sonnet 4.5

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-02-07 23:12:40 +03:00
parent 6f9584ba67
commit a332507b1d
5 changed files with 151 additions and 56 deletions

View File

@@ -411,15 +411,37 @@ class IncrementalUpdater:
return False
def example_usage():
"""Example usage of incremental updater."""
def main():
"""CLI entry point for incremental updates."""
import argparse
from pathlib import Path
skill_dir = Path("output/react")
parser = argparse.ArgumentParser(description="Detect and apply incremental skill updates")
parser.add_argument("skill_dir", help="Path to skill directory")
parser.add_argument("--check-changes", action="store_true", help="Check for changes only")
parser.add_argument("--generate-package", help="Generate update package at specified path")
parser.add_argument("--apply-update", help="Apply update package from specified path")
args = parser.parse_args()
skill_dir = Path(args.skill_dir)
if not skill_dir.exists():
print(f"❌ Error: Directory not found: {skill_dir}")
return 1
# Initialize updater
updater = IncrementalUpdater(skill_dir)
# Apply update if specified
if args.apply_update:
update_path = Path(args.apply_update)
if not update_path.exists():
print(f"❌ Error: Update package not found: {update_path}")
return 1
print(f"📥 Applying update from: {update_path}")
success = updater.apply_update_package(update_path)
return 0 if success else 1
# Detect changes
print("🔍 Detecting changes...")
change_set = updater.detect_changes()
@@ -428,13 +450,18 @@ def example_usage():
report = updater.generate_diff_report(change_set)
print(report)
if args.check_changes:
return 0 if not change_set.has_changes else 1
if change_set.has_changes:
# Generate update package
# Generate update package if specified
if args.generate_package:
package_path = Path(args.generate_package)
else:
package_path = skill_dir.parent / f"{skill_dir.name}-update.json"
print("\n📦 Generating update package...")
package_path = updater.generate_update_package(
change_set,
skill_dir.parent / f"{skill_dir.name}-update.json"
)
package_path = updater.generate_update_package(change_set, package_path)
print(f"✅ Package created: {package_path}")
# Save versions
@@ -443,6 +470,9 @@ def example_usage():
else:
print("\n✅ No changes detected - skill is up to date!")
return 0
if __name__ == "__main__":
example_usage()
import sys
sys.exit(main())