Loading...
Loading...
Compare original and translation side by side
Authoritative guide for authoring and consuming feature knowledge files in.ai-context/features/
这是编写和使用目录下特性知识文件的权威指南。ai-context/features/
| Aspect | | SDD spec (engram artifact) |
|---|---|---|
| Purpose | Permanent business domain knowledge | Behavioral delta spec for a specific change |
| Lifetime | Lives forever — updated but never deleted | Created per change — eventually archived |
| Content | Business rules, invariants, data model, integration contracts, history | GIVEN/WHEN/THEN scenarios describing observable behavior for one change |
| When written | Once per bounded context; updated via | Once per SDD change; archived with the change |
| Who reads it | | |
| Cross-change value | High — encodes knowledge that predates and outlasts any single change | Low — describes behavior introduced or modified by one specific change |
ai-context/features/| 方面 | | SDD规范(engram工件) |
|---|---|---|
| 用途 | 永久业务领域知识 | 针对特定变更的行为增量规范 |
| 生命周期 | 永久存在——仅更新不删除 | 随变更创建——最终归档 |
| 内容 | 业务规则、不变量、数据模型、集成契约、历史记录 | 描述单个变更可观测行为的GIVEN/WHEN/THEN场景 |
| 编写时机 | 每个限界上下文编写一次;通过 | 每个SDD变更编写一次;随变更归档 |
| 阅读人群 | | |
| 跨变更价值 | 高——编码了早于且存续于任何单个变更的知识 | 低——仅描述单个变更引入或修改的行为 |
ai-context/features/ai-context/features/<domain>.mdmemory-initmemory-initai-context/features/<domain>.mdmemory-initmemory-init<change-name>Input: change-name (kebab-case string)
Output: list of matching ai-context/features/<domain>.md paths (may be empty)
Algorithm:
1. If ai-context/features/ does not exist → return [] (skip silently)
2. List all .md files in ai-context/features/
3. Exclude any file whose name starts with underscore (e.g. _template.md)
4. Extract stems: split change-name on "-", discard single-char stems
5. For each remaining file f:
domain = filename stem of f (without .md extension)
if domain appears in change-name
OR any stem from step 4 appears in domain:
add f to matches
6. Return all matches (may be multiple files)
7. If matches is empty → skip preload silently (no error, no warning)| Change name | Stems (after filtering) | Matches |
|---|---|---|
| | |
| | |
| | No match against |
| | No match — stems do not appear in any domain slug |
_template.md<change-name>输入: change-name(短横线分隔字符串)
输出: 匹配的ai-context/features/<domain>.md路径列表(可能为空)
算法:
1. 如果ai-context/features/不存在 → 返回[](静默跳过)
2. 列出ai-context/features/中的所有.md文件
3. 排除任何以下划线开头的文件(例如_template.md)
4. 提取词干:将change-name按"-"拆分,丢弃单字符词干
5. 对每个剩余文件f:
domain = f的文件名词干(不含.md扩展名)
如果domain出现在change-name中
或者步骤4中的任何词干出现在domain中:
将f添加到匹配列表
6. 返回所有匹配项(可能有多个文件)
7. 如果匹配项为空 → 静默跳过预加载(无错误、无警告)| 变更名称 | 过滤后的词干 | 匹配结果 |
|---|---|---|
| | |
| | |
| | 与 |
| | 无匹配 — 词干未出现在任何domain slug中 |
_template.md/memory-update/memory-updatememory-init[auto-updated]/memory-update/memory-updatememory-init[auto-updated]ai-context/features/sdd-meta-system.mdagent-config"The SDD meta-system is the Claude Code configuration and skill orchestration framework... It provides two primary capabilities: a library of reusable skills and an SDD phase pipeline... The system is self-hosting: changes to its own skills must follow the same SDD cycle."
- Every skill modification MUST go through the SDD planning cycle (at minimum /sdd-propose) before /sdd-apply.
- sync.sh MUST only move memory/ from ~/.claude/ to the repo.
- Developers MUST NOT edit files under ~/.claude/ directly.| Entity | Key Fields | Constraints |
|---------------|------------------------------------|--------------------------------------------|
| Skill | directory name, SKILL.md, format | format must be procedural|reference|anti-pattern |
| SDD Change | proposal, design, tasks | stored in engram as sdd/<name>/* artifacts || System | Direction | Contract |
|-------------|-----------|-------------------------------------------------------|
| install.sh | outbound | Deploys repo to ~/.claude/ — run after any config change |
| sync.sh | inbound | Copies ~/.claude/memory/ to repo — memory only |undefinedagent-configai-context/features/sdd-meta-system.md"SDD元系统是Claude Code配置和技能编排框架... 它提供两个核心功能:可复用技能库和SDD阶段流水线... 系统是自托管的:其自身技能的变更必须遵循相同的SDD周期。"
- 任何技能修改在执行/sdd-apply之前必须经过SDD规划周期(至少执行/sdd-propose)。
- sync.sh必须仅将memory/从~/.claude/移动到仓库。
- 开发人员不得直接编辑~/.claude/下的文件。| 实体 | 关键字段 | 约束条件 |
|---------------|------------------------------------|--------------------------------------------|
| Skill | 目录名、SKILL.md、格式 | 格式必须为procedural|reference|anti-pattern |
| SDD Change | proposal、design、tasks | 作为sdd/<name>/*工件存储在engram中 || 系统 | 方向 | 契约 |
|-------------|-----------|-------------------------------------------------------|
| install.sh | 出站 | 将仓库部署到~/.claude/ — 任何配置变更后运行 |
| sync.sh | 入站 | 将~/.claude/memory/复制到仓库 — 仅处理memory |undefined
**Known Gotchas** (operational hazards and non-obvious behaviors):
For the full worked example, read `ai-context/features/sdd-meta-system.md`.
---
**已知陷阱**(操作风险和非显而易见的行为):
完整示例请查看`ai-context/features/sdd-meta-system.md`。
---ai-context/features/_template.md<domain-slug>.mdai-context/features/_template.mdsdd/<change>/specsdd-proposesdd-specai-context/features//memory-update/memory-updatememory-initproject-analyzeai-context/features/feature_docs:ai-context/features/_template.md<domain-slug>.mdai-context/features/_template.mdsdd/<change>/specsdd-proposesdd-specai-context/features//memory-update/memory-updatememory-initproject-analyzeai-context/features/feature_docs: