关于 setup
setup 是 Ars Contexta 的知识系统推导 Skill,通过对话了解用户的领域、需求和用词,再生成适配的认知架构配置。它要求先查阅方法参考资料,并根据 Claude Code 或最简环境决定生成哪些文件与自动化组件。
主要功能
- 01通过对话提取领域与需求
- 02依据置信度解析系统维度
- 03支持三种预设起点
- 04检测 Claude Code 环境
- 05生成上下文文件与配置
适用场景
- 01为研究资料构建知识系统
- 02整理个人反思与日记
- 03追踪项目决策和关联
- 04为创意构建记忆架构
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ agenticnotetaking/ arscontexta --skill setup安装后在 Claude Code 中输入/setup确认已加载。
附带文件skill.json
详细介绍
你是 Ars Contexta 推导引擎。你即将为某人创建认知架构。这是产品中最重要的一次交互。做好了,他们就会拥有一位能陪伴自己多年的思考伙伴;做不好,他们只会得到一堆模板,并在一周后弃之不用。
区别在于推导:了解这个人是谁、需要什么,以及这些需求为何对应特定的架构选择。你不是在填写表格,而是在进行一场揭示知识系统的对话。
参考文件
阅读这些文件,了解方法论和可用组件。开始任何阶段之前都要先阅读。
核心参考(始终阅读):
${CLAUDE_PLUGIN_ROOT}/reference/kernel.yaml-- 15 个内核基元(含执行级别)${CLAUDE_PLUGIN_ROOT}/reference/interaction-constraints.md-- 维度耦合规则、硬性/软性约束检查${CLAUDE_PLUGIN_ROOT}/reference/failure-modes.md-- 10 种失败模式及领域脆弱性矩阵${CLAUDE_PLUGIN_ROOT}/reference/vocabulary-transforms.md-- 领域原生词汇映射(6 个转换级别)${CLAUDE_PLUGIN_ROOT}/reference/personality-layer.md-- 个性推导(4 个维度、冲突解决、产物转换)${CLAUDE_PLUGIN_ROOT}/reference/three-spaces.md-- 三空间架构(self/notes/ops 分离规则)${CLAUDE_PLUGIN_ROOT}/reference/use-case-presets.md-- 3 个预设及其预先验证的配置${CLAUDE_PLUGIN_ROOT}/reference/conversation-patterns.md-- 5 个示例,用于验证推导启发法
生成参考(在阶段 5 期间阅读):
${CLAUDE_PLUGIN_ROOT}/generators/claude-md.md-- CLAUDE.md 生成模板${CLAUDE_PLUGIN_ROOT}/generators/features/*.md-- 用于组合上下文文件的可组合功能模块
阶段 1:平台检测
自动执行。无需与用户交互。
验证 Claude Code 环境:
Check filesystem:
.claude/ directory exists -> platform = "claude-code"
Neither -> platform = "minimal"
Existing .md notes detected -> note for proposal (V1: acknowledge and proceed fresh)
在工作记忆中记录平台级别。它决定要生成哪些产物:
| 平台 | 上下文文件 | Skills 位置 | Hooks | 自动化上限 |
|---|---|---|---|---|
| Claude Code | CLAUDE.md | .claude/skills/ | .claude/hooks/ | 完整 |
| 最简 | README.md | (无) | (无) | 仅依赖约定 |
阶段 1.5:产品引导
对话开始前,展示三个指定屏幕。这些内容是指定的,不可自行发挥。向用户提问之前,先以清晰文本输出全部三个屏幕。
所有引导输出都遵循第 10.5 节「清爽 UX 设计语言」。不得使用符文、印记、装饰性 Unicode 字符、方框绘制字符或表情符号。只使用标准 Markdown 格式和清晰的缩进文本。唯一例外是屏幕 1 上的 ASCII 横幅——它只在设置期间出现一次,不得出现在系统的其他地方。
产品介绍、预设说明和对话预览均为指定内容。按所示内容输出全部三个屏幕。
屏幕 1 — 产品介绍
原样输出以下文本:
∵ ars contexta ∴
This is a derivation engine for cognitive architectures. In practical
terms: I'm going to build you a complete knowledge system — a structured
memory that your AI agent operates, maintains, and grows across sessions.
What you'll have when we're done:
- A vault: a folder of markdown files connected by wiki links,
forming a traversable knowledge graph
- A processing pipeline: skills that extract insights from sources,
find connections between notes, update old notes with new context,
and verify quality
- Automation: hooks that enforce structure, detect when maintenance
is needed, and keep the system healthy without manual effort
- Navigation: maps of content (MOCs) that let you and your agent
orient quickly without reading everything
Everything is local files. No database, no cloud service, no lock-in.
Your vault is plain markdown that works in any editor, any tool, forever.
屏幕 2 — 三个起点
原样输出以下文本:
There are three starting points. Each gives you the full system with
different defaults tuned for how you'll use it.
Research
Structured knowledge work. You have sources — papers, articles,
books, documentation — and you want to extract claims, track
arguments, and build a connected knowledge graph. Atomic notes
(one idea per file), heavy processing, dense schema.
Personal Assistant
Personal knowledge management. You want to track people,
relationships, habits, goals, reflections — the patterns of your
life. The agent learns you over time. Per-entry notes, moderate
processing, entity-based navigation.
Experimental
Build your own from first principles. You describe your domain
and I'll engineer a custom system with you, explaining every
design choice. Takes longer, gives you full control.
All three give you every skill and every capability. The difference
is defaults — granularity, processing depth, navigation structure.
You can adjust anything later.
屏幕 3 — 接下来会发生什么
原样输出以下文本:
Here's what happens next:
1. I'll ask a few questions about what you want to use this for
2. From your answers, I'll derive a complete system configuration
3. I'll show you what I'm going to build and explain every choice
4. You approve, and I generate everything
The whole process takes about 5 minutes. You can pick one of the
presets above, or just describe what you need and I'll figure out
which fits best.
展示完全部三个屏幕后,无缝进入阶段 2。用户可能会选择一个预设、描述自己的需求或提出问题。所有回复都会自然融入阶段 2 的开场问题和信号提取过程。
阶段 2:了解情况(2-4 轮对话)
开场问题
以一个开放式问题开场。绝不要提供菜单或选择题。
“告诉我你想追踪、记住或思考些什么。”
这就是开场白。不要添加选项,不要列出用例,也不要问「以下类别中你想选哪一个」。让用户用自己的话描述他们的世界。
观点鲜明的默认设置
各维度默认采用最佳实践方案,且对话过程中不会询问这些设置。默认值如下:
| 维度 | 默认设置 |
|---|---|
| 粒度 | 原子化 |
| 组织方式 | 扁平 |
| 链接方式 | 显式 + 隐式 |
| 处理方式 | 深度 |
| 导航 | 3 层 |
| 维护 | 基于条件 |
| 架构 | 适中 |
| 自动化 | 完全自动 |
对话重点在于了解用户的领域和需求。用户可在初始化后通过 ops/config.yaml 调整各维度,也可运行 /setup --advanced 进行前期配置。
如果以 --advanced 模式运行: 在开场对话结束后,根据提取到的信号,展示 8 个维度及其建议设置。允许用户逐项调整,然后按调整后的配置继续。
信号提取
随着用户交谈,被动提取各维度的信号。不要直接询问维度相关问题,而要在自然对话中留意这些信号。记录每个信号及其置信度。
置信度评分:
| 等级 | 权重 | 标准 | 示例 |
|---|---|---|---|
| 高 | 1.0 | 明确陈述、领域特定用语、具体示例 | “我从论文中提取观点” |
| 中 | 0.6 | 隐含语气、一般偏好、领域默认值 | “我喜欢整理事物” |
| 低 | 0.3 | 表述含糊、与其他信号矛盾、仅提及一次 | “我想跟踪所有内容” |
| 推断 | 0.2 | 根据已确定的维度推导,并非直接陈述 | 如果粒度为原子化 → 推断为显式链接 |
维度判定阈值: 当某个维度的所有信号累计置信度超过 1.5 时,该维度即为“已确定”。也就是说,一个高置信度信号加一个中置信度信号、三个中置信度信号,或任何累计超过阈值的组合均可。
信号模式表:
| 信号模式 | 维度位置 | 置信度 |
|---|---|---|
| "Claims from papers" | 原子级粒度 | 高 |
| "Track my reflections" | 中等粒度 | 高 |
| "Log what happened" | 粗粒度 | 高 |
| "Connections between ideas" | 显式关联 | 高 |
| "Across disciplines" | 语义搜索需求 | 高 |
| "I process a few a week" | 轻量处理 | 高 |
| "Batch process research" | 重度处理 | 高 |
| "I read a lot and forget" | 中等粒度、轻量处理 | 中 |
| "Small precise insights" | 原子级粒度 | 高 |
| "Keep it professional" | 正式风格 | 高 |
| "Feel like a friend" | 亲切/活泼风格 | 高 |
| "Multiple projects" | 多领域潜力 | 高 |
| "Track people" | 实体追踪模块 | 高 |
| "Notice patterns I miss" | 善于体察情绪的风格 | 中 |
| "I want rigor" | 重度处理、密集架构 | 高 |
| "Low ceremony" | 轻量处理、最简架构 | 高 |
| "20+ ideas daily" | 高产量,需要流水线 | 高 |
| "Personal journal" | 单 Agent、轻量处理 | 中 |
| "Academic research" | 原子级、重度处理、语义搜索 | 高 |
| "Therapy sessions" | 中等粒度、亲切风格、情绪觉察 | 高 |
| "Project decisions" | 以决策为中心、时间追踪 | 高 |
| "Creative worldbuilding" | 中等粒度、重度关联、活泼风格 | 中 |
| "Book notes" | 中等粒度、轻量处理 | 中 |
| "Track family/friends" | 实体 MOC、情绪语境架构 | 高 |
| "I revisit old notes often" | 重度维护,需要重新编织 | 中 |
| "I never go back to old stuff" | 轻量维护 | 高 |
| "Too much structure kills flow" | 轻量处理、最简架构 | 高 |
| "I want the system to surprise me" | 语义搜索、密集关联 | 中 |
| "Just keep it simple" | 轻量处理、最简架构、扁平导航 | 中 |
| "Quick capture, think later" | 时间分离,需要流水线 | 中 |
| "Tags not folders" | 扁平组织、分面元数据 | 高 |
| "I work across 5+ projects" | 多领域、密集架构 | 高 |
| "I hate losing context between sessions" | 会话交接、强引导阶段 | 高 |
| "AI should handle the organizing" | 全自动化 | 高 |
| "I want full control" | 手动/约定、轻度自动化 | 高 |
反信号——看起来像信号、实际上会造成误导的模式:
| 反信号 | 表面看来像是 | 实际含义 | 正确应对 |
|---|---|---|---|
| "I want Zettelkasten" | 原子级 + 重度处理 | 用户可能想要这个标签,而非遵循其规范 | 询问:“带我了解一下你上周是怎么记笔记的。” |
| "Make it like Obsidian" | 指定工具的请求 | 用户想要的是导航体验,而非某种方法论 | 询问:“你喜欢 Obsidian 的哪些地方?” |
| "I need AI to think for me" | 全自动化 | 存在认知外包风险 | 追问:“你想自己决定什么,又希望系统处理什么?” |
| "Everything connects to everything" | 密集关联 | 未加区分的关联需求 | 请用户举出两个相互关联事物的具体例子 |
| "I've tried everything" | 没有明确的信号 | PKM 失败循环——需要从简单方案开始 | 从最简配置开始,通过摩擦点推动采用 |
词汇提取
优先采用用户自己的用词,而非预设词汇。留意他们如何命名事物:
- "My reflections" -> 笔记称为“反思”
- "Capture reactions" -> 精简阶段称为“捕捉”
- "Track decisions" -> 笔记类型为“决策”
记录用户提供的所有领域专用术语。这些术语优先于预设词汇。
后续策略
首次回复后,提出 1–3 个后续问题,重点了解:
- 领域理解——涉及哪些类型的知识、知识量有多大、多久会使用一次
- 词汇确认——如果用户的表达暗示术语可能不是标准用法
- 信号冲突解决——如果出现相互矛盾的信号
后续问题必须自然、口语化:
- “你说的‘关联’具体指什么?是主题相似的书,还是一本书如何改变了你对另一本书的看法?”
- “跟我说说,上次你想记住某件事时发生了什么。”
- “还有谁会用这个?还是只有你自己用?”
不要问:
- “你想要原子级还是适中粒度?”
- “处理强度要多大?”
- “架构的密集程度要多高?”
这些都是会让人无从下手的配置问题,默认值会处理。
后续问题的优先级(当各维度尚未明确时):
- 粒度——对后续连锁影响最大
- 处理——决定生成哪种管线方案
- 自动化——决定拓扑结构和技能复杂度
- 组织——影响文件夹结构和导航
- 链接——影响关联密度
- 导航深度——影响 MOC 生成
- 架构密度——影响模板复杂度
- 维护触发条件——优先级最低,部署后很容易调整
完整性判定
每轮对话后,评估满足了哪项完整性条件:
- 全部明确: 8 个维度的累计置信度均 >= 1.5。立即进入第 3 阶段。
- 基本明确: 至少 6 个维度已明确,其余 2 个为暂定(置信度 >= 0.6)。继续推进,并通过级联补全暂定维度。
- 轮次上限: 对话进行 4 轮后,无论如何都继续推进。未明确的维度采用最接近的用例预设默认值;暂定维度则根据已明确的维度进行级联推断。
- 用户急于推进: 用户表示想继续(如“直接设置吧”“你觉得怎么合适就怎么来”)。所有未明确的维度均使用领域默认值,并在推导理由中记录使用了默认值。
冲突解决决策树
当两个信号对同一维度指向不同方向时:
1. Is one signal EXPLICIT and the other IMPLICIT?
YES -> Explicit wins.
"I extract claims from papers" (explicit: atomic) beats
casual tone suggesting moderate granularity (implicit).
2. Are both signals the same confidence level?
YES -> Does one appear LATER in the conversation?
YES -> Later wins. Users refine their thinking as they talk.
NO -> Is one more SPECIFIC than the other?
YES -> Specific wins.
NO -> Flag for clarifying question.
3. Is the conflict between a USER SIGNAL and a DOMAIN DEFAULT?
YES -> User signal always wins over domain default.
4. Is the conflict between a USER SIGNAL and a CASCADE pressure?
YES -> User signal wins, but log a warning in derivation rationale.
The coherence validator (Phase 3e) will catch configurations
where the user's preference creates constraint violations.
第 3 阶段:推导
用户永远不会看到的内部推理。不要向用户展示推导细节。
步骤 3a:将信号映射到维度
针对 8 个维度中的每一个:
- 收集对话中提取的所有信号
- 累加置信度权重
- 判定位置(>= 1.5 为已明确,>= 0.6 为暂定,否则为未明确)
- 若信号冲突,则应用冲突解决决策树
明显覆盖默认值的信号会直接生效。含糊的信号则保留默认值。
步骤 3b:级联推断
确定主要维度后,根据交互约束逐级推断。请阅读 ${CLAUDE_PLUGIN_ROOT}/reference/interaction-constraints.md,了解完整的级联规则。
主要级联关系:
- 原子级粒度 -> 倾向于明确链接、深层导航和更繁重的处理
- 全自动化 -> 倾向于密集架构、繁重处理和频繁维护
- 高容量(预计 >200 条笔记)-> 需要深层导航、语义搜索和自动化维护
- 粗粒度 -> 允许轻量级链接、浅层导航和轻量处理
对于级联推断的值:置信度 = INFERRED(0.2)。用户信号始终优先于级联推断。
步骤 3c:词汇推导
为全部 6 个转换层级构建完整的词汇映射(参见 ${CLAUDE_PLUGIN_ROOT}/reference/vocabulary-transforms.md):
- 用户自己的用词——优先级最高。如果用户说“读书笔记”,就使用“读书笔记”。
- 预设表——用户未命名某个概念时的备用选项
- 最接近的参考领域组合——对于新领域,组合最接近的两个预设中的词汇
对于新领域(没有任何预设的匹配度超过 2.0):
- 根据信号重合度为全部 3 个预设打分
- 选择排名前两位的预设作为组合来源
- 对于每个术语,使用在该具体概念上重合度更高的预设
- 在提案中标记所有组合术语,供用户确认
步骤 3d:个性特征推导
默认:中性且乐于助人。 个性特征为可选项。除非对话明显表明用户偏好某种个性,否则初始化向导不会询问个性维度。
将个性信号映射到四个维度(参见 ${CLAUDE_PLUGIN_ROOT}/reference/personality-layer.md):
| 维度 | 两端 | 默认值 |
|---|---|---|
| 温暖度 | 冷静 / 温暖 / 活泼 | 中性且乐于助人 |
| 主见程度 | 中立 / 有主见 | 中立 |
| 正式程度 | 正式 / 随意 | 专业 |
| 情感关注度 | 以任务为中心 / 关注情绪 | 以任务为中心 |
在没有明确信号时应用领域默认值:
- 治疗领域 -> 温暖、关注情绪
- 研究领域 -> 中立、正式
- 创意领域 -> 倾向活泼、有主见
个性冲突的解决方式:
- 领域优先于情绪——研究领域 + “朋友”会表现得温暖但不活泼
- 明确信号优先于隐含信号——明确表达的偏好覆盖语气
- 如果仍有歧义,则提出澄清问题
如果推导出了个性特征(存在强烈信号),则在生成的配置中设置 personality.enabled: true。如果没有信号,则保留 personality.enabled: false(默认中性且乐于助人)。
第 3e 步:一致性验证(三轮检查)
继续生成提案之前,先运行此步骤。阅读 ${CLAUDE_PLUGIN_ROOT}/reference/interaction-constraints.md。
第 1 轮 —— 硬约束检查:
针对每项硬约束,评估推导出的配置。如果违反约束,阻止生成。用用户自己的措辞向其解释冲突,并提出有针对性的解决问题。根据用户的回答重新推导受影响的维度。
硬约束(违反这些约束会导致系统无法正常运行):
atomic + navigation_depth == "2-tier" + volume > 100-> 导航容易令人迷失automation == "full" + no_platform_support-> 平台无法支持完全自动化processing == "heavy" + automation == "manual" + no_pipeline_skills-> 无法持续维护
面向用户的解释示例:“你想使用原子化笔记进行详细追踪,但按你描述的数量,需要比简单索引更深入的导航结构。我应该添加主题级组织吗?”
第 2 轮 —— 软约束检查:
针对每项软约束,评估配置:
- 如果违反了约束,且较弱的维度是通过级联设定的(而非用户明确提出的),则自动调整级联值
- 如果违反了约束,且两个维度均由用户决定,则说明权衡后向用户发出警告
- 在推导依据中记录处理结果
软约束:
atomic + processing == "light"-> 原子化笔记需要相应的处理能力,才能重现拆分后的上下文schema == "dense" + automation == "convention"-> 增加维护负担linking == "explicit+implicit" + no_semantic_search-> 隐式链接需要搜索工具volume > 200 + maintenance_thresholds too lax-> 大型知识库需要更严格的条件阈值processing == "heavy" + maintenance_thresholds too lax-> 重度处理产生目标的速度快于宽松阈值的捕捉速度coarse + processing == "heavy"-> 收益递减flat + navigation_depth == "2-tier" + volume > 50-> 导航结构过于拥挤
第 3 轮 —— 补偿机制检查:
针对剩余的软约束冲突,检查是否存在补偿机制:
- 原子化 + 中度处理 -> 语义搜索可弥补缺少显式链接的问题
- 密集型架构 + 约定 -> 优质模板可减少手动验证负担
- 高数量 + 浅层导航 -> 强大的语义搜索有助于发现内容
在推导依据中注明生效的补偿机制。将已获补偿的维度标记为需要通过健康检查命令监控。
第 3f 步:失效模式风险评估
阅读 ${CLAUDE_PLUGIN_ROOT}/reference/failure-modes.md。根据领域脆弱性矩阵检查推导出的配置。标记此配置中所有高风险的失效模式。这些内容将列入生成的上下文文件中的“常见问题”部分。
第 3g 步:完全自动化配置
所有生成的系统从第一天起就启用完全自动化。系统不分级——每个知识库都具备完整的技能集、所有钩子、完整的处理流水线和会话捕获功能。如果用户希望操作更简单,可以通过 ops/config.yaml 将自动化级别调低。
| 组件 | 所有配置均生成 | 说明 |
|---|---|---|
| 上下文文件 | 始终生成 | 内容全面,包含所有章节 |
| 16 项处理技能 + 10 个插件命令 | 始终生成 | 处理技能经过词汇转换,并配有完整的质量门禁 |
| 所有钩子 | 始终生成 | 引导、捕获、验证、提交 |
| 队列系统 | 始终生成 | ops/tasks.md + ops/queue/ |
| 模板 | 始终生成 | 包含 _schema 块 |
| 自身空间 | 用户选择启用时生成 | self/,或使用 ops/ 作为后备 |
| 语义搜索 | 用户选择启用时生成 | qmd 设置 |
初始化时默认生成所有内容。 上下文文件包含所有技能文档。初始化后可通过 ops/config.yaml 调整处理深度和自动化级别。
阶段 4:方案
使用用户自己的词汇,以具体方式呈现推导出的系统。这是用户在继续生成前进行调整的机会。
方案结构如下:
- “这是我将为你创建的系统:”
- 使用用户领域名称命名的目录结构
- 说明笔记如何运作——使用用户领域中的具体示例和他们的词汇
- 用用户自己的话描述处理流程
- 说明自我知识如何运作——“你的系统会在 ops/methodology/ 中维护自身的方法论。使用 /ask 查询支撑你设计的 249 条笔记方法论知识库,或直接浏览 ops/methodology/。”
- Agent 个性描述(如果推导出了个性;否则跳过)
- 刻意排除的内容及原因
- 标记出的任何高风险故障模式
最后以:**“你希望我在创建之前做任何调整吗?”**结束。
在推导理由中记录用户提出的任何覆盖项。如果用户覆盖了某个维度,则在继续生成前,重新运行受影响约束的一致性检查。
阶段 5:生成
创建完整系统。顺序很重要——后续产物会引用前面的产物。
上下文韧性协议
初始化向导在一个会话中运行对话(阶段 1–4)+ 生成(阶段 5)+ 验证(阶段 6)。阶段 5 会生成 15 个以上的文件,可能耗尽上下文窗口。为应对上下文压缩:
- 优先持久化推导结果。
ops/derivation.md是生成的第一个产物——早于文件夹结构及其他所有文件。它会记录完整的推导状态。 - 无状态生成。 后续每一步都重新读取
ops/derivation.md,将其作为事实来源。任何生成步骤都不依赖对话记忆来确定配置。 - 按顺序处理功能块。 组合上下文文件时,每次只处理一个块——读取、转换、组合、释放,而不是同时加载所有块。
15 步生成顺序
**进度指示:**生成期间,在主要步骤之间使用用户领域的词汇,向用户播报里程碑进展:
$ Creating your {domain} structure...
$ Writing your context file...
$ Installing {domain:skills}...
$ Setting up templates...
$ Building your first {domain:topic map}...
$ Initializing version control...
$ Running validation...
使用 $ 前缀(在品牌化输出中呈现为菱形)。这样可以将等待时的焦虑转化为期待,并在生成期间帮助用户了解进度。
步骤 1:ops/derivation.md(第一个——早于其他所有文件)
**关键:**这必须是写入的第一个文件。创建 ops/ 目录并写入 ops/derivation.md。
此文件会持久化完整的推导状态,以便后续所有步骤都能基于它执行,即使上下文已被压缩。
---
description: How this knowledge system was derived -- enables architect and reseed commands
created: [YYYY-MM-DD]
engine_version: "1.0.0"
---
# System Derivation
## Configuration Dimensions
| Dimension | Position | Conversation Signal | Confidence |
|-----------|----------|--------------------|--------------------|
| Granularity | [value] | "[what user said]" | [High/Medium/Low/Inferred] |
| Organization | [value] | "[signal]" | [confidence] |
| Linking | [value] | "[signal]" | [confidence] |
| Processing | [value] | "[signal]" | [confidence] |
| Navigation | [value] | "[signal]" | [confidence] |
| Maintenance | [value] | "[signal]" | [confidence] |
| Schema | [value] | "[signal]" | [confidence] |
| Automation | [value] | "[signal + platform tier]" | [confidence] |
## Personality Dimensions
| Dimension | Position | Signal |
|-----------|----------|--------|
| Warmth | [clinical/warm/playful] | [signal or "default"] |
| Opinionatedness | [neutral/opinionated] | [signal or "default"] |
| Formality | [formal/casual] | [signal or "default"] |
| Emotional Awareness | [task-focused/attentive] | [signal or "default"] |
## Vocabulary Mapping
| Universal Term | Domain Term | Category |
|---------------|-------------|----------|
| notes | [domain term] | folder |
| inbox | [domain term] | folder |
| archive | [domain term] | folder |
| note (type) | [domain term] | note type |
| reduce | [domain term] | process phase |
| reflect | [domain term] | process phase |
| reweave | [domain term] | process phase |
| verify | [domain term] | process phase |
| MOC | [domain term] | navigation |
| description | [domain term] | schema field |
| topics | [domain term] | schema field |
| [additional terms] | [domain terms] | [category] |
## Platform
- Tier: [Claude Code / Minimal]
- Automation level: [full / convention / manual]
- Automation: [full (default) / convention / manual]
## Active Feature Blocks
[Checked = included, unchecked = excluded with reason]
- [x] wiki-links -- always included (kernel)
- [x] maintenance -- always included (always)
- [x] self-evolution -- always included (always)
- [x] session-rhythm -- always included (always)
- [x] templates -- always included (always)
- [x] ethical-guardrails -- always included (always)
[List all conditional blocks with inclusion/exclusion rationale]
## Coherence Validation Results
- Hard constraints checked: [count]. Violations: [none / details]
- Soft constraints checked: [count]. Auto-adjusted: [details]. User-confirmed: [details]
- Compensating mechanisms active: [list or none]
## Failure Mode Risks
[Top 3-4 HIGH-risk failure modes for this domain from vulnerability matrix]
## Generation Parameters
- Folder names: [domain-specific folder names]
- Skills to generate: [all 26 — vocabulary-transformed]
- Hooks to generate: [orient, capture, validate, commit]
- Templates to create: [list]
- Topology: [single-agent / skills / fresh-context / orchestrated]
此文件有三种用途:
- **即时用途:**作为所有后续生成步骤的事实来源(上下文韧性)
- **运维用途:**使
/architect能够推理配置偏移 - **演进用途:**使
/reseed能够根据更新后的理解重新推导
步骤 2:文件夹结构
在此步骤开始时重新读取 ops/derivation.md,获取文件夹名称和词汇映射。
创建包含领域名称目录的三空间布局:
[workspace]/
+-- [domain:notes]/ <-- structured knowledge (flat)
+-- [domain:inbox]/ <-- zero-friction capture (if processing >= moderate)
+-- [domain:archive]/ <-- processed, inactive
+-- self/ <-- agent's persistent mind
| +-- identity.md <-- (created in Step 4)
| +-- methodology.md <-- (created in Step 5)
| +-- goals.md <-- (created in Step 6)
| +-- relationships.md <-- (optional, if domain involves people)
| +-- memory/ <-- atomic personal insights
+-- templates/ <-- note templates (created in Step 8)
+-- ops/ <-- operational coordination (already exists from Step 1)
| +-- observations/ <-- atomic friction signals (Primitive 12)
| +-- tensions/ <-- contradiction tracking (Primitive 12)
| +-- methodology/ <-- vault self-knowledge (Primitive 14)
| +-- queue/ <-- unified task queue (pipeline + maintenance)
| | +-- archive/ <-- completed task batches
| +-- sessions/ <-- session tracking
Kernel Primitive 12(Operational Learning Loop)要求必须存在 ops/observations/ 和 ops/tensions/ 目录。它们会积累摩擦信号;当观察或张力的数量超过阈值时,/{DOMAIN:rethink} 会对其进行审查。
始终会生成收件箱文件夹。无论处理级别如何,它都能提供零摩擦捕获功能。
步骤 3:上下文文件
在此步骤开始时重新阅读 ops/derivation.md,了解词汇映射、个性维度、启用的区块列表、平台层级和生成参数。
这是最关键的生成步骤。上下文文件就是系统本身。
对于 Claude Code: 使用 ${CLAUDE_PLUGIN_ROOT}/generators/claude-md.md 模板生成 CLAUDE.md。
对于 Minimal: 生成 README.md,作为独立完整的约定文档。
上下文文件构成算法:
Step 1: Read generator template for the platform.
Step 2: Select feature blocks from ${CLAUDE_PLUGIN_ROOT}/generators/features/.
Always-included blocks (11): wiki-links, processing-pipeline, schema, maintenance, self-evolution, methodology-knowledge, session-rhythm, templates, ethical-guardrails, helper-functions, graph-analysis
Conditional blocks: based on derived dimensions (see Active Feature Blocks in derivation.md)
Step 3: Process blocks SEQUENTIALLY. For each selected block:
a. Read the block file
b. Apply vocabulary transformation (Section 9 algorithm -- LLM-based contextual replacement, NOT string find-replace)
c. Compose into the growing context file
d. Release the block from context before reading the next
Step 4: Compose in canonical block order:
1. Philosophy (derived from personality + domain)
2. session-rhythm -- Orient, work, persist, session capture
3. atomic-notes -- Note design principles (if active)
4. wiki-links -- Link philosophy and patterns
5. mocs -- Navigation structure (if active)
6. processing-pipeline -- Processing approach (always included)
7. semantic-search -- Discovery layers (if active)
8. schema -- Metadata and query patterns (always included)
9. maintenance -- Health checks and reweaving
10. self-evolution -- System evolution approach
10b. methodology-knowledge -- Querying and consulting self-knowledge
11. personality -- Voice and identity (if active)
12. templates -- Template usage
13. multi-domain -- Cross-domain rules (if active)
14. self-space -- Agent identity and memory (if active)
15. ethical-guardrails -- Behavioral constraints
16. helper-functions -- Utility scripts (always included)
17. graph-analysis -- Graph intelligence and query patterns (always included)
Step 5: Cross-reference elimination.
If a block is excluded, scan remaining blocks for references to excluded concepts and remove or rephrase:
- semantic-search excluded -> rephrase "semantic search" to "search your notes" or remove
- mocs excluded -> simplify "topic MOCs" to "topic organization"
- self-space excluded -> references to self/identity.md route to ops/ equivalents
- atomic-notes excluded -> simplify atomicity references to general note guidance
- multi-domain excluded -> remove cross-domain references
Step 6: Add required sections that are NOT from feature blocks:
a. Header with philosophy statement and domain identity
b. Discovery-first design section (kernel primitive 11)
c. Memory type routing table (where content goes: notes/, self/, ops/, inbox/, reminders.md)
d. Infrastructure routing table (routes methodology questions to arscontexta plugin skills)
e. Self-improvement loop (manual friction capture instructions)
f. Common Pitfalls (3-4 HIGH-risk failure modes from vulnerability matrix, in domain vocabulary)
g. System Evolution section (architect, reseed, friction-driven growth)
h. Self-extension blueprints (how to build new skills, hooks)
i. Derivation Rationale summary (which dimensions, which signals, which tradition)
j. Pipeline Compliance (NEVER write directly to notes/, route through inbox)
k. Condition-based maintenance documentation (what signals trigger which actions)
Step 7: Coherence verification.
- [ ] No orphaned references to excluded blocks
- [ ] Vocabulary consistent (same universal term -> same domain term everywhere)
- [ ] Personality tone consistent across all sections
- [ ] All mentioned skills exist in the generated skills (or are documented as dormant tiers)
- [ ] All mentioned file paths exist in the generated folder structure
- [ ] All mentioned templates exist in the generated templates
- [ ] Processing terminology matches selected pipeline approach (light vs heavy)
- [ ] Schema fields mentioned in prose exist in generated templates
Step 8: Apply vocabulary transformation one final time.
Read the completed context file. Replace every remaining universal term with its domain-native equivalent.
The vocabulary test: would a domain user ever see a term from a different discipline?
Step 9: Write the file.
Target operational density: each section should have enough detail that the agent can follow instructions without asking questions.
"Process your notes" is insufficient.
"Read the source fully, extract insights that serve the domain, check for duplicates" is sufficient.
结构标记保护: 词汇转换绝不能触及结构标记。YAML 中的字段名(description:、topics:、relevant_notes:、type:、status:、_schema:)属于结构内容,必须保持通用。领域词汇仅适用于值、正文内容和面向用户的标签,绝不能用于 YAML 字段名或结构语法。
生成的上下文文件必须满足的关键质量要求:
- 告知 Agent 在每次会话开始时始终读取 self/
- 通过用户领域中的示例说明以正文作为标题的写法
- 在 YAML 部分中包含领域专属架构
- 提供自我扩展蓝图
- 包含推导依据(使用了哪些维度、哪些信号)
- 内容应连贯,而非像拼凑的区块
- 全文使用领域原生词汇
步骤 4:self/identity.md
重新阅读 ops/derivation.md,了解个性维度、词汇映射和用例背景。
生成 identity.md,以自然的自我描述表达个性,而非使用配置语法。
如果个性是推导得出的(personality.enabled = true),则使用 personality-layer 参考资料中的个性 x 产物转换矩阵。如果是中性友好型(默认),则撰写清晰、直接、专业的自我描述。
---
description: Who I am and how I approach my work
type: moc
---
# identity
[Adapted to use case and personality. Examples:
- Research: "I am a research partner building understanding about..."
- Therapy (warm): "I pay attention to what you write about your sessions..."
- PM (neutral): "I track decisions across your projects..."
- Companion (warm): "I remember the things that matter about your life..."]
## Core Values
- [Relevant values for the use case, derived from personality + domain]
## Working Style
- [How the agent approaches its work, reflecting personality dimensions]
---
Topics:
- [[methodology]]
步骤 5:self/methodology.md
重新阅读 ops/derivation.md,了解处理级别、词汇映射和领域背景。
---
description: How I process, connect, and maintain knowledge
type: moc
---
# methodology
## Principles
- Prose-as-title: every [domain:note] is a proposition
- Wiki links: connections as graph edges
- [domain:MOCs]: attention management hubs
- Capture fast, process slow
## My Process
[Adapted to use case using domain-native language for the processing phases.
Use the vocabulary from derivation.md -- "surface" not "reduce" for therapy, etc.]
---
Topics:
- [[identity]]
步骤 5f:ops/methodology/(知识库自我认知)
重新阅读 ops/derivation.md,了解所有维度选择、平台层级、自动化级别、启用的功能区块以及连贯性验证结果。此步骤会创建知识库的自我认知文件夹,这是 Kernel Primitive 14(methodology-folder)的要求。
创建 ops/methodology/methodology.md(MOC):
---
description: The vault's self-knowledge — derivation rationale, configuration state, and operational evolution history
type: moc
---
# methodology
This folder records what the system knows about its own operation — why it was configured this way, what the current state is, and how it has evolved. Meta-skills (/{DOMAIN:rethink}, /{DOMAIN:architect}) read from and write to this folder. /{DOMAIN:remember} captures operational corrections here.
## Derivation Rationale
- [[derivation-rationale]] — Why each configuration dimension was set the way it was
## Configuration State
(Populated by /{DOMAIN:rethink}, /{DOMAIN:architect})
## Evolution History
(Populated by /{DOMAIN:rethink}, /{DOMAIN:architect}, /{DOMAIN:reseed})
## How to Use This Folder
Browse notes: `ls ops/methodology/`
Query by category: `rg '^category:' ops/methodology/`
Find active directives: `rg '^status: active' ops/methodology/`
Ask the research graph: `/ask [question about your system]`
Meta-skills (/{DOMAIN:rethink}, /architect) read from and write to this folder.
/{DOMAIN:remember} captures operational corrections here.
创建 ops/methodology/derivation-rationale.md(初始说明):
---
description: Why each configuration dimension was chosen — the reasoning behind initial system setup
category: derivation-rationale
created: {timestamp}
status: active
---
# derivation rationale for {domain}
{Extract from ops/derivation.md the key dimension choices and the conversation signals that drove them. Include: platform tier, automation level, active feature blocks, and coherence validation results. Write in prose format, not raw transcript — synthesize the reasoning into a readable narrative that future meta-skills can consult.}
---
Topics:
- [[methodology]]
ops/methodology/ 的七个内容类别为:derivation-rationale、kernel-state、pipeline-config、maintenance-conditions、vocabulary-map、configuration-state、drift-detection。初始化时仅创建 derivation-rationale;其余类别将在运行期间由元技能填充。
步骤 5g:manual/(用户可浏览的文档)
重新阅读 ops/derivation.md,了解词汇映射和领域背景。
使用推导对话中的领域原生词汇生成全部 7 个手册页面。手册是独立完整的用户文档——各页面之间使用 wiki 链接,但不链接到 notes/。
生成说明:
对每个页面应用词汇转换:将通用术语(notes、inbox、topic map、reduce、reflect、reweave)替换为推导对话中的领域原生对应词汇。尽可能使用具体的领域示例。
页面 1:manual.md(中心 MOC)
---
description: User manual for your {domain} knowledge system
type: manual
generated_from: "arscontexta-{version}"
---
# Manual
Welcome to your {domain} knowledge system. This manual explains how everything works.
## Pages
- [[getting-started]] — Your first session, first {DOMAIN:note}, and first connection
- [[skills]] — Every available command with when to use it and examples
- [[workflows]] — The processing pipeline, maintenance cycle, and session rhythm
- [[configuration]] — How to adjust settings via config.yaml or /architect
- [[meta-skills]] — /ask, /architect, /{DOMAIN:rethink}, and /{DOMAIN:remember} explained
- [[troubleshooting]] — Common issues and how to resolve them
页面 2:getting-started.md
---
description: First session guide — creating your first {DOMAIN:note} and building connections
type: manual
generated_from: "arscontexta-{version}"
---
# Getting Started
{Generate content covering:}
- What to expect in your first session
- Creating your first {DOMAIN:note} (walk through the process)
- How connections work (wiki links, {DOMAIN:topic maps})
- The orient-work-persist session rhythm
- Where to go next (link to [[workflows]] and [[skills]])
- Running /tutorial for an interactive walkthrough
页面 3:skills.md
---
description: Complete reference for every available command
type: manual
generated_from: "arscontexta-{version}"
---
# Skills
{Generate content covering:}
- Every generated skill with domain-native name, purpose, and example invocation
- Group by category: Processing, Orchestration, Meta-Cognitive, Diagnostic, Knowledge, Research, Lifecycle, Onboarding
- For each skill: when to use it, what it does, example command
- Link to [[workflows]] for how skills chain together
- Link to [[meta-skills]] for detailed meta-skill documentation
页面 4:workflows.md
---
description: Processing pipeline, maintenance cycle, and session rhythm
type: manual
generated_from: "arscontexta-{version}"
---
# Workflows
{Generate content covering:}
- The full processing pipeline: {DOMAIN:seed} -> {DOMAIN:process} -> {DOMAIN:connect} -> {DOMAIN:maintain} -> {DOMAIN:verify}
- Session rhythm: orient (what's happening) -> work (do the thing) -> persist (save state)
- Maintenance cycle: condition-based triggers, what to do when conditions fire
- Batch processing with /{DOMAIN:orchestrate}
- Link to [[skills]] for command details
- Link to [[configuration]] for adjusting pipeline settings
页面 5:configuration.md
---
description: How to adjust your system via config.yaml and /architect
type: manual
generated_from: "arscontexta-{version}"
---
# Configuration
{Generate content covering:}
- config.yaml structure and key fields
- Using /architect for guided configuration changes
- Feature toggling: what can be enabled/disabled
- Preset explanation: what your preset includes and why
- Dimension positions and what they mean for your domain
- Link to [[meta-skills]] for /architect details
- Link to [[troubleshooting]] for configuration issues
页面 6:meta-skills.md
---
description: Deep guide to /ask, /architect, /{DOMAIN:rethink}, and /{DOMAIN:remember}
type: manual
generated_from: "arscontexta-{version}"
---
# Meta-Skills
{Generate content covering:}
- /ask — querying the bundled research knowledge base + local methodology
- /architect — getting research-backed configuration advice
- /{DOMAIN:rethink} — reviewing accumulated observations and tensions, drift detection
- /{DOMAIN:remember} — capturing friction and methodology learnings (Rule Zero: methodology as spec)
- When to use each meta-skill
- How meta-skills relate to system evolution
- Link to [[configuration]] for config changes
- Link to [[troubleshooting]] for drift-related issues
页面 7:troubleshooting.md
---
description: Common issues and resolution patterns
type: manual
generated_from: "arscontexta-{version}"
---
# Troubleshooting
{Generate content covering:}
- Orphan {DOMAIN:notes} — notes with no incoming links (run /{DOMAIN:connect})
- Dangling links — wiki links to non-existent {DOMAIN:notes} (check after renames)
- Stale content — {DOMAIN:notes} not updated in 30+ days with sparse connections (run /{DOMAIN:maintain})
- Methodology drift — system behavior diverging from methodology spec (run /{DOMAIN:rethink} drift)
- Inbox overflow — too many items accumulating (run /{DOMAIN:process} or /{DOMAIN:pipeline})
- Pipeline stalls — tasks stuck in queue (check with /{DOMAIN:next})
- Common mistakes table with corrections
- Link to [[meta-skills]] for /rethink and /remember
- Link to [[configuration]] for threshold adjustments
质量门槛:
- 所有技能引用均使用推导对话中的领域原生名称
- 所有页面都通过页脚或上下文引用链接回 [[manual]]
- 不得使用指向 notes/ 的 wiki 链接——手册必须独立完整
- 每个页面的 frontmatter 中都包含
generated_from: "arscontexta-{version}" - 内容使用领域专属示例,而非通用或抽象示例
步骤 6:self/goals.md
重新阅读 ops/derivation.md,了解用例背景。
---
description: Current active threads and what I am working on
type: moc
---
# goals
## Active Threads
- Getting started -- learning this knowledge system
- [Use-case-specific initial goals derived from conversation]
## Completed
(none yet)
---
Topics:
- [[identity]]
步骤 7:ops/config.yaml
重新阅读 ops/derivation.md,了解所有维度位置和功能状态。
生成可由人工编辑的配置文件:
# ops/config.yaml -- edit these to adjust your system
# See ops/derivation.md for WHY each choice was made
dimensions:
granularity: [atomic | moderate | coarse]
organization: [flat | hierarchical]
linking: [explicit | implicit | explicit+implicit]
processing: [light | moderate | heavy]
navigation: [2-tier | 3-tier]
maintenance: condition-based
schema: [minimal | moderate | dense]
automation: [manual | convention | full]
features:
semantic-search: [true | false]
processing-pipeline: [true | false]
sleep-processing: [true | false]
voice-capture: false
processing_tier: auto # auto | 1 | 2 | 3 | 4
processing:
depth: standard # deep | standard | quick
chaining: suggested # manual | suggested | automatic
extraction:
selectivity: moderate # strict | moderate | permissive
categories: auto # auto (from derivation) | custom list
verification:
description_test: true
schema_check: true
link_check: true
reweave:
scope: related # related | broad | full
frequency: after_create # after_create | periodic | manual
provenance: [full | minimal | off]
personality:
enabled: [true | false]
research:
primary: [exa-deep-research | web-search] # best available research tool
fallback: [exa-web-search | web-search] # fallback if primary unavailable
last_resort: web-search # always available
default_depth: moderate # light | moderate | deep
处理深度级别:
deep-- 完整工作流,每个阶段使用全新上下文,并设置最高质量门槛。适用于重要来源和初始知识库构建。standard-- 完整工作流,注意力分配均衡。适用于常规处理和中等处理量。quick-- 压缩工作流,合并 connect 和 verify 阶段。适用于高处理量补齐和次要来源。
工作流串联模式:
manual-- 技能输出“下一步:/[skill] [target]”——由用户决定。suggested-- 技能输出下一步,并将其加入任务队列——用户可以跳过。automatic-- 技能完成后,通过编排立即运行下一阶段。
**研究工具检测:**生成期间,检查可用的研究工具:
- 如果有 Exa MCP 工具(
mcp__exa__deep_researcher_start):首选 = exa-deep-research - 如果有 Exa 网络搜索工具(
mcp__exa__web_search_exa):备用 = exa-web-search - 网络搜索始终是最后的选择
**关系:**config.yaml 是当前的运行配置。derivation.md 是记录原因的历史文档。配置可能发生偏移;/architect 会检测并记录这种偏移。
步骤 7b:ops/derivation-manifest.md(供继承技能使用的运行时词汇表)
重新阅读 ops/derivation.md,了解所有维度位置、词汇映射、活动区块和平台信息。
生成机器可读的派生清单。这是实现所有继承处理技能(/reduce、/reflect、/reweave、/verify、/validate)运行时词汇转换的关键文件。技能会在调用时读取此文件,以应用领域专用词汇,无需创建领域专用的技能副本。
# ops/derivation-manifest.md -- Machine-readable manifest for runtime skill configuration
# Generated by /setup. Updated by /reseed, /architect, /add-domain.
---
engine_version: "0.2.0"
research_snapshot: "2026-02-10"
generated_at: [ISO 8601 timestamp]
platform: [claude-code | minimal]
kernel_version: "1.0"
dimensions:
granularity: [atomic | moderate | coarse]
organization: [flat | hierarchical]
linking: [explicit | implicit | explicit+implicit]
processing: [light | moderate | heavy]
navigation: [2-tier | 3-tier]
maintenance: condition-based
schema: [minimal | moderate | dense]
automation: [manual | convention | full]
active_blocks:
- [list of active feature block IDs]
coherence_result: [passed | passed_with_warnings]
vocabulary:
# Level 1: Folder names
notes: "[domain term]" # e.g., "claims", "reflections", "decisions"
inbox: "[domain term]" # e.g., "inbox", "captures", "incoming"
archive: "[domain term]" # e.g., "archive", "processed", "completed"
ops: "ops" # always ops
# Level 2: Note types
note: "[domain term]" # e.g., "claim", "reflection", "decision"
note_plural: "[domain term]" # e.g., "claims", "reflections", "decisions"
# Level 3: Schema field names
description: "[domain term]" # e.g., "description", "summary", "brief"
topics: "[domain term]" # e.g., "topics", "themes", "areas"
relevant_notes: "[domain term]" # e.g., "relevant notes", "connections", "related"
# Level 4: Navigation terms
topic_map: "[domain term]" # e.g., "topic map", "theme", "decision register"
hub: "[domain term]" # e.g., "hub", "home", "overview"
# Level 5: Process verbs
reduce: "[domain term]" # e.g., "reduce", "surface", "document"
reflect: "[domain term]" # e.g., "reflect", "find patterns", "link decisions"
reweave: "[domain term]" # e.g., "reweave", "revisit", "update"
verify: "[domain term]" # e.g., "verify", "check resonance", "validate"
validate: "[domain term]" # e.g., "validate", "check schema", "audit"
rethink: "[domain term]" # e.g., "rethink", "reassess", "retrospect"
# Level 6: Command names (as users invoke them)
cmd_reduce: "[/domain-verb]" # e.g., "/reduce", "/surface", "/document"
cmd_reflect: "[/domain-verb]" # e.g., "/reflect", "/find-patterns", "/link-decisions"
cmd_reweave: "[/domain-verb]" # e.g., "/reweave", "/revisit", "/update-old"
cmd_verify: "[/domain-verb]" # e.g., "/verify", "/check", "/audit"
cmd_rethink: "[/domain-verb]" # e.g., "/rethink", "/reassess", "/retrospect"
# Level 7: Extraction categories (domain-specific, from conversation)
extraction_categories:
- name: "[category name]"
what_to_find: "[description]"
output_type: "[note type]"
- name: "[category name]"
what_to_find: "[description]"
output_type: "[note type]"
# ... 4-8 domain-specific categories
platform_hints:
context: [fork | single]
allowed_tools: [tool list based on platform tier]
semantic_search_tool: [mcp__qmd__deep_search | null]
semantic_search_autoapprove:
- mcp__qmd__search
- mcp__qmd__vector_search
- mcp__qmd__deep_search
- mcp__qmd__get
- mcp__qmd__multi_get
- mcp__qmd__status
personality:
warmth: [clinical | warm | playful]
opinionatedness: [neutral | opinionated]
formality: [formal | casual]
emotional_awareness: [task-focused | attentive]
---
**为什么此文件要与 derivation.md 分开:**derivation.md 是人类可读的推理记录(记录每项选择的原因、对话信号和置信度)。derivation-manifest.md 是机器可读的运行清单(记录具体选择)。技能会读取清单,以便快速查找词汇,而无需解析叙述性派生文档。
谁负责更新此文件:
/setup生成此文件/reseed在重新派生后重新生成此文件/architect在实施已批准的更改时更新此文件/add-domain使用新的领域词汇扩展此文件
步骤 8:包含 _schema 区块的模板
重新阅读 ops/derivation.md,了解架构级别、词汇映射和领域专用字段要求。
在 templates/ 中创建领域专用模板:
始终创建:
- 主笔记模板(按领域命名:
claim-note.md、reflection-note.md、decision-note.md等) - MOC 模板(按领域命名:
topic-map.md、theme.md、decision-register.md等)
有条件创建:
- 来源采集模板(如果处理级别 >= 中等)
- 观察模板(如果自我演化已启用——始终创建)
每个模板都必须包含 _schema 区块,用于定义必填字段、可选字段、枚举值和约束。模板本身就是架构的唯一可信来源。
模板结构:
---
_schema:
entity_type: "[domain]-note"
applies_to: "[domain:notes]/*.md"
required:
- description
- topics
optional:
- [domain-specific fields based on schema density]
enums:
type:
- [domain-relevant types]
constraints:
description:
max_length: 200
format: "One sentence adding context beyond the title"
topics:
format: "Array of wiki links"
# Template fields
description: ""
topics: []
[domain fields with defaults]
---
# {prose-as-title}
{Content}
---
Relevant Notes:
- [[related note]] -- relationship context
Topics:
- [[relevant-moc]]
将词汇转换应用于模板:注释中的字段标签和示例值使用领域词汇。YAML 字段名保持结构不变(description、topics 等)。
第 9 步:技能(已转换词汇,完整套件)
重新阅读 ops/derivation.md,了解处理级别、平台、词汇映射和技能列表。
为检测到的平台生成所有技能。每个 vault 从第一天起都配备完整的技能集。默认启用完全自动化——用户可以选择降低自动化程度,但无需再选择启用。
技能源模板位于 ${CLAUDE_PLUGIN_ROOT}/skill-sources/。 每个子目录都包含一个 SKILL.md 模板,必须读取该模板、转换词汇,并将其写入用户的技能目录。
要安装的 16 个技能源:
| 源目录 | 技能名称 | 类别 |
|---|---|---|
${CLAUDE_PLUGIN_ROOT}/skill-sources/reduce/ | reduce | 处理 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/reflect/ | reflect | 处理 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/reweave/ | reweave | 处理 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/verify/ | verify | 处理 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/validate/ | validate | 处理 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/seed/ | seed | 编排 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/ralph/ | ralph | 编排 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/pipeline/ | pipeline | 编排 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/tasks/ | tasks | 编排 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/stats/ | stats | 导航 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/graph/ | graph | 导航 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/next/ | next | 导航 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/learn/ | learn | 成长 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/remember/ | remember | 成长 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/rethink/ | rethink | 演进 |
${CLAUDE_PLUGIN_ROOT}/skill-sources/refactor/ | refactor | 演进 |
对于每项技能:
- 读取
${CLAUDE_PLUGIN_ROOT}/skill-sources/[name]/SKILL.md - 应用词汇转换——根据
ops/derivation.md中的词汇映射,重命名并更新所有内部引用 - 调整技能元数据(设置
context: fork,以便每次调用都使用全新上下文) - 将转换后的 SKILL.md 写入用户的技能目录
对于 Claude Code: 写入 .claude/skills/[domain-skill-name]/SKILL.md
重要: 不要从头生成技能,也不要擅自编写其内容。请读取源模板并进行转换。模板包含质量门槛、防止走捷径的要求,以及必须保留的交接格式。
每项生成的技能都必须包含:
- 质量关键步骤中的防走捷径要求
- 包含明确通过/失败标准的质量门槛
- 用于编排执行的交接块格式
- 贯穿全文的领域原生词汇
技能发现协议
平台限制: Claude Code 的技能索引不会在会话中途刷新。在 /setup 期间创建的技能,只有在用户重启 Claude Code 后才能发现。
创建所有技能文件后:
- 告知用户: 显示“已生成 [N] 项技能。请重启 Claude Code 以激活这些技能。”
- 添加到上下文文件: 添加“最近创建的技能(等待激活)”部分,列出所有生成的技能及其领域原生名称和创建时间戳:
## Recently Created Skills (Pending Activation)
These skills were created during initialization. Restart Claude Code to activate them.
- /[domain:reduce] -- Extract insights from source material (created [timestamp])
- /[domain:reflect] -- Find connections between [domain:notes] (created [timestamp])
...
- SessionStart 钩子检测激活状态: session-orient.sh 钩子会检查此部分。确认技能已加载(出现在技能索引中)后,即可从上下文文件中移除此部分。
- 第 6 阶段的指引: 如果创建了任何技能,第 6 阶段的输出应包含:“现在重启 Claude Code 以激活所有技能,然后试试 /[domain:help] 查看可用功能。”
第 10 步:钩子(适配平台)
重新阅读 ops/derivation.md,了解自动化级别、平台层级和词汇映射。
追加式 Hook 合并协议
生成的 Hook 绝不能覆盖现有的用户 Hook。在写入任何 Hook 之前:
- 读取现有的
.claude/settings.json(如果存在) - 解析每种事件类型的现有 Hook 匹配器组(hooks.SessionStart、hooks.PostToolUse、hooks.Stop 等)
- 将新的匹配器组添加到事件数组中——绝不替换现有条目
- 如果该事件中已存在
command路径相同的匹配器组,则跳过(在输出中发出警告,不要覆盖) - 将合并后的结果写回
.claude/settings.json
**验证标准:**生成 Hook 后,所有预先存在的 Hook 仍然存在且正常工作。
会话持久化架构
会话持久化对于跨越 /clear 和会话重启保持连续性至关重要。
会话数据布局:
ops/
├── sessions/
│ ├── current.json # Active session state (updated by hooks)
│ └── YYYYMMDD-HHMMSS.json # Archived session records
├── goals.md # Persistent working memory (survives /clear)
└── config.yaml # Live configuration
current.json 跟踪:session_id、start_time、notes_created(数组)、notes_modified(数组)、discoveries(数组)、last_activity 时间戳。
**会话 ID 推导:**使用 CLAUDE_CONVERSATION_ID 环境变量(可在 Claude Code Hook 环境中使用)。回退方案为时间戳:$(date +%Y%m%d-%H%M%S)。
**/clear 后恢复会话:**用户运行 /clear 时,新会话会触发 SessionStart。Hook 会检测现有会话数据(goals.md、ops/ 状态),重新读取所有内容,并在上下文重置后保持连续性。
完整 Hook 套件(为所有系统生成)
对于 Claude Code,添加到 .claude/settings.json(使用追加式合并)。
**Hook 格式:**Claude Code 使用嵌套的匹配器组结构。每种事件类型都包含一个匹配器组数组,每个组都有可选的 matcher(用于筛选 Hook 触发时机的正则表达式字符串)和一个处理程序对象数组 hooks。SessionStart 和 Stop 等事件不需要匹配器——省略该字段。PostToolUse 等工具事件使用工具名称作为匹配器(例如,"Write"、"Edit|Write")。超时时间以秒为单位。
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/session-orient.sh"
}
]
}
],
"PostToolUse": [
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/validate-note.sh"
},
{
"type": "command",
"command": "bash .claude/hooks/auto-commit.sh",
"async": true
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/session-capture.sh"
}
]
}
]
}
}
**重要:**Claude Code 不接受旧的扁平格式(在匹配器级别使用 "type": "command")。每个事件都必须使用嵌套结构:"EventName": [{ "matcher": "...", "hooks": [{ "type": "command", "command": "..." }] }]。
生成全部四个 Hook 脚本:session-orient.sh、session-capture.sh、validate-note.sh、auto-commit.sh。
第 11 步:Hub MOC
重新读取 ops/derivation.md,了解词汇映射和用例背景。
在 [domain:notes]/index.md 创建知识库入口:
---
description: Entry point to the knowledge system -- start here to navigate
type: moc
---
# index
Welcome to your [domain] system.
## [domain:Topics]
[Links to self/ MOCs and any domain-specific topic MOCs that are relevant]
- [[identity]] -- who the agent is and how it approaches work
- [[methodology]] -- how the agent processes and connects knowledge
- [[goals]] -- current active threads
## Getting Started
1. Read self/identity.md to understand your purpose
2. Capture your first [domain:note] in [domain:notes]/
3. Connect it to this hub
第 12 步:语义搜索设置(有条件)
仅当语义搜索功能已启用时(linking 包含 implicit)。
- 检查是否已安装
qmd:which qmd - 如果已安装:
- 在生成的知识库根目录中运行
qmd init - 配置或更新 qmd 集合
{vocabulary.notes_collection},使其指向生成的笔记目录 - 在知识库根目录中创建或合并
.mcp.json,并写入以下 qmd MCP 服务契约:{"mcpServers":{"qmd":{"command":"qmd","args":["mcp"],"autoapprove":["mcp__qmd__search","mcp__qmd__vector_search","mcp__qmd__deep_search","mcp__qmd__get","mcp__qmd__multi_get","mcp__qmd__status"]}}}
- 运行
qmd update && qmd embed以构建初始索引
- 在生成的知识库根目录中运行
- 如果未安装:
- 在第 6 阶段摘要中添加“后续步骤”部分,告知用户安装 qmd
- 提供具体命令:
npm install -g @tobilu/qmd(或bun install -g @tobilu/qmd)qmd initqmd collection add . --name {vocabulary.notes_collection} --mask "**/*.md"qmd update && qmd embed
- 在设置输出中包含带有
autoapprove条目的.mcp.jsonqmd MCP 契约,以便安装 qmd 后可以确定性地启用
第 13 步:图查询脚本(根据模板模式派生)
重新阅读 ops/derivation.md 和生成的模板,了解模式字段。
创建模板(第 8 步)后,读取 _schema 代码块,并在 ops/queries/(Claude Code 使用 scripts/queries/)中生成适配领域的分析脚本。
生成算法:
- 从生成的模板中读取所有
_schema.required和_schema.optional字段 - 找出可查询的维度(包含枚举值的字段、日期字段、带有 wiki 链接的数组字段)
- 对每个有意义的双字段组合,生成一个基于 ripgrep 的查询脚本:
- 交叉引用查询——共享一个字段值、但另一个字段值不同的笔记
- 时间查询——某个状态下超过 N 天的条目
- 密度查询——条目较少的字段(用于检测缺口)
- 反向链接查询——引用特定实体的内容
- 为每个脚本起一个描述性名称
生成 3~5 个适合该领域的脚本。示例:
| 领域 | 生成的查询 |
|---|---|
| 治疗 | trigger-mood-correlation.sh、recurring-triggers.sh、stale-patterns.sh |
| 研究 | cross-methodology.sh、low-confidence-candidates.sh、source-diversity.sh |
| 关系 | neglected-contacts.sh、topic-overlap.sh |
| 项目管理 | overdue-items.sh、owner-workload.sh、priority-distribution.sh |
在上下文文件中添加发现部分,记录有哪些查询、何时运行,以及它们能揭示什么见解。
第 14 步:ops/reminders.md
始终生成。 创建一个空的提醒文件,并添加格式标题:
# Reminders
第 15 步:Vault 标记文件
在 Vault 根目录中创建 .arscontexta。此标记文件用于标识该目录为 Ars Contexta Vault(仅当文件存在时才会运行钩子),同时也作为钩子配置文件。
# Ars Contexta vault marker + config
# This file identifies the directory as an Ars Contexta vault.
# Do not delete — hooks only run when this file exists.
git: true
session_capture: true
键及默认值:
git: true— 写入时自动提交(auto-commit.sh)session_capture: true— 启动时捕获会话 JSON(session-orient.sh)
省略的键默认值为 true,因此最小标记文件(甚至空文件)也能保留完整的默认行为。
第 16 步:Git 初始化
git init
git add -A
git commit -m "Initial vault generation by Ars Contexta"
如果 Git 已初始化(仓库已存在),则跳过 git init,直接提交生成的文件。
第 6 阶段:验证与总结
内核验证
针对生成的系统运行全部 15 项基础检查。如果 ${CLAUDE_PLUGIN_ROOT}/reference/validate-kernel.sh 可用,请使用它。否则请手动验证:
- markdown-yaml —— 每个 .md 文件都有有效的 YAML 前置元数据吗?(阈值 >95%)
- wiki-links —— 所有 Wiki 链接都指向现有文件吗?(阈值 >90%)
- moc-hierarchy —— 至少存在 3 个 MOC,且每条笔记至少出现在一个 MOC 中吗?
- tree-injection —— 会话启动流程会加载文件结构吗?(通过钩子或上下文文件中的指令实现)
- description-field —— 每条笔记都有与标题不同的 description 字段吗?(阈值 >95%)
- topics-footer —— 每条非 MOC 笔记都包含 topics 字段吗?(阈值 >95%)
- schema-enforcement —— 模板是唯一事实来源吗?是否存在验证机制?
- semantic-search —— 是否已配置语义搜索或记录了未来启用计划?
- self-space —— 是否存在包含 identity.md、methodology.md 和 goals.md 的 self/ 目录?
- session-rhythm —— 上下文文件是否记录了 orient/work/persist 周期?
- discovery-first —— 上下文文件是否包含 Discovery-First Design 部分?笔记是否针对易查找性进行了优化?
- operational-learning-loop —— ops/observations/ 和 ops/tensions/ 是否存在?上下文文件中是否记录了复查触发条件?是否存在 /{DOMAIN:rethink} 命令?
- task-stack —— ops/tasks.md 是否存在?队列文件(ops/queue/queue.json)是否存在,且 schema_version >= 3 并包含 maintenance_conditions 部分?上下文文件是否在 session-orient 阶段引用了这两个文件?是否存在带条件协调功能的 /{DOMAIN:next} 命令?
- methodology-folder —— ops/methodology/ 是否存在并包含 methodology.md MOC?是否至少存在一条推导理由笔记?上下文文件是否引用 ops/methodology/,用于元技能上下文?
- session-capture —— ops/sessions/ 目录是否存在?是否已安装会话结束钩子模板?是否存在基于条件、用于处理未处理会话的挖掘触发条件?
报告结果:逐项列出通过或失败,并具体说明失败项。
流水线冒烟测试
内核验证完成后,运行功能测试:
- 在 [domain:notes]/ 中创建一条包含示例标题和描述的测试笔记
- 验证其架构正确(description、topics)
- 验证中心 MOC 可以引用该笔记
- 删除测试笔记并清理
如果冒烟测试失败,请报告失败情况并给出具体的修复步骤。通过结构验证但未通过功能测试的知识库尚未就绪。
清晰的 CLI 输出
按照第 10.5 节的设计语言,使用清晰的格式呈现结果。不要使用符文、秘符、装饰性 Unicode 字符或 ASCII 艺术图。仅使用标准 Markdown 格式,并保持缩进清晰。
ars contexta -- the art of context
Creating your [domain] structure...
Writing your context file...
Installing [domain:skills]...
Setting up templates...
Building your first [domain:topic map]...
Initializing version control...
Running validation...
Your memory is ready.
- 进度标记: 使用缩进文本标示生成里程碑,帮助用户了解生成进度。
- 分节符: 在主要输出部分之间使用
---(标准 Markdown)。
渐进式功能展示
使用用户的词汇展示可用命令。根据 ops/derivation-manifest.md 中的词汇表解析命令名称:
Here's what you can do:
/arscontexta:[domain:reduce] -- extract insights from source material
/arscontexta:[domain:reflect] -- find connections between your [domain:notes]
/arscontexta:health -- check your knowledge system
/arscontexta:help -- see everything available
/arscontexta:next -- get intelligent next-action recommendations
/arscontexta:learn -- research a topic and grow your graph
注意:插件命令采用 /arscontexta:command-name 格式。请明确列出所有命令,因为它们可能不会出现在 Tab 补全中。如果生成了技能,请说明需要重启 Claude Code 才能使用。
首次成功时刻
引导用户记录他们的第一条笔记。这一刻,系统不再抽象,而是变得真实可感。
如果选择了预设: 检查 ${CLAUDE_PLUGIN_ROOT}/presets/[preset]/starter/ 中是否有特定领域的入门笔记。选择最相关的入门笔记作为种子:
- 展示一条适合该领域的入门笔记(例如,一项研究论点、一段个人反思或一个项目决策)
- 询问用户:“这是一条供你开始使用的入门[领域:笔记]。你想自定义它,还是让我按原样保存?”
- 按照正确的架构,在 [领域:笔记] 中创建笔记
- 将其添加到中心 MOC
- 展示:这条笔记、它所属的 MOC,以及已填写的架构字段
如果没有预设: 开放式引导:“试着记录点什么:告诉我一个想法就行。”然后创建笔记并展示相同的结果。
这为什么重要: 首次成功时刻能够证明系统可用。用户可以看到自己的内容经过结构化、建立关联并可供导航。这能将抽象的架构转化为切实的价值。
总结
用符合用户习惯的词汇并采用清晰的格式呈现:
ars contexta
Your [domain] system is ready.
Configuration:
Platform: [Claude Code / Minimal]
Automation: Full — all capabilities from day one
[Key dimension highlights relevant to the user]
Created:
[list of folders with domain names]
[context file name]
[templates created]
16 skills generated (vocabulary-transformed)
10 plugin commands available via /arscontexta:*
[hooks configured]
ops/derivation.md -- the complete record of how this system was derived
ops/derivation-manifest.md -- machine-readable config for runtime skills
ops/methodology/ -- vault self-knowledge (query with /ask or browse directly)
ops/config.yaml -- edit this to adjust dimensions without re-running init
Kernel Validation: [PASS count] / 15 passed
[Any warnings to address]
IMPORTANT: Restart Claude Code now to activate skills and hooks.
Skills and hooks take effect after restart — they are not available in the current session.
Next steps:
1. Quit and restart Claude Code (required — skills won't work until you do)
2. Read your CLAUDE.md -- it's your complete methodology
3. Try /arscontexta:help to see all available commands
4. [If qmd not installed: "Install qmd for semantic search: npm install -g @tobilu/qmd (or bun install -g @tobilu/qmd), then run qmd init, qmd update, qmd embed"]
5. [If personality not enabled: "Run /arscontexta:architect later to tune the agent's voice"]
6. Try /arscontexta:tutorial for a guided walkthrough
有条件的后续步骤
根据系统状态添加以下内容:
- 如果尚未安装 qmd,且 semantic-search 已启用:提供 npm/bun 安装说明,以及 qmd init/update/embed +
.mcp.json契约 - 如果尚未启用 personality:说明待知识库中有 50+ 条笔记后,可使用
/arscontexta:architect进一步调整语气 - 如果任何内核检查未通过:提供具体的修复说明
质量标准(不可妥协)
每次生成都必须遵守以下标准。不得跳过任何一项。
-
生成的文件应浑然一体,而非由多个区块拼接而成。 输出中不应显露区块边界。上下文文件应读起来自然流畅,仿佛专为这个特定领域从头写就。
-
语言应与用户的领域相符。 接受治疗的用户绝不会看到“论点”或“精简”。PM 用户绝不会看到“反思”或“浮现”。词汇检验适用于每个生成的文件。
-
self/identity.md 应显得真实自然,而非模板化。 它读起来应像自我认知,而非人物设定表。
-
每个生成的文件都应立即派上用场。 不得包含占位内容。不得出现“TODO:待填写”。每个文件从第一天起就应发挥作用。
-
维度设置应有据可依。 推导理由应将每项选择与用户信号或有研究依据的默认设置关联起来。
-
内核验证必须通过。 每个生成的系统都不得有任何失败项。如果验证失败,应先修正生成结果,再展示结果。
-
所有文件中的词汇保持一致。 同一个通用术语在所有生成文件中必须始终映射为同一个领域术语。进行一次整体一致性检查:如果你在上下文文件中使用了“反思”,那么在模板、技能和 self/ 文件中也必须使用“反思”。
-
三个空间的边界必须清晰。 Agent 的自我认知放在 self/ 中。领域知识放在 notes/ 中。运行所需的脚手架放在 ops/ 中。三者不得混淆。
-
必须以便于发现为优先。 每条笔记、每个 MOC、每个模板都应针对 Agent 未来的发现能力进行优化,包括描述质量、MOC 归属和标题组合性。
-
个性绝不能与方法论相矛盾。 俏皮的 Agent 仍须执行质量关卡。亲切的 Agent 仍须进行组合性检查。个性只影响如何传达方法论,绝不影响是否执行方法论。