opencodekit 0.15.21 → 0.16.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 (144) hide show
  1. package/dist/index.js +5 -7
  2. package/dist/template/.opencode/AGENTS.md +85 -23
  3. package/dist/template/.opencode/agent/build.md +88 -7
  4. package/dist/template/.opencode/agent/explore.md +1 -1
  5. package/dist/template/.opencode/agent/general.md +54 -4
  6. package/dist/template/.opencode/agent/looker.md +1 -1
  7. package/dist/template/.opencode/agent/painter.md +1 -1
  8. package/dist/template/.opencode/agent/plan.md +52 -0
  9. package/dist/template/.opencode/agent/review.md +1 -1
  10. package/dist/template/.opencode/agent/scout.md +3 -3
  11. package/dist/template/.opencode/agent/vision.md +1 -1
  12. package/dist/template/.opencode/command/create.md +231 -91
  13. package/dist/template/.opencode/command/design.md +40 -7
  14. package/dist/template/.opencode/command/handoff.md +22 -0
  15. package/dist/template/.opencode/command/init.md +49 -78
  16. package/dist/template/.opencode/command/plan.md +36 -16
  17. package/dist/template/.opencode/command/pr.md +15 -0
  18. package/dist/template/.opencode/command/research.md +3 -0
  19. package/dist/template/.opencode/command/resume.md +8 -18
  20. package/dist/template/.opencode/command/review-codebase.md +30 -0
  21. package/dist/template/.opencode/command/ship.md +199 -0
  22. package/dist/template/.opencode/command/start.md +316 -28
  23. package/dist/template/.opencode/command/status.md +24 -1
  24. package/dist/template/.opencode/command/ui-review.md +36 -7
  25. package/dist/template/.opencode/command/verify.md +307 -0
  26. package/dist/template/.opencode/memory/_templates/prd.md +29 -0
  27. package/dist/template/.opencode/memory/_templates/proposal.md +38 -0
  28. package/dist/template/.opencode/memory/_templates/spec.md +66 -0
  29. package/dist/template/.opencode/memory/_templates/tasks.md +198 -0
  30. package/dist/template/.opencode/memory/_templates/tech-stack.md +50 -0
  31. package/dist/template/.opencode/memory/project/tech-stack.md +53 -0
  32. package/dist/template/.opencode/memory/research/ccpm-analysis.md +334 -0
  33. package/dist/template/.opencode/memory/research/openspec-analysis.md +226 -0
  34. package/dist/template/.opencode/memory.db +0 -0
  35. package/dist/template/.opencode/memory.db-shm +0 -0
  36. package/dist/template/.opencode/memory.db-wal +0 -0
  37. package/dist/template/.opencode/opencode.json +18 -4
  38. package/dist/template/.opencode/package.json +1 -0
  39. package/dist/template/.opencode/plans/1770006237537-mighty-otter.md +418 -0
  40. package/dist/template/.opencode/plans/1770006913647-glowing-forest.md +170 -0
  41. package/dist/template/.opencode/plans/1770013678126-witty-planet.md +278 -0
  42. package/dist/template/.opencode/plugin/lib/memory-db.ts +828 -0
  43. package/dist/template/.opencode/plugin/memory.ts +38 -1
  44. package/dist/template/.opencode/skill/index-knowledge/SKILL.md +76 -31
  45. package/dist/template/.opencode/skill/memory-system/SKILL.md +110 -55
  46. package/dist/template/.opencode/skill/tool-priority/SKILL.md +2 -2
  47. package/dist/template/.opencode/tool/memory-get.ts +143 -0
  48. package/dist/template/.opencode/tool/memory-maintain.ts +167 -0
  49. package/dist/template/.opencode/tool/memory-migrate.ts +319 -0
  50. package/dist/template/.opencode/tool/memory-read.ts +17 -46
  51. package/dist/template/.opencode/tool/memory-search.ts +131 -28
  52. package/dist/template/.opencode/tool/memory-timeline.ts +105 -0
  53. package/dist/template/.opencode/tool/memory-update.ts +21 -26
  54. package/dist/template/.opencode/tool/observation.ts +112 -100
  55. package/dist/template/.opencode/tsconfig.json +19 -19
  56. package/package.json +1 -1
  57. package/dist/template/.opencode/command/accessibility-check.md +0 -331
  58. package/dist/template/.opencode/command/agent-browser.md +0 -21
  59. package/dist/template/.opencode/command/analyze-mockup.md +0 -423
  60. package/dist/template/.opencode/command/analyze-project.md +0 -295
  61. package/dist/template/.opencode/command/brainstorm.md +0 -373
  62. package/dist/template/.opencode/command/cloudflare.md +0 -70
  63. package/dist/template/.opencode/command/commit.md +0 -245
  64. package/dist/template/.opencode/command/complete-next-task.md +0 -77
  65. package/dist/template/.opencode/command/design-audit.md +0 -480
  66. package/dist/template/.opencode/command/edit-image.md +0 -242
  67. package/dist/template/.opencode/command/finish.md +0 -255
  68. package/dist/template/.opencode/command/fix-ci.md +0 -109
  69. package/dist/template/.opencode/command/fix-types.md +0 -104
  70. package/dist/template/.opencode/command/fix-ui.md +0 -117
  71. package/dist/template/.opencode/command/fix.md +0 -168
  72. package/dist/template/.opencode/command/frontend-design.md +0 -21
  73. package/dist/template/.opencode/command/generate-diagram.md +0 -349
  74. package/dist/template/.opencode/command/generate-icon.md +0 -283
  75. package/dist/template/.opencode/command/generate-image.md +0 -246
  76. package/dist/template/.opencode/command/generate-pattern.md +0 -247
  77. package/dist/template/.opencode/command/generate-storyboard.md +0 -250
  78. package/dist/template/.opencode/command/implement.md +0 -609
  79. package/dist/template/.opencode/command/import-plan.md +0 -406
  80. package/dist/template/.opencode/command/index-knowledge.md +0 -25
  81. package/dist/template/.opencode/command/integration-test.md +0 -424
  82. package/dist/template/.opencode/command/issue.md +0 -102
  83. package/dist/template/.opencode/command/new-feature.md +0 -651
  84. package/dist/template/.opencode/command/opensrc.md +0 -58
  85. package/dist/template/.opencode/command/quick-build.md +0 -238
  86. package/dist/template/.opencode/command/ralph.md +0 -41
  87. package/dist/template/.opencode/command/research-and-implement.md +0 -148
  88. package/dist/template/.opencode/command/research-ui.md +0 -466
  89. package/dist/template/.opencode/command/restore-image.md +0 -424
  90. package/dist/template/.opencode/command/revert-feature.md +0 -386
  91. package/dist/template/.opencode/command/skill-create.md +0 -517
  92. package/dist/template/.opencode/command/skill-optimize.md +0 -556
  93. package/dist/template/.opencode/command/summarize.md +0 -412
  94. package/dist/template/.opencode/command/triage.md +0 -398
  95. package/dist/template/.opencode/memory/_templates/README.md +0 -35
  96. package/dist/template/.opencode/memory/_templates/observation.md +0 -39
  97. package/dist/template/.opencode/memory/_templates/project/architecture.md +0 -60
  98. package/dist/template/.opencode/memory/_templates/project/commands.md +0 -72
  99. package/dist/template/.opencode/memory/_templates/project/conventions.md +0 -68
  100. package/dist/template/.opencode/memory/_templates/project/gotchas.md +0 -41
  101. package/dist/template/.opencode/memory/_templates/prompt-engineering.md +0 -333
  102. package/dist/template/.opencode/memory/observations/2026-01-22-decision-agents-md-prompt-engineering-improvement.md +0 -29
  103. package/dist/template/.opencode/memory/observations/2026-01-25-decision-agent-roles-build-orchestrates-general-e.md +0 -14
  104. package/dist/template/.opencode/memory/observations/2026-01-25-decision-simplified-swarm-helper-tool-to-fix-type.md +0 -20
  105. package/dist/template/.opencode/memory/observations/2026-01-25-decision-use-beads-as-swarm-board-source-of-truth.md +0 -14
  106. package/dist/template/.opencode/memory/observations/2026-01-25-learning-user-wants-real-swarm-coordination-guida.md +0 -15
  107. package/dist/template/.opencode/memory/observations/2026-01-28-decision-created-deep-research-skill-for-thorough.md +0 -29
  108. package/dist/template/.opencode/memory/observations/2026-01-28-decision-gh-grep-mcp-wrapper-vs-native-grep-searc.md +0 -21
  109. package/dist/template/.opencode/memory/observations/2026-01-28-decision-oracle-tool-optimal-usage-patterns.md +0 -32
  110. package/dist/template/.opencode/memory/observations/2026-01-28-learning-ampcode-deep-mode-research-integration-w.md +0 -42
  111. package/dist/template/.opencode/memory/observations/2026-01-28-pattern-research-delegation-pattern-explore-for-.md +0 -32
  112. package/dist/template/.opencode/memory/observations/2026-01-29-decision-copilot-auth-plugin-rate-limit-handling.md +0 -27
  113. package/dist/template/.opencode/memory/observations/2026-01-29-decision-spec-driven-approach-for-opencodekit.md +0 -21
  114. package/dist/template/.opencode/memory/observations/2026-01-29-learning-karpathy-llm-coding-insights-dec-2025.md +0 -44
  115. package/dist/template/.opencode/memory/observations/2026-01-30-decision-github-copilot-claude-routing-keep-disab.md +0 -32
  116. package/dist/template/.opencode/memory/observations/2026-01-30-discovery-context-management-research-critical-gap.md +0 -14
  117. package/dist/template/.opencode/memory/observations/2026-01-30-discovery-kimi-k2-5-agent-swarm-architecture-patte.md +0 -45
  118. package/dist/template/.opencode/memory/observations/2026-01-30-pattern-swarm-tools-architecture.md +0 -28
  119. package/dist/template/.opencode/memory/observations/2026-01-31-decision-copilot-auth-plugin-updated-with-baseurl.md +0 -63
  120. package/dist/template/.opencode/memory/observations/2026-01-31-decision-created-dedicated-worker-agent-for-swarm.md +0 -20
  121. package/dist/template/.opencode/memory/observations/2026-01-31-decision-rollback-to-v1-1-47-for-copilot-claude-r.md +0 -21
  122. package/dist/template/.opencode/memory/observations/2026-01-31-decision-simplified-swarm-to-task-tool-pattern.md +0 -44
  123. package/dist/template/.opencode/memory/observations/2026-01-31-decision-swarm-architecture-task-tool-over-tmux.md +0 -33
  124. package/dist/template/.opencode/memory/observations/2026-01-31-decision-worker-skills-defined-for-swarm-delegati.md +0 -30
  125. package/dist/template/.opencode/memory/observations/2026-01-31-learning-gpt-reasoning-config-for-github-copilot.md +0 -51
  126. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-auth-comparison-finding.md +0 -61
  127. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-reasoning-architecture-.md +0 -66
  128. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-custom-tools-api.md +0 -48
  129. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-v1-1-48-skills-as-slash-command.md +0 -21
  130. package/dist/template/.opencode/memory/observations/2026-01-31-learning-swarm-system-simplified-removed-mailbox-.md +0 -30
  131. package/dist/template/.opencode/memory/observations/2026-01-31-learning-v1-1-48-native-copilot-reasoning-via-pr-.md +0 -45
  132. package/dist/template/.opencode/memory/observations/2026-01-31-warning-cannot-add-custom-config-to-opencode-jso.md +0 -18
  133. package/dist/template/.opencode/memory/observations/2026-01-31-warning-copilot-claude-v1-endpoint-returns-404-c.md +0 -48
  134. package/dist/template/.opencode/memory/observations/2026-01-31-warning-opencode-v1-1-48-claude-thinking-block-s.md +0 -51
  135. package/dist/template/.opencode/memory/project/architecture.md +0 -60
  136. package/dist/template/.opencode/memory/project/commands.md +0 -72
  137. package/dist/template/.opencode/memory/project/conventions.md +0 -68
  138. package/dist/template/.opencode/memory/project/gotchas.md +0 -41
  139. package/dist/template/.opencode/skill/notebooklm/SKILL.md +0 -272
  140. package/dist/template/.opencode/skill/notebooklm/references/setup.md +0 -353
  141. package/dist/template/.opencode/tool/notebooklm.ts +0 -488
  142. package/dist/template/.opencode/tool/oracle.ts +0 -240
  143. /package/dist/template/.opencode/memory/{user.example.md → _templates/user.md} +0 -0
  144. /package/dist/template/.opencode/memory/{user.md → project/user.md} +0 -0
