fallow-rs/fallow-skills

GitHub: fallow-rs/fallow-skills

为 30 多种 AI 编程 Agent 提供 JavaScript 和 TypeScript 代码库静态分析技能,自动发现死代码、循环依赖、重复代码和复杂度问题。

Stars: 2 | Forks: 0

fallow
Agent skills for the JavaScript and TypeScript codebase analyzer.

MIT License CI Agent Skills fallow v2.11.0

[fallow](https://github.com/fallow-rs/fallow) 的 Agent 技能,fallow 是一个基于 Rust 的原生代码库分析工具,用于分析 JavaScript 和 TypeScript。Fallow 能够发现未使用的代码、循环依赖、代码重复、复杂度热点以及架构边界违规。提供 84 个框架插件、零配置、亚秒级性能。支持任何兼容 [Agent Skills](https://agentskills.io) 规范的 Agent:Claude Code、Cursor、OpenAI Codex、Windsurf、GitHub Copilot、Gemini CLI、Amp 以及 [其他 30 多种](https://agentskills.io)。 ## 快速开始 ### Claude Code ``` /install fallow-rs/fallow-skills ``` ### Cursor ``` git clone https://github.com/fallow-rs/fallow-skills.git ~/.cursor/skills/fallow-skills ``` ### OpenAI Codex ``` git clone https://github.com/fallow-rs/fallow-skills.git ~/.agents/skills/fallow-skills ``` ### Windsurf ``` git clone https://github.com/fallow-rs/fallow-skills.git ~/.codeium/windsurf/skills/fallow-skills ``` ### GitHub Copilot ``` git clone https://github.com/fallow-rs/fallow-skills.git .github/skills/fallow-skills ``` ### Gemini CLI ``` gemini skills install https://github.com/fallow-rs/fallow-skills.git ``` ### Amp ``` git clone https://github.com/fallow-rs/fallow-skills.git ~/.config/agents/skills/fallow-skills ```
其他 Agent 将技能目录克隆或复制到你的 Agent 的技能目录中。此技能遵循开放的 [Agent Skills](https://agentskills.io) 规范,并可与任何兼容的 Agent 一起使用。
## 前置条件 必须在目标项目中安装 Fallow: ``` npm install -g fallow # prebuilt binaries npx fallow dead-code # or run without installing ``` 有关包括 `cargo install fallow-cli` 在内的所有安装选项,请参阅[安装指南](https://docs.fallow.tools/installation)。 ## 可用技能 | 技能 | 描述 | 触发短语 | |---|---|---| | [fallow](fallow/) | JS/TS 代码库分析:未使用的代码、循环依赖、重复代码、复杂度 | "find dead code"、"unused exports"、"find duplicates"、"check code health" | ## 包含内容 ### 休耕 | 类别 | 功能 | |---|---| | **死代码** | 查找未使用的文件、导出、类型、依赖项、枚举/类成员(15 种问题类型) | | **重复代码** | 通过 4 种模式查找代码克隆:严格、轻微、宽松、语义 | | **复杂度** | 函数复杂度分析、热点检测、健康评分 | | **自动修复** | 移除未使用的导出和依赖项,并提供试运行预览 | | **CI** | GitHub Actions、SARIF 上传、基线比较、PR 范围检查 | | **Monorepo** | 针对每个工作区进行分析,并支持跨包解析 | | **调试** | 追踪导出使用链、文件边缘和依赖项使用情况 | ### 参考文档 - **[CLI 参考](fallow/references/cli-reference.md)**:所有 10 个命令、标志、JSON 输出结构、配置格式 - **[注意事项](fallow/references/gotchas.md)**:19 个带有错误/正确示例的常见陷阱 - **[模式](fallow/references/patterns.md)**:14 个用于 CI、Monorepo、迁移和增量采用的工作流方案 ## 示例提示词 安装完成后,你可以使用自然语言: - "Find all dead code in this project" - "Are there any unused dependencies?" - "Find code duplication in the codebase" - "Clean up unused exports" - "Set up a CI check for dead code" - "Check the complexity of this codebase" - "Why is this export flagged as unused?" - "Check if this PR introduces dead code" - "Find unused files in the payments package" - "What's the duplication percentage?" ## 工作原理 ``` User: "Find all unused exports" ↓ Agent loads fallow skill ↓ Skill instructs: run `fallow dead-code --format json --quiet --unused-exports` ↓ Agent executes command, parses JSON output ↓ Agent summarizes findings with file paths and line numbers ``` 该技能为 Agent 提供: 1. **命令知识**:针对每项任务应使用哪个 fallow 命令及标志 2. **输出解析**:如何解析 JSON 结果 3. **防护机制**:修复前始终进行试运行、绝不运行 watch、在非 TTY 环境下使用 `--yes` 4. **调试支持**:如何使用 `--trace` 追踪误报 ## 相关资源 - [fallow](https://github.com/fallow-rs/fallow):基于 Rust 的原生 JavaScript 代码库分析器(比 knip 快 3-36 倍) - [fallow-docs](https://docs.fallow.tools):官方文档 - [VS Code 扩展](https://marketplace.visualstudio.com/items?itemName=fallow-rs.fallow-vscode):在你的编辑器中提供实时诊断 - [Agent Skills 规范](https://agentskills.io):此技能所遵循的开放标准 ## 许可证 MIT。有关详细信息,请参阅 [LICENSE](LICENSE)。
标签:Agent Skills, AI代理, Claude Code, CMS安全, Cursor, Fallow, Gemini CLI, GitHub Copilot, JavaScript, OpenAI Codex, Rust, TypeScript, Windsurf, 代码复杂度, 代码审查, 代码重复检测, 代码重构, 可视化界面, 威胁情报, 安全插件, 开发者工具, 循环依赖, 技术债务, 插件, 数据可视化, 数据管道, 无配置, 暗色界面, 架构边界检查, 死代码检测, 网络流量审计, 网络调试, 自动化, 软件工程, 错误基检测, 静态代码分析