返回顶部
f

foam-notes泡沫笔记

Work with Foam note repositories. Create, edit, link, and tag notes. Get intelligent wikilink and tag suggestions. Skill supports backlinks discovery, daily notes, templates, graph visualization, note deletion, and renaming. Full Foam documentation included for easy querying.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.3
安全检测
已通过
1,128
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

foam-notes

Foam 笔记

在 VS Code 中处理 Foam 笔记工作区。Foam 是一个免费、开源的个人知识管理系统,使用带有维基链接的标准 Markdown 文件。

快速参考

  • - 维基链接:[[笔记名称]] — 双向连接笔记
  • 嵌入:![[笔记名称]] — 包含其他笔记的内容
  • 反向链接:自动发现与当前笔记的连接
  • 标签:#标签 或 frontmatter tags: [标签1, 标签2]
  • 日记:Alt+D 或命令 Foam: 打开日记

配置

将 config.json.template 复制为 config.json 并根据需要编辑:

json
{
foam_root: /path/to/your/foam-workspace,
default_template: new-note,
defaultnotesfolder: notes,
dailynotefolder: journals,
author: Your Name,
wikilinks: {
title_stopwords: [home, index, readme, draft, template],
suffixes: [-hub],
min_length: 3
},
tags: {
editorial_stopwords: [notes, note, foam, markdown, file, page, section]
}
}

位置:技能目录中的 config.json(与 SKILL.md 同级)。

配置键

类型默认值描述
foamroot字符串(自动检测)Foam 工作区的路径
defaulttemplate
字符串 | new-note | 新笔记的模板 | | defaultnotesfolder | 字符串 | notes | 新笔记的子文件夹 | | dailynotefolder | 字符串 | journals | 日记的子文件夹 | | author | 字符串 | | 创建笔记的作者名称 | | wikilinks.title_stopwords | 列表 | [] | 从不匹配为维基链接的笔记标题(例如 home、index、todo)。添加工作区中会产生误报的任何通用文件名。 | | wikilinks.suffixes | 列表 | [] | 文件名后缀,其基本词干也应注册为匹配键。例如,如果您将中心/地图笔记命名为 docker-hub.md,请在此处添加 -hub,以便正文中的 docker 匹配 docker-hub.md。 | | wikilinks.min_length | 整数 | 3 | 考虑进行维基链接匹配的最小键长度 | | tags.editorial_stopwords | 列表 | [] | 从标签建议中排除的领域特定词(除了标准英语停用词之外)。 |

Foam 根目录优先级顺序(从高到低)

  1. 1. --foam-root CLI 参数
  2. FOAMWORKSPACE 环境变量
  3. config.json 中的 foamroot
  4. 通过查找 .foam 或 .vscode 目录自动检测
  5. 当前工作目录

完整文档请参见 references/configuration.md。

脚本

所有脚本都支持 --foam-root 来覆盖工作区路径。

init_templates.py

使用官方 Foam 模板中的入门模板初始化 .foam/templates/:

bash
python3 scripts/init_templates.py # 复制到当前工作区
python3 scripts/init_templates.py --foam-root ~/notes
python3 scripts/init_templates.py --list # 显示可用模板
python3 scripts/init_templates.py --force # 覆盖现有文件
python3 scripts/init_templates.py --dry-run # 预览将要复制的内容

包含的模板:

  • - new-note.md — 新笔记的默认模板
  • daily-note.md — 日记模板
  • your-first-template.md — 演示 VS Code 代码片段的示例模板

create_note.py

从模板创建新笔记:

bash
python3 scripts/create_note.py 我的新想法
python3 scripts/create_note.py 会议笔记 --template meeting
python3 scripts/create_note.py 研究主题 --dir research/

find_backlinks.py

查找所有链接到给定笔记的笔记:

bash
python3 scripts/find_backlinks.py 机器学习
python3 scripts/find_backlinks.py ml-basics --format json

search_tags.py

按标签查找笔记:

bash
python3 scripts/search_tags.py #research
python3 scripts/search_tags.py machine-learning --include-frontmatter

