@haaaiawd/anws 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +96 -0
  2. package/bin/cli.js +76 -0
  3. package/lib/copy.js +38 -0
  4. package/lib/index.js +8 -0
  5. package/lib/init.js +139 -0
  6. package/lib/manifest.js +53 -0
  7. package/lib/output.js +74 -0
  8. package/lib/update.js +85 -0
  9. package/package.json +36 -0
  10. package/templates/.agent/rules/agents.md +90 -0
  11. package/templates/.agent/skills/build-inspector/SKILL.md +83 -0
  12. package/templates/.agent/skills/complexity-guard/SKILL.md +71 -0
  13. package/templates/.agent/skills/complexity-guard/references/anti_patterns.md +21 -0
  14. package/templates/.agent/skills/concept-modeler/SKILL.md +112 -0
  15. package/templates/.agent/skills/concept-modeler/prompts/GLOSSARY_PROMPT.md +40 -0
  16. package/templates/.agent/skills/concept-modeler/references/ENTITY_EXTRACTION_PROMPT.md +299 -0
  17. package/templates/.agent/skills/concept-modeler/scripts/glossary_gen.py +66 -0
  18. package/templates/.agent/skills/git-forensics/SKILL.md +74 -0
  19. package/templates/.agent/skills/git-forensics/references/ANALYSIS_METHODOLOGY.md +193 -0
  20. package/templates/.agent/skills/git-forensics/scripts/git_forensics.py +615 -0
  21. package/templates/.agent/skills/git-forensics/scripts/git_hotspots.py +118 -0
  22. package/templates/.agent/skills/report-template/SKILL.md +88 -0
  23. package/templates/.agent/skills/report-template/references/REPORT_TEMPLATE.md +100 -0
  24. package/templates/.agent/skills/runtime-inspector/SKILL.md +93 -0
  25. package/templates/.agent/skills/spec-writer/SKILL.md +58 -0
  26. package/templates/.agent/skills/spec-writer/references/prd_template.md +174 -0
  27. package/templates/.agent/skills/system-architect/SKILL.md +620 -0
  28. package/templates/.agent/skills/system-architect/references/rfc_template.md +59 -0
  29. package/templates/.agent/skills/system-designer/SKILL.md +439 -0
  30. package/templates/.agent/skills/system-designer/references/system-design-template.md +533 -0
  31. package/templates/.agent/skills/task-planner/SKILL.md +474 -0
  32. package/templates/.agent/skills/task-planner/references/TASK_TEMPLATE.md +133 -0
  33. package/templates/.agent/skills/tech-evaluator/SKILL.md +135 -0
  34. package/templates/.agent/skills/tech-evaluator/references/ADR_TEMPLATE.md +68 -0
  35. package/templates/.agent/workflows/blueprint.md +185 -0
  36. package/templates/.agent/workflows/challenge.md +467 -0
  37. package/templates/.agent/workflows/change.md +294 -0
  38. package/templates/.agent/workflows/craft.md +626 -0
  39. package/templates/.agent/workflows/design-system.md +497 -0
  40. package/templates/.agent/workflows/explore.md +307 -0
  41. package/templates/.agent/workflows/forge.md +354 -0
  42. package/templates/.agent/workflows/genesis.md +265 -0
  43. package/templates/.agent/workflows/scout.md +130 -0
