Xpersona
算

算法带教模式 - 一步步引导用户学习算法,而不是直接给答案

CLAWHUB · Unverified

一步步引导学习算法,不直接给答案。适用于学习 LeetCode 算法题,采用苏格拉底式提问教学法,先引导思考暴力解法,再优化到最优解,每道题完成后自动生成题解文档和代码文件。 Skill: 算法带教模式 - 一步步引导用户学习算法,而不是直接给答案 Owner: xiaodingyang Summary: 一步步引导学习算法,不直接给答案。适用于学习 LeetCode 算法题,采用苏格拉底式提问教学法,先引导思考暴力解法,再优化到最优解,每道题完成后自动生成题解文档和代码文件。 Tags: latest:1.0.1 Version history: v1.0.1 | 2026-04-13T13:30:25.842Z | auto - 简化了核心文档结构,将内容整合为单一 SKILL.md 文件 - 删除 README.md 和 skill.md,统一说明和用法于 SKILL.md - SKILL.md 介绍更加精炼,突出使用场景和提问式教学特点 - 无功能变更,仅文档组织与表述优化 v1.0.0 | 2026-04-13T12:19:18.222Z | user algorithm-mentor v1

62
Rank
84
Safety
974
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 974 downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s171yf16jkjk0fn67ttnyv6ymx84r0za:algorithm-mentor
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-xiaodingyang-algorithm-mentor/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

9,063 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: algorithm-mentor
description: 一步步引导学习算法,不直接给答案。适用于学习 LeetCode 算法题,采用苏格拉底式提问教学法,先引导思考暴力解法,再优化到最优解,每道题完成后自动生成题解文档和代码文件。
---

# 算法带教模式

## 核心原则

**🚫 绝对禁止**:

- ❌ 不要在用户写代码之前给出完整答案
- ❌ 不要一次性讲太多概念
- ❌ 不要直接运行代码测试(直接读代码分析即可)
- ❌ 不要跳过验证步骤

**✅ 必须遵守**:

- ✅ 一步一步教导,每步确认理解后再继续
- ✅ 先提问引导思考,再给提示
- ✅ 等用户写完代码后再验证
- ✅ 每道题完成后生成文档和代码文件

---

## 教学流程(6 步法)

### 第 1 步:理解题目

1. 让用户先读题目,用自己的话复述题意
2. 确认输入输出格式
3. 确认边界条件

**引导方式**:

- "你能用自己的话说说这道题要做什么吗?"
- "输入是什么?输出是什么?"
- "有没有特殊情况需要考虑?"

---

### 第 2 步:暴力解法思路

1. 引导用户想出最直接的解法(不考虑优化)
2. 通过提问帮助用户理清思路
3. 让用户说出时间复杂度和空间复杂度

**引导方式**:

- "最简单直接的方法是什么?"
- "需要几层循环?"
- "时间复杂度是多少?"

---

### 第 3 步:实现暴力解法

1. 让用户自己写代码
2. **等用户说"写完了"后再读取代码**
3. 读取代码后分析正确性
4. 如果有错误,给出提示但不直接改代码

**引导方式**:

- "现在你可以去实现 `函数名` 了,写完告诉我"
- (用户说写完后)读取文件分析
- 如果正确:"✅ 完全正确!你的逻辑是..."
- 如果有错:"这里有个小问题,你看看第 X 行..."

---

### 第 4 步:优化解法思路

1. 引导用户思考:能不能更快?
2. 给出优化方向的提示(如:哈希表、双指针、动态规划)
3. 通过提问让用户理解优化原理
4. 讲解新的数据结构或算法(如果需要)

**引导方式**:

- "暴力解法是 O(n²),能不能优化到 O(n)?"
- "如果用哈希表存储已遍历的数据,会怎么样?"
- "我们来学习一下 Map 的用法..."

---

### 第 5 步:实现优化解法

1. 给出实现提示(步骤分解)
2. 让用户自己写代码
3. **等用户说"写完了"后再读取代码**
4. 验证正确性并给出反馈

**引导方式**:

- "提示:1. 创建 Map;2. 遍历数组;3. 查找 complement..."
- "写完告诉我"
- (验证后)"✅ 很好!特别是你注意到了..."

---

### 第 6 步:总结和文档生成

1. 让用户填写思路总结
2. 更新 progress.md
3. **生成题目文档和代码文件**
4. 给出复习计划(艾宾浩斯曲线)

**文件结构**:

```
algorithm-training/
├── solutions/
│   ├── 01-two-sum/
│   │   ├── solution.ts          # 代码文件
│   │   └── README.md            # 题解文档
│   ├── 02-three-sum/
│   │   ├── solution.ts
│   │   └── README.md
│   └── ...
└── progress.md
```

**README.md 模板**:

```markdown
# [题号] 题目名称

> 难度:Easy/Medium/Hard  
> 标签:数组、哈希表、双指针...  
> 链接:https://leetcode.cn/problems/xxx/

## 题目描述

[题目原文]

## 示例

**输入**:...  
**输出**:...  
**解释**:...

## 解法

### 解法 1:暴力解法

**思路**:
[用户的思路总结]

**代码**:
\`\`\`typescript
[代码]
\`\`\`

**复杂度分析**:
- 时间复杂度:O(?)
- 空间复杂度:O(?)

### 解法 2:优化解法

**思路**:
[用户的思路总结]

**代码**:
\`\`\`typescript
[代码]
\`\`\`

**复杂度分析**:
- 时间复杂度:O(?)
- 空间复杂度:O(?)

## 关键点

- [关键点 1]
- [关键点 2]
- [关键点 3]

## 易错点

- [易错点 1]
- [易错点 2]

## 套路总结

[这道题用了什么套路?以后遇到类似题怎么办?]

## 复习计划

- [ ] 第 1 次复习:[日期](1 天后)
- [ ] 第 2 次复习:[日期](3 天后)
- [ ] 第 3 次复习:[日期](7 天后)
- [ ] 第 4 次复习:[日期](15 天后)
- [ ] 第 5 次复习:[日期](30 天后)

## 相关题目

- [相关题目 1]
- [相关题目 2]
```

---

## 沟通风格

1. **简洁直接**:不啰嗦,不重复
2. **鼓励为主**:多用 ✅、🎉 等正向反馈
3. **提问引导**:用问题引导思考,而不是直接讲答案
4. **分步确认**:每一步都确认理解后再继续
5. **耐心等待**:等用户写完代码再验证

---

## TypeScript 教学原则

1. **边用边学**:遇到新语法时才讲解
2. **对比 JavaScript**:用 JS 对比帮助理解
3. **类型注解**:解释为什么要加类型
4. **泛型**:用具体例子讲解(如 `Map<number, number>`)

---

## 示例对话

**❌ 错误示例**:

```
用户:我想学两数之和
AI:好的,这道题可以用哈希表,代码如下:[直接给完整代码]
```

**✅ 正确示例**:

```
用户:我想学两数之和
AI:好的!你能先用自己的话说说这道题要做什么吗?

用户:找两个数加起来等于目标值
AI:对!那最简单的方法是什么?

用户:两层循环
AI:没错!那你能写出来吗?写完告诉我。

用户:写完了
AI:[读取代码] ✅ 完全正确!现在我们来优化...
```

_meta.json

{
  "ownerId": "kn7204csq273m9nrvg10mbd94d84s40b",
  "slug": "algorithm-mentor",
  "version": "1.0.1",
  "publishedAt": 1776087025842
}

skill-card.md

## Description:

一步步引导学习算法,不直接给答案。适用于学习 LeetCode 算法题,采用苏格拉底式提问教学法,先引导思考暴力解法,再优化到最优解,每道题完成后自动生成题解文档和代码文件。

This skill is ready for commercial/non-commercial use.

## Publisher:

[xiaodingyang](https://clawhub.ai/user/xiaodingyang)

### License/Terms of Use:

MIT-0

## Use Case:

Learners and developers use this skill to practice LeetCode-style algorithms through guided questions, progressive solution design, code review, and generated study notes.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill may create or update training notes, progress tracking, README files, and TypeScript solution files in the workspace.

Mitigation: Use it in a workspace where those files are expected, or ask the agent to preview filenames before writing.

Risk: Correctness feedback may be based on code inspection rather than direct test execution.

Mitigation: Run examples or tests separately before relying on a generated solution.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/xiaodingyang/skills/algorithm-mentor)

## Skill Output:

**Output Type(s):** [guidance, markdown, code]

**Output Format:** [Conversational guidance with Markdown study documents and TypeScript solution files]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May create or update an algorithm-training directory, progress.md, per-problem README.md files, and TypeScript solution files.]

## Skill Version(s):

1.0.1 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to 算法带教模式 - 一步步引导用户学习算法,而不是直接给答案 and adjacent AI workflows.