plugins/tools/cortex/skills/cortex-ingest/SKILL.md
外部源 (文件/URL/目录) 摄取进 vault — 抽实体, 套模板 (cli=manual), wikilink 回填; URL 走 defuddle。Triggers on "ingest", "摄取".
npx skillsauth add lazygophers/ccplugin cortex-ingestInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
把外部内容 (本地文件 / 网页 / 目录批量) 转成结构化 知识库 页面写入 Obsidian vault。
/cortex:ingest 显式调用 (slash, 无入参; AI 从 prompt 推 path/url/dir)源类型 ─┬─ URL (https?://) → ingest_url.sh → 知识库/项目/<host>/_site/<slug>/<slug>.md
│ (网页/arxiv/docs/blog, _site 占位代替 org)
├─ github/gitlab URL → ingest_remote.sh → 知识库/项目/<host>/<org>/<repo>/
├─ 本地文件 (md/pdf/epub/docx/txt) → ingest_file.sh
├─ 本地 git repo → ingest_remote.sh (相对 $HOME 拆段, 不足 3 段补 _local)
└─ 目录批量 → Glob 收集 → 单文件循环
收件箱仅留 fleeting/journal/question 纯笔记, 非外部 URL 默认目标。
CLI 不可用 fallback: WebFetch + defuddle + 手工调三过滤器
→ P0 三过滤器 (url_security → html_sanitize → masking) 顺序严格, 任一拒绝即终止
/cortex:ingest auto (wrapper / cron 触发): 跳所有 AskUserQuestion, 自动判源类型 / 默认 kind=log / L3 写盘默认通过 / 三过滤器拒绝即终止不询问。
/cortex:ingest (会话内交互): per-file AskUserQuestion L3 写盘授权门; 批量 ≥3 升级 per-batch 单次确认。
知识库/项目/<host>/<org>/<repo>/): 主题/ (≥4) + 模块/ + 文件/ + 符号/api/ 任一空 → 拒交知识库 .md 4 字段 (0.0-10.0 浮点 + maturity enum): score / confidence / source_credibility / maturity。AI 落档自动写, 详见 extract.md §3.1。
| 文件 | 内容 | |---|---| | pipeline.md | 9 步主流程 + 源类型表 + 错误处理 + Source frontmatter 路由 | | safety-filters.md | P0 三过滤器 (url_security/html_sanitize/masking) 详细规范 | | layout.md | 4 层目录 + 分级 .md 下限 + 拒交硬条件 + 分级评分 + 增量元数据 | | extract.md | frontmatter schema + 深度处理 L1-L6 + 6 类抽取 + 覆盖度 + 评分启发式 | | exclude.md | 强制排除清单 (build 产物 / lock / binary / 系统 IDE / 临时备份 / 压缩包) | | knowledge-graph.md | 4 制品 (Bases/Canvas/Wikilink/websearch) | | global-rules.md | 文件夹优先 + 嵌套 repo 处理 + tag ≥10 约定 |
git commit; 不抓 URL 二级链接 (除非显式 /cortex:ingest); 不抽过 5 个 entity (避噪音, 多了让用户手工拆)development
Go 数据库规范——GORM Model 命名 ModelXxx、表名单数、枚举 uint8 + 常量、索引 idx_ 前缀 + deleted_at leading column、禁 time.Time 统一 int64 unix、禁指针/nullable 字段、TEXT/BLOB/JSON 禁 default、AutoMigrate 禁改主键。设计 DB model、写 GORM tag、建索引、做 migration 审查时触发。
development
Go HTTP API 规范——响应始终 200 + body code 字段、路由 /api/* 全 POST 单段 <Action><Model>、中间件逐路由注册禁 Group(prefix,mw...)、handler 仅返回 (rsp,error)、认证走 header。设计 HTTP API、写路由/handler/中间件时触发。
development
Go 项目结构规范——三层架构(API → Impl → State)、全局状态模式、internal/ 私有包、cmd/ 仅 main.go、go.work 多模块、禁止 Repository 接口和 DI 容器、struct 公共字段开头全 omitempty、handler var rsp 顶声明、禁 legacy migration。设计项目骨架、新建目录、组织包、做架构评审时触发。
development
Go 命名规范——Id/Uid 字段(非 ID)、IsActive/HasMFA 布尔前缀、CreatedAt 时间字段、接收者统一用 p、包名全小写无下划线、泛型类型参数描述性命名、集合字段 xxx_list 禁 xxxs 复数、Enum 0 值 XxxNil 禁 Unknown、禁 Status 统一 State、Set/Update 语义区分。定义结构体字段、函数、变量、包、接收者名、泛型、枚举时触发。