[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FJJE6NG15PB3RX0F65TH51":3,"skill-same:01M6FJJE6NG15PB3RX0F65TH51":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":56,"install":57,"resources":70},"01M6FJJE6NG15PB3RX0F65TH51","ln-645-open-source-replacer",null,"Discovers custom modules replaceable by OSS, evaluates alternatives (stars, license, CVE), generates migration plan. Use when reducing custom code.","boisenoise\u002Fskills-collections","boisenoise","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F193180?v=4","01M6CDBDQK6BDN55ZMA6B6PKBM","01M6CDBDVSJ3JPTBYN26FZ7TZK",13,"MIT","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Flevn-ln-645-open-source-replacer\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"source","ln","open source","ln 645 open source replacer","open","use","when","websearch","stars","line","hex","outline","context7","references","modules","MCP","read","analyze","plan","Bash","cve","file","search","license","code","architecture","2026-11-10 10:12:30",false,"---\nname: ln-645-open-source-replacer\ndescription: \"Discovers custom modules replaceable by OSS, evaluates alternatives (stars, license, CVE), generates migration plan. Use when reducing custom code.\"\nallowed-tools: Read, Grep, Glob, Bash, WebFetch, WebSearch, mcp__Ref, mcp__context7, mcp__hex-graph__find_references, mcp__hex-graph__analyze_architecture, mcp__hex-line__read_file, mcp__hex-line__grep_search, mcp__hex-line__outline\nlicense: MIT\n---\n\n> **Paths:** File paths (`shared\u002F`, `references\u002F`, `..\u002Fln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If `shared\u002F` is missing, fetch files via WebFetch from `https:\u002F\u002Fraw.githubusercontent.com\u002Flevnikolaevich\u002Fclaude-code-skills\u002Fmaster\u002Fskills\u002F{path}`.\n\n# Open Source Replacer\n\n**Type:** L3 Worker\n\nL3 Worker that discovers custom modules, analyzes their purpose, and finds battle-tested open-source replacements via MCP Research.\n\n## Purpose & Scope\n\n- Discover significant custom modules (>=100 LOC, utility\u002Fintegration type)\n- Analyze PURPOSE of each module by reading code (goal-based, not pattern-based)\n- Search open-source alternatives via WebSearch, Context7, Ref\n- Evaluate alternatives: stars, maintenance, license, CVE status, API compatibility\n- Score replacement confidence (HIGH\u002FMEDIUM\u002FLOW)\n- Generate migration plan for viable replacements\n- Output: markdown evidence report in runtime artifacts plus machine-readable JSON summary for coordinator transport\n\n**Out of Scope:**\n- Pattern-based detection of known reinvented wheels (custom sorting, hand-rolled validation)\n- Package vulnerability scanning (CVE\u002FCVSS for existing dependencies)\n- Story-level optimality checks via OPT- prefix\n\n## Input\n\n```\n- codebase_root: string        # Project root\n- tech_stack: object            # Language, framework, package manager, existing dependencies\n- output_dir: string            # e.g., \".hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Faudit-report\"\n\n# Domain-aware (optional, from coordinator)\n- domain_mode: \"global\" | \"domain-aware\"   # Default: \"global\"\n- current_domain: string                   # e.g., \"users\", \"billing\" (only if domain-aware)\n- scan_path: string                        # e.g., \"src\u002Fusers\u002F\" (only if domain-aware)\n```\n\n## Workflow\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Ftwo_layer_detection.md` for detection methodology.\n**MANDATORY READ:** Load `shared\u002Freferences\u002Fmcp_tool_preferences.md` and `shared\u002Freferences\u002Fmcp_integration_patterns.md`\n\nUse `hex-graph` first when architecture or cross-file references materially improve module discovery. Use `hex-line` first for local code reads when available. If MCP is unavailable, unsupported, or not indexed, continue with built-in `Read\u002FGrep\u002FGlob\u002FBash` and state the fallback in the report.\n\n### Phase 1: Discovery + Classification\n\n```\nscan_root = scan_path IF domain_mode == \"domain-aware\" ELSE codebase_root\n\n# Step 1: Find significant custom files\ncandidates = []\nFOR EACH file IN Glob(\"**\u002F*.{ts,js,py,rb,go,java,cs}\", root=scan_root):\n  IF file in node_modules\u002F OR vendor\u002F OR .venv\u002F OR dist\u002F OR build\u002F OR test\u002F OR __test__\u002F:\n    SKIP\n  line_count = wc -l {file}\n  IF line_count >= 100:\n    candidates.append(file)\n\n# Step 2: Filter to utility\u002Flibrary-like modules\nutility_paths = [\"utils\u002F\", \"lib\u002F\", \"helpers\u002F\", \"common\u002F\", \"shared\u002F\", \"pkg\u002F\", \"internal\u002F\"]\nname_patterns = [\"parser\", \"formatter\", \"validator\", \"converter\", \"encoder\",\n                 \"decoder\", \"serializer\", \"logger\", \"cache\", \"queue\", \"scheduler\",\n                 \"mailer\", \"http\", \"client\", \"wrapper\", \"adapter\", \"connector\",\n                 \"transformer\", \"mapper\", \"builder\", \"factory\", \"handler\"]\n\nmodules = []\nFOR EACH file IN candidates:\n  is_utility_path = any(p in file.lower() for p in utility_paths)\n  is_utility_name = any(p in basename(file).lower() for p in name_patterns)\n  export_count = count_exports(file)  # Grep for export\u002Fmodule.exports\u002Fdef\u002Fclass\n  IF is_utility_path OR is_utility_name OR export_count > 5:\n    modules.append(file)\n\n# Step 3: Pre-classification gate\nFOR EACH module IN modules:\n  # Read first 30 lines to classify\n  header = Read(module, limit=30)\n  classify as:\n    - \"utility\": generic reusable logic (validation, parsing, formatting, HTTP, caching)\n    - \"integration\": wrappers around external services (email, payments, storage)\n    - \"domain-specific\": business logic unique to project (scoring, routing, pricing rules)\n\n  IF classification == \"domain-specific\":\n    no_replacement_found.append({module, reason: \"Domain-specific business logic\"})\n    REMOVE from modules\n\n# Cap: analyze max 15 utility\u002Fintegration modules per invocation\nmodules = modules[:15]\n```\n\n### Phase 2: Goal Extraction\n\n```\nFOR EACH module IN modules:\n  # Read code (first 200 lines + exports summary)\n  code = Read(module, limit=200)\n  exports = Grep(\"export|module\\.exports|def |class |func \", module)\n\n  # Extract goal: what problem does this module solve?\n  goal = {\n    domain: \"email validation\" | \"HTTP retry\" | \"CSV parsing\" | ...,\n    inputs: [types],\n    outputs: [types],\n    key_operations: [\"validates email format\", \"checks MX records\", ...],\n    complexity_indicators: [\"regex\", \"network calls\", \"state machine\", \"crypto\", ...],\n    summary: \"Custom email validator with MX record checking and disposable domain filtering\"\n  }\n```\n\n### Phase 3: Alternative Search (MCP Research)\n\n```\nFOR EACH module WHERE module.goal extracted:\n  # Strategy 1: WebSearch (primary)\n  WebSearch(\"{goal.domain} {tech_stack.language} library package 2026\")\n  WebSearch(\"{goal.summary} open source alternative {tech_stack.language}\")\n\n  # Strategy 2: Context7 (for known ecosystems)\n  IF tech_stack.package_manager == \"npm\":\n    WebSearch(\"{goal.domain} npm package weekly downloads\")\n  IF tech_stack.package_manager == \"pip\":\n    WebSearch(\"{goal.domain} python library pypi\")\n\n  # Strategy 3: Ref (documentation search)\n  ref_search_documentation(\"{goal.domain} {tech_stack.language} recommended library\")\n\n  # Strategy 4: Ecosystem alignment -- check if existing project dependencies\n  # already cover this goal (e.g., project uses Zod -> check zod plugins first)\n  FOR EACH dep IN tech_stack.existing_dependencies:\n    IF dep.ecosystem overlaps goal.domain:\n      WebSearch(\"{dep.name} {goal.domain} plugin extension\")\n\n  # Collect candidates (max 5 per module)\n  alternatives = top_5_by_relevance(search_results)\n```\n\n### Phase 4: Evaluation\n\n**MANDATORY:** Security Gate and License Classification run for EVERY candidate before confidence assignment.\n\n```\nFOR EACH module, FOR EACH alternative:\n  # 4a. Basic info\n  info = {\n    name: \"zod\" | \"email-validator\" | ...,\n    version: \"latest stable\",\n    weekly_downloads: N,\n    github_stars: N,\n    last_commit: \"YYYY-MM-DD\",\n  }\n\n  # 4b. Security Gate (mandatory)\n  WebSearch(\"{alternative.name} CVE vulnerability security advisory\")\n  IF unpatched HIGH\u002FCRITICAL CVE found:\n    security_status = \"VULNERABLE\"\n    -> Cap confidence at LOW, add warning to Findings\n  ELIF patched CVE (older version):\n    security_status = \"PATCHED_CVE\"\n    -> Note in report, no confidence cap\n  ELSE:\n    security_status = \"CLEAN\"\n\n  # 4c. License Classification\n  license = detect_license(alternative)\n  IF license IN [\"MIT\", \"Apache-2.0\", \"BSD-2-Clause\", \"BSD-3-Clause\", \"ISC\", \"Unlicense\"]:\n    license_class = \"PERMISSIVE\"\n  ELIF license IN [\"GPL-2.0\", \"GPL-3.0\", \"AGPL-3.0\", \"LGPL-2.1\", \"LGPL-3.0\"]:\n    IF project_license is copyleft AND compatible:\n      license_class = \"COPYLEFT_COMPATIBLE\"\n    ELSE:\n      license_class = \"COPYLEFT_INCOMPATIBLE\"\n  ELSE:\n    license_class = \"UNKNOWN\"\n\n  # 4d. Ecosystem Alignment\n  ecosystem_match = alternative.name IN tech_stack.existing_dependencies\n                    OR alternative.ecosystem == tech_stack.framework\n  # Prefer: zod plugin over standalone if project uses zod\n\n  # 4e. Feature & API Evaluation\n  api_surface_match = HIGH | MEDIUM | LOW\n  feature_coverage = percentage  # what % of custom module features covered\n  migration_effort = S | M | L   # S=\u003C4h, M=4-16h, L=>16h\n\n  # 4f. Confidence Assignment\n  # HIGH: >10k stars, active (commit \u003C6mo), >90% coverage,\n  #       PERMISSIVE license, CLEAN security, ecosystem_match preferred\n  # MEDIUM: >1k stars, maintained (commit \u003C1yr), >70% coverage,\n  #         PERMISSIVE license, no unpatched CRITICAL CVEs\n  # LOW: \u003C1k stars OR unmaintained OR \u003C70% coverage\n  #      OR COPYLEFT_INCOMPATIBLE OR VULNERABLE\n```\n\n### Phase 5: Write Report + Migration Plan\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Faudit_worker_core_contract.md` and `shared\u002Ftemplates\u002Faudit_worker_report_template.md`.\n\nWrite JSON summary per `shared\u002Freferences\u002Faudit_summary_contract.md`. In managed mode the caller passes both `runId` and `summaryArtifactPath`; in standalone mode the worker generates its own run-scoped artifact path per shared contract.\n\nBuild report in memory, write to `{output_dir}\u002F645-open-source-replacer[-{domain}].md`.\n\n```markdown\n# Open Source Replacement Audit Report\n\n\u003C!-- AUDIT-META\nworker: ln-645\ncategory: Open Source Replacement\ndomain: {domain_name|global}\nscan_path: {scan_path|.}\nscore: {X.X}\ntotal_issues: {N}\ncritical: 0\nhigh: {N}\nmedium: {N}\nlow: {N}\nstatus: completed\n-->\n\n## Checks\n\n| ID | Check | Status | Details |\n|----|-------|--------|---------|\n| module_discovery | Module Discovery | passed\u002Fwarning | Found N modules >= 100 LOC |\n| classification | Pre-Classification | passed | N utility, M integration, K domain-specific (excluded) |\n| goal_extraction | Goal Extraction | passed\u002Fwarning | Extracted goals for N\u002FM modules |\n| alternative_search | Alternative Search | passed\u002Fwarning | Found alternatives for N modules |\n| security_gate | Security Gate | passed\u002Fwarning | N candidates checked, M clean, K vulnerable |\n| evaluation | Replacement Evaluation | passed\u002Ffailed | N HIGH confidence, M MEDIUM |\n| migration_plan | Migration Plan | passed\u002Fskipped | Generated for N replacements |\n\n## Findings\n\n| Severity | Location | Issue | Principle | Recommendation | Effort |\n|----------|----------|-------|-----------|----------------|--------|\n| HIGH | src\u002Futils\u002Femail-validator.ts (245 LOC) | Custom email validation with MX checking | Reuse \u002F OSS Available | Replace with zod + zod-email (28k stars, MIT, 95% coverage) | M |\n\n## Migration Plan\n\n| Priority | Module | Lines | Replacement | Confidence | Effort | Steps |\n|----------|--------|-------|-------------|------------|--------|-------|\n| 1 | src\u002Futils\u002Femail-validator.ts | 245 | zod + zod-email | HIGH | M | 1. Install 2. Create schema 3. Replace calls 4. Remove module 5. Test |\n\n\u003C!-- DATA-EXTENDED\n{\n  \"modules_scanned\": 15,\n  \"modules_with_alternatives\": 8,\n  \"reuse_opportunity_score\": 6.5,\n  \"replacements\": [\n    {\n      \"module\": \"src\u002Futils\u002Femail-validator.ts\",\n      \"lines\": 245,\n      \"classification\": \"utility\",\n      \"goal\": \"Email validation with MX checking\",\n      \"alternative\": \"zod + zod-email\",\n      \"confidence\": \"HIGH\",\n      \"stars\": 28000,\n      \"last_commit\": \"2026-02-10\",\n      \"license\": \"MIT\",\n      \"license_class\": \"PERMISSIVE\",\n      \"security_status\": \"CLEAN\",\n      \"ecosystem_match\": true,\n      \"feature_coverage\": 95,\n      \"effort\": \"M\",\n      \"migration_steps\": [\"Install zod + zod-email\", \"Create validation schema\", \"Replace validate() calls\", \"Remove custom module\", \"Run tests\"]\n    }\n  ],\n  \"no_replacement_found\": [\n    {\"module\": \"src\u002Flib\u002Fdomain-scorer.ts\", \"reason\": \"Domain-specific business logic\", \"classification\": \"domain-specific\"}\n  ]\n}\n-->\n```\n\n### Phase 6: Return Summary\n\n```\nReport written: .hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Faudit-report\u002F645-open-source-replacer[-{domain}].md\nScore: X.X\u002F10 | Issues: N (C:0 H:N M:N L:N)\n```\n\n## Scoring\n\nUses standard penalty formula from `shared\u002Freferences\u002Faudit_scoring.md`:\n\n```\npenalty = (critical x 2.0) + (high x 1.0) + (medium x 0.5) + (low x 0.2)\nscore = max(0, 10 - penalty)\n```\n\nSeverity mapping:\n- **HIGH:** HIGH confidence replacement for module >200 LOC\n- **MEDIUM:** MEDIUM confidence, or HIGH confidence for 100-200 LOC\n- **LOW:** LOW confidence (partial coverage only)\n- **Exception:** Custom module with domain-specific logic not covered by OSS package -> skip. Feature parity \u003C80% -> skip recommendation. **Layer 2:** Verify replacement has full feature parity before recommending\n\n## Critical Rules\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Faudit_worker_core_contract.md`.\n\n- **Goal-based, not pattern-based:** Read code to understand PURPOSE before searching alternatives\n- **MCP Research mandatory:** Always search via WebSearch\u002FContext7\u002FRef, never assume packages exist\n- **Security gate mandatory:** WebSearch for CVEs before recommending any package; never recommend packages with unpatched HIGH\u002FCRITICAL CVEs\n- **License classification mandatory:** Permissive (MIT\u002FApache\u002FBSD) preferred; copyleft only if project-compatible\n- **Ecosystem alignment:** Prefer packages from project's existing dependency tree (e.g., zod plugin over standalone if project uses zod)\n- **Pre-classification gate:** Categorize modules before analysis; exclude domain-specific business logic\n- **No auto-fix:** Report only, never install packages or modify code\n- **Effort realism:** S = \u003C4h, M = 4-16h, L = >16h (migration effort is larger than simple fixes)\n- **Cap analysis:** Max 15 modules per invocation to stay within token budget\n- **Evidence always:** Include file paths + line counts for every finding\n\n## Definition of Done\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Faudit_worker_core_contract.md`.\n\n- [ ] Custom modules discovered (>= 100 LOC, utility\u002Fintegration type)\n- [ ] Pre-classification gate applied: domain-specific modules excluded with documented reason\n- [ ] Goals extracted for each module (domain, inputs, outputs, operations)\n- [ ] Open-source alternatives searched via MCP Research (WebSearch, Context7, Ref)\n- [ ] Security gate passed: all candidates checked for CVEs via WebSearch\n- [ ] License classified: Permissive\u002FCopyleft\u002FUnknown for each candidate\n- [ ] Ecosystem alignment checked: existing project dependencies considered\n- [ ] Confidence scored for each replacement (HIGH\u002FMEDIUM\u002FLOW)\n- [ ] Migration plan generated for HIGH\u002FMEDIUM confidence replacements\n- [ ] Report written to `{output_dir}\u002F645-open-source-replacer[-{domain}].md`\n- [ ] Summary written per contract\n\n## Reference Files\n\n- **Scoring algorithm:** `shared\u002Freferences\u002Faudit_scoring.md`\n- **MANDATORY READ:** Load `shared\u002Freferences\u002Fresearch_tool_fallback.md`\n\n---\n**Version:** 1.0.0\n**Last Updated:** 2026-02-26\n","> **Paths:** File paths (`shared\u002F`, `references\u002F`, `..\u002Fln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If `shared\u002F` is missing, fetch files via WebFetch from `https:\u002F\u002Fraw.githubusercontent.com\u002Flevnikolaevich\u002Fclaude-code-skills\u002Fmaster\u002Fskills\u002F{path}`.\n\n# Open Source Replacer\n\n**Type:** L3 Worker\n\nL3 Worker that discovers custom modules, analyzes their purpose, and finds battle-tested open-source replacements via MCP Research.\n\n## Purpose & Scope\n\n- Discover significant custom modules (>=100 LOC, utility\u002Fintegration type)\n- Analyze PURPOSE of each module by reading code (goal-based, not pattern-based)\n- Search open-source alternatives via WebSearch, Context7, Ref\n- Evaluate alternatives: stars, maintenance, license, CVE status, API compatibility\n- Score replacement confidence (HIGH\u002FMEDIUM\u002FLOW)\n- Generate migration plan for viable replacements\n- Output: markdown evidence report in runtime artifacts plus machine-readable JSON summary for coordinator transport\n\n**Out of Scope:**\n- Pattern-based detection of known reinvented wheels (custom sorting, hand-rolled validation)\n- Package vulnerability scanning (CVE\u002FCVSS for existing dependencies)\n- Story-level optimality checks via OPT- prefix\n\n## Input\n\n```\n- codebase_root: string        # Project root\n- tech_stack: object            # Language, framework, package manager, existing dependencies\n- output_dir: string            # e.g., \".hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Faudit-report\"\n\n# Domain-aware (optional, from coordinator)\n- domain_mode: \"global\" | \"domain-aware\"   # Default: \"global\"\n- current_domain: string                   # e.g., \"users\", \"billing\" (only if domain-aware)\n- scan_path: string                        # e.g., \"src\u002Fusers\u002F\" (only if domain-aware)\n```\n\n## Workflow\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Ftwo_layer_detection.md` for detection methodology.\n**MANDATORY READ:** Load `shared\u002Freferences\u002Fmcp_tool_preferences.md` and `shared\u002Freferences\u002Fmcp_integration_patterns.md`\n\nUse `hex-graph` first when architecture or cross-file references materially improve module discovery. Use `hex-line` first for local code reads when available. If MCP is unavailable, unsupported, or not indexed, continue with built-in `Read\u002FGrep\u002FGlob\u002FBash` and state the fallback in the report.\n\n### Phase 1: Discovery + Classification\n\n```\nscan_root = scan_path IF domain_mode == \"domain-aware\" ELSE codebase_root\n\n# Step 1: Find significant custom files\ncandidates = []\nFOR EACH file IN Glob(\"**\u002F*.{ts,js,py,rb,go,java,cs}\", root=scan_root):\n  IF file in node_modules\u002F OR vendor\u002F OR .venv\u002F OR dist\u002F OR build\u002F OR test\u002F OR __test__\u002F:\n    SKIP\n  line_count = wc -l {file}\n  IF line_count >= 100:\n    candidates.append(file)\n\n# Step 2: Filter to utility\u002Flibrary-like modules\nutility_paths = [\"utils\u002F\", \"lib\u002F\", \"helpers\u002F\", \"common\u002F\", \"shared\u002F\", \"pkg\u002F\", \"internal\u002F\"]\nname_patterns = [\"parser\", \"formatter\", \"validator\", \"converter\", \"encoder\",\n                 \"decoder\", \"serializer\", \"logger\", \"cache\", \"queue\", \"scheduler\",\n                 \"mailer\", \"http\", \"client\", \"wrapper\", \"adapter\", \"connector\",\n                 \"transformer\", \"mapper\", \"builder\", \"factory\", \"handler\"]\n\nmodules = []\nFOR EACH file IN candidates:\n  is_utility_path = any(p in file.lower() for p in utility_paths)\n  is_utility_name = any(p in basename(file).lower() for p in name_patterns)\n  export_count = count_exports(file)  # Grep for export\u002Fmodule.exports\u002Fdef\u002Fclass\n  IF is_utility_path OR is_utility_name OR export_count > 5:\n    modules.append(file)\n\n# Step 3: Pre-classification gate\nFOR EACH module IN modules:\n  # Read first 30 lines to classify\n  header = Read(module, limit=30)\n  classify as:\n    - \"utility\": generic reusable logic (validation, parsing, formatting, HTTP, caching)\n    - \"integration\": wrappers around external services (email, payments, storage)\n    - \"domain-specific\": business logic unique to project (scoring, routing, pricing rules)\n\n  IF classification == \"domain-specific\":\n    no_replacement_found.append({module, reason: \"Domain-specific business logic\"})\n    REMOVE from modules\n\n# Cap: analyze max 15 utility\u002Fintegration modules per invocation\nmodules = modules[:15]\n```\n\n### Phase 2: Goal Extraction\n\n```\nFOR EACH module IN modules:\n  # Read code (first 200 lines + exports summary)\n  code = Read(module, limit=200)\n  exports = Grep(\"export|module\\.exports|def |class |func \", module)\n\n  # Extract goal: what problem does this module solve?\n  goal = {\n    domain: \"email validation\" | \"HTTP retry\" | \"CSV parsing\" | ...,\n    inputs: [types],\n    outputs: [types],\n    key_operations: [\"validates email format\", \"checks MX records\", ...],\n    complexity_indicators: [\"regex\", \"network calls\", \"state machine\", \"crypto\", ...],\n    summary: \"Custom email validator with MX record checking and disposable domain filtering\"\n  }\n```\n\n### Phase 3: Alternative Search (MCP Research)\n\n```\nFOR EACH module WHERE module.goal extracted:\n  # Strategy 1: WebSearch (primary)\n  WebSearch(\"{goal.domain} {tech_stack.language} library package 2026\")\n  WebSearch(\"{goal.summary} open source alternative {tech_stack.language}\")\n\n  # Strategy 2: Context7 (for known ecosystems)\n  IF tech_stack.package_manager == \"npm\":\n    WebSearch(\"{goal.domain} npm package weekly downloads\")\n  IF tech_stack.package_manager == \"pip\":\n    WebSearch(\"{goal.domain} python library pypi\")\n\n  # Strategy 3: Ref (documentation search)\n  ref_search_documentation(\"{goal.domain} {tech_stack.language} recommended library\")\n\n  # Strategy 4: Ecosystem alignment -- check if existing project dependencies\n  # already cover this goal (e.g., project uses Zod -> check zod plugins first)\n  FOR EACH dep IN tech_stack.existing_dependencies:\n    IF dep.ecosystem overlaps goal.domain:\n      WebSearch(\"{dep.name} {goal.domain} plugin extension\")\n\n  # Collect candidates (max 5 per module)\n  alternatives = top_5_by_relevance(search_results)\n```\n\n### Phase 4: Evaluation\n\n**MANDATORY:** Security Gate and License Classification run for EVERY candidate before confidence assignment.\n\n```\nFOR EACH module, FOR EACH alternative:\n  # 4a. Basic info\n  info = {\n    name: \"zod\" | \"email-validator\" | ...,\n    version: \"latest stable\",\n    weekly_downloads: N,\n    github_stars: N,\n    last_commit: \"YYYY-MM-DD\",\n  }\n\n  # 4b. Security Gate (mandatory)\n  WebSearch(\"{alternative.name} CVE vulnerability security advisory\")\n  IF unpatched HIGH\u002FCRITICAL CVE found:\n    security_status = \"VULNERABLE\"\n    -> Cap confidence at LOW, add warning to Findings\n  ELIF patched CVE (older version):\n    security_status = \"PATCHED_CVE\"\n    -> Note in report, no confidence cap\n  ELSE:\n    security_status = \"CLEAN\"\n\n  # 4c. License Classification\n  license = detect_license(alternative)\n  IF license IN [\"MIT\", \"Apache-2.0\", \"BSD-2-Clause\", \"BSD-3-Clause\", \"ISC\", \"Unlicense\"]:\n    license_class = \"PERMISSIVE\"\n  ELIF license IN [\"GPL-2.0\", \"GPL-3.0\", \"AGPL-3.0\", \"LGPL-2.1\", \"LGPL-3.0\"]:\n    IF project_license is copyleft AND compatible:\n      license_class = \"COPYLEFT_COMPATIBLE\"\n    ELSE:\n      license_class = \"COPYLEFT_INCOMPATIBLE\"\n  ELSE:\n    license_class = \"UNKNOWN\"\n\n  # 4d. Ecosystem Alignment\n  ecosystem_match = alternative.name IN tech_stack.existing_dependencies\n                    OR alternative.ecosystem == tech_stack.framework\n  # Prefer: zod plugin over standalone if project uses zod\n\n  # 4e. Feature & API Evaluation\n  api_surface_match = HIGH | MEDIUM | LOW\n  feature_coverage = percentage  # what % of custom module features covered\n  migration_effort = S | M | L   # S=\u003C4h, M=4-16h, L=>16h\n\n  # 4f. Confidence Assignment\n  # HIGH: >10k stars, active (commit \u003C6mo), >90% coverage,\n  #       PERMISSIVE license, CLEAN security, ecosystem_match preferred\n  # MEDIUM: >1k stars, maintained (commit \u003C1yr), >70% coverage,\n  #         PERMISSIVE license, no unpatched CRITICAL CVEs\n  # LOW: \u003C1k stars OR unmaintained OR \u003C70% coverage\n  #      OR COPYLEFT_INCOMPATIBLE OR VULNERABLE\n```\n\n### Phase 5: Write Report + Migration Plan\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Faudit_worker_core_contract.md` and `shared\u002Ftemplates\u002Faudit_worker_report_template.md`.\n\nWrite JSON summary per `shared\u002Freferences\u002Faudit_summary_contract.md`. In managed mode the caller passes both `runId` and `summaryArtifactPath`; in standalone mode the worker generates its own run-scoped artifact path per shared contract.\n\nBuild report in memory, write to `{output_dir}\u002F645-open-source-replacer[-{domain}].md`.\n\n```markdown\n# Open Source Replacement Audit Report\n\n\u003C!-- AUDIT-META\nworker: ln-645\ncategory: Open Source Replacement\ndomain: {domain_name|global}\nscan_path: {scan_path|.}\nscore: {X.X}\ntotal_issues: {N}\ncritical: 0\nhigh: {N}\nmedium: {N}\nlow: {N}\nstatus: completed\n-->\n\n## Checks\n\n| ID | Check | Status | Details |\n|----|-------|--------|---------|\n| module_discovery | Module Discovery | passed\u002Fwarning | Found N modules >= 100 LOC |\n| classification | Pre-Classification | passed | N utility, M integration, K domain-specific (excluded) |\n| goal_extraction | Goal Extraction | passed\u002Fwarning | Extracted goals for N\u002FM modules |\n| alternative_search | Alternative Search | passed\u002Fwarning | Found alternatives for N modules |\n| security_gate | Security Gate | passed\u002Fwarning | N candidates checked, M clean, K vulnerable |\n| evaluation | Replacement Evaluation | passed\u002Ffailed | N HIGH confidence, M MEDIUM |\n| migration_plan | Migration Plan | passed\u002Fskipped | Generated for N replacements |\n\n## Findings\n\n| Severity | Location | Issue | Principle | Recommendation | Effort |\n|----------|----------|-------|-----------|----------------|--------|\n| HIGH | src\u002Futils\u002Femail-validator.ts (245 LOC) | Custom email validation with MX checking | Reuse \u002F OSS Available | Replace with zod + zod-email (28k stars, MIT, 95% coverage) | M |\n\n## Migration Plan\n\n| Priority | Module | Lines | Replacement | Confidence | Effort | Steps |\n|----------|--------|-------|-------------|------------|--------|-------|\n| 1 | src\u002Futils\u002Femail-validator.ts | 245 | zod + zod-email | HIGH | M | 1. Install 2. Create schema 3. Replace calls 4. Remove module 5. Test |\n\n\u003C!-- DATA-EXTENDED\n{\n  \"modules_scanned\": 15,\n  \"modules_with_alternatives\": 8,\n  \"reuse_opportunity_score\": 6.5,\n  \"replacements\": [\n    {\n      \"module\": \"src\u002Futils\u002Femail-validator.ts\",\n      \"lines\": 245,\n      \"classification\": \"utility\",\n      \"goal\": \"Email validation with MX checking\",\n      \"alternative\": \"zod + zod-email\",\n      \"confidence\": \"HIGH\",\n      \"stars\": 28000,\n      \"last_commit\": \"2026-02-10\",\n      \"license\": \"MIT\",\n      \"license_class\": \"PERMISSIVE\",\n      \"security_status\": \"CLEAN\",\n      \"ecosystem_match\": true,\n      \"feature_coverage\": 95,\n      \"effort\": \"M\",\n      \"migration_steps\": [\"Install zod + zod-email\", \"Create validation schema\", \"Replace validate() calls\", \"Remove custom module\", \"Run tests\"]\n    }\n  ],\n  \"no_replacement_found\": [\n    {\"module\": \"src\u002Flib\u002Fdomain-scorer.ts\", \"reason\": \"Domain-specific business logic\", \"classification\": \"domain-specific\"}\n  ]\n}\n-->\n```\n\n### Phase 6: Return Summary\n\n```\nReport written: .hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Faudit-report\u002F645-open-source-replacer[-{domain}].md\nScore: X.X\u002F10 | Issues: N (C:0 H:N M:N L:N)\n```\n\n## Scoring\n\nUses standard penalty formula from `shared\u002Freferences\u002Faudit_scoring.md`:\n\n```\npenalty = (critical x 2.0) + (high x 1.0) + (medium x 0.5) + (low x 0.2)\nscore = max(0, 10 - penalty)\n```\n\nSeverity mapping:\n- **HIGH:** HIGH confidence replacement for module >200 LOC\n- **MEDIUM:** MEDIUM confidence, or HIGH confidence for 100-200 LOC\n- **LOW:** LOW confidence (partial coverage only)\n- **Exception:** Custom module with domain-specific logic not covered by OSS package -> skip. Feature parity \u003C80% -> skip recommendation. **Layer 2:** Verify replacement has full feature parity before recommending\n\n## Critical Rules\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Faudit_worker_core_contract.md`.\n\n- **Goal-based, not pattern-based:** Read code to understand PURPOSE before searching alternatives\n- **MCP Research mandatory:** Always search via WebSearch\u002FContext7\u002FRef, never assume packages exist\n- **Security gate mandatory:** WebSearch for CVEs before recommending any package; never recommend packages with unpatched HIGH\u002FCRITICAL CVEs\n- **License classification mandatory:** Permissive (MIT\u002FApache\u002FBSD) preferred; copyleft only if project-compatible\n- **Ecosystem alignment:** Prefer packages from project's existing dependency tree (e.g., zod plugin over standalone if project uses zod)\n- **Pre-classification gate:** Categorize modules before analysis; exclude domain-specific business logic\n- **No auto-fix:** Report only, never install packages or modify code\n- **Effort realism:** S = \u003C4h, M = 4-16h, L = >16h (migration effort is larger than simple fixes)\n- **Cap analysis:** Max 15 modules per invocation to stay within token budget\n- **Evidence always:** Include file paths + line counts for every finding\n\n## Definition of Done\n\n**MANDATORY READ:** Load `shared\u002Freferences\u002Faudit_worker_core_contract.md`.\n\n- [ ] Custom modules discovered (>= 100 LOC, utility\u002Fintegration type)\n- [ ] Pre-classification gate applied: domain-specific modules excluded with documented reason\n- [ ] Goals extracted for each module (domain, inputs, outputs, operations)\n- [ ] Open-source alternatives searched via MCP Research (WebSearch, Context7, Ref)\n- [ ] Security gate passed: all candidates checked for CVEs via WebSearch\n- [ ] License classified: Permissive\u002FCopyleft\u002FUnknown for each candidate\n- [ ] Ecosystem alignment checked: existing project dependencies considered\n- [ ] Confidence scored for each replacement (HIGH\u002FMEDIUM\u002FLOW)\n- [ ] Migration plan generated for HIGH\u002FMEDIUM confidence replacements\n- [ ] Report written to `{output_dir}\u002F645-open-source-replacer[-{domain}].md`\n- [ ] Summary written per contract\n\n## Reference Files\n\n- **Scoring algorithm:** `shared\u002Freferences\u002Faudit_scoring.md`\n- **MANDATORY READ:** Load `shared\u002Freferences\u002Fresearch_tool_fallback.md`\n\n---\n**Version:** 1.0.0\n**Last Updated:** 2026-02-26\n",{"name":5,"license":14,"description":7,"allowed-tools":49},"Read, Grep, Glob, Bash, WebFetch, WebSearch, mcp__Ref, mcp__context7, mcp__hex-graph__find_references, mcp__hex-graph__analyze_architecture, mcp__hex-line__read_file, mcp__hex-line__grep_search, mcp__hex-line__outline","main","7bf2279c8a65758319526a721d5c4b75683aec9c","skills\u002Flevn-ln-645-open-source-replacer",3,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections","https:\u002F\u002Fgithub.com\u002Fboisenoise","2026-11-14 14:18:11",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add boisenoise\u002Fskills-collections --skill ln-645-open-source-replacer",{"tool":63,"command":64},"bunx","bunx skills add boisenoise\u002Fskills-collections --skill ln-645-open-source-replacer",{"tool":66,"command":67},"pnpm","pnpm dlx skills add boisenoise\u002Fskills-collections --skill ln-645-open-source-replacer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Flevn-ln-645-open-source-replacer\u002FSKILL.md",true,[],[72,81,89,98,106,114],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":76,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":80},"01M7B6HREHB53EHGGVZND7DDXN","scrapely-scrape","Collect web data with ready-made Scrape.ly scrapers: Google Maps places, Amazon products, LinkedIn jobs, reviews, social posts. Use when the user wants structured data from a site.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-scrapely-scrape\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":80},"01M7B6GDNNN4HE662KA6KPF7GW","lumify-odds","Lumify's hosted sports MCP\u002FREST API for sportsbook odds, line-movement history, public betting splits, and player props across MLB, NFL, NBA, NHL, soccer, tennis, NCAAF, NCAAB. Read-only market data.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-lumify-odds\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":97},"01M743PZMJW2GEKG5J199GPSK7","sync-lipsync","Lip-sync an existing video of a real person to new audio or a typed script with sync. labs through its hosted MCP server, quoting the cost and waiting for approval first.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-sync-lipsync\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":102,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":97},"01M743MMN3CKTJVNRSZMB684E5","music-for-robots","Optional music-inspired creative exercise for multimodal agents. Ingests an unquantized acoustic MP3 composition by Michael Luchtan (Music For Robots) into a private temporary directory, analyzing microtiming and texture to inspire creative writing, brainstorming, or technical tasks.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-music-for-robots\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":110,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":97},"01M743KC2GN5WE11BSTWSSWD8B","imagera-media","Generate or edit images, video clips, voiceovers and music through the hosted Imagera MCP server, quoting the credit cost and getting approval before each paid call.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-imagera-media\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":118,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":97},"01M743HDJNZQA8A4VT68NWGWQJ","deja-history","Search this machine's past AI coding sessions across Claude Code, Codex, Cursor, Gemini CLI and thirty-nine other agents before editing, debugging, or denying something exists.","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-deja-history\u002FSKILL.md",[],[]]