@miniidealab/openlogos 0.7.2 → 0.8.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 (52) hide show
  1. package/codex-plugin-template/plugin.json +10 -0
  2. package/codex-plugin-template/session-start.sh +125 -0
  3. package/dist/commands/change.d.ts.map +1 -1
  4. package/dist/commands/change.js +21 -3
  5. package/dist/commands/change.js.map +1 -1
  6. package/dist/commands/init.d.ts +9 -1
  7. package/dist/commands/init.d.ts.map +1 -1
  8. package/dist/commands/init.js +173 -34
  9. package/dist/commands/init.js.map +1 -1
  10. package/dist/commands/module.d.ts +5 -0
  11. package/dist/commands/module.d.ts.map +1 -0
  12. package/dist/commands/module.js +233 -0
  13. package/dist/commands/module.js.map +1 -0
  14. package/dist/commands/next.d.ts +10 -0
  15. package/dist/commands/next.d.ts.map +1 -0
  16. package/dist/commands/next.js +125 -0
  17. package/dist/commands/next.js.map +1 -0
  18. package/dist/commands/status.d.ts +12 -0
  19. package/dist/commands/status.d.ts.map +1 -1
  20. package/dist/commands/status.js +116 -1
  21. package/dist/commands/status.js.map +1 -1
  22. package/dist/commands/sync.d.ts.map +1 -1
  23. package/dist/commands/sync.js +13 -1
  24. package/dist/commands/sync.js.map +1 -1
  25. package/dist/commands/verify.js +2 -2
  26. package/dist/commands/verify.js.map +1 -1
  27. package/dist/i18n.d.ts.map +1 -1
  28. package/dist/i18n.js +68 -8
  29. package/dist/i18n.js.map +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +30 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/lib/sync-resource-index.js +5 -5
  34. package/dist/lib/sync-resource-index.js.map +1 -1
  35. package/package.json +8 -4
  36. package/skills/architecture-designer/SKILL.en.md +1 -1
  37. package/skills/architecture-designer/SKILL.md +1 -1
  38. package/skills/prd-writer/SKILL.en.md +1 -1
  39. package/skills/prd-writer/SKILL.md +1 -1
  40. package/skills/product-designer/SKILL.en.md +1 -1
  41. package/skills/product-designer/SKILL.md +1 -1
  42. package/skills/scenario-architect/SKILL.en.md +2 -2
  43. package/skills/scenario-architect/SKILL.md +11 -5
  44. package/skills/test-writer/SKILL.en.md +1 -1
  45. package/skills/test-writer/SKILL.md +2 -2
  46. package/spec/change-management.md +5 -0
  47. package/spec/cli-json-output.md +20 -1
  48. package/spec/codex-plugin.md +138 -0
  49. package/spec/directory-convention.md +4 -2
  50. package/spec/logos-project.md +41 -5
  51. package/spec/module-naming-convention.md +74 -0
  52. package/spec/workflow.md +1 -1
@@ -16,6 +16,8 @@
16
16
  |------|------|------|------|
17
17
  | `project` | object | 是 | 项目基本信息 |
18
18
  | `tech_stack` | object | 是 | 技术栈描述 |
19
+ | `scenario_counter` | object | 否 | 全局场景编号计数器(多模块项目必填) |
20
+ | `modules` | array | 否 | 模块注册表(多模块项目必填) |
19
21
  | `scenarios` | array | 否 | 场景清单(单一真相来源,Phase 3-1 前写入) |
20
22
  | `resource_index` | array | 是 | 资源索引列表 |
21
23
  | `conventions` | array | 否 | 项目约定 |
@@ -62,6 +64,27 @@
62
64
  | `mock-callback` | 编排中主动调用模拟回调端点 | 支付回调、Webhook |
63
65
  | `mock-service` | 使用本地 mock 服务替代 | OAuth Provider、第三方 API |
64
66
 