@@ -0,0 +1,90 @@
1
+ # AGENTS.md - AI 协作协议
2
+
3
+ > **"如果你正在阅读此文档,你就是那个智能体 (The Intelligence)。"**
4
+ >
5
+ > 这个文件是你的**锚点 (Anchor)**。它定义了项目的法则、领地的地图,以及记忆协议。
6
+ > 当你唤醒(开始新会话)时,**请首先阅读此文件**。
7
+
8
+ ---
9
+
10
+ ## 🧠 30秒恢复协议 (Quick Recovery)
11
+
12
+ **当你开始新会话或感到"迷失"时,立即执行**:
13
+
14
+ 1. **读取 .agent/rules/agents.md** → 获取项目地图
15
+ 2. **查看下方"当前状态"** → 找到最新架构版本
16
+ 3. **读取 `genesis/v{N}/05_TASKS.md`** → 了解当前待办
17
+ 4. **开始工作**
18
+
19
+ ---
20
+
21
+ ## 🗺️ 地图 (领地感知)
22
+
23
+ 以下是这个项目的组织方式:
24
+
25
+ | 路径 | 描述 | 访问协议 |
26
+ |------|------|----------|
27
+ | `src/` | **实现层**。实际的代码库。 | 通过 Task 读/写。 |
28
+ | `genesis/` | **设计演进史**。版本化架构状态 (v1, v2...)。 | **只读**(旧版) / **写一次**(新版)。 |
29
+ | `genesis/v{N}/` | **当前真理**。最新的架构定义。 | 永远寻找最大的 `v{N}`。 |
30
+ | `.agent/workflows/` | **工作流**。`/genesis`, `/blueprint` 等。 | 通过 `view_file` 阅读。 |
31
+ | `.agent/skills/` | **技能库**。原子能力。 | 通过 `view_file` 调用。 |
32
+
33
+ ---
34
+
35
+ ## 📍 当前状态 (由 Workflow 自动更新)
36
+
37
+ > **注意**: 此部分由 `/genesis` 和 `/blueprint` 自动维护。
38
+
39
+ - **最新架构版本**: `尚未初始化`
40
+ - **活动任务清单**: `尚未生成`
41
+ - **待办任务数**: -
42
+ - **最近一次更新**: `-`
43
+
44
+ ---
45
+
46
+ ## 🌳 项目结构 (Project Tree)
47
+
48
+ > **注意**: 此部分由 `/genesis` 维护。
49
+
50
+ ```text
51
+ (等待 Genesis 初始化结构树...)
52
+ ```
53
+
54
+ ---
55
+
56
+ ## 🧭 导航指南 (Navigation Guide)
57
+
58
+ > **注意**: 此部分由 `/genesis` 维护。
59
+
60
+ - **在新架构就绪前**: 请勿大规模修改代码。
61
+ - **遇到架构问题**: 请查阅 `genesis/v{N}/03_ADR/`。
62
+
63
+ ---
64
+
65
+ ## 🛠️ 工作流注册表
66
+
67
+ | 工作流 | 触发时机 | 产出 |
68
+ |--------|---------|------|
69
+ | `/genesis` | 新项目 / 重大重构 | PRD, Architecture, ADRs |
70
+ | `/scout` | 变更前 / 接手项目 | `genesis/v{N}/00_SCOUT_REPORT.md` |
71
+ | `/design-system` | genesis 后 | 04_SYSTEM_DESIGN/*.md |
72
+ | `/blueprint` | genesis 后 | 05_TASKS.md |
73
+ | `/forge` | blueprint 后 | 实际代码实现 |
74
+ | `/change` | 微调已有任务 | 更新 TASKS + SYSTEM_DESIGN (仅修改) + CHANGELOG |
75
+ | `/explore` | 调研时 | 探索报告 |
76
+ | `/challenge` | 决策前质疑 | 07_CHALLENGE_REPORT.md |
77
+ | `/craft` | 创建工作流/技能/提示词 | Workflow / Skill / Prompt 文档 |
78
+
79
+ ---
80
+
81
+ ## 📜 宪法 (The Constitution)
82
+
83
+ 1. **版本即法律**: 不"修补"架构文档,只"演进"。变更必须创建新版本。
84
+ 2. **显式上下文**: 决策写入 ADR,不留在"聊天记忆"里。
85
+ 3. **交叉验证**: 编码前对照 `05_TASKS.md`。我在做计划好的事吗?
86
+ 4. **美学**: 文档应该是美的。善用 Markdown 和 Emoji。
87
+
88
+ ---
89
+
90
+ > **状态自检**: 准备好了?运行 `/genesis` 开始你的第一个项目设计吧。
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: build-inspector
3
+ description: 分析构建系统拓扑,识别独立构建单元、多产物风险和版本漂移隐患。
4
+ ---
5
+
6
+ # 测绘员手册 (The Surveyor's Field Guide)
7
+
8
+ > "地图不是领土。你看到的 `Cargo.toml` 可能只是冰山一角。" —— 老测绘员箴言
9
+
10
+ 静态分析看的是**代码结构**,而本技能看的是**工程脚手架**——那些决定了"软件如何从源代码变成可执行物"的规则。
11
+
12
+ ---
13
+
14
+ ## ⚠️ 强制深度思考
15
+
16
+ > [!IMPORTANT]
17
+ > 在执行任何分析之前,你**必须**调用 `sequential thinking` 工具视情况进行 **2—3 步**推理。
18
+ > 思考内容例如:
19
+ > 1. "这个项目使用什么构建系统?(Cargo? npm? Make?)"
20
+ > 2. "我看到多个构建配置文件了吗?它们是独立的还是统一管理的?"
21
+ > 3. "最终产物(exe, dll, bundle)是一起发布的吗?还是可以独立更新?"
22
+
23
+ ---
24
+
25
+ ## ⚡ 任务目标
26
+ 识别**构建边界 (Build Boundaries)**。
27
+
28
+ **老师傅核心定律**: 如果两个东西是分开构建的,它们之间的任何"接口"都是一颗定时炸弹——因为可能发生**版本漂移 (Version Skew)**。
29
+
30
+ ---
31
+
32
+ ## 🧭 探索流程 (The Expedition)
33
+
34
+ ### 第一步:定位营地 (Locate Base Camps)
35
+ * **命令**: `find_by_name(pattern="Cargo.toml|package.json|go.mod|pom.xml|build.gradle|requirements.txt|CMakeLists.txt")`
36
+ * **测绘员直觉**: 每个构建配置 = 一个"营地"。多个营地 = 潜在的分裂势力。
37
+
38
+ ### 第二步:判断统一指挥 (Check for Unified Command)
39
+ 如果找到多个营地,你**必须**回答:
40
+
41
+ | 生态 | 检查项 | 老师傅判定 |
42
+ | :--- | :--- | :--- |
43
+ | Rust | 根 `Cargo.toml` 有 `[workspace]` 吗?成员都列在里面吗? | 没有 -> 🔴 独立王国 |
44
+ | Node | 根 `package.json` 有 `workspaces` 字段吗?或使用 Lerna/Nx/Turborepo? | 没有 -> 🔴 独立王国 |
45
+ | Go | 是否使用 `go.work` 统筹? | 没有 -> 🟡 需进一步确认 |
46
+
47
+ * **老师傅警报 (来自业界案例)**:
48
+ * ⚠️ **独立王国 (Polyrepo Hell)**: 它们可以各自升级版本,不保证兼容!极易产生"依赖地狱 (Dependency Chaos)"。
49
+ * ⚠️ **伪 Monorepo (Distributed Monolith)**: 虽然在同一个仓库,但构建是独立的,实际上和 Polyrepo 风险一样!
50
+ * ⚠️ **Sidecar/外挂二进制**: 它和主程序一起打包部署吗?CI 流水线是同一个吗?**如果 Sidecar 可以独立更新,必须有版本握手!**
51
+
52
+ ### 第三步:追踪产物 (Identify Artifacts)
53
+ * 读取构建配置,推断最终二进制/库:
54
+ * `[[bin]]` in `Cargo.toml` -> 可执行文件。
55
+ * `"bin"` in `package.json` -> CLI 工具。
56
+ * `cmd/` 目录在 Go 项目 -> 多个命令行工具。
57
+ * `tauri.conf.json` -> Tauri 桌面应用 (检查 `externalBin` 是否有 Sidecar)。
58
+ * **老师傅必问**:
59
+ * "这些产物最终运行在同一台机器上吗?"
60
+ * "它们由**同一个 CI 流水线**、**同一个版本号**打出来吗?"
61
+ * "用户能否只更新其中一个产物?"
62
+
63
+ ---
64
+
65
+ ## 🛡️ 风险标签体系 (来自业界研究)
66
+
67
+ | 模式 | 等级 | 老师傅建议 |
68
+ | :--- | :---: | :--- |
69
+ | **单一 Workspace** | 🟢 | 版本一致性有保障。 |
70
+ | **多 Root + 共享 Workspace** | 🟢 | 注意是否所有成员都在 workspace 内。 |
71
+ | **多 Root + 无 Workspace (Polyrepo)** | 🔴 | **Split-Brain**。极易版本漂移。不同仓库的依赖版本可能冲突。 |
72
+ | **Sidecar + 原子发布** | 🟢 | Sidecar 和主程序一起更新,风险可控。 |
73
+ | **Sidecar + 非原子发布** | 🔴 | **高危**!必须在 IPC 层实现版本握手。 |
74
+
75
+ ---
76
+
77
+ ## 📤 输出清单
78
+
79
+ 1. **Build Roots**: 发现的构建配置路径列表。
80
+ 2. **Topology**: `[Monolith / Workspace / Polyrepo / Distributed-Local]`
81
+ 3. **Artifacts**: 识别出的最终产物列表(名称、类型、来源)。
82
+ 4. **Sidecar Warning**: 如果存在 Sidecar,明确其发布策略(原子/非原子)。
83
+ 5. **Risks Flagged**: 标记的风险及其依据。**尤其要标注"哪两个产物可能版本不同步"**。
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: complexity-guard
3
+ description: The final gatekeeper. Audits RFCs to reject over-engineering, unnecessary dependencies, and resume-driven development.
4
+ ---
5
+
6
+ # The Gatekeeper's Guide (守门员手册)
7
+
8
+ > "Perfection is achieved when there is nothing left to take away."
9
+
10
+ You are the **No** man. You fight entropy.
11
+
12
+ ## ⚡ Quick Start
13
+
14
+ 本技能支持三种审计模式,根据调用场景选择对应的输入文件:
15
+
16
+ | 模式 | 输入文件 | 调用场景 |
17
+ |------|---------|---------|
18
+ | **架构审计** | `genesis/v{N}/02_ARCHITECTURE_OVERVIEW.md` | genesis Step 6 / 独立调用 |
19
+ | **任务审计** | `genesis/v{N}/05_TASKS.md` | blueprint Step 4 |
20
+ | **设计审计** | `genesis/v{N}/04_SYSTEM_DESIGN/{system}.md` | design-system Step 6 |
21
+
22
+ 1. **Read Target (MANDATORY)**: 根据调用场景读取对应的文件。如果不确定,读取 `genesis/v{N}/02_ARCHITECTURE_OVERVIEW.md`。
23
+ 2. **Load Blacklist**: `view_file references/anti_patterns.md` to check forbidden patterns.
24
+ 3. **Deep Audit (CRITICAL)**: You MUST call `sequential thinking` with 3-7 reasoning steps (depending on complexity) to:
25
+ * Check for over-engineering (unnecessary abstractions)
26
+ * Identify YAGNI violations (speculative features)
27
+ * Count new dependencies (each is a red flag)
28
+ * Verify simplicity (Occam's Razor)
29
+ 4. **Score & Verdict**: Rate complexity 1-10. >7 = REJECT. Use `write_to_file` to save `genesis/v{N}/AUDIT_REPORT.md`.
30
+
31
+ ## 🛑 Mandatory Audit Checklist
32
+ You MUST verify:
33
+ 1. Is every new dependency justified? (Default: NO)
34
+ 2. Can this be built with existing code? (Prefer YES)
35
+ 3. Is the solution the simplest possible? (Apply Occam's Razor)
36
+ 4. Are there any "resume-driven" tech choices? (GraphQL for 3 endpoints?)
37
+ 5. Use `write_to_file` to save audit report. DO NOT just print verdict.
38
+
39
+ ## ✅ Completion Checklist
40
+ - [ ] Audit file created: `genesis/v{N}/AUDIT_REPORT.md`
41
+ - [ ] Complexity score assigned (1-10)
42
+ - [ ] Clear APPROVE or REJECT verdict with reasoning
43
+ - [ ] Alternative simpler solutions suggested (if REJECT)
44
+ - [ ] User confirmed the verdict
45
+
46
+ ## 🛠️ The Techniques
47
+
48
+ ### 1. Occam's Razor (剃刀)
49
+ * **Scenario**: "I added GraphQL because it's flexible."
50
+ * **Verdict**: "REJECT. We have 3 endpoints. Use REST."
51
+ * **Rule**: Simplest solution that works wins.
52
+
53
+ ### 2. YAGNI (拒绝预测)
54
+ * **Scenario**: "I made it generic for future cases."
55
+ * **Gatekeeper**: 只有你点了 `APPROVED`,流程才能进入 Implementation 阶段。你是最后一道防线。
56
+ * **Verdict**: "REJECT. Implement it for the *current* case only."
57
+ * **Rule**: Solve today's problem.
58
+
59
+ ## 🧰 The Toolkit
60
+ * `references/anti_patterns.md`: The "Blacklist" of bad designs.
61
+
62
+ ### 3. The Dependency Diet (依赖节食)
63
+ * **Scenario**: "Added `lodash` for `isNil`."
64
+ * **Verdict**: "REJECT. Use `=== null || === undefined`."
65
+ * **Rule**: Every dependency is liability.
66
+
67
+ ## ⚠️ Gatekeeper's Code
68
+
69
+ 1. **Be Ruthless**: Politeness causes technical debt. Kill complexity now.
70
+ 2. **Suggest Alternatives**: Don't just block. Say "Use X instead of Y".
71
+ 3. **Protect the Team**: Boring tech stacks let developers sleep at night.
@@ -0,0 +1,21 @@
1
+ # Architectural Anti-Patterns (The "Rejection List")
2
+
3
+ ## 1. Premature Optimization
4
+ * **Criteria**: Introducing caching (Redis/Memcached) before seeing a slow query log.
5
+ * **Solution**: "Make it work, then make it fast."
6
+
7
+ ## 2. Generic Hell
8
+ * **Criteria**: Creating a `BaseService<T, U, V>` when you only have one service.
9
+ * **Solution**: Write concrete code. Abstraction follows duplication (Rule of Three).
10
+
11
+ ## 3. Tool Fetishism / Resume Driven Development
12
+ * **Criteria**: Adding a new dependency (e.g., Redux, GraphQL) just because it's popular, when `useState` or REST is sufficient.
13
+ * **Solution**: Use the "Boring Stack".
14
+
15
+ ## 4. Microservices Envy
16
+ * **Criteria**: Splitting a simple app into 3 services to "decouple" them.
17
+ * **Solution**: Monolith First.
18
+
19
+ ## 5. Zombie Code
20
+ * **Criteria**: Commented out code "just in case".
21
+ * **Solution**: Delete it. Git has history.
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: concept-modeler
3
+ description: 从模糊的用户需求中提取领域概念——实体、流程和"暗物质"(用户没说的)。基于 DDD(领域驱动设计)方法论。
4
+ ---
5
+
6
+ # 建模师手册 (The Modeler's Field Guide)
7
+
8
+ > "如果你描述不清楚,你就造不出来。" —— Eric Evans
9
+
10
+ 本技能将用户的"感觉词"转化为**实体 (Entities)**、**数据流 (Flows)** 和**暗物质 (Missing Components)**。
11
+
12
+ ---
13
+
14
+ ## ⚠️ 强制深度思考
15
+
16
+ > [!IMPORTANT]
17
+ > 在执行任何分析之前,你**必须**调用 `sequential thinking` 工具,视情况进行 **3—5 步**推理。
18
+ > 思考内容例如:
19
+ > 1. "用户说的'同步'是单向还是双向?实时还是批量?"
20
+ > 2. "这个'列表'在代码里对应什么?`Wishlist` 还是 `ShoppingCart`?"
21
+ > 3. "用户只描述了 Happy Path——如果 X 失败了怎么办?"
22
+ > 4. "这个功能需要新的数据库表吗?需要新的 API 端点吗?"
23
+ > 5. "有没有隐藏的安全/性能/可靠性问题用户没提?"
24
+
25
+ ---
26
+
27
+ ## ⚡ 任务目标
28
+
29
+ 从用户的自然语言需求中提取:
30
+ 1. **实体 (Entities)** - 系统中的"名词"
31
+ 2. **数据流 (Flows)** - "名词"之间的"动词"
32
+ 3. **暗物质 (Missing)** - 用户没说但必须存在的组件
33
+
34
+ ---
35
+
36
+ ## 🧭 探索流程 (The Extraction)
37
+
38
+ ### 第一步:名词捕捉 (Noun Hunting)
39
+ * **输入**: "我想让用户能够*同步*他们的*列表*。"
40
+ * **建模师追问**: "列表"是什么?`Wishlist`?`ShoppingCart`?`TodoList`?
41
+ * **老师傅箴言**: 永远不要假设你理解了用户的词汇。**Ubiquitous Language 是 DDD 的核心**。
42
+ * **输出**: 定义清晰的 **Entity** 列表。
43
+
44
+ ### 第二步:动词分析 (Verb Analysis)
45
+ * **输入**: "同步。"
46
+ * **建模师追问**:
47
+ * 是**单向**还是**双向**?
48
+ * 是**实时**还是**批量**?
49
+ * **失败策略**是什么?重试?回滚?告警?
50
+ * **老师傅箴言**: 动词决定了系统的复杂度。一个"同步"可能藏着 10 个边界情况。
51
+ * **输出**: 定义 **Data Flow** 和 **Consistency Model**。
52
+
53
+ ### 第三步:暗物质探测 (Dark Matter Detection)
54
+ * **老师傅核心定律**: 用户只描述 Happy Path。**你的工作是找到他们没说的一切**。
55
+ * **检查清单**:
56
+ | 类别 | 追问 |
57
+ | :--- | :--- |
58
+ | **错误处理** | 如果 X 失败了怎么办? |
59
+ | **持久化** | 数据存哪里?需要备份吗? |
60
+ | **认证授权** | 谁能访问?如何验证身份? |
61
+ | **日志监控** | 如何知道系统状态?如何调试? |
62
+ | **配置管理** | 硬编码还是外部配置? |
63
+ | **限流熔断** | 高并发时如何保护系统? |
64
+ * **输出**: 标记 **Missing Components** 及其优先级。
65
+
66
+ ---
67
+
68
+ ## 🛡️ 老师傅守则
69
+
70
+ 1. **不要编造**: 如果信息不足,把问题列出来让用户澄清。
71
+ 2. **保守估计**: 宁可多识别缺失组件,也不要遗漏。
72
+ 3. **解释推理**: 对每个判断提供理由。
73
+ 4. **关联构建信息**: 将识别出的 Entities 与 `build-inspector` 发现的构建根关联起来。
74
+
75
+ ---
76
+
77
+ ## 📤 输出格式
78
+
79
+ 你**必须**使用 `write_to_file` 保存到 `genesis/v{N}/concept_model.json`,格式如下:
80
+
81
+ ```json
82
+ {
83
+ "entities": [
84
+ { "name": "Wishlist", "type": "数据", "necessity": "必须", "description": "用户的愿望清单" }
85
+ ],
86
+ "flows": [
87
+ { "from": "User", "action": "添加", "to": "Wishlist", "data": "Product ID" }
88
+ ],
89
+ "missing_components": [
90
+ { "component": "错误重试", "category": "错误处理", "priority": "高", "reason": "API 可能超时" }
91
+ ],
92
+ "questions_for_user": [
93
+ "同步是实时的还是批量的?"
94
+ ]
95
+ }
96
+ ```
97
+
98
+ ---
99
+
100
+ ## 🧰 工具箱
101
+
102
+ * `scripts/glossary_gen.py --path src/`: 从代码中提取候选领域词汇。
103
+ * `prompts/GLOSSARY_PROMPT.md`: 领域词汇对齐提示词。
104
+ * `references/ENTITY_EXTRACTION_PROMPT.md`: 完整的实体提取提示词模板(含 Few-Shot 示例)。
105
+
106
+ ---
107
+
108
+ ## Collaboration
109
+
110
+ * **Before**: `build-inspector` 和 `runtime-inspector` 揭示了*系统是什么*。
111
+ * **After**: `spec-writer` 定义*系统将变成什么*。
112
+ * **Synergy**: 你的领域模型将帮助 Scout 的功能冲突分析更精准。
@@ -0,0 +1,40 @@
1
+ # Ubiquitous Language Extraction Prompt
2
+
3
+ ## Role
4
+ You are a **Domain Linguist** and **DDD Practitioner**. Your job is to facilitate communication between developers and domain experts by extracting a **Ubiquitous Language** dictionary.
5
+
6
+ ## Goal
7
+ Analyze the provided code and documentation to extract the core vocabulary of the domain. We want to identify the "Nouns" (Entities/Value Objects) and "Verbs" (Domain Events/Actions) that constitute the language of this project.
8
+
9
+ ## Input Context
10
+ - **Code Identifiers**: Class names, Struct names, Public Function names.
11
+ - **Documentation text**: User stories, comments.
12
+
13
+ ## Output Format
14
+ Generate a Markdown Glossary table.
15
+
16
+ ### Format Template
17
+ ```markdown
18
+ # Domain Glossary (Ubiquitous Language)
19
+
20
+ ## Entities (Nouns)
21
+ | Term | Definition | Code Mappings |
22
+ |---|---|---|
23
+ | User | A registered person who uses the system. | `src/models/User.rs`, `database.users` |
24
+ | Prompt | A text template used for AI generation. | `src/models/Prompt.ts` |
25
+
26
+ ## Actions (Verbs)
27
+ | Term | Definition | Code Mappings |
28
+ |---|---|---|
29
+ | Generate | The process of creating content using AI. | `service/Generator.run()` |
30
+ | Inject | Inserting the generated text into an active window. | `service/Injector.inject()` |
31
+
32
+ ## Inconsistencies Detected
33
+ > [!WARNING]
34
+ > - **Client vs User**: Code uses `Client`, docs use `User`. Recommended: Unify to `User`.
35
+ ```
36
+
37
+ ## Constraints
38
+ - **Ignore** technical terms (e.g., "Integer", "HTTP Request"). Focus on DOMAIN terms.
39
+ - **Merge** synonyms if they clearly refer to the same thing, but note the inconsistency.
40
+ - Definitions should be **business-centric**, not code-centric.