list_tags.py

列出所有标签及其使用次数:

bash
python3 scripts/list_tags.py
python3 scripts/list_tags.py --hierarchy --min-count 3

graph_summary.py

分析知识图谱:

bash
python3 scripts/graph_summary.py
python3 scripts/graph_summary.py --format json

daily_note.py

创建日记:

bash
python3 scripts/daily_note.py
python3 scripts/daily_note.py --yesterday
python3 scripts/daily_note.py --template custom-daily
python3 scripts/daily_note.py --print-path # 仅输出路径

suggest_wikilinks.py

通过查找笔记中与现有笔记标题匹配的文本来建议维基链接:

bash
python3 scripts/suggest_wikilinks.py my-note.md # 交互模式
python3 scripts/suggest_wikilinks.py my-note.md --apply 1,3,5 # 自动应用
python3 scripts/suggest_wikilinks.py my-note.md --auto-apply # 全部应用
python3 scripts/suggest_wikilinks.py my-note.md --dry-run # 仅预览
python3 scripts/suggest_wikilinks.py my-note.md --with-aliases # 创建 [[目标|文本]] 格式

该脚本扫描笔记内容,识别与存档中现有笔记标题匹配的单词/短语。它以编号列表形式呈现:

  1. 1. 第12行,第8列
文本:machine learning 链接到:[[machine-learning]] 上下文:...working on machine learning projects...

维基链接格式:

  • - 默认:[[目标]] — 简洁的链接
  • 使用 --with-aliases:[[目标|显示文本]] — 保留原始文本作为别名

回复:

  • - 要实施的数字(例如 1 3 5)
  • all 应用所有建议
  • none 取消

suggest_tags.py

根据内容和存档中的现有标签为笔记建议标签:

bash
python3 scripts/suggest_tags.py my-note.md # 交互模式
python3 scripts/suggest_tags.py my-note.md --apply all # 添加所有建议
python3 scripts/suggest_tags.py my-note.md --apply existing # 仅现有标签
python3 scripts/suggest_tags.py my-note.md --frontmatter # 添加到 frontmatter

该脚本:

  1. 1. 从笔记内容中提取关键词
  2. 查找匹配的现有标签(带使用次数)
  3. 基于内容分析建议新标签

以编号列表形式呈现,分为两个部分:

  • - 现有标签 — 已在您的存档中使用
  • 新建议 — 从当前笔记内容中提取

回复:

  • - 数字(例如 1 3 5)
  • all — 所有建议
  • existing — 仅现有标签
  • new — 仅新建议
  • none — 取消
  • 或输入自定义标签:#mytag #project

delete_note.py

删除笔记,支持可选备份和自动反向链接处理:

bash
python3 scripts/delete_note.py 旧笔记 # 交互式删除
python3 scripts/delete_note.py 旧笔记 --force # 跳过确认
python3 scripts/delete_note.py 旧笔记 --backup # 移动到 .foam/trash/
python3 scripts/delete_note.py 旧笔记 --fix-links # 从其他笔记中移除维基链接

功能:

  • - 备份模式:将笔记移动到 .foam/trash/ 而不是永久删除
  • 反向链接检测:显示哪些笔记链接到被删除的笔记
  • 链接修复:自动从其他笔记中移除维基链接
  • 确认:删除前提示(使用 --force 跳过)

rename_note.py

重命名笔记并自动更新所有维基链接:

bash
python3 scripts/rename

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 foam-notes-1776420039 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 foam-notes-1776420039 技能

通过命令行安装

skillhub install foam-notes-1776420039

下载

⬇ 下载 foam-notes v1.0.3(免费)

文件大小: 48.83 KB | 发布时间: 2026-4-17 19:38

v1.0.3 最新 2026-4-17 19:38
- Added detailed configuration section with all available config keys and descriptions.
- Explained new options for customizing wikilink and tag suggestion logic using stopwords, suffixes, and minimum lengths.
- Clarified location and usage of `config.json` for workspace setup.
- No changes to scripts or core functionality; documentation improvements only.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部