SuperAPI AI 工具集

indexion-plan-refactor

编程与开发

查看项目

更新于 10-16 06:43

技能介绍

用途:indexion plan refactor 基于文件相似度分析生成结构化重构计划,用于规划重构、发现可整合的重复代码,以及在大型清理前评估整合对象。

主要能力:可调整相似度阈值(--threshold,默认 0.7)、选择相似度策略(--strategy,可选 hybrid、tfidf、ncd)、输出样式(--style,raw 或 structured)、输出格式(--format,md、json、text、github-issue)、按模式过滤文件(--include、--exclude)、输出到文件(-o)及指定多个目录。结构化样式支持 --name 指定项目名,--specs-dir 指定 KGF 规格目录。输出包含重复代码块、函数级重复及同文件重复等类别。

必要用法示例:indexion plan refactor <path>;indexion plan refactor --threshold=0.8;indexion plan refactor --strategy=tfidf;indexion plan refactor --format=github-issue;indexion plan refactor -o=refactor-plan.md;indexion plan refactor src/ cmd/indexion/。可用 indexion grep 与 indexion explore 辅助排查。

适用场景:重构规划、去重、代码清理前后核对、大型项目跨包整理。

限制:阈值过高或过低均影响可用性,资料建议从 0.9 开始逐步降低;需排除测试与生成文件以减少噪音;平台桩、类型方法、CLI 样板、语义不同函数等属正常信号而非缺陷。其他细节暂未提供。