API安装
- 作者仓库星标 2,010
- 作者更新于 实时读取
- 作者仓库 tinyfish-cookbook
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tinyfish-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 需要 · Vendor-specific
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- Python
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: leetcode-coach
description: Find and set up coding practice problems tailored to your weak areas, then create local files so…
category: 工程开发
runtime: Python
---
# leetcode-coach 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Pre-flight Check (REQUIRED) / Step 1 — Gather inputs / Step 2 — Find matching problems”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Pre-flight Check (REQUIRED) / Step 1 — Gather inputs / Step 2 — Find matching problems”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、会按任务需要访问外部网络、需要准备 Vendor-specific API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/tmp` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Pre-flight Check (REQUIRED) / Step 1 — Gather inputs / Step 2 — Find matching problems”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: leetcode-coach
description: Find and set up coding practice problems tailored to your weak areas, then create local files so…
category: 工程开发
source: tinyfish-io/tinyfish-cookbook
---
# leetcode-coach
## 什么时候使用
- 把工程方向的常用动作沉淀成 Agent 可调用的技能 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Pre-flight Check (REQUIRED) / Step 1 — Gather inputs / Step 2 — Find matching problems」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "leetcode-coach" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Pre-flight Check (REQUIRED) / Step 1 — Gather inputs / Step 2 — Find matching problems
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件 | 会按任务需要访问外部网络
安全层 -> 需要准备 Vendor-specific API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} LeetCode Coach
Find coding problems matched to your weak areas from LeetCode, HackerRank, and Codeforces — then set up local files so you can start solving immediately.
Pre-flight Check (REQUIRED)
Before making any TinyFish call, always run BOTH checks:
1. CLI installed?
which tinyfish && tinyfish --version || echo "TINYFISH_CLI_NOT_INSTALLED"
If not installed, stop and tell the user:
Install the TinyFish CLI:
npm install -g @tiny-fish/cli
2. Authenticated?
tinyfish auth status
If not authenticated, stop and tell the user:
You need a TinyFish API key. Get one at: https://agent.tinyfish.ai/api-keys
Then authenticate:
tinyfish auth login
Do NOT proceed until both checks pass.
Step 1 — Gather inputs
Ask for the following if not already provided:
Required:
- Preferred language — e.g. Python, JavaScript, Java, C++, Go, Rust
Optional (but improves results):
- Weak areas / topics to focus on — e.g. "dynamic programming", "graphs", "sliding window", "binary search", "recursion", "trees"
- Difficulty — Easy / Medium / Hard (default: Medium)
If the user isn't sure of their weak areas, ask:
"What topics do you find yourself getting stuck on, or want to get better at?"
If they still aren't sure, default to: Arrays, Strings, and Hash Maps (the most commonly tested fundamentals).
Step 2 — Find matching problems
Fire parallel TinyFish agents across LeetCode, HackerRank, and Codeforces to find real problems matching the topic and difficulty.
# Agent 1 — LeetCode problem search
tinyfish agent run \
--url "https://leetcode.com/problemset/?difficulty={DIFFICULTY}&topicSlugs={TOPIC_SLUG}" \
"You are on the LeetCode problem set page filtered by difficulty and topic.
Find 3 problems that match the topic: {TOPIC}.
For each problem extract:
- title
- difficulty (Easy/Medium/Hard)
- acceptance rate
- topic tags
- direct URL to the problem (e.g. https://leetcode.com/problems/two-sum/)
STRICT RULES:
- Do NOT click any problem to open it
- Read only the problem listing visible on this page
- Return exactly 3 problems, no more
- Skip premium-only problems (marked with a lock icon)
Return JSON array: [{title, difficulty, acceptance_rate, tags, url}]" \
--sync > /tmp/lc_leetcode.json &
# Agent 2 — HackerRank problem search
tinyfish agent run \
--url "https://www.hackerrank.com/domains/algorithms?filters%5Bsubdomains%5D%5B%5D={TOPIC_SLUG}" \
"You are on HackerRank's algorithms problem listing filtered by topic.
Find 2 problems that match the topic: {TOPIC} at {DIFFICULTY} level.
For each problem extract:
- title
- difficulty
- score/points
- topic tags
- direct URL to the problem
STRICT RULES:
- Do NOT click any problem
- Read only the visible listing
- Return up to 2 problems
- Skip problems requiring premium or contests
Return JSON array: [{title, difficulty, score, tags, url}]" \
--sync > /tmp/lc_hackerrank.json &
# Agent 3 — Codeforces problem search
tinyfish agent run \
--url "https://codeforces.com/problemset?tags={TOPIC_SLUG}" \
"You are on Codeforces problem set filtered by tag.
Find 2 problems matching the topic: {TOPIC} at approximately {DIFFICULTY} level
(Easy ≈ rating 800-1200, Medium ≈ 1300-1800, Hard ≈ 1900+).
For each problem extract:
- problem ID (e.g. 1A, 158B)
- title
- rating
- tags
- direct URL (e.g. https://codeforces.com/problemset/problem/1/A)
STRICT RULES:
- Do NOT click any problem
- Read only the visible listing
- Return up to 2 problems
Return JSON array: [{id, title, rating, tags, url}]" \
--sync > /tmp/lc_codeforces.json &
wait
echo "=== LEETCODE ===" && cat /tmp/lc_leetcode.json
echo "=== HACKERRANK ===" && cat /tmp/lc_hackerrank.json
echo "=== CODEFORCES ===" && cat /tmp/lc_codeforces.json
Before running, replace:
{DIFFICULTY}— Easy / Medium / Hard{TOPIC}— human-readable topic e.g.dynamic programming{TOPIC_SLUG}— URL-friendly e.g.dynamic-programming
Step 3 — Present problem options
From the results, pick the 3 best problems across all sources. Prefer:
- LeetCode problems (widest community support, best editorial availability)
- Problems with clear descriptions visible from the listing
- Problems with acceptance rates between 30-60% for Medium difficulty
Present them like this:
Here are 3 problems matched to your focus on **{TOPIC}** in **{LANGUAGE}**:
**Option 1 — {Title}** ({difficulty}) · {source}
Tags: {tags}
Acceptance: {rate}
🔗 {url}
**Option 2 — {Title}** ({difficulty}) · {source}
Tags: {tags}
🔗 {url}
**Option 3 — {Title}** ({difficulty}) · {source}
Tags: {tags}
🔗 {url}
Which one do you want to tackle? (1, 2, or 3)
Wait for the user to choose a problem before proceeding.
Step 3b — Ask how they want to solve it
Once the user picks a problem, ask:
How do you want to solve it?
1. **On the website** — I'll give you the direct link and you solve it in the browser
2. **Locally** — I'll fetch the full problem and set up files on your machine so you can code in your editor
(1 or 2)
If they choose option 1 (website): Give them the direct link to the problem and wish them luck:
Here you go: {problem_url}
Good luck! Come back and paste your solution when you're done — I'll review it.
Stop here. Do not create any files.
If they choose option 2 (locally): Continue to Step 4.
Step 4 — Fetch the full problem
Once the user picks, fetch the full problem description using TinyFish.
tinyfish agent run \
--url "{CHOSEN_PROBLEM_URL}" \
"You are on a coding problem page. Extract the complete problem details.
Extract:
- title
- difficulty
- full problem description (exactly as written — do not paraphrase)
- constraints (exact list)
- all example inputs and outputs with explanations
- topic tags
- any follow-up questions mentioned
STRICT RULES:
- Do NOT click any links
- Extract the complete description verbatim — do not shorten it
- If examples have visual diagrams described in text, include them
Return JSON: {title, difficulty, description, constraints: [], examples: [{input, output, explanation}], tags: [], followup}" \
--sync
Step 5 — Create local files
Once you have the full problem, create these three files in the current working directory:
problem.md
# {Problem Title}
**Source:** {url}
**Difficulty:** {difficulty}
**Tags:** {tags}
**Language:** {language}
---
## Problem
{full problem description}
## Constraints
{constraints as bullet list}
## Examples
### Example 1
**Input:** {input}
**Output:** {output}
**Explanation:** {explanation}
### Example 2
...
---
## Notes
<!-- Add your approach notes here before coding -->
solution.{ext}
Create a starter file with the correct extension for the chosen language and a function signature scaffold. Use the appropriate extension:
| Language | Extension | Starter |
|---|---|---|
| Python | .py |
def solution(): with docstring |
| JavaScript | .js |
function solution() {} with JSDoc |
| TypeScript | .ts |
typed function signature |
| Java | .java |
class + method scaffold |
| C++ | .cpp |
#include + function |
| Go | .go |
package + func |
| Rust | .rs |
fn solution() |
Include a comment at the top:
// Problem: {title}
// Source: {url}
// Difficulty: {difficulty}
// Your approach: (fill this in before coding)
Infer the function signature from the problem description if possible (e.g. if the problem says "given an array of integers, return..."). If unclear, use a generic starter.
test_cases.md
# Test Cases — {Problem Title}
## From the problem
| # | Input | Expected Output |
|---|-------|----------------|
| 1 | {input} | {output} |
| 2 | {input} | {output} |
## Edge cases to consider
<!-- Think about: empty input, single element, negative numbers, duplicates, max constraints -->
- [ ] Empty input
- [ ] Single element
- [ ] Already sorted / already valid
- [ ] Maximum constraint size
Step 6 — Brief the user
Once the files are created, tell the user:
Files created:
- problem.md ← full problem description
- solution.{ext} ← starter template in {language}
- test_cases.md ← sample test cases + edge case checklist
Take your time and solve it. When you're done, paste your solution here and I'll review it — checking for correctness, edge cases, time complexity, and style.
Good luck!
Edge Cases
- LeetCode returns no results for topic — fall back to searching
https://leetcode.com/problemset/?search={TOPIC}without the filter - Problem URL is premium-only — skip it and pick the next best option from the results
- User doesn't know their weak areas — default to Arrays + Hash Maps (Medium), which covers the widest range of interview fundamentals
- User wants a specific problem by name — skip Steps 2-3, go straight to fetching and creating files for that problem
- Codeforces returns nothing — skip it silently, present options from LeetCode and HackerRank only
- User is a complete beginner — suggest Easy difficulty and start with Two Sum (LeetCode #1) as a warm-up before moving to their topic of interest
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核