@miniidealab/openlogos 0.2.0 → 0.3.1

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 (36) hide show
  1. package/dist/commands/init.d.ts +9 -2
  2. package/dist/commands/init.d.ts.map +1 -1
  3. package/dist/commands/init.js +219 -8
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/commands/sync.d.ts.map +1 -1
  6. package/dist/commands/sync.js +9 -41
  7. package/dist/commands/sync.js.map +1 -1
  8. package/dist/i18n.d.ts.map +1 -1
  9. package/dist/i18n.js +14 -0
  10. package/dist/i18n.js.map +1 -1
  11. package/dist/index.js +1 -1
  12. package/package.json +5 -2
  13. package/skills/api-designer/SKILL.en.md +209 -0
  14. package/skills/api-designer/SKILL.md +209 -0
  15. package/skills/architecture-designer/SKILL.en.md +181 -0
  16. package/skills/architecture-designer/SKILL.md +181 -0
  17. package/skills/change-writer/SKILL.en.md +146 -0
  18. package/skills/change-writer/SKILL.md +146 -0
  19. package/skills/code-reviewer/SKILL.en.md +204 -0
  20. package/skills/code-reviewer/SKILL.md +204 -0
  21. package/skills/db-designer/SKILL.en.md +212 -0
  22. package/skills/db-designer/SKILL.md +212 -0
  23. package/skills/merge-executor/SKILL.en.md +84 -0
  24. package/skills/merge-executor/SKILL.md +84 -0
  25. package/skills/prd-writer/SKILL.en.md +171 -0
  26. package/skills/prd-writer/SKILL.md +171 -0
  27. package/skills/product-designer/SKILL.en.md +228 -0
  28. package/skills/product-designer/SKILL.md +228 -0
  29. package/skills/project-init/SKILL.en.md +163 -0
  30. package/skills/project-init/SKILL.md +163 -0
  31. package/skills/scenario-architect/SKILL.en.md +214 -0
  32. package/skills/scenario-architect/SKILL.md +214 -0
  33. package/skills/test-orchestrator/SKILL.en.md +142 -0
  34. package/skills/test-orchestrator/SKILL.md +142 -0
  35. package/skills/test-writer/SKILL.en.md +247 -0
  36. package/skills/test-writer/SKILL.md +247 -0