67
+ ### scenario_counter
68
+
69
+ 对象,维护全局场景编号计数器。多模块项目必填,确保不同模块的场景编号全局唯一、不重复。
70
+
71
+ | 字段 | 类型 | 必填 | 说明 |
72
+ |------|------|------|------|
73
+ | `next_id` | integer | 是 | 下一个场景的序号(整数),如 `19` 表示下一个场景从 `S19` 开始 |
74
+
75
+ **使用规则**:AI 每次生成新场景前必须读取此字段取号,生成后立即将 `next_id` 加 1 并写回,严禁不同模块从 S01 重新开始编号。
76
+
77
+ ### modules
78
+
79
+ 数组,模块注册表。多模块项目必填,统一在此文件维护,不另建 `modules.yaml`。`openlogos init` 时自动写入 `core` 模块初始数据。
80
+
81
+ | 字段 | 类型 | 必填 | 说明 |
82
+ |------|------|------|------|
83
+ | `id` | string | 是 | 模块标识符,小写字母 + 连字符,如 `core`、`payment` |
84
+ | `name` | string | 是 | 模块名称(中文或英文均可) |
85
+ | `status` | string | 是 | 模块状态:`in-progress`(推进中)或 `stable`(已稳定) |
86
+ | `loop_phase` | string\|null | 是 | 当前所处阶段(如 `api-design`、`scenario-modeling`);`stable` 模块设为 `null` |
87
+
65
88
  ### resource_index
66
89
 
67
90
  数组,每个元素描述一个关键资源文件:
@@ -84,13 +107,13 @@
84
107
  | `id` | string | 是 | 场景唯一编号,格式为 `S` + 两位数字,如 `S01`、`S02` |
85
108
  | `name` | string | 是 | 场景名称(一句话描述) |
86
109
 
87
- **命名规则约定**(各阶段产出物通过 `SXX` 前缀与场景关联,无需在 yaml 中声明路径):
110
+ **命名规则约定**(各阶段产出物通过 `<module>-SXX` 前缀与场景关联,无需在 yaml 中声明路径):
88
111
 
89
112
  | 阶段 | 产出物路径规则 | 示例 |
90
113
  |------|-------------|------|
91
- | Phase 3-1 场景建模 | `logos/resources/prd/3-technical-plan/2-scenario-implementation/SXX-*.md` | `S01-user-register.md` |
114
+ | Phase 3-1 场景建模 | `logos/resources/prd/3-technical-plan/2-scenario-implementation/<module>-SXX-*.md` | `core-S01-user-register.md` |
92
115
  | Phase 3-2 API 设计 | `logos/resources/api/SXX-*.yaml` 或 `SXX-*.yml` | `S01-user-register.yaml` |
93
- | Phase 3-3a 测试用例 | `logos/resources/test/SXX-*.md` | `S01-test-cases.md` |
116
+ | Phase 3-3a 测试用例 | `logos/resources/test/<module>-SXX-*.md` | `core-S01-test-cases.md` |
94
117
 
95
118
  **完成判断规则**:只有 `scenarios` 中每个 `id` 在对应阶段都存在匹配文件,该阶段才视为完成。若 `scenarios` 字段缺失,则降级为旧的"目录有文件即完成"逻辑(向后兼容)。
96
119
 
@@ -114,6 +137,19 @@ tech_stack:
114
137
  auth: "Supabase Auth"
115
138
  payment: "Paddle"
116
139
 
140
+ scenario_counter:
141
+ next_id: 6
142
+
143
+ modules:
144
+ - id: core
145
+ name: 核心功能
146
+ status: stable
147
+ loop_phase: null
148
+ - id: payment
149
+ name: 支付模块
150
+ status: in-progress
151
+ loop_phase: api-design
152
+
117
153
  external_dependencies:
118
154
  - name: "邮件服务"
119
155
  provider: "SendGrid"
@@ -132,9 +168,9 @@ external_dependencies:
132
168
  test_config: "POST /api/test/simulate-payment-callback"
133
169
 
134
170
  resource_index:
135
- - path: logos/resources/prd/1-product-requirements/01-requirements.md
171
+ - path: logos/resources/prd/1-product-requirements/core-01-requirements.md
136
172
  desc: 产品核心需求文档。涉及产品定位、目标用户、功能需求时必读。
137
- - path: logos/resources/prd/2-product-design/1-feature-specs/01-information-architecture.md
173
+ - path: logos/resources/prd/2-product-design/1-feature-specs/core-00-information-architecture.md
138
174
  desc: 信息架构文档。涉及页面结构、导航设计时必读。
139
175
  - path: logos/resources/api/auth.yaml
140
176
  desc: 认证相关 API 规格。涉及登录、注册、OAuth 接口设计时必读。
