-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheat-sheet.html
More file actions
539 lines (483 loc) · 19.6 KB
/
cheat-sheet.html
File metadata and controls
539 lines (483 loc) · 19.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Orcta Engineering Cheat Sheet</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: #fafafa;
padding: 48px 24px;
color: #1a1a1a;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.container {
max-width: 920px;
margin: 0 auto;
background: white;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.08);
padding: 64px 72px;
}
.header {
border-bottom: 1px solid #e8e8e8;
padding-bottom: 32px;
margin-bottom: 48px;
}
.header h1 {
font-size: 32px;
font-weight: 600;
color: #1a1a1a;
letter-spacing: -0.02em;
margin-bottom: 12px;
}
.header .subtitle {
font-size: 16px;
color: #6b6b6b;
font-weight: 400;
letter-spacing: -0.01em;
margin-bottom: 16px;
}
.header .meta {
font-size: 13px;
color: #a0a0a0;
}
.section {
margin-bottom: 56px;
}
.section:last-child {
margin-bottom: 0;
}
.section-title {
font-size: 20px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 24px;
letter-spacing: -0.02em;
}
.principles-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20px;
}
.principle-card {
background: #fafafa;
border: 1px solid #f0f0f0;
border-radius: 6px;
padding: 24px;
}
.principle-card h3 {
font-size: 15px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 8px;
letter-spacing: -0.01em;
}
.principle-card p {
font-size: 14px;
color: #6b6b6b;
line-height: 1.5;
}
.non-negotiables {
background: #fafafa;
border: 1px solid #e0e0e0;
border-left: 3px solid #1a1a1a;
border-radius: 6px;
padding: 24px 28px;
}
.non-negotiables h3 {
font-size: 18px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 16px;
letter-spacing: -0.01em;
}
.non-negotiables-list {
list-style: none;
}
.non-negotiables-list li {
font-size: 14px;
color: #4a4a4a;
padding: 12px 0;
padding-left: 24px;
position: relative;
line-height: 1.5;
border-bottom: 1px solid #f0f0f0;
}
.non-negotiables-list li:last-child {
border-bottom: none;
}
.non-negotiables-list li::before {
content: '';
position: absolute;
left: 0;
top: 19px;
width: 6px;
height: 6px;
background: #1a1a1a;
border-radius: 50%;
}
.non-negotiables-list strong {
color: #1a1a1a;
font-weight: 600;
}
.naming-section {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
margin-top: 24px;
}
.naming-card {
background: #fafafa;
border: 1px solid #f0f0f0;
border-radius: 6px;
padding: 20px;
}
.naming-card h3 {
font-size: 14px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 16px;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.convention-item {
padding: 8px 0;
font-size: 13px;
border-bottom: 1px solid #f5f5f5;
}
.convention-item:last-child {
border-bottom: none;
}
.convention-label {
display: block;
color: #6b6b6b;
margin-bottom: 4px;
}
.convention-value {
font-family: 'JetBrains Mono', monospace;
font-size: 12px;
color: #1a1a1a;
background: white;
padding: 4px 8px;
border-radius: 3px;
display: inline-block;
border: 1px solid #e8e8e8;
}
.decision-tree {
background: #fafafa;
border: 1px solid #f0f0f0;
border-radius: 6px;
padding: 28px;
}
.decision-item {
padding: 16px 0;
border-bottom: 1px solid #f0f0f0;
}
.decision-item:last-child {
border-bottom: none;
padding-bottom: 0;
}
.decision-question {
font-size: 14px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 6px;
}
.decision-answer {
font-size: 14px;
color: #5a5a5a;
line-height: 1.5;
padding-left: 16px;
border-left: 2px solid #e8e8e8;
}
.reference-section {
margin-top: 48px;
padding-top: 32px;
border-top: 1px solid #e8e8e8;
}
.reference-title {
font-size: 16px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 16px;
}
.reference-links {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.reference-link {
display: inline-block;
font-size: 14px;
color: #5a5a5a;
text-decoration: none;
padding: 8px 16px;
border: 1px solid #e0e0e0;
border-radius: 4px;
transition: all 0.15s ease;
}
.reference-link:hover {
background: #fafafa;
border-color: #d0d0d0;
color: #1a1a1a;
}
.footer-note {
margin-top: 32px;
padding-top: 24px;
border-top: 1px solid #f5f5f5;
text-align: center;
}
.footer-note p {
font-size: 13px;
color: #a0a0a0;
line-height: 1.6;
}
.footer-note p:first-child {
color: #5a5a5a;
margin-bottom: 8px;
}
@media (max-width: 768px) {
.container {
padding: 40px 32px;
}
.principles-grid {
grid-template-columns: 1fr;
}
.naming-section {
grid-template-columns: 1fr;
}
.header h1 {
font-size: 28px;
}
}
@media print {
body {
background: white;
padding: 0;
}
.container {
box-shadow: none;
max-width: 100%;
padding: 32px;
}
.reference-link {
display: none;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>Engineering Cheat Sheet</h1>
<p class="subtitle">Essential principles, conventions, and decision guides for daily development work</p>
<p class="meta">Version 1.1 · Last Updated June 2025 · Print for Quick Reference</p>
</div>
<div class="section">
<h2 class="section-title">Core Engineering Beliefs</h2>
<div class="principles-grid">
<div class="principle-card">
<h3>Principles Over Tools</h3>
<p>Deep understanding matters more than superficial mastery of frameworks. Concepts drive tool choices.</p>
</div>
<div class="principle-card">
<h3>Progressive Abstraction</h3>
<p>Build simple first, then abstract. Avoid premature optimization that obscures clarity.</p>
</div>
<div class="principle-card">
<h3>Code as Craft</h3>
<p>Write for humans first. Clean, understandable code shows respect for future readers.</p>
</div>
<div class="principle-card">
<h3>Document to Scale</h3>
<p>Documentation is an act of generosity to teammates and your future self.</p>
</div>
<div class="principle-card">
<h3>Speed with Stability</h3>
<p>Move fast without shipping broken things. Testing and reviews safeguard quality.</p>
</div>
<div class="principle-card">
<h3>Ownership Mentality</h3>
<p>If you ship it, you own it. Monitor, maintain, and improve what you build.</p>
</div>
</div>
</div>
<div class="section">
<div class="non-negotiables">
<h3>Non-Negotiables</h3>
<ul class="non-negotiables-list">
<li><strong>Every pull request gets reviewed.</strong> No self-merges. Feedback must be kind, clear, and constructive.</li>
<li><strong>Tests are mandatory.</strong> 80% coverage target for core services. No broken code in main branches.</li>
<li><strong>Never commit secrets.</strong> Use environment variables and secrets managers. Check before pushing.</li>
</ul>
</div>
</div>
<div class="section">
<h2 class="section-title">Naming Conventions</h2>
<div class="naming-section">
<div class="naming-card">
<h3>JavaScript / TypeScript</h3>
<div class="convention-item">
<span class="convention-label">Variables</span>
<span class="convention-value">camelCase</span>
</div>
<div class="convention-item">
<span class="convention-label">Functions</span>
<span class="convention-value">camelCase</span>
</div>
<div class="convention-item">
<span class="convention-label">Components</span>
<span class="convention-value">PascalCase</span>
</div>
<div class="convention-item">
<span class="convention-label">Constants</span>
<span class="convention-value">SCREAMING_SNAKE</span>
</div>
<div class="convention-item">
<span class="convention-label">Files</span>
<span class="convention-value">kebab-case</span>
</div>
</div>
<div class="naming-card">
<h3>Python</h3>
<div class="convention-item">
<span class="convention-label">Variables</span>
<span class="convention-value">snake_case</span>
</div>
<div class="convention-item">
<span class="convention-label">Functions</span>
<span class="convention-value">snake_case</span>
</div>
<div class="convention-item">
<span class="convention-label">Classes</span>
<span class="convention-value">PascalCase</span>
</div>
<div class="convention-item">
<span class="convention-label">Constants</span>
<span class="convention-value">SCREAMING_SNAKE</span>
</div>
<div class="convention-item">
<span class="convention-label">Files</span>
<span class="convention-value">kebab-case</span>
</div>
</div>
<div class="naming-card">
<h3>Go</h3>
<div class="convention-item">
<span class="convention-label">Variables</span>
<span class="convention-value">camelCase</span>
</div>
<div class="convention-item">
<span class="convention-label">Functions</span>
<span class="convention-value">camelCase</span>
</div>
<div class="convention-item">
<span class="convention-label">Exported Types</span>
<span class="convention-value">PascalCase</span>
</div>
<div class="convention-item">
<span class="convention-label">Packages</span>
<span class="convention-value">lowercase</span>
</div>
<div class="convention-item">
<span class="convention-label">Files</span>
<span class="convention-value">kebab-case</span>
</div>
</div>
</div>
</div>
<div class="section">
<h2 class="section-title">Decision Guide</h2>
<div class="decision-tree">
<div class="decision-item">
<div class="decision-question">Should I ship without tests?</div>
<div class="decision-answer">No. Write at least unit tests for business logic. Integration tests for user-facing features.</div>
</div>
<div class="decision-item">
<div class="decision-question">Should I self-merge my PR?</div>
<div class="decision-answer">No. Get one approval minimum, unless you're a tech lead handling an emergency hotfix.</div>
</div>
<div class="decision-item">
<div class="decision-question">Should I abstract this code?</div>
<div class="decision-answer">Only if you've used it three or more times. Build simple first, abstract later.</div>
</div>
<div class="decision-item">
<div class="decision-question">Should I skip documentation?</div>
<div class="decision-answer">No. At minimum: what it does, how to run it, and any known issues.</div>
</div>
<div class="decision-item">
<div class="decision-question">Should I deploy to production?</div>
<div class="decision-answer">Only after dev to staging to tech lead approval. Monitor for at least one hour after.</div>
</div>
<div class="decision-item">
<div class="decision-question">Should I refactor this duplicated code?</div>
<div class="decision-answer">Yes, now. Don't postpone improvements. Make the codebase better every time you touch it.</div>
</div>
</div>
</div>
<div class="section">
<h2 class="section-title">Development Workflow</h2>
<div class="decision-tree">
<div class="decision-item">
<div class="decision-question">1. Start with Why</div>
<div class="decision-answer">Understand the user need before writing code. Link to issues or document the requirement.</div>
</div>
<div class="decision-item">
<div class="decision-question">2. Design Before Code</div>
<div class="decision-answer">Think through architecture first. Draw diagrams or write brief design docs for complex features.</div>
</div>
<div class="decision-item">
<div class="decision-question">3. Build Simple</div>
<div class="decision-answer">Start with the simplest implementation. Avoid premature optimization or abstraction.</div>
</div>
<div class="decision-item">
<div class="decision-question">4. Test Thoroughly</div>
<div class="decision-answer">Write tests that cover happy paths and edge cases. Run locally before pushing.</div>
</div>
<div class="decision-item">
<div class="decision-question">5. Refactor as You Go</div>
<div class="decision-answer">Clean up duplicated code and unclear logic immediately while context is fresh.</div>
</div>
<div class="decision-item">
<div class="decision-question">6. Submit for Review</div>
<div class="decision-answer">Use PR template. Include clear description, screenshots for UI, and test instructions.</div>
</div>
<div class="decision-item">
<div class="decision-question">7. Address Feedback</div>
<div class="decision-answer">Respond within 24 hours. Make changes or discuss alternatives. Reviews are collaborative.</div>
</div>
<div class="decision-item">
<div class="decision-question">8. Monitor After Deploy</div>
<div class="decision-answer">Watch logs and metrics for at least one hour. Address issues quickly or revert if needed.</div>
</div>
</div>
</div>
<div class="reference-section">
<h3 class="reference-title">Additional Resources</h3>
<div class="reference-links">
<a href="engineering-philosophy.pdf" class="reference-link">Engineering Philosophy</a>
<a href="engineering-playbook.pdf" class="reference-link">Complete Playbook</a>
<a href="naming-conventions.pdf" class="reference-link">Naming Conventions</a>
<a href="workflow-guide.html" class="reference-link">Development Workflow</a>
<a href="git-workflow-react.html" class="reference-link">Git Workflow</a>
</div>
</div>
<div class="footer-note">
<p>These aren't rules to slow you down—they're guardrails to help you move faster, together.</p>
</div>
</div>
</body>
</html>