← 返回 Skills 市场
fourierer

auto-leetcode

作者 Fourier · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
40
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install auto-leetcode
功能描述
LeetCode刷题辅助技能。当用户提供LeetCode题目序号+名称时,自动获取题目内容、生成解题思路和带注释的代码,并在指定目录下创建题目文件夹。支持用户指定编程语言(默认Python)。当用户提到LeetCode刷题、做LeetCode题目、LeetCode题解、刷算法题等场景时触发。
使用说明 (SKILL.md)

LeetCode 刷题助手

根据用户提供的题目序号+名称,自动生成题目内容、解题思路和代码,并创建本地文件夹。

输入要求

用户需提供:

  • 题目序号+名称(如 42.接雨水1.两数之和
  • 本地目录路径(如 /Users/yihe/leetcode
  • 编程语言(可选,默认 Python;可选 pythoncppjavajavascriptgorust

若用户未提供目录或语言,主动询问。

工作流程

1. 获取题目内容

使用 web-search-prime_web_search_prime 搜索题目,关键词格式:LeetCode {序号} {名称}

然后使用 web-reader_webReader 抓取题目页面内容(优先使用 LeetCode 中文站 leetcode.cn 的链接)。

从抓取内容中提取:

  • 题目标题
  • 难度(简单/中等/困难)
  • 题目描述
  • 输入输出示例
  • 数据范围/约束条件

2. 生成解题思路

基于题目内容,分析并生成结构化的解题思路,包含:

  • 问题分析与关键洞察
  • 推荐解法(优先给出最优解)
  • 算法步骤(伪代码或自然语言描述)
  • 时间/空间复杂度分析
  • 如有多种解法,列出对比(从暴力到最优)

3. 生成代码

根据用户指定语言(默认Python)生成带详细注释的代码:

  • 函数/类签名词汇与LeetCode一致
  • 中文注释解释关键逻辑
  • 包含解题思路中的核心算法
  • 代码风格参考 references/code-style.md

4. 创建本地文件

在用户指定目录下创建文件夹并写入文件。

文件夹命名:使用题目序号+名称(如 42.接雨水

文件结构

{目录}/{序号}.{名称}/
├── 题目内容.md
├── 解题思路.md
└── {序号}.{ext}

语言与扩展名映射

语言 扩展名
python .py
cpp .cpp
java .java
javascript .js
go .go
rust .rs

5. 文件内容格式

各文件格式参考 references/output-templates.md

安全使用建议
This looks safe for its stated purpose. Before installing, be aware that it will use web lookup/reading tools and create files in a local directory you provide. Choose a dedicated folder and check for existing files with the same problem name to avoid accidental overwrites.
功能分析
Type: OpenClaw Skill Name: auto-leetcode Version: 1.0.0 The 'auto-leetcode' skill is a legitimate utility designed to automate the process of fetching LeetCode problem descriptions and generating solution files. It uses standard web search and reading tools to gather information and writes the results to a user-specified local directory using predefined templates in 'references/output-templates.md'. No indicators of malicious intent, data exfiltration, or unauthorized execution were found.
能力评估
Purpose & Capability
The stated purpose, workflow, and included reference templates all align around fetching LeetCode problem content, generating explanations/code, and saving them locally.
Instruction Scope
The skill instructs use of web search/web reader tools and local file creation, which are purpose-aligned but should remain limited to the requested LeetCode problem and user-provided directory.
Install Mechanism
There is no install spec, no executable code, no required binaries, and no required environment variables or credentials.
Credentials
Writing files under a user-specified path is proportionate to the skill, but users should choose a dedicated directory and avoid overwriting existing work.
Persistence & Privilege
The only persistence described is creation of local problem folders and files; there is no background service, credential storage, memory indexing, or ongoing autonomous behavior.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install auto-leetcode
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /auto-leetcode 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
auto-leetcode 1.0.0 – LeetCode刷题自动化助手发布 - 根据用户输入的题目序号和名称自动获取LeetCode题目信息 - 生成结构化解题思路与带注释的代码(支持多语言,默认Python) - 在指定本地目录自动创建题目文件夹与标准文件结构 - 支持自定义编程语言(Python、C++、Java、JavaScript、Go、Rust) - 全程引导用户输入必要信息,自动补全缺失部分
元数据
Slug auto-leetcode
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

auto-leetcode 是什么?

LeetCode刷题辅助技能。当用户提供LeetCode题目序号+名称时,自动获取题目内容、生成解题思路和带注释的代码,并在指定目录下创建题目文件夹。支持用户指定编程语言(默认Python)。当用户提到LeetCode刷题、做LeetCode题目、LeetCode题解、刷算法题等场景时触发。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 40 次。

如何安装 auto-leetcode?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install auto-leetcode」即可一键安装,无需额外配置。

auto-leetcode 是免费的吗?

是的,auto-leetcode 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

auto-leetcode 支持哪些平台?

auto-leetcode 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 auto-leetcode?

由 Fourier(@fourierer)开发并维护,当前版本 v1.0.0。

💬 留言讨论