Skip to content

Commit 0d4c6a4

Browse files
PaulDuvallclaude
andcommitted
docs: add diagram guidelines to pattern specification
📋 Change summary: * pattern-spec.md: Added comprehensive Mermaid diagram guidelines * Specified when to use diagrams (workflows, interactions, architecture) * Added diagram formatting standards and placement rules * Updated validation checklist to include diagram considerations * Enhanced pattern specification with visual explanation support 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent fe9afc4 commit 0d4c6a4

1 file changed

Lines changed: 43 additions & 1 deletion

File tree

pattern-spec.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,45 @@ Patterns are organized into three main categories:
9292
- Use realistic file paths and tool names
9393
- Show both input and expected output where applicable
9494

95+
### Diagrams
96+
Consider adding diagrams when the pattern would benefit from visual explanation:
97+
98+
**When to use diagrams:**
99+
- Multi-step workflows or processes (use flowcharts)
100+
- System interactions or data flow (use sequence diagrams)
101+
- Component relationships or architecture (use component diagrams)
102+
- State transitions or decision trees (use state diagrams)
103+
- Timeline-based processes (use timeline or Gantt charts)
104+
105+
**Diagram guidelines:**
106+
- Use Mermaid syntax for consistency and maintainability
107+
- Place diagrams immediately after the pattern description, before Core Implementation
108+
- Keep diagrams simple and focused on the core concept
109+
- Label all components clearly with descriptive names
110+
- Use consistent styling and colors within the same pattern
111+
- Limit to 1-2 diagrams per pattern to maintain focus
112+
113+
**Mermaid diagram types to consider:**
114+
```mermaid
115+
# Flowchart for decision flows and processes
116+
graph TD
117+
A[Start] --> B{Decision}
118+
B -->|Yes| C[Action 1]
119+
B -->|No| D[Action 2]
120+
121+
# Sequence diagram for interactions over time
122+
sequenceDiagram
123+
participant User
124+
participant AI
125+
User->>AI: Request
126+
AI->>User: Response
127+
128+
# Component diagram for system architecture
129+
graph LR
130+
A[Component A] --> B[Component B]
131+
B --> C[Component C]
132+
```
133+
95134
### Hyperlinks
96135
- ALL pattern references MUST be hyperlinked using format: `[Pattern Name](#pattern-name-anchor)`
97136
- This applies to: Reference table, Related Patterns sections, pattern mentions in descriptions, implementation examples, and any other pattern references
@@ -190,7 +229,10 @@ Before adding a new pattern, verify:
190229
- [ ] Addresses specific, actionable problem
191230
- [ ] Dependencies are clearly stated
192231
- [ ] Example shows only the pattern's essence, not complete implementation
193-
- [ ] References examples directory for detailed implementation
232+
- [ ] References examples directory for detailed implementation (if directory exists)
233+
- [ ] Considers whether a diagram would enhance understanding of the pattern
234+
- [ ] If diagram included, uses Mermaid syntax and follows diagram guidelines
235+
- [ ] Diagram placement is after description, before Core Implementation (if applicable)
194236
- [ ] Writing is clear and concise
195237
- [ ] Fits logically within existing pattern organization
196238
- [ ] Added to Complete Pattern Reference table with correct hyperlink

0 commit comments

Comments
 (0)