You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding patterns to existing solutions, update ALL solution entries in SOLUTIONS dict:
1121
+
1122
+
```python
1123
+
# Incomplete - only updated "default"
1124
+
SOLUTIONS= {
1125
+
"default": {
1126
+
"api_kernels": ["MyKernel"], # ✅ Added
1127
+
"patterns": ["my_pattern"], # ✅ Added
1128
+
},
1129
+
"variant": {
1130
+
# ❌ Missing api_kernels and patterns!
1131
+
},
1132
+
}
1133
+
```
1134
+
1135
+
### 4. README Updates May Be Optional
1136
+
1137
+
If the main README uses a "View All Patterns" link to `docs/patterns/README.md`, you only need to update `docs/patterns/README.md`. The main README table shows representative examples, not exhaustive listings.
1138
+
1139
+
### 5. Mindmap Config Update Is Optional
1140
+
1141
+
Updating `tools/mindmaps/ai-markmap-agent/config/config.yaml` is only needed if you want the pattern to appear in auto-generated mindmaps. It can be deferred.
1142
+
1143
+
---
1144
+
1145
+
## Writing Effective Intuition Guides
1146
+
1147
+
The `intuition.md` file is the most valuable documentation you'll write. Here's how to make it effective:
1148
+
1149
+
### Use Relatable Analogies
1150
+
1151
+
Each pattern benefits from a memorable mental model:
1152
+
1153
+
| Pattern | Effective Analogy |
1154
+
|---------|-------------------|
1155
+
| Multi-Source BFS | "Flashlights in a cave" - multiple light sources spreading simultaneously |
1156
+
| K-Way Merge | "Racing snails" - each sequence is a snail, heap picks the leader |
1157
+
| Linked List Reversal | "Train car couplers" - flip the direction of each coupler |
1158
+
| Sliding Window | "Moving spotlight" - illuminate a section, slide to reveal more |
1159
+
| Monotonic Stack | "Building heights" - what can you see looking left/right? |
1160
+
1161
+
### Include Visual Traces
1162
+
1163
+
ASCII art helps readers follow the algorithm step-by-step:
1164
+
1165
+
```
1166
+
Step 0: prev=None, curr=1
1167
+
None <- 1 2 -> 3 -> 4 -> None
1168
+
1169
+
Step 1: prev=1, curr=2
1170
+
None <- 1 <- 2 3 -> 4 -> None
1171
+
```
1172
+
1173
+
### Highlight Common Mistakes
1174
+
1175
+
Show both wrong and right approaches:
1176
+
1177
+
```python
1178
+
# ❌ WRONG - loses reference to next node
1179
+
curr.next = prev
1180
+
curr = curr.next # Oops, curr.next is now prev!
1181
+
1182
+
# ✅ RIGHT - save next before modifying
1183
+
next_node = curr.next
1184
+
curr.next = prev
1185
+
curr = next_node
1186
+
```
1187
+
1188
+
### Add Pattern Recognition Signals
1189
+
1190
+
Help readers identify when to use the pattern:
1191
+
1192
+
```markdown
1193
+
**Use this pattern when you see:**
1194
+
- "Reverse" + "linked list" in problem statement
1195
+
- "In-place" or "O(1) space" constraints
1196
+
- "Swap adjacent pairs" or "reverse in groups"
1197
+
```
1198
+
1199
+
### Structure Recommendations
1200
+
1201
+
1.**Mental Model** (1-2 paragraphs with analogy)
1202
+
2.**Visual Walkthrough** (ASCII trace of key algorithm)
0 commit comments