@@ -0,0 +1,228 @@
1
+ # Skill: Product Designer
2
+
3
+ > Based on scenarios from the Phase 1 requirements document, refine interaction flows and feature specifications, and generate product prototypes. The prototype format automatically adapts to the product type (Web/CLI/Library, etc.). Scenario numbering stays consistent with Phase 1.
4
+
5
+ ## Trigger Conditions
6
+
7
+ - User requests a product design document or feature specification
8
+ - User requests prototypes or interaction design
9
+ - User mentions "Phase 2", "product design layer", or "WHAT"
10
+ - Requirements document exists (with scenario definitions) and solution design needs to begin
11
+
12
+ ## Core Capabilities
13
+
14
+ 1. **Identify the product type** and determine the corresponding prototype format (see Product Types and Prototype Strategy below)
15
+ 2. Design information architecture (page structure / command structure / API structure)
16
+ 3. Use Phase 1 scenarios as the backbone to refine interaction flows and feature specifications
17
+ 4. Supplement each scenario with interaction-level GIVEN/WHEN/THEN acceptance criteria
18
+ 5. Generate prototypes appropriate for the product type
19
+ 6. When a scenario is too coarse-grained, split it into sub-scenarios (`S01.1`, `S01.2`)
20
+
21
+ ## Product Types and Prototype Strategy
22
+
23
+ Before executing this Skill, first determine the product type (inferred from the requirements document's constraints and boundaries, and the `tech_stack` in `logos-project.yaml`), then select the corresponding prototype format:
24
+
25
+ | Product Type | Typical Features | Prototype Format | Interaction Spec Focus |
26
+ |---------|---------|---------|-------------|
27
+ | **Web Application** | Has UI pages, user login | Interactive HTML pages | Page navigation, form validation, state changes |
28
+ | **CLI Tool** | Terminal commands, no GUI | Terminal interaction examples (command + output simulation) | Command format, parameter design, output format, error messages |
29
+ | **AI Skills / Conversational Product** | User interacts with AI via natural language | Dialogue flowchart + sample dialogue scripts | Dialogue steps, AI questioning strategy, deliverable format |
30
+ | **Library / SDK** | Called by other programs | API usage examples (code snippets) | Public interfaces, parameter design, return values, error codes |
31
+ | **Mobile Application** | Mobile UI | HTML pages (mobile viewport) | Gesture interaction, navigation patterns, offline state |
32
+ | **Hybrid** | Combination of multiple deliverables | Select the corresponding format for each deliverable | Interaction handoffs between deliverables |
33
+
34
+ ## Execution Steps
35
+
36
+ ### Step 1: Read the Requirements Document and Identify the Product Type
37
+
38
+ Read the Phase 1 requirements document and extract:
39
+ - Scenario list (`S01`, `S02`...) and priorities
40
+ - Constraints and boundaries → determine product type
41
+ - `tech_stack` in `logos-project.yaml` → confirm technical form
42
+
43
+ Output the product type determination and rationale for the prototype strategy selection.
44
+
45
+ ### Step 2: Design Information Architecture
46
+
47
+ Design architecture at different levels based on the product type:
48
+
49
+ - **Web Application**: Page structure, navigation hierarchy, route design
50
+ - **CLI Tool**: Command tree structure, subcommand hierarchy, global options
51
+ - **AI Skills**: Skill trigger relationships, dialogue step orchestration, deliverable dependency chain
52
+ - **Library / SDK**: Module structure, public API grouping
53
+
54
+ ### Step 3: Refine Interaction Specifications Per Scenario
55
+
56
+ Define complete interaction details for each scenario (see format examples below). Different product types emphasize different interaction dimensions.
57
+
58
+ ### Step 4: Supplement Interaction-Level Acceptance Criteria
59
+
60
+ Building on the Phase 1 GIVEN/WHEN/THEN, refine down to the interaction element level.
61
+
62
+ ### Step 5: Generate Prototypes
63
+
64
+ Generate prototypes in the format corresponding to the product type (see examples).
65
+
66
+ ### Step 6: Output the Product Design Document
67
+
68
+ Organize by scenario, with each scenario containing interaction specifications + corresponding prototype.
69
+
70
+ ## Scenario Elaboration Examples
71
+
72
+ ### Web Application Example
73
+
74
+ ```markdown
75
+ ### S01: Email Registration — Interaction Specification
76
+
77
+ **Pages Involved**: Registration page, email verification waiting page, verification success page
78
+
79
+ **Interaction Flow**:
80
+ 1. User clicks "Sign Up" on the homepage → redirected to the registration page
81
+ 2. Registration page contains: email input, password input, confirm password input, sign up button
82
+ 3. Real-time validation: email format, password length ≥ 8, both passwords match
83
+ 4. Successful submission → redirected to email verification waiting page
84
+
85
+ #### Acceptance Criteria (Interaction Level)
86
+
87
+ ##### Normal: Successful Registration
88
+ - **GIVEN** User is on the registration page, all fields are empty
89
+ - **WHEN** User enters test@example.com, password "Pass1234", confirm password "Pass1234", clicks "Sign Up" button
90
+ - **THEN** "Sign Up" button enters loading state, redirects to email verification waiting page after 1-3 seconds
91
+ ```
92
+
93
+ **Prototype**: `01-register-prototype.html` (interactive HTML page)
94
+
95
+ ### CLI Tool Example
96
+
97
+ ````markdown
98
+ ### S01: CLI Project Initialization — Interaction Specification
99
+
100
+ **Command Format**: `openlogos init [name]`
101
+
102
+ **Parameter Design**:
103
+ | Parameter | Type | Required | Default | Description |
104
+ |------|------|------|--------|------|
105
+ | name | string | No | Current directory name | Project name |
106
+
107
+ **Interaction Flow**:
108
+ 1. User runs `openlogos init my-project` in the terminal
109
+ 2. CLI checks if `logos/logos.config.json` already exists
110
+ 3. Does not exist → creates directory structure, outputs created file list line by line
111
+ 4. Exists → outputs error message and exits
112
+
113
+ **Terminal Output Simulation**:
114
+
115
+ Normal path:
116
+ ```
117
+ $ openlogos init my-project
118
+
119
+ Creating OpenLogos project structure...
120
+
121
+ ✓ logos/resources/prd/1-product-requirements/
122
+ ✓ logos/resources/prd/2-product-design/
123
+ ✓ logos/resources/prd/3-technical-plan/1-architecture/
124
+ ✓ logos/resources/prd/3-technical-plan/2-scenario-implementation/
125
+ ✓ logos/resources/api/
126
+ ✓ logos/resources/database/
127
+ ✓ logos/resources/scenario/
128
+ ✓ logos/changes/
129
+ ✓ logos/logos.config.json
130
+ ✓ logos/logos-project.yaml
131
+ ✓ AGENTS.md
132
+ ✓ CLAUDE.md
133
+
134
+ Project initialized. Next steps:
135
+ 1. Edit logos/logos.config.json to configure your project
136
+ 2. Start with Phase 1: tell AI "Help me write requirements"
137
+ 3. Run `openlogos status` to check progress at any time
138
+ ```
139
+
140
+ Error path:
141
+ ```
142
+ $ openlogos init
143
+ Error: logos/logos.config.json already exists in current directory.
144
+ This directory has already been initialized as an OpenLogos project.
145
+ ```
146
+
147
+ #### Acceptance Criteria (Interaction Level)
148
+
149
+ ##### Normal: Brand New Project
150
+ - **GIVEN** Current directory has no `logos/logos.config.json`
151
+ - **WHEN** User runs `openlogos init my-project`
152
+ - **THEN** Terminal outputs the 12 created files/directories line by line, ends with "Next steps" guidance, exit code is 0
153
+
154
+ ##### Error: Already Initialized
155
+ - **GIVEN** Current directory already contains `logos/logos.config.json`
156
+ - **WHEN** User runs `openlogos init`
157
+ - **THEN** Terminal outputs a red error message, no files are created, exit code is 1
158
+ ````
159
+
160
+ **Prototype**: `01-init-terminal.md` (terminal interaction simulation document)
161
+
162
+ ### AI Skills / Conversational Product Example
163
+
164
+ ```markdown
165
+ ### S02: AI-Assisted Requirements Writing — Interaction Specification
166
+
167
+ **Trigger Method**: User enters natural language in an AI coding tool
168
+
169
+ **Dialogue Flow**:
170
+ 1. User says "Help me write requirements"
171
+ 2. AI reads the prd-writer Skill
172
+ 3. AI follows up: "Please first tell me your product positioning — what problem does this product solve, and for whom?"
173
+ 4. User describes the product idea
174
+ 5. AI follows up: "Who is the core user? Can you describe a specific person?"
175
+ 6. User describes the user persona
176
+ 7. AI consolidates the information and begins outputting a structured requirements document
177
+ 8. After output, AI asks: "The requirements draft has been generated. Please review it and let me know what needs to be changed."
178
+
179
+ **AI Behavioral Guidelines**:
180
+ - No more than 3 rounds of follow-up questions, each round focusing on 1 key piece of information
181
+ - If the user provides sufficient information in the first message, skip follow-up questions and output directly
182
+ - Output document format strictly follows the prd-writer specification
183
+
184
+ #### Acceptance Criteria (Interaction Level)
185
+
186
+ ##### Normal: Sufficient Information
187
+ - **GIVEN** User describes product positioning, target users, and core pain points in the first message
188
+ - **WHEN** AI begins executing the prd-writer Skill
189
+ - **THEN** AI directly outputs a structured requirements document without follow-up questions
190
+
191
+ ##### Normal: Insufficient Information
192
+ - **GIVEN** User only says "Help me write requirements"
193
+ - **WHEN** AI begins executing the prd-writer Skill
194
+ - **THEN** AI asks about product positioning (round 1) → user responds → AI asks about target users (round 2) → user responds → AI outputs requirements document
195
+ ```
196
+
197
+ **Prototype**: `02-prd-writer-dialogue.md` (dialogue flow script)
198
+
199
+ ## Output Specification
200
+
201
+ - Feature specs: `logos/resources/prd/2-product-design/1-feature-specs/`
202
+ - Prototypes: `logos/resources/prd/2-product-design/2-page-design/`
203
+ - Design documents and prototypes appear in pairs: `{number}-{name}-design.md` + `{number}-{name}-prototype.{ext}`
204
+ - Web Application: `.html`
205
+ - CLI Tool: `-terminal.md` (terminal interaction simulation)
206
+ - AI Skills: `-dialogue.md` (dialogue flow script)
207
+ - Library / SDK: `-api-examples.md` (usage examples)
208
+ - **Scenario numbering must be consistent with Phase 1**; use sub-numbers when splitting (`S01.1`)
209
+
210
+ ## Best Practices
211
+
212
+ - **Scenarios are the backbone**: Don't organize documents by "pages" or "commands" — organize by "scenarios"
213
+ - **Phase 1 acceptance criteria are the input**: Phase 2 does not rewrite acceptance criteria; it refines Phase 1 criteria down to the interaction element level
214
+ - **Sub-scenario splits need justification**: Only split when a Phase 1 scenario truly contains two independent interaction paths
215
+ - **CLI "prototypes" are terminal output simulations**: No HTML needed — use code blocks to simulate terminal input/output
216
+ - **AI Skills "prototypes" are dialogue scripts**: Simulate multi-turn conversations between the user and AI, specifying AI behavior at each node
217
+ - **Hybrid products are organized by scenario**: Within the same product, CLI scenarios use terminal simulations while Web scenarios use HTML — no need for a uniform format
218
+ - **Nested Markdown code blocks**: When the document content itself contains ` ``` ` code fences (e.g., AI outputting code snippets in dialogue scripts, or nested command output in terminal simulations), **the outer fence must use 4 backticks** (` ```` `), keeping the inner fence at 3. This is standard Markdown syntax to prevent the parser from misjudging nesting levels and causing formatting issues. The CLI Tool example above demonstrates this rule.
219
+
220
+ ## Recommended Prompts
221
+
222
+ The following prompts can be copied directly for use with AI:
223
+
224
+ - `Create product design based on the requirements document`
225
+ - `Help me design the interaction flow and prototype for S01`
226
+ - `Help me create the product design for all scenarios`
227
+ - `Help me design the CLI command interaction flow`
228
+ - `Help me design the AI Skill dialogue flow`
@@ -0,0 +1,228 @@
1
+ # Skill: Product Designer
2
+
3
+ > 基于 Phase 1 需求文档中的场景,细化交互流程和功能规格,生成产品原型。原型形式根据产品类型自动适配(Web/CLI/Library 等)。场景编号与 Phase 1 保持一致。
4
+
5
+ ## 触发条件
6
+
7
+ - 用户要求写产品设计文档或功能规格
8
+ - 用户要求画原型或设计交互
9
+ - 用户提到 "Phase 2"、"产品设计层"、"WHAT"
10
+ - 已有需求文档(含场景定义),需要开始设计解决方案
11
+
12
+ ## 核心能力
13
+
14
+ 1. **识别产品类型**,确定对应的原型形式(见下方产品类型与原型策略)
15
+ 2. 设计信息架构(页面结构 / 命令结构 / API 结构)
16
+ 3. 以 Phase 1 场景为骨架,细化交互流程和功能规格
17
+ 4. 为每个场景补充交互级 GIVEN/WHEN/THEN 验收条件
18
+ 5. 生成适合产品类型的原型
19
+ 6. 当场景粒度过大时,拆分为子场景(`S01.1`, `S01.2`)
20
+
21
+ ## 产品类型与原型策略
22
+
23
+ 执行本 Skill 前,先判断产品类型(可从需求文档的约束与边界、`logos-project.yaml` 的 `tech_stack` 推断),选择对应的原型形式:
24
+
25
+ | 产品类型 | 典型特征 | 原型形式 | 交互规格重点 |
26
+ |---------|---------|---------|-------------|
27
+ | **Web 应用** | 有 UI 页面、用户登录 | HTML 可交互页面 | 页面流转、表单校验、状态变化 |
28
+ | **CLI 工具** | 终端命令、无 GUI | 终端交互示例(命令 + 输出模拟) | 命令格式、参数设计、输出格式、错误提示 |
29
+ | **AI Skills / 对话式产品** | 用户通过自然语言与 AI 交互 | 对话流程图 + 示例对话脚本 | 对话步骤、AI 提问策略、产出物格式 |
30
+ | **库 / SDK** | 被其他程序调用 | API 使用示例(代码片段) | 公开接口、参数设计、返回值、错误码 |
31
+ | **移动应用** | 手机端 UI | HTML 页面(移动视口) | 手势交互、导航模式、离线状态 |
32
+ | **混合型** | 多种交付物组合 | 按交付物分别选择对应形式 | 各交付物间的交互衔接 |
33
+
34
+ ## 执行步骤
35
+
36
+ ### Step 1: 读取需求文档,识别产品类型
37
+
38
+ 读取 Phase 1 需求文档,提取:
39
+ - 场景清单(`S01`, `S02`...)及优先级
40
+ - 约束与边界 → 判断产品类型
41
+ - `logos-project.yaml` 的 `tech_stack` → 确认技术形态
42
+
43
+ 输出产品类型判断和原型策略选择理由。
44
+
45
+ ### Step 2: 设计信息架构
46
+
47
+ 根据产品类型设计不同层面的架构:
48
+
49
+ - **Web 应用**:页面结构、导航层级、路由设计
50
+ - **CLI 工具**:命令树结构、子命令层级、全局选项
51
+ - **AI Skills**:Skill 触发关系、对话步骤编排、产出物依赖链
52
+ - **库 / SDK**:模块结构、公开 API 分组
53
+
54
+ ### Step 3: 逐场景细化交互规格
55
+
56
+ 为每个场景定义完整的交互细节(格式见下方示例)。不同产品类型侧重不同的交互维度。
57
+
58
+ ### Step 4: 补充交互级验收条件
59
+
60
+ 在 Phase 1 的 GIVEN/WHEN/THEN 基础上,细化到交互元素级别。
61
+
62
+ ### Step 5: 生成原型
63
+
64
+ 根据产品类型生成对应形式的原型(见示例)。
65
+
66
+ ### Step 6: 输出产品设计文档
67
+
68
+ 按场景组织,每个场景包含交互规格 + 对应原型。
69
+
70
+ ## 场景展开示例
71
+
72
+ ### Web 应用示例
73
+
74
+ ```markdown
75
+ ### S01: 邮箱注册 — 交互规格
76
+
77
+ **涉及页面**:注册页、邮件验证等待页、验证成功页
78
+
79
+ **交互流程**:
80
+ 1. 用户在首页点击「注册」→ 跳转注册页
81
+ 2. 注册页包含:邮箱输入框、密码输入框、确认密码输入框、注册按钮
82
+ 3. 实时校验:邮箱格式、密码长度 ≥ 8、两次密码一致
83
+ 4. 提交成功 → 跳转邮件验证等待页
84
+
85
+ #### 验收条件(交互级)
86
+
87
+ ##### 正常:成功注册
88
+ - **GIVEN** 用户在注册页面,所有字段为空
89
+ - **WHEN** 用户填写 test@example.com、密码 "Pass1234"、确认密码 "Pass1234",点击「注册」按钮
90
+ - **THEN** 「注册」按钮变为 loading 状态,1-3 秒后跳转到邮件验证等待页
91
+ ```
92
+
93
+ **原型**:`01-register-prototype.html`(可交互的 HTML 页面)
94
+
95
+ ### CLI 工具示例
96
+
97
+ ````markdown
98
+ ### S01: CLI 初始化项目 — 交互规格
99
+
100
+ **命令格式**:`openlogos init [name]`
101
+
102
+ **参数设计**:
103
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
104
+ |------|------|------|--------|------|
105
+ | name | string | 否 | 当前目录名 | 项目名称 |
106
+
107
+ **交互流程**:
108
+ 1. 用户在终端运行 `openlogos init my-project`
109
+ 2. CLI 检查 `logos/logos.config.json` 是否已存在
110
+ 3. 不存在 → 创建目录结构,逐行输出创建的文件清单
111
+ 4. 存在 → 输出错误提示并退出
112
+
113
+ **终端输出模拟**:
114
+
115
+ 正常路径:
116
+ ```
117
+ $ openlogos init my-project
118
+
119
+ Creating OpenLogos project structure...
120
+
121
+ ✓ logos/resources/prd/1-product-requirements/
122
+ ✓ logos/resources/prd/2-product-design/
123
+ ✓ logos/resources/prd/3-technical-plan/1-architecture/
124
+ ✓ logos/resources/prd/3-technical-plan/2-scenario-implementation/
125
+ ✓ logos/resources/api/
126
+ ✓ logos/resources/database/
127
+ ✓ logos/resources/scenario/
128
+ ✓ logos/changes/
129
+ ✓ logos/logos.config.json
130
+ ✓ logos/logos-project.yaml
131
+ ✓ AGENTS.md
132
+ ✓ CLAUDE.md
133
+
134
+ Project initialized. Next steps:
135
+ 1. Edit logos/logos.config.json to configure your project
136
+ 2. Start with Phase 1: tell AI "帮我写需求文档"
137
+ 3. Run `openlogos status` to check progress at any time
138
+ ```
139
+
140
+ 错误路径:
141
+ ```
142
+ $ openlogos init
143
+ Error: logos/logos.config.json already exists in current directory.
144
+ This directory has already been initialized as an OpenLogos project.
145
+ ```
146
+
147
+ #### 验收条件(交互级)
148
+
149
+ ##### 正常:全新项目
150
+ - **GIVEN** 当前目录无 `logos/logos.config.json`
151
+ - **WHEN** 用户运行 `openlogos init my-project`
152
+ - **THEN** 终端逐行输出创建的 12 个文件/目录,最后输出 "Next steps" 引导,退出码为 0
153
+
154
+ ##### 异常:已初始化
155
+ - **GIVEN** 当前目录已存在 `logos/logos.config.json`
156
+ - **WHEN** 用户运行 `openlogos init`
157
+ - **THEN** 终端输出红色错误提示,不创建任何文件,退出码为 1
158
+ ````
159
+
160
+ **原型**:`01-init-terminal.md`(终端交互模拟文档)
161
+
162
+ ### AI Skills / 对话式产品示例
163
+
164
+ ```markdown
165
+ ### S02: AI 辅助写需求文档 — 交互规格
166
+
167
+ **触发方式**:用户在 AI 编程工具中输入自然语言
168
+
169
+ **对话流程**:
170
+ 1. 用户说「帮我写需求文档」
171
+ 2. AI 读取 prd-writer Skill
172
+ 3. AI 追问:「请先告诉我你的产品定位——这个产品要解决什么人的什么问题?」
173
+ 4. 用户描述产品想法
174
+ 5. AI 追问:「核心用户是谁?能描述一个具体的人吗?」
175
+ 6. 用户描述用户画像
176
+ 7. AI 汇总信息,开始输出结构化需求文档
177
+ 8. AI 输出后询问:「需求文档初稿已生成,请 review 后告诉我需要修改的地方」
178
+
179
+ **AI 行为规范**:
180
+ - 追问不超过 3 轮,每轮聚焦 1 个关键信息
181
+ - 如果用户在第一条消息中提供了充分信息,跳过追问直接输出
182
+ - 输出的文档格式严格遵循 prd-writer 规范
183
+
184
+ #### 验收条件(交互级)
185
+
186
+ ##### 正常:信息充分
187
+ - **GIVEN** 用户在第一条消息中描述了产品定位、目标用户和核心痛点
188
+ - **WHEN** AI 开始执行 prd-writer Skill
189
+ - **THEN** AI 直接输出结构化需求文档,不进行追问
190
+
191
+ ##### 正常:信息不足
192
+ - **GIVEN** 用户只说了「帮我写需求文档」
193
+ - **WHEN** AI 开始执行 prd-writer Skill
194
+ - **THEN** AI 追问产品定位(第 1 轮)→ 用户回答 → AI 追问目标用户(第 2 轮)→ 用户回答 → AI 输出需求文档
195
+ ```
196
+
197
+ **原型**:`02-prd-writer-dialogue.md`(对话流程脚本)
198
+
199
+ ## 输出规范
200
+
201
+ - 功能规格:`logos/resources/prd/2-product-design/1-feature-specs/`
202
+ - 原型:`logos/resources/prd/2-product-design/2-page-design/`
203
+ - 设计文档与原型成对出现:`{序号}-{名称}-design.md` + `{序号}-{名称}-prototype.{ext}`
204
+ - Web 应用:`.html`
205
+ - CLI 工具:`-terminal.md`(终端交互模拟)
206
+ - AI Skills:`-dialogue.md`(对话流程脚本)
207
+ - 库 / SDK:`-api-examples.md`(使用示例)
208
+ - **场景编号必须与 Phase 1 一致**,如需拆分使用子编号(`S01.1`)
209
+
210
+ ## 实践经验
211
+
212
+ - **场景是骨架**:不要按"页面"或"命令"组织文档,按"场景"组织
213
+ - **Phase 1 的验收条件是输入**:Phase 2 不是重写验收条件,而是在 Phase 1 的基础上细化到交互元素级别
214
+ - **子场景拆分要有理由**:只在 Phase 1 的场景确实包含两条独立的交互路径时才拆分
215
+ - **CLI 的"原型"是终端输出模拟**:不需要 HTML,用代码块模拟终端的输入输出即可
216
+ - **AI Skills 的"原型"是对话脚本**:模拟用户和 AI 的多轮对话,明确 AI 在每个节点的行为
217
+ - **混合型产品按场景分**:同一个产品中 CLI 场景用终端模拟、Web 场景用 HTML,不需要统一形式
218
+ - **Markdown 嵌套代码块**:当文档内容本身包含 ` ``` ` 代码围栏时(如对话脚本中 AI 输出代码片段、终端模拟中嵌套命令输出),**外层围栏必须使用 4 个反引号**(` ```` `),内层保持 3 个。这是 Markdown 标准语法,避免解析器误判层级导致格式错乱。上方 CLI 工具示例已体现此规则
219
+
220
+ ## 推荐提示词
221
+
222
+ 以下提示词可以直接复制给 AI 使用:
223
+
224
+ - `基于需求文档做产品设计`
225
+ - `帮我设计 S01 的交互流程和原型`
226
+ - `帮我把所有场景的产品设计做出来`
227
+ - `帮我设计 CLI 命令的交互流程`
228
+ - `帮我设计 AI Skill 的对话流程`
@@ -0,0 +1,163 @@
1
+ # Skill: Project Init
2
+
3
+ > Initialize a project structure following the OpenLogos methodology, generating configuration files, AI instruction files, and standard directories.
4
+
5
+ ## Trigger Conditions
6
+
7
+ - User requests creating a new project or initializing a project structure
8
+ - User mentions "openlogos init" or "initialize project"
9
+ - No `logos/logos.config.json` exists in the current directory
10
+
11
+ ## Core Capabilities
12
+
13
+ 1. Create the `logos/` directory and its standard substructure
14
+ 2. Generate the `logos/logos.config.json` configuration file
15
+ 3. Generate the `logos/logos-project.yaml` AI collaboration index
16
+ 4. Generate `AGENTS.md` / `CLAUDE.md` AI instruction files (in the root directory)
17
+ 5. Create the `logos/changes/` change management directory
18
+
19
+ ## Execution Steps
20
+
21
+ ### Step 1: Gather Project Information
22
+
23
+ Confirm the following information with the user:
24
+
25
+ - **Project name**: Used for the `name` field in `logos/logos.config.json`
26
+ - **Project description**: A one-sentence description
27
+ - **Tech stack**: Main framework, language, database, deployment platform
28
+ - **Document modules**: Whether additional modules are needed beyond the default prd/api/scenario/database
29
+
30
+ If the user does not provide these, use reasonable defaults.
31
+
32
+ ### Step 2: Create Directory Structure
33
+
34
+ ```
35
+ project-root/
36
+ └── logos/
37
+ ├── resources/
38
+ │ ├── prd/
39
+ │ │ ├── 1-product-requirements/
40
+ │ │ ├── 2-product-design/
41
+ │ │ │ ├── 1-feature-specs/
42
+ │ │ │ └── 2-page-design/
43
+ │ │ └── 3-technical-plan/
44
+ │ │ ├── 1-architecture/
45
+ │ │ └── 2-scenario-implementation/
46
+ │ ├── api/
47
+ │ ├── database/
48
+ │ └── scenario/
49
+ └── changes/
50
+ ```
51
+
52
+ ### Step 3: Generate logos/logos.config.json
53
+
54
+ ```json
55
+ {
56
+ "name": "{project name}",
57
+ "description": "{project description}",
58
+ "documents": {
59
+ "prd": {
60
+ "label": { "en": "Product Docs", "zh": "产品文档" },
61
+ "path": "./resources/prd",
62
+ "pattern": "**/*.{md,html,htm,pdf}"
63
+ },
64
+ "api": {
65
+ "label": { "en": "API Docs", "zh": "API 文档" },
66
+ "path": "./resources/api",
67
+ "pattern": "**/*.{yaml,yml,json}"
68
+ },
69
+ "scenario": {
70
+ "label": { "en": "Scenarios", "zh": "业务场景" },
71
+ "path": "./resources/scenario",
72
+ "pattern": "**/*.json"
73
+ },
74
+ "database": {
75
+ "label": { "en": "Database", "zh": "数据库" },
76
+ "path": "./resources/database",
77
+ "pattern": "**/*.sql"
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ > The `path` field is relative to the directory where `logos.config.json` itself resides (i.e., `logos/`), so `./resources/prd` points to `logos/resources/prd`.
84
+
85
+ ### Step 4: Generate logos/logos-project.yaml
86
+
87
+ ```yaml
88
+ project:
89
+ name: "{project name}"
90
+ description: "{project description}"
91
+ methodology: "OpenLogos"
92
+
93
+ tech_stack:
94
+ framework: "{framework provided by user}"
95
+ language: "{language provided by user}"
96
+ # ... populate based on user-provided information
97
+
98
+ resource_index: []
99
+ # Initially empty; entries are added incrementally as documents are produced
100
+
101
+ conventions:
102
+ - "Follow the OpenLogos three-layer progression model (Why → What → How)"
103
+ - "Every change must first create a change proposal in logos/changes/"
104
+ ```
105
+
106
+ ### Step 5: Generate AGENTS.md (Root Directory)
107
+
108
+ Generate AGENTS.md based on the content from Step 3 and Step 4, placed in the **project root directory**:
109
+
110
+ ```markdown
111
+ # AI Assistant Instructions
112
+
113
+ This project follows the **OpenLogos** methodology.
114
+ Read `logos/logos-project.yaml` first to understand the project resource index.
115
+
116
+ ## Project Context
117
+ - Config: `logos/logos.config.json`
118
+ - Resource Index: `logos/logos-project.yaml`
119
+ - Tech Stack: {extracted from logos-project.yaml}
120
+
121
+ ## Methodology Rules
122
+ 1. Never write code without first completing the design documents
123
+ 2. Follow the Why → What → How progression
124
+ 3. All API designs must originate from scenario sequence diagrams
125
+ 4. All code changes must have corresponding API orchestration tests
126
+ 5. Use the Delta change workflow for iterations (see logos/changes/ directory)
127
+
128
+ ## Conventions
129
+ {extracted from conventions in logos-project.yaml}
130
+ ```
131
+
132
+ Also generate `CLAUDE.md` with identical content to AGENTS.md.
133
+
134
+ ### Step 6: Output Initialization Report
135
+
136
+ Report to the user which files and directories were created, and provide next-step suggestions:
137
+
138
+ 1. Edit `logos/logos.config.json` to refine the project configuration
139
+ 2. Start with Phase 1: Write the requirements document
140
+ 3. Use the `prd-writer` Skill to assist with writing
141
+
142
+ ## Output Specification
143
+
144
+ - `logos/logos.config.json`: Valid JSON, conforming to `spec/logos.config.schema.json`
145
+ - `logos/logos-project.yaml`: Valid YAML
146
+ - `AGENTS.md` / `CLAUDE.md`: Markdown format, located in the project root directory
147
+ - All directories under `logos/` are created; empty directories contain `.gitkeep`
148
+
149
+ ## Best Practices
150
+
151
+ - **Don't over-configure**: Keep configuration minimal during initialization; let users refine it gradually during use
152
+ - **resource_index starts empty**: Add entries as documents are produced, avoiding meaningless placeholder content
153
+ - **Keep AGENTS.md concise**: Only include project-specific information; use fixed templates for universal methodology rules
154
+ - **Prioritize creating the directory structure**: The `logos/` directory structure is the first step in adopting the methodology — more important than any document
155
+ - **Low intrusiveness**: All methodology assets are contained within `logos/`, keeping the project's own structure clean
156
+
157
+ ## Recommended Prompts
158
+
159
+ The following prompts can be copied directly for use with AI:
160
+
161
+ - `Help me initialize an OpenLogos project`
162
+ - `Initialize this project with OpenLogos, the project name is xxx`
163
+ - `Help me integrate OpenLogos into an existing project`