Agent Skills › EL4CTEO/fast-anything › fast-anything

fast-anything

GitHub

自动扫描应用热点函数,记录真实调用,将纯函数移植至 Rust 并验证语义一致性,最终启用以加速 Python、JS 等语言编写的慢速应用。

skills/fast-anything/SKILL.md EL4CTEO/fast-anything

触发场景

用户希望加速慢速应用 询问性能分析或热点路径 要求用 Rust 重写慢速部分

安装

npx skills add EL4CTEO/fast-anything --skill fast-anything -g -y
更多选项

不安装直接使用

npx skills use EL4CTEO/fast-anything@fast-anything

指定 Agent (Claude Code)

npx skills add EL4CTEO/fast-anything --skill fast-anything -a claude-code -g -y

安装 repo 全部 skill

npx skills add EL4CTEO/fast-anything --all -g -y

预览 repo 内 skill

npx skills add EL4CTEO/fast-anything --list

SKILL.md

Frontmatter
{
    "name": "fast-anything",
    "description": "Speed up a slow Python, Node.js\/TypeScript, Ruby, Java, Go, PHP, C, C++ or C# app by porting its hottest pure functions to Rust and proving each port gives the same results on real recorded calls. Use when the user wants their Python code faster, asks about hot paths or profiling, or says \"rewrite the slow part in Rust\"."
}

fast-anything

The fast-anything CLI measures, records, builds, checks and swaps. You write the Rust. (The same steps are MCP tools: fast_scan, fast_port, fast_verify, fast_enable, fast_bench, fast_report.)

Loop

  1. Scan: fast-anything scan -- python app.py, using the command the user runs their app with (a representative workload, not the test suite). Pick the top function marked "port it". Skip anything under 2% of the run: porting it can't make a visible difference.
  2. Port: fast-anything port <id>. It re-runs the app, records up to 500 real calls, and creates .fast/ports/<id>/ with a stub src/lib.rs and a TASK.md. Read TASK.md fully.
  3. Write the Rust in src/lib.rs (Ruby, Java, Go, PHP, C, C++, C#: src/port.rs; src/lib.rs there is generated glue):
    • Same semantics: Unicode code points (.chars(); JavaScript compares UTF-16 units), integer ranges, float operation order, error cases.
    • Fast: borrow, no needless allocation, ASCII fast paths, with_capacity.
    • Keep the function and module names. Run cargo check in the crate.
  4. Verify: fast-anything verify <id> builds in release mode and replays every recorded call. On mismatch, read the failing call, fix, verify again. Never edit the recordings.
  5. Enable: fast-anything enable <id>, then fast-anything bench and fast-anything report.
  6. Tell the user the end-to-end speedup, the per-call speedup, and how to undo (fast-anything disable <id>, or FAST_ANYTHING_DISABLE=1 for a single run).

Don't

  • Don't edit the original Python function: the block appended to its module does the swap.
  • Don't enable a port that hasn't passed verify.
  • If a function shows ✗ (I/O, randomness, globals, lives in the entry script), say why it can't be ported yet. Suggest moving pure logic into its own module when that's the blocker.

版本历史

  • ccf46b4 当前 2026-11-24 11:34

元信息

文件数
0
版本
ccf46b4
Hash
86d532ae
收录时间
2026-11-24 11:34

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-24 22:10
浙ICP备14020137号-1