@@ -1,168 +0,0 @@
1
- ---
2
- description: Debug and fix an issue
3
- argument-hint: "<issue or bead-id> [--quick]"
4
- agent: build
5
- ---
6
-
7
- # Fix: $ARGUMENTS
8
-
9
- You're debugging and fixing an issue. Understand before you fix.
10
-
11
- ## Load Context
12
-
13
- If `$ARGUMENTS` is a bead ID:
14
-
15
- !`bd show $ARGUMENTS`
16
- !`cat .beads/artifacts/$ARGUMENTS/spec.md 2>/dev/null`
17
-
18
- ## Parse The Error
19
-
20
- Extract from the issue:
21
-
22
- - **Error message** - exact text
23
- - **Stack trace** - file:line references
24
- - **Reproduction** - steps to trigger
25
- - **Expected vs Actual** - what should happen vs what happens
26
-
27
- ## Estimate Complexity
28
-
29
- - **S** (~10 calls): Error points to exact line, obvious fix
30
- - **M** (~30 calls): Clear reproduction, known area
31
- - **L** (~100 calls): Intermittent, multiple files, needs investigation
32
- - **XL**: Should be decomposed or researched first
33
-
34
- If `--quick` flag: Skip deep analysis, fix directly.
35
-
36
- ## Quick Fix (S or --quick)
37
-
38
- 1. Go to error location
39
- 2. Identify obvious cause
40
- 3. Make minimal fix
41
- 4. Run targeted test
42
- 5. Commit
43
-
44
- ## Systematic Debug (M/L)
45
-
46
- Load the debugging skill:
47
-
48
- ```typescript
49
- skill({ name: "systematic-debugging" });
50
- ```
51
-
52
- **Phase 1: Root Cause (NO fixes yet)**
53
-
54
- Read error location. Trace data flow backward. Check recent changes:
55
-
56
- !`git log -p --since="1 week ago" -- <file>`
57
-
58
- Form a hypothesis. Write it down before fixing anything.
59
-
60
- **Phase 2: Reproduce**
61
-
62
- Write a failing test that reproduces the bug:
63
-
64
- ```bash
65
- npm test -- --grep "<bug-related>"
66
- ```
67
-
68
- Verify it fails for the right reason.
69
-
70
- **Phase 3: Fix**
71
-
72
- Make the fix. Verify test passes. Run full suite:
73
-
74
- ```bash
75
- npm test
76
- npm run type-check
77
- ```
78
-
79
- ## Rollback Strategy
80
-
81
- Before making changes:
82
-
83
- ```bash
84
- git stash # or note current commit
85
- ```
86
-
87
- If fix makes things worse:
88
-
89
- ```bash
90
- git checkout -- <file>
91
- ```
92
-
93
- ## Document Root Cause
94
-
95
- Create observation:
96
-
97
- ```typescript
98
- observation({
99
- type: "bugfix",
100
- title: "[brief description]",
101
- content: "Root cause: [what]\nFix: [how]\nPrevention: [future]",
102
- bead_id: "$ARGUMENTS",
103
- });
104
- ```
105
-
106
- If it's a gotcha worth remembering, update `project/gotchas.md`.
107
-
108
- ## Complete
109
-
110
- If all verifications pass:
111
-
112
- ```bash
113
- git add <files>
114
- git status
115
- git diff --cached --stat
116
- ```
117
-
118
- **Use question tool to get commit decision:**
119
-
120
- ```typescript
121
- question({
122
- questions: [
123
- {
124
- header: "Commit",
125
- question: "Fix Complete: $ARGUMENTS. What should I do next?",
126
- options: [
127
- {
128
- label: "Commit changes (Recommended)",
129
- description: "Git commit and bd sync",
130
- },
131
- {
132
- label: "Show diff first",
133
- description: "Review changes before committing",
134
- },
135
- {
136
- label: "Skip commit",
137
- description: "I'll review and commit manually",
138
- },
139
- ],
140
- },
141
- ],
142
- });
143
- ```
144
-
145
- If user confirms:
146
-
147
- ```bash
148
- git commit -m "fix: [description]
149
-
150
- Root cause: [brief]
151
- $ARGUMENTS"
152
-
153
- bd sync
154
- ```
155
-
156
- ## Output
157
-
158
- ```
159
- Fixed: $ARGUMENTS
160
-
161
- Root cause: [brief]
162
- Changes: [files]
163
- Tests: Pass
164
-
165
- Next:
166
- - /finish $ARGUMENTS # Close the bead
167
- - /pr $ARGUMENTS # Create PR
168
- ```
@@ -1,21 +0,0 @@
1
- ---
2
- description: Create distinctive, production-grade frontend interfaces
3
- argument-hint: "[component/page description]"
4
- agent: build
5
- ---
6
-
7
- # Frontend Design: $ARGUMENTS
8
-
9
- Create UI components, pages, or applications with React, Tailwind CSS v4, shadcn/ui, and Motion.
10
-
11
- ## Load Skill
12
-
13
- ```typescript
14
- skill({ name: "frontend-design" });
15
- ```
16
-
17
- Then follow the skill instructions to create the interface.
18
-
19
- <user-request>
20
- $ARGUMENTS
21
- </user-request>
@@ -1,349 +0,0 @@
1
- ---
2
- description: Generate technical diagrams, flowcharts, and visual documentation
3
- argument-hint: "<description> [--type=<type>] [--style=<style>] [--format=<format>] [--from-code]"
4
- agent: vision
5
- model: proxypal/gemini-3-flash-preview
6
- ---
7
-
8
- # Generate Diagram: $ARGUMENTS
9
-
10
- Generate technical diagrams and visual documentation with Mermaid code output.
11
-
12
- ## Parse Arguments
13
-
14
- | Argument | Default | Options |
15
- | ------------- | --------- | ------------------------------- |
16
- | Description | required | What the diagram shows |
17
- | `--type` | flowchart | See diagram types below |
18
- | `--style` | clean | clean, sketch, formal, colorful |
19
- | `--format` | both | png, svg, mermaid, both |
20
- | `--size` | medium | simple, medium, complex |
21
- | `--from-code` | false | Analyze codebase to generate |
22
- | `--colors` | default | Brand colors or preset |
23
-
24
- ---
25
-
26
- ## Diagram Types
27
-
28
- | Type | Description | Best For |
29
- | -------------- | ---------------------------------------- | ----------------------- |
30
- | `flowchart` | Process flows, decision trees | Workflows, algorithms |
31
- | `sequence` | Interaction sequences, API calls | System interactions |
32
- | `architecture` | System components, infrastructure | High-level design |
33
- | `erd` | Entity relationship diagrams | Database design |
34
- | `class` | Class diagrams, inheritance | OOP design |
35
- | `state` | State machines, transitions | UI states, workflows |
36
- | `mindmap` | Hierarchical concepts | Brainstorming, planning |
37
- | `gantt` | Timeline, project schedule | Project planning |
38
- | `wireframe` | UI layouts, screen mockups | UX design |
39
- | `network` | Network topology | Infrastructure |
40
- | `c4` | C4 model (context, container, component) | Architecture docs |
41
-
42
- ---
43
-
44
- ## Workflow: AI vs Mermaid-First
45
-
46
- ### Use AI Generation When:
47
-
48
- - Creating wireframes or visual mockups
49
- - Need artistic/sketch style
50
- - Complex visual that Mermaid can't express
51
-
52
- ### Use Mermaid-First When:
53
-
54
- - Technical diagrams (flowchart, sequence, erd, class)
55
- - Need precise control over structure
56
- - Will iterate on the diagram
57
- - Need version-controlled diagrams
58
-
59
- **Recommendation:** For technical diagrams, this command generates Mermaid code that you can edit and render.
60
-
61
- ---
62
-
63
- ## Mermaid Syntax Reference
64
-
65
- ### Flowchart
66
-
67
- ```mermaid
68
- flowchart TD
69
- A[Start] --> B{Decision?}
70
- B -->|Yes| C[Action 1]
71
- B -->|No| D[Action 2]
72
- C --> E[End]
73
- D --> E
74
- ```
75
-
76
- **Shapes:** `[Rectangle]` `(Rounded)` `{Diamond}` `([Stadium])` `[[Subroutine]]`
77
- **Directions:** `TD` (top-down), `LR` (left-right), `BT`, `RL`
78
-
79
- ### Sequence Diagram
80
-
81
- ```mermaid
82
- sequenceDiagram
83
- participant U as User
84
- participant A as API
85
- participant D as Database
86
-
87
- U->>A: POST /login
88
- A->>D: Query user
89
- D-->>A: User data
90
- A-->>U: JWT token
91
- ```
92
-
93
- **Arrows:** `->>` (solid), `-->>` (dashed), `-x` (cross), `-)` (async)
94
-
95
- ### Entity Relationship
96
-
97
- ```mermaid
98
- erDiagram
99
- USER ||--o{ ORDER : places
100
- ORDER ||--|{ LINE_ITEM : contains
101
- PRODUCT ||--o{ LINE_ITEM : includes
102
-
103
- USER {
104
- int id PK
105
- string email
106
- string name
107
- }
108
- ```
109
-
110
- **Cardinality:** `||` (one), `o{` (zero or more), `|{` (one or more)
111
-
112
- ### Class Diagram
113
-
114
- ```mermaid
115
- classDiagram
116
- class User {
117
- +String email
118
- +String name
119
- +login()
120
- +logout()
121
- }
122
- class Admin {
123
- +deleteUser()
124
- }
125
- User <|-- Admin
126
- ```
127
-
128
- **Relationships:** `<|--` (inheritance), `*--` (composition), `o--` (aggregation)
129
-
130
- ### State Diagram
131
-
132
- ```mermaid
133
- stateDiagram-v2
134
- [*] --> Idle
135
- Idle --> Loading : fetch
136
- Loading --> Success : resolve
137
- Loading --> Error : reject
138
- Success --> Idle : reset
139
- Error --> Idle : retry
140
- ```
141
-
142
- ### Gantt Chart
143
-
144
- ```mermaid
145
- gantt
146
- title Project Timeline
147
- dateFormat YYYY-MM-DD
148
- section Phase 1
149
- Design :a1, 2024-01-01, 2w
150
- Development :a2, after a1, 4w
151
- section Phase 2
152
- Testing :a3, after a2, 2w
153
- ```
154
-
155
- ### Mindmap
156
-
157
- ```mermaid
158
- mindmap
159
- root((Project))
160
- Frontend
161
- React
162
- Tailwind
163
- Backend
164
- Node.js
165
- PostgreSQL
166
- DevOps
167
- Docker
168
- AWS
169
- ```
170
-
171
- ---
172
-
173
- ## Style Options
174
-
175
- | Style | Description | Use Case |
176
- | ---------- | ----------------------- | ---------------------------- |
177
- | `clean` | Minimal, professional | Documentation, presentations |
178
- | `sketch` | Hand-drawn appearance | Informal, brainstorming |
179
- | `formal` | Box borders, structured | Enterprise, technical docs |
180
- | `colorful` | Vibrant, color-coded | Marketing, education |
181
-
182
- ---
183
-
184
- ## Codebase Integration (--from-code)
185
-
186
- Analyze actual code to generate diagrams:
187
-
188
- ```bash
189
- # Generate architecture from imports
190
- /generate-diagram system architecture --from-code --type=architecture
191
-
192
- # Generate ERD from models
193
- /generate-diagram database schema --from-code --type=erd
194
-
195
- # Generate class diagram from TypeScript
196
- /generate-diagram class relationships --from-code --type=class
197
- ```
198
-
199
- **How it works:**
200
-
201
- 1. Scans relevant source files
202
- 2. Extracts structure (classes, functions, imports)
203
- 3. Generates Mermaid code representing actual codebase
204
- 4. Renders as diagram
205
-
206
- ---
207
-
208
- ## Examples by Type
209
-
210
- ### Flowchart
211
-
212
- ```bash
213
- # User authentication flow
214
- /generate-diagram user login process with email verification --type=flowchart
215
-
216
- # Algorithm
217
- /generate-diagram binary search algorithm --type=flowchart --style=clean
218
- ```
219
-
220
- ### Sequence Diagram
221
-
222
- ```bash
223
- # API flow
224
- /generate-diagram OAuth2 authentication flow between client, auth server, and resource server --type=sequence
225
-
226
- # Microservice communication
227
- /generate-diagram order processing across payment, inventory, and shipping services --type=sequence
228
- ```
229
-
230
- ### Architecture
231
-
232
- ```bash
233
- # System overview
234
- /generate-diagram e-commerce platform with React frontend, Node API, and PostgreSQL --type=architecture
235
-
236
- # Cloud infrastructure
237
- /generate-diagram AWS deployment with ECS, RDS, and CloudFront --type=architecture --style=formal
238
- ```
239
-
240
- ### ERD
241
-
242
- ```bash
243
- # Database schema
244
- /generate-diagram user management system with users, roles, and permissions --type=erd
245
-
246
- # E-commerce
247
- /generate-diagram product catalog with categories, variants, and inventory --type=erd
248
- ```
249
-
250
- ### State Diagram
251
-
252
- ```bash
253
- # UI states
254
- /generate-diagram form submission states from idle to loading to success or error --type=state
255
-
256
- # Order lifecycle
257
- /generate-diagram order status from pending through processing, shipped, delivered --type=state
258
- ```
259
-
260
- ---
261
-
262
- ## Size/Complexity Guidance
263
-
264
- | Size | Elements | Description |
265
- | --------- | ---------- | ---------------------------- |
266
- | `simple` | 3-5 nodes | Quick sketch, single concept |
267
- | `medium` | 6-12 nodes | Standard documentation |
268
- | `complex` | 13+ nodes | Comprehensive system view |
269
-
270
- **Tip:** Start simple, iterate to add detail.
271
-
272
- ---
273
-
274
- ## Output
275
-
276
- ### File Structure
277
-
278
- ```
279
- .opencode/memory/design/diagrams/[name]/
280
- ├── diagram.png # Rendered image
281
- ├── diagram.svg # Vector version
282
- ├── diagram.mmd # Mermaid source code
283
- └── README.md # Usage notes
284
- ```
285
-
286
- ### Inline Output
287
-
288
- ```markdown
289
- ## Generated Diagram
290
-
291
- **Type:** sequence
292
- **Description:** User authentication flow
293
-
294
- ### Mermaid Code
295
-
296
- \`\`\`mermaid
297
- sequenceDiagram
298
- User->>Auth: Login request
299
- Auth->>DB: Validate credentials
300
- DB-->>Auth: User data
301
- Auth-->>User: JWT token
302
- \`\`\`
303
-
304
- ### Rendered
305
-
306
- [PNG/SVG image displayed]
307
-
308
- ### Usage
309
-
310
- - Embed in GitHub markdown (supports Mermaid natively)
311
- - Use Mermaid Live Editor for modifications
312
- - Export to PNG/SVG for presentations
313
- ```
314
-
315
- ---
316
-
317
- ## Rendering Options
318
-
319
- | Platform | Mermaid Support |
320
- | ------------ | -------------------- |
321
- | GitHub | Native in markdown |
322
- | GitLab | Native in markdown |
323
- | Notion | Via code block |
324
- | Confluence | Via plugin |
325
- | VS Code | Via extension |
326
- | Mermaid Live | https://mermaid.live |
327
-
328
- ---
329
-
330
- ## Limitations
331
-
332
- | Limitation | Workaround |
333
- | ------------------- | --------------------------------------------------- |
334
- | Very large diagrams | Break into multiple smaller diagrams |
335
- | Custom icons | Use external tool, embed as image |
336
- | Precise positioning | Mermaid auto-layouts; use external tool for control |
337
- | Complex styling | Basic theming only; export SVG for advanced styling |
338
- | Wireframes | AI-generated image better than Mermaid |
339
-
340
- ---
341
-
342
- ## Related Commands
343
-
344
- | Need | Command |
345
- | -------------------- | ------------------ |
346
- | Analyze mockup | `/analyze-mockup` |
347
- | Generate image | `/generate-image` |
348
- | Review architecture | `/review-codebase` |
349
- | Create documentation | `/summarize` |