@@ -0,0 +1,74 @@
1
+ # 模块前缀命名规范
2
+
3
+ > 版本:1.0.0
4
+ >
5
+ > 本文档定义 OpenLogos 多模块项目的文件命名规范。所有 Skill 生成文件时必须遵循此规范。
6
+
7
+ ## 核心原则:文件名即命名空间
8
+
9
+ 所有设计文档文件名统一遵循格式:
10
+
11
+ ```
12
+ <module>-<序号或语义名>-<类型>.md
13
+ ```
14
+
15
+ - **module**:模块标识符,小写字母 + 连字符,如 `core`、`user`、`payment`
16
+ - 初始项目的默认模块统一使用 `core-` 前缀
17
+ - 新模块开发时,直接在同一目录下创建带新模块前缀的文件,无需新建子目录
18
+
19
+ ## 各类文件命名规则
20
+
21
+ | 文件类型 | 格式 | 示例 |
22
+ |---------|------|------|
23
+ | 需求文档 | `<module>-{序号}-{英文名}.md` | `core-01-requirements.md` |
24
+ | 功能规格 | `<module>-{序号}-{英文名}.md` | `core-00-information-architecture.md` |
25
+ | 页面设计 | `<module>-{序号}-{英文名}.md` | `core-01-cli-terminal.md` |
26
+ | 架构文档 | `<module>-{序号}-{英文名}.md` | `core-01-architecture-overview.md`(全局唯一,始终在此文件上更新) |
27
+ | 场景概览 | `<module>-00-scenario-overview.md` | `core-00-scenario-overview.md` |
28
+ | 场景实现 | `<module>-SXX-{英文名}.md` | `core-S01-cli-init.md` |
29
+ | 测试用例 | `<module>-SXX-test-cases.md` | `core-S01-test-cases.md` |
30
+
31
+ ## 场景编号全局唯一
32
+
33
+ 所有模块的场景编号共享一个全局递增序列(`S01`、`S02`...),由 `logos-project.yaml` 中的 `scenario_counter.next_id` 字段维护。
34
+
35
+ **AI 行为约束**:
36
+ 1. 生成新场景前,必须读取 `logos-project.yaml` 的 `scenario_counter.next_id` 取号
37
+ 2. 生成后立即将 `next_id` 加 1 并写回
38
+ 3. 严禁不同模块从 S01 重新开始编号
39
+
40
+ ## 模块注册表
41
+
42
+ 模块统一在 `logos-project.yaml` 的 `modules[]` 中维护,不另建 `modules.yaml`。
43
+
44
+ ```yaml
45
+ scenario_counter:
46
+ next_id: 19
47
+
48
+ modules:
49
+ - id: core
50
+ name: 核心功能
51
+ status: stable
52
+ loop_phase: null
53
+ - id: payment
54
+ name: 支付模块
55
+ status: in-progress
56
+ loop_phase: api-design
57
+ ```
58
+
59
+ ## 多模块共存示例
60
+
61
+ 同一目录下,不同模块的文件自然共存,通过前缀区分:
62
+
63
+ ```
64
+ logos/resources/prd/3-technical-plan/2-scenario-implementation/
65
+ ├── core-00-scenario-overview.md
66
+ ├── core-S01-cli-init.md
67
+ ├── core-S02-prd-writer.md
68
+ ├── payment-00-scenario-overview.md
69
+ └── payment-S19-checkout.md # 场景编号全局连续,不从 S01 重新开始
70
+ ```
71
+
72
+ ## 部署说明
73
+
74
+ 本文件(`spec/module-naming-convention.md`)是源码规范,由 `openlogos init` / `openlogos sync` 通过 `deploySpecs()` 自动部署到用户项目的 `logos/spec/` 目录。请勿直接修改 `logos/spec/` 下的副本。
package/spec/workflow.md CHANGED
@@ -206,7 +206,7 @@ Phase 2 在 Phase 1 场景的基础上增加交互细节:
206
206
  - 来源:时序图 Step 序列(主路径)、EX 异常用例(异常路径)、Phase 1/2 验收条件
207
207
  - 关注:跨模块调用链的正确性、数据在 Step 间的传递、异常发生时的补偿/回滚逻辑
208
208
 
209
- **产出物**:测试用例规格文档(Markdown),存放在 `logos/resources/test/`,按场景分文件(如 `S01-test-cases.md`)。
209
+ **产出物**:测试用例规格文档(Markdown),存放在 `logos/resources/test/`,按场景分文件(命名格式:`<module>-{场景编号}-test-cases.md`,如 `core-S01-test-cases.md`)。
210
210
 
211
211
  **Gate 3.3a**:核心场景的单元测试和场景测试用例已设计,覆盖所有 P0 场景的正常路径 + 核心 EX 异常路径。
212
212