/openlogos:scenario-architectfrom openlogos
Expands business scenarios from product requirements into Mermaid sequence diagrams with API calls, exception cases, and explanatory notes. Links scenario definitions to technical architecture components.
Ships in openlogos. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
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:
| Input (from Phase 1/2) | Output (Phase 3) |
|---|---|
| Scenario number and name | Sequence diagram title retains the number |
| Trigger conditions | Starting arrow of the sequence diagram |
| Main path description | Step sequence in the sequence diagram |
| GIVEN/WHEN/THEN (business level) | Behavior description of sequence diagram steps |
| Exception acceptance criteria | EX exception cases (technical level) |
| Pages and interactions involved (Phase 2) | Participant identification |
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.
Scenario Granularity Pre-Check (before drawing any sequence diagram):
Before proceeding, verify that the scenario definitions from Phase 1 have proper granularity. Check for these anti-patterns:
POST /api/tasks), it is too fine-grainedIf any anti-pattern is detected: Stop and recommend returning to Phase 1 to re-organize scenarios by business goals before drawing sequence diagrams. Drawing sequence diagrams for overly fine-grained scenarios will propagate the problem to API design, test cases, and code.
Confirm the following for each scenario:
S01, S02... (or Phase 2 sub-scenarios S01.1)Draw Mermaid sequence diagrams for each scenario, strictly following these conventions:
Numbering conventions:
Step N: number prefixHTTP_METHOD /api/path — brief explanation⚠️ Single-line constraint (required):
->> or -->>) must stay on one line; do not insert line breaks inside the message text.⚠️ Mermaid sequenceDiagram syntax safety (required):
U, W, API, or DB; do not put /, spaces, parentheses, or Chinese text in aliases.participant <alias> as <display name> display names short. Put complex technology stacks, ports, API paths, and extra explanations in the step narrative below the diagram.POST /api/path is fine, but multi-line JSON, long error bodies, HTML, Markdown tables, or deeply nested parentheses should not appear in Mermaid messages.Participant conventions:
U (User/Browser), W (Web/Frontend), SB (Supabase), DB (Database)participant declarationScenario numbering conventions:
S01: Email Registration — Sequence DiagramFormat example:
sequenceDiagram
participant U as User/Browser
participant W as Web (Astro)
participant SB as Supabase Auth
participant DB as Supabase DB
U->>W: Step 1: POST /api/auth/register — Submit {email, password, referral_code?}
W->>SB: Step 2: supabase.auth.signUp(email, password, metadata) — Initiate user creation
SB-->>W: Step 3: Return {user, session} or error
W->>DB: Step 4: INSERT INTO profiles — Write user extended info
DB-->>W: Step 5: Return write result
W-->>U: Step 6: Return registration result + prompt to verify email
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.
Format conventions:
> blockquote→ see EX-N.M references after steps that trigger exceptions; do not expand exception content inlineNormal flow format example:
## Step Descriptions
1. **Developer** enters `openlogos init my-project` in the terminal.
2. **CLI** checks whether `logos/logos.config.json` already exists. If it exists → see EX-2.1.
3. **CLI** displays a language selection menu in the terminal (1. English / 2. 中文). If the terminal is non-TTY → see EX-3.1.
> 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.
4. **Developer** selects a language (enters 1 or 2).
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.
> Priority chain: CLI argument > package.json > Cargo.toml > pyproject.toml > directory name. Scoped names automatically strip the `@org/` prefix.
6. **CLI** creates 11 directories in sequence (`logos/resources/prd/...` etc.), writing `.gitkeep` to each.
7. **CLI** writes `logos/logos.config.json` (containing locale + 5 document module definitions).
8. **CLI** writes `logos/logos-project.yaml` (containing empty tech_stack + conventions).
9. **CLI** writes `AGENTS.md` and `CLAUDE.md` (containing Phase detection logic).
10. **CLI** outputs the list of created files and next-step suggestions in the terminal.
Exception case format example:
## Exception Cases
### EX-2.1: Project Already Initialized
- **Trigger condition**: Step 2 detects that `logos/logos.config.json` already exists
- **Expected response**: stderr outputs `Error: logos/logos.config.json already exists in current directory.`, exit(1)
- **Side effects**: No files created, existing configuration not overwritten
### EX-3.1: Non-TTY Environment
- **Trigger condition**: Step 3 detects that `process.stdin.isTTY` is false (CI pipeline / piped input)
- **Expected response**: Skip language selection interaction, default to `locale = 'en'`
- **Side effects**: None, flow proceeds directly to Step 5
### EX-5.1: Project Name Conflict
- **Trigger condition**: In Step 5, the user-provided `name` differs from the name in `package.json` (or other config files)
- **Expected response**: Display two options for the user to choose from; in non-TTY environments, automatically use the user-provided name
- **Side effects**: None, flow continues to Step 6 after selection
Narrative principles:
> blockquote without disrupting reading flow→ 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 documentExpand 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):
#### Exception Cases
##### EX-2.1: Email Already Registered (← Phase 1 S01 exception acceptance criteria)
- **Trigger condition**: Submitted email already exists in the auth.users table
- **Expected response**: HTTP 409 `{ code: "EMAIL_EXISTS", message: "Email already registered" }`
- **Side effects**: No records created, no emails sent
##### EX-2.2: Supabase Auth Service Unavailable (technical exception, not covered in Phase 1)
- **Trigger condition**: Supabase Auth service times out or returns 5xx
- **Expected response**: HTTP 503 `{ code: "AUTH_SERVICE_UNAVAILABLE", message: "Authentication service temporarily unavailable" }`
- **Side effects**: Error logged, alert triggered
##### EX-4.1: Profile Write Failure (technical exception, not covered in Phase 1)
- **Trigger condition**: INSERT INTO profiles violates unique constraint or RLS denies access
- **Expected response**: HTTP 500 `{ code: "PROFILE_CREATE_FAILED", message: "User profile creation failed" }`
- **Side effects**: Record in auth.users already created but profiles not created (compensation mechanism needed)
Exception case numbering rule: EX-{step number}.{sequence number}
Summarize the technical implementation status of all scenarios:
# Business Scenario Overview (Technical Implementation)
## Scenario Map
| Number | Scenario Name | Phase 1 | Phase 2 | Phase 3 Sequence Diagram | API | Orchestration | Status |
|--------|--------------|---------|---------|--------------------------|-----|---------------|--------|
| S01 | Email Registration | ✅ | ✅ | ✅ | ✅ | 🔲 | In Progress |
| S02 | Password Login | ✅ | ✅ | 🔲 | 🔲 | 🔲 | Not Started |
## Scenario Dependencies
[Describe prerequisite/follow-up relationships between scenarios]
## Scenario Index
[File links for each scenario, spanning all three Phases]
logos/resources/prd/3-technical-plan/2-scenario-implementation/core-00-scenario-overview.mdlogos/resources/prd/3-technical-plan/2-scenario-implementation/<module>-{scenario-number}-{scenario-name}.md (read current module from modules[] in logos-project.yaml, default is core; read scenario_counter.next_id before generating, increment and write back immediately after)EX-N.M numbering, globally uniqueThe following prompts can be copied directly for AI use:
Help me draw the sequence diagram for S01Help me do scenario modeling for all P0 scenariosHelp me add exception case sequence diagrams for S03Based on the product design, help me do technical scenario modeling先读取 spec/authority-closure.md 与项目 Authority Registry。场景只引用稳定 fact_id,不从代码、文件名或参与者名称推断 owner。
sequence diagram 必须区分 command、mutation entry、authority write/read、projection refresh、consumer decision 与 recovery;projection 消息标注 freshness identity。若两个参与者都能直接 write canonical state 或给出最终 decision,停止场景交付并回退 architecture-designer。
异常路径至少包含 stale projection、conflicting old copy、response lost/restart 和 legacy writer。恢复从 authority/receipt 开始;禁止把目录扫描、mtime、marker 存在性或 stale cache 画成权威 fallback。追溯必须连接 fact_id、AC 条款和真实 UT/ST。
What SKILL.md sets; muted values are Claude Code's defaults
16 skills in this plugin
/api-designerDesign OpenAPI specifications derived from scenario sequence diagrams. Use when scenarios exist in 2-scenario-implementation/ but logos/resources/api/ is empty. All description and summary values in YAML must be double-quoted./architecture-designerDesign technical architecture and select technology stack. Use when product design exists in logos/resources/prd/2-product-design/ but logos/resources/prd/3-technical-plan/1-architecture/ is empty./change-writerWrite change proposals with impact analysis following OpenLogos delta workflow. Use when the project lifecycle is active and source code or methodology documents need modification.npx claudepluginhub miniidealab/openlogos --plugin openlogosOther plugins' skills for the same job