@miniidealab/openlogos 0.3.0 → 0.3.2
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.
- package/dist/commands/init.d.ts +2 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +112 -8
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/sync.js +1 -1
- package/dist/commands/sync.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/skills/api-designer/SKILL.en.md +209 -0
- package/skills/architecture-designer/SKILL.en.md +181 -0
- package/skills/change-writer/SKILL.en.md +146 -0
- package/skills/code-reviewer/SKILL.en.md +204 -0
- package/skills/db-designer/SKILL.en.md +212 -0
- package/skills/merge-executor/SKILL.en.md +84 -0
- package/skills/prd-writer/SKILL.en.md +171 -0
- package/skills/product-designer/SKILL.en.md +228 -0
- package/skills/project-init/SKILL.en.md +163 -0
- package/skills/scenario-architect/SKILL.en.md +214 -0
- package/skills/test-orchestrator/SKILL.en.md +142 -0
- package/skills/test-writer/SKILL.en.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,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`
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Skill: Scenario Architect
|
|
2
|
+
|
|
3
|
+
> Expand business scenarios defined in Phase 1/2 into technical sequence diagrams, letting API design emerge naturally, and design comprehensive exception cases. Scenario numbering follows Phase 1 definitions.
|
|
4
|
+
|
|
5
|
+
## Trigger Conditions
|
|
6
|
+
|
|
7
|
+
- User requests drawing sequence diagrams, designing business scenarios, or performing scenario modeling
|
|
8
|
+
- User mentions "Phase 3 Step 1", "scenario-driven", "technical plan design"
|
|
9
|
+
- Requirements documents and product design documents (with scenario definitions) already exist, ready to begin technical implementation
|
|
10
|
+
- User specifies a particular scenario number (e.g., S01) to be expanded into a sequence diagram
|
|
11
|
+
|
|
12
|
+
## Core Capabilities
|
|
13
|
+
|
|
14
|
+
1. Read scenario definitions and acceptance criteria from Phase 1/2 as input for sequence diagrams
|
|
15
|
+
2. Draw Mermaid sequence diagrams for each scenario (strictly following numbering conventions)
|
|
16
|
+
3. Write explanatory notes for key steps (explaining "why" rather than "what")
|
|
17
|
+
4. Identify exception conditions for each step and design structured exception cases
|
|
18
|
+
5. Generate scenario overview documents (scenario map + scenario index)
|
|
19
|
+
|
|
20
|
+
## Linking with Phase 1/2
|
|
21
|
+
|
|
22
|
+
**Phase 3 does not identify scenarios from scratch.** Scenarios are defined in Phase 1 (`S01`, `S02`...), interaction flows are refined in Phase 2, and technical architecture and technology choices are established in Step 0. The job of Phase 3 Step 1 is to expand the same scenario from an "interaction perspective" into a "technical perspective". The participants in the sequence diagram should align with the system components in the architecture diagram:
|
|
23
|
+
|
|
24
|
+
| Input (from Phase 1/2) | Output (Phase 3) |
|
|
25
|
+
|------------------------|----------------|
|
|
26
|
+
| Scenario number and name | Sequence diagram title retains the number |
|
|
27
|
+
| Trigger conditions | Starting arrow of the sequence diagram |
|
|
28
|
+
| Main path description | Step sequence in the sequence diagram |
|
|
29
|
+
| GIVEN/WHEN/THEN (business level) | Behavior description of sequence diagram steps |
|
|
30
|
+
| Exception acceptance criteria | EX exception cases (technical level) |
|
|
31
|
+
| Pages and interactions involved (Phase 2) | Participant identification |
|
|
32
|
+
|
|
33
|
+
## Execution Steps
|
|
34
|
+
|
|
35
|
+
### Step 1: Load Scenario Context
|
|
36
|
+
|
|
37
|
+
Read scenario definitions from the Phase 1 requirements document, Phase 2 product design document, and Phase 3 Step 0 technical architecture summary. **Do not reinvent scenarios**—directly reuse existing numbers and descriptions. Participant naming should be consistent with the system components in the architecture diagram.
|
|
38
|
+
|
|
39
|
+
Confirm the following for each scenario:
|
|
40
|
+
- **Scenario number**: Reuse Phase 1's `S01`, `S02`... (or Phase 2 sub-scenarios `S01.1`)
|
|
41
|
+
- **Participants**: Identify which system components are involved from Phase 2's interaction flows
|
|
42
|
+
- **Main path**: Extract the normal flow from Phase 1/2 acceptance criteria
|
|
43
|
+
- **Known exceptions**: Extract from Phase 1/2 exception acceptance criteria
|
|
44
|
+
|
|
45
|
+
### Step 2: Draw Sequence Diagrams
|
|
46
|
+
|
|
47
|
+
Draw Mermaid sequence diagrams for each scenario, **strictly following these conventions**:
|
|
48
|
+
|
|
49
|
+
**Numbering conventions**:
|
|
50
|
+
- Every arrow must have a `Step N:` number prefix
|
|
51
|
+
- Numbering starts at 1 and increments consecutively
|
|
52
|
+
- Each arrow includes a one-line behavior description: `HTTP_METHOD /api/path — brief explanation`
|
|
53
|
+
|
|
54
|
+
**Participant conventions**:
|
|
55
|
+
- Use short aliases: `U` (User/Browser), `W` (Web/Frontend), `SB` (Supabase), `DB` (Database)
|
|
56
|
+
- Full name for each participant is noted in the `participant` declaration
|
|
57
|
+
|
|
58
|
+
**Scenario numbering conventions**:
|
|
59
|
+
- Document title format: `S01: Email Registration — Sequence Diagram`
|
|
60
|
+
- One scenario per file, numbered to correspond with Phase 1
|
|
61
|
+
|
|
62
|
+
**Format example**:
|
|
63
|
+
|
|
64
|
+
```mermaid
|
|
65
|
+
sequenceDiagram
|
|
66
|
+
participant U as User/Browser
|
|
67
|
+
participant W as Web (Astro)
|
|
68
|
+
participant SB as Supabase Auth
|
|
69
|
+
participant DB as Supabase DB
|
|
70
|
+
|
|
71
|
+
U->>W: Step 1: POST /api/auth/register — Submit {email, password, referral_code?}
|
|
72
|
+
W->>SB: Step 2: supabase.auth.signUp(email, password, metadata) — Initiate user creation
|
|
73
|
+
SB-->>W: Step 3: Return {user, session} or error
|
|
74
|
+
W->>DB: Step 4: INSERT INTO profiles — Write user extended info
|
|
75
|
+
DB-->>W: Step 5: Return write result
|
|
76
|
+
W-->>U: Step 6: Return registration result + prompt to verify email
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Step 3: Write Step Narratives
|
|
80
|
+
|
|
81
|
+
After the sequence diagram, use a **consecutively numbered list** to write out all steps one by one, forming a linear narrative that humans can read fluently from start to finish.
|
|
82
|
+
|
|
83
|
+
**Format conventions**:
|
|
84
|
+
|
|
85
|
+
1. **Every step must be written out**—no skipping, no omitting. Simple steps can be covered in one line; complex steps are elaborated below using `>` blockquote
|
|
86
|
+
2. **Every step must have a clear subject**—the reader should never have to guess "who is doing this". Use the alias or full name from the participant table as the subject
|
|
87
|
+
3. **Numbering strictly corresponds to the Step N in the sequence diagram**
|
|
88
|
+
4. **Normal flow and exception cases are written separately**—normal flow comes first, exception cases follow. In the normal flow, only add `→ see EX-N.M` references after steps that trigger exceptions; do not expand exception content inline
|
|
89
|
+
|
|
90
|
+
**Normal flow format example**:
|
|
91
|
+
|
|
92
|
+
````markdown
|
|
93
|
+
## Step Descriptions
|
|
94
|
+
|
|
95
|
+
1. **Developer** enters `openlogos init my-project` in the terminal.
|
|
96
|
+
2. **CLI** checks whether `logos/logos.config.json` already exists. If it exists → see EX-2.1.
|
|
97
|
+
3. **CLI** displays a language selection menu in the terminal (1. English / 2. 中文). If the terminal is non-TTY → see EX-3.1.
|
|
98
|
+
|
|
99
|
+
> Language selection is placed in the `init` phase (rather than global configuration) because this is the user's first interaction with OpenLogos, making it the most natural moment to confirm language preference.
|
|
100
|
+
|
|
101
|
+
4. **Developer** selects a language (enters 1 or 2).
|
|
102
|
+
5. **CLI** detects the project name from `package.json` / `Cargo.toml` / `pyproject.toml` / directory name. If the user-provided name conflicts with the config file name → see EX-5.1.
|
|
103
|
+
|
|
104
|
+
> Priority chain: CLI argument > package.json > Cargo.toml > pyproject.toml > directory name. Scoped names automatically strip the `@org/` prefix.
|
|
105
|
+
|
|
106
|
+
6. **CLI** creates 11 directories in sequence (`logos/resources/prd/...` etc.), writing `.gitkeep` to each.
|
|
107
|
+
7. **CLI** writes `logos/logos.config.json` (containing locale + 5 document module definitions).
|
|
108
|
+
8. **CLI** writes `logos/logos-project.yaml` (containing empty tech_stack + conventions).
|
|
109
|
+
9. **CLI** writes `AGENTS.md` and `CLAUDE.md` (containing Phase detection logic).
|
|
110
|
+
10. **CLI** outputs the list of created files and next-step suggestions in the terminal.
|
|
111
|
+
````
|
|
112
|
+
|
|
113
|
+
**Exception case format example**:
|
|
114
|
+
|
|
115
|
+
````markdown
|
|
116
|
+
## Exception Cases
|
|
117
|
+
|
|
118
|
+
### EX-2.1: Project Already Initialized
|
|
119
|
+
|
|
120
|
+
- **Trigger condition**: Step 2 detects that `logos/logos.config.json` already exists
|
|
121
|
+
- **Expected response**: stderr outputs `Error: logos/logos.config.json already exists in current directory.`, exit(1)
|
|
122
|
+
- **Side effects**: No files created, existing configuration not overwritten
|
|
123
|
+
|
|
124
|
+
### EX-3.1: Non-TTY Environment
|
|
125
|
+
|
|
126
|
+
- **Trigger condition**: Step 3 detects that `process.stdin.isTTY` is false (CI pipeline / piped input)
|
|
127
|
+
- **Expected response**: Skip language selection interaction, default to `locale = 'en'`
|
|
128
|
+
- **Side effects**: None, flow proceeds directly to Step 5
|
|
129
|
+
|
|
130
|
+
### EX-5.1: Project Name Conflict
|
|
131
|
+
|
|
132
|
+
- **Trigger condition**: In Step 5, the user-provided `name` differs from the name in `package.json` (or other config files)
|
|
133
|
+
- **Expected response**: Display two options for the user to choose from; in non-TTY environments, automatically use the user-provided name
|
|
134
|
+
- **Side effects**: None, flow continues to Step 6 after selection
|
|
135
|
+
````
|
|
136
|
+
|
|
137
|
+
**Narrative principles**:
|
|
138
|
+
- **No skipping steps**: Even if a step is worth only one line (e.g., "CLI writes file"), it must still be written out to maintain consecutive numbering
|
|
139
|
+
- **Subject first**: Each step begins with a bold subject, so the reader can immediately see "who is acting"
|
|
140
|
+
- **Use blockquotes for supplementary notes**: When you need to explain "why" or document a design decision, expand below the step using `>` blockquote without disrupting reading flow
|
|
141
|
+
- **Exception cases as separate sections**: Normal flow only contains `→ see EX-N.M` references; the trigger conditions, expected responses, and side effects of exceptions are expanded in the "Exception Cases" section at the bottom of the document
|
|
142
|
+
|
|
143
|
+
### Step 4: Design Exception Cases
|
|
144
|
+
|
|
145
|
+
Expand exception acceptance criteria identified in Phase 1/2 into technical-level exception cases, and supplement with technical exceptions not covered in Phase 1/2 (e.g., service unavailable, database write failure):
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
#### Exception Cases
|
|
149
|
+
|
|
150
|
+
##### EX-2.1: Email Already Registered (← Phase 1 S01 exception acceptance criteria)
|
|
151
|
+
- **Trigger condition**: Submitted email already exists in the auth.users table
|
|
152
|
+
- **Expected response**: HTTP 409 `{ code: "EMAIL_EXISTS", message: "Email already registered" }`
|
|
153
|
+
- **Side effects**: No records created, no emails sent
|
|
154
|
+
|
|
155
|
+
##### EX-2.2: Supabase Auth Service Unavailable (technical exception, not covered in Phase 1)
|
|
156
|
+
- **Trigger condition**: Supabase Auth service times out or returns 5xx
|
|
157
|
+
- **Expected response**: HTTP 503 `{ code: "AUTH_SERVICE_UNAVAILABLE", message: "Authentication service temporarily unavailable" }`
|
|
158
|
+
- **Side effects**: Error logged, alert triggered
|
|
159
|
+
|
|
160
|
+
##### EX-4.1: Profile Write Failure (technical exception, not covered in Phase 1)
|
|
161
|
+
- **Trigger condition**: INSERT INTO profiles violates unique constraint or RLS denies access
|
|
162
|
+
- **Expected response**: HTTP 500 `{ code: "PROFILE_CREATE_FAILED", message: "User profile creation failed" }`
|
|
163
|
+
- **Side effects**: Record in auth.users already created but profiles not created (compensation mechanism needed)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Exception case numbering rule**: `EX-{step number}.{sequence number}`
|
|
167
|
+
|
|
168
|
+
### Step 5: Generate Scenario Overview Document
|
|
169
|
+
|
|
170
|
+
Summarize the technical implementation status of all scenarios:
|
|
171
|
+
|
|
172
|
+
```markdown
|
|
173
|
+
# Business Scenario Overview (Technical Implementation)
|
|
174
|
+
|
|
175
|
+
## Scenario Map
|
|
176
|
+
| Number | Scenario Name | Phase 1 | Phase 2 | Phase 3 Sequence Diagram | API | Orchestration | Status |
|
|
177
|
+
|--------|--------------|---------|---------|--------------------------|-----|---------------|--------|
|
|
178
|
+
| S01 | Email Registration | ✅ | ✅ | ✅ | ✅ | 🔲 | In Progress |
|
|
179
|
+
| S02 | Password Login | ✅ | ✅ | 🔲 | 🔲 | 🔲 | Not Started |
|
|
180
|
+
|
|
181
|
+
## Scenario Dependencies
|
|
182
|
+
[Describe prerequisite/follow-up relationships between scenarios]
|
|
183
|
+
|
|
184
|
+
## Scenario Index
|
|
185
|
+
[File links for each scenario, spanning all three Phases]
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Output Specification
|
|
189
|
+
|
|
190
|
+
- **Scenario overview**: `logos/resources/prd/3-technical-plan/2-scenario-implementation/00-scenario-overview.md`
|
|
191
|
+
- **Scenario documents**: `logos/resources/prd/3-technical-plan/2-scenario-implementation/{scenario-number}-{scenario-name}.md`
|
|
192
|
+
- Sequence diagrams use Mermaid format (renderable directly in Markdown)
|
|
193
|
+
- Exception cases use `EX-N.M` numbering, globally unique
|
|
194
|
+
- Each scenario document contains: sequence diagram + step descriptions + exception cases
|
|
195
|
+
- **Scenario numbers must be consistent with Phase 1/2**
|
|
196
|
+
|
|
197
|
+
## Best Practices
|
|
198
|
+
|
|
199
|
+
- **Do not identify scenarios from scratch**: Phase 3 scenarios come from Phase 1 requirements documents. If a scenario not present in Phase 1 is discovered, go back to Phase 1 to add it
|
|
200
|
+
- **Phase 1/2 exceptions are inputs**: Phase 1's "exception: email already registered" should be expanded in Phase 3 into a technical specification with HTTP status codes and response bodies
|
|
201
|
+
- **Draw the main path first, then add exceptions**: Do not try to draw all branches in the first pass; get the main path clear first
|
|
202
|
+
- **Exception case coverage strategy**: Every step involving an external call (database, third-party service) should have at least 1 exception case
|
|
203
|
+
- **Step numbering maintenance**: When inserting a step in the middle, renumber all subsequent steps and update all EX references accordingly
|
|
204
|
+
- **Participant granularity**: In microservice architectures, each service is a participant; in monolithic applications, divide by logical layers (Web, Auth, DB)
|
|
205
|
+
- **Sequence diagrams are the source of APIs**: Cross-system-boundary arrows in sequence diagrams are the APIs that need to be designed—if an API cannot be traced back to a sequence diagram, it probably should not exist
|
|
206
|
+
|
|
207
|
+
## Recommended Prompts
|
|
208
|
+
|
|
209
|
+
The following prompts can be copied directly for AI use:
|
|
210
|
+
|
|
211
|
+
- `Help me draw the sequence diagram for S01`
|
|
212
|
+
- `Help me do scenario modeling for all P0 scenarios`
|
|
213
|
+
- `Help me add exception case sequence diagrams for S03`
|
|
214
|
+
- `Based on the product design, help me do technical scenario modeling`
|