埃恩学习

数据 社区

技能解读

当前原文的自动摘译,尚未人工审校。

这是做什么的

分析当前的编码会话以提取可重用的模式并将其保存为技能或规则修订以供将来的会话使用。这是 PostToolUse 钩子自动执行操作的手动触发器。

工艺流程

运行提取脚本: 该脚本: 扫描最近的工具调用和文件更改 识别模式(重复修复、样式更正、通用架构) 与现有规则和技能进行比较

何时使用

在建立新模式的长时间编码会话之后 当您发现自己反复进行相同的更正时 在集成新库并建立约定之后 定期捕获积累的项目知识

注意事项

自动的 PostToolUse 钩子 (continuous-learning-v2.cjs) 在每次工具调用后都会进行轻量级提取。这个/erne-learn命令运行全面的分析,捕获实时钩子可能错过的模式。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
数据
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
94 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@JubaKitiashvili · MIT
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
macOS · Linux · Windows
运行环境要求
Node.js
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
  • 命令执行
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# /erne-learn — Generate Skills from Session

You are executing the `/erne-learn` command. This is **script-driven** — it runs the continuous-learning-v2 pipeline directly.

## What This Does

Analyzes the current coding session to extract reusable patterns and save them as skills or rule amendments for future sessions. This is the manual trigger for what `PostToolUse` hooks do automatically.

## Process

1. **Run the extraction script:**

```bash
node .claude/hooks/scripts/extract-session-patterns.js
```

This script:
- Scans recent tool calls and file changes
- Identifies patterns (repeated fixes, style corrections, common architectures)
- Compares against existing rules and skills
- Generates candidates for new content

2. **Review candidates:**
The script outputs a list of potential learnings:
```
[PATTERN] Zustand store always uses immer middleware → Suggest rule amendment
[PATTERN] All screens use SafeAreaView wrapper → Suggest coding-style rule
[PATTERN] API calls always retry 3 times → Suggest pattern rule
[SKILL] Complex form validation flow → Suggest skill creation
```

3. **Approve or reject each candidate:**
For each candidate, decide:
- **Approve** → Script writes to `.claude/rules/` or `.claude/skills/`
- **Reject** → Skip this pattern
- **Edit** → Modify before saving

4. **Validate new content:**
```bash
node .claude/hooks/scripts/validate-content.js
```
Ensures new rules/skills have valid frontmatter and don't conflict with existing content.

## When to Use
- After a long coding session where you established new patterns
- When you notice yourself repeatedly making the same corrections
- After integrating a new library and establishing conventions
- Periodically to capture accumulated project knowledge

## Note
The automatic `PostToolUse` hook (`continuous-learning-v2.cjs`) does lightweight extraction after every tool call. This `/erne-learn` command runs a comprehensive analysis that catches patterns the real-time hook might miss.

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。