-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathagent-guide.html
More file actions
980 lines (887 loc) · 51.8 KB
/
agent-guide.html
File metadata and controls
980 lines (887 loc) · 51.8 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
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="/favicon.png">
<title>Agent Guide - Ralph CLI</title>
<meta name="description" content="Concise reference for AI agents working with Ralph CLI on behalf of users.">
<link rel="stylesheet" href="/docs/rams-design-system.css">
</head>
<body class="rams-page rams-compact">
<script src="/js/sidebar.js"></script>
<!-- Persistent Sidebar (Desktop) -->
<aside class="rams-sidebar" id="rams-sidebar">
<div class="rams-sidebar-header">
<div class="rams-logo">
<button
class="rams-logo-mark"
onclick="toggleSidebar()"
aria-label="Toggle sidebar navigation"
aria-expanded="true"
aria-controls="rams-sidebar"
title="Toggle sidebar">
</button>
<span class="rams-logo-text">RALPH</span>
</div>
</div>
<div class="rams-nav-section" style="border-bottom: 1px solid var(--rams-gray-200); margin-bottom: var(--rams-space-4); padding-bottom: var(--rams-space-4);">
<ul class="rams-nav-items">
<li><a href="/dashboard.html" class="rams-nav-link">← Back to Dashboard</a></li>
</ul>
</div>
<nav class="rams-nav">
<div class="rams-nav-section">
<div class="rams-nav-label">Getting Started</div>
<ul class="rams-nav-items">
<li><a href="/docs/" class="rams-nav-link">Home</a></li>
<li><a href="/docs/tutorial.html" class="rams-nav-link">Tutorial</a></li>
<li><a href="/docs/commands.html" class="rams-nav-link">Commands</a></li>
</ul>
</div>
<div class="rams-nav-section">
<div class="rams-nav-label">Resources</div>
<ul class="rams-nav-items">
<li><a href="/docs/examples.html" class="rams-nav-link">Examples</a></li>
<li><a href="/docs/tips.html" class="rams-nav-link">Best Practices</a></li>
<li><a href="/docs/troubleshooting.html" class="rams-nav-link">Troubleshooting</a></li>
</ul>
</div>
<div class="rams-nav-section">
<div class="rams-nav-label">Advanced</div>
<ul class="rams-nav-items">
<li><a href="/docs/integration.html" class="rams-nav-link">Integrations</a></li>
<li><a href="/docs/agent-guide.html" class="rams-nav-link active">Agent Guide</a></li>
</ul>
</div>
</nav>
<div class="rams-sidebar-footer">
<div class="rams-version">v1.0.0</div>
</div>
</aside>
<!-- Main Content -->
<main class="rams-main">
<!-- Top Bar -->
<div class="rams-topbar">
<div class="rams-breadcrumb">
<a href="/docs/" class="rams-breadcrumb-link">Documentation</a>
<span class="rams-breadcrumb-sep">/</span>
<span class="rams-breadcrumb-current">Agent Guide</span>
</div>
</div>
<!-- Page Header -->
<header class="rams-header">
<h1 class="rams-h1">Agent Operation Guide</h1>
<p class="rams-lead">Concise reference for AI agents working with Ralph CLI. Follow these patterns when users request Ralph-related tasks.</p>
</header>
<!-- Table of Contents -->
<nav class="rams-content" style="background: var(--rams-gray-50); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 12px 16px; margin-bottom: 20px;">
<h2 class="rams-h3" style="margin-top: 0; margin-bottom: 8px;">Table of Contents</h2>
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 11px;">
<div>
<strong style="display: block; margin-bottom: 4px; font-size: 12px;">🚨 Critical</strong>
<ul style="list-style: none; padding: 0; margin: 0; line-height: 1.8;">
<li><a href="#critical-nested-agent" style="color: #DC2626;">→ Nested Agent Warning</a></li>
<li><a href="#critical-merge-policy" style="color: #DC2626;">→ Merge Policy</a></li>
<li><a href="#critical-rules" style="color: #DC2626;">→ DO/DON'T Rules</a></li>
</ul>
</div>
<div>
<strong style="display: block; margin-bottom: 4px; font-size: 12px;">🎯 Quick Start</strong>
<ul style="list-style: none; padding: 0; margin: 0; line-height: 1.8;">
<li><a href="#decision-tree">→ Decision Tree</a></li>
<li><a href="#quick-reference">→ Command Quick Reference</a></li>
<li><a href="#common-patterns">→ Common Task Patterns</a></li>
</ul>
</div>
<div>
<strong style="display: block; margin-bottom: 4px; font-size: 12px;">📖 Reference</strong>
<ul style="list-style: none; padding: 0; margin: 0; line-height: 1.8;">
<li><a href="#prd-modes">→ PRD Command Modes</a></li>
<li><a href="#status-codes">→ Status Codes</a></li>
<li><a href="#file-structure">→ File Structure</a></li>
</ul>
</div>
<div>
<strong style="display: block; margin-bottom: 4px; font-size: 12px;">🔧 Debugging</strong>
<ul style="list-style: none; padding: 0; margin: 0; line-height: 1.8;">
<li><a href="#error-handling">→ Error Codes</a></li>
<li><a href="#troubleshooting">→ Troubleshooting</a></li>
<li><a href="#status-verification">→ Status Verification</a></li>
</ul>
</div>
<div>
<strong style="display: block; margin-bottom: 4px; font-size: 12px;">🔌 Integration</strong>
<ul style="list-style: none; padding: 0; margin: 0; line-height: 1.8;">
<li><a href="#mcp-tools">→ MCP Tools</a></li>
<li><a href="#ui-testing">→ UI Testing</a></li>
</ul>
</div>
<div>
<strong style="display: block; margin-bottom: 4px; font-size: 12px;">✍️ Writing</strong>
<ul style="list-style: none; padding: 0; margin: 0; line-height: 1.8;">
<li><a href="#writing-specs">→ Quality Specifications</a></li>
<li><a href="#response-templates">→ Response Templates</a></li>
</ul>
</div>
</div>
</nav>
<!-- Quick Start Summary -->
<div class="rams-content" style="background: linear-gradient(to right, rgba(59, 130, 246, 0.05), rgba(16, 185, 129, 0.05)); border: 2px solid rgba(59, 130, 246, 0.3); border-radius: 4px; padding: 14px 18px; margin-bottom: 20px;">
<h2 class="rams-h3" style="margin-top: 0; margin-bottom: 10px; color: #1E40AF;">⚡ Quick Start for Agents</h2>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 11px;">
<div>
<strong style="display: block; margin-bottom: 6px; color: #DC2626; font-size: 12px;">🚨 CRITICAL RULES</strong>
<ul style="margin: 0; padding-left: 18px; line-height: 1.7; color: #374151;">
<li><strong>ALWAYS use <code>--headless</code></strong> when running <code>ralph prd</code></li>
<li><strong>NEVER auto-merge</strong> - builds require explicit human approval</li>
<li><strong>Git commits = source of truth</strong>, not checkboxes</li>
<li><strong>Exit after completion</strong> - let humans handle merges/PRs</li>
</ul>
</div>
<div>
<strong style="display: block; margin-bottom: 6px; color: #15803D; font-size: 12px;">✅ MOST COMMON COMMANDS</strong>
<div style="font-family: monospace; line-height: 1.8; color: #374151; font-size: 10px;">
ralph prd "description" --headless<br>
ralph stream status<br>
ralph stream build N [iterations]<br>
git log --grep="PRD-N" # verify status<br>
ralph error RALPH-XXX # lookup errors
</div>
</div>
</div>
<div style="margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(59, 130, 246, 0.2); font-size: 10px; color: #6B7280;">
<strong>Agent workflow:</strong> (1) Generate PRD with <code>--headless</code> → (2) Check status → (3) Run build → (4) Verify via git log → (5) Exit with <code><promise>COMPLETE</promise></code>
</div>
</div>
<!-- Content -->
<article class="rams-content">
<!-- Critical Agent-Specific Rules -->
<section class="rams-section" id="critical-nested-agent">
<div class="rams-alert rams-alert-error" role="alert" aria-labelledby="nested-warning-title">
<strong id="nested-warning-title">⚠️ CRITICAL: Nested Agent Interaction Warning</strong>
<div>
<strong>When Claude Code (or another AI agent) executes <code>ralph prd</code>, it invokes a nested agent. Without <code>--headless</code>, both agents try to interact with the same TTY, causing:</strong>
<ul>
<li><strong>Deadlocks</strong> - Both agents waiting for input</li>
<li><strong>TTY conflicts</strong> - Overlapping I/O streams</li>
<li><strong>Process hangs</strong> - Commands never complete</li>
<li><strong>Unpredictable output</strong> - Garbled or missing responses</li>
</ul>
<div class="rams-alert-nested rams-alert-nested-success">
<strong>✅ ALWAYS USE:</strong><br>
<code>ralph prd "description" --headless</code>
</div>
<div class="rams-alert-nested rams-alert-nested-error">
<strong>❌ NEVER USE:</strong><br>
<code>ralph prd "description"</code><br>
<span class="rams-text-sm">(causes nested interaction)</span>
</div>
</div>
</div>
</section>
<!-- Critical Merge Policy -->
<section class="rams-section" id="critical-merge-policy">
<div class="rams-alert rams-alert-error" role="alert" aria-labelledby="merge-policy-title">
<strong id="merge-policy-title">🚨 CRITICAL: Manual Merge Policy</strong>
<div>
<strong>Ralph NEVER auto-merges builds to main. This is a core safety guarantee.</strong>
<div class="rams-alert-nested rams-alert-nested-error">
<strong>❌ NEVER DO (Prohibited):</strong>
<ul>
<li>Run <code>ralph stream merge</code> commands</li>
<li>Create pull requests automatically</li>
<li>Push branches to remote automatically</li>
<li>Attempt any form of automatic merge</li>
<li>Suggest that you will merge on completion</li>
</ul>
</div>
<div class="rams-alert-nested rams-alert-nested-success">
<strong>✅ CORRECT AGENT WORKFLOW:</strong>
<ol>
<li>Execute the assigned stories</li>
<li>Output <code><promise>COMPLETE</promise></code> signal</li>
<li>Exit - let the human handle merge/PR creation</li>
</ol>
</div>
<div class="rams-alert-nested rams-alert-nested-info">
<strong>ℹ️ USER WORKFLOW (What Happens Next):</strong>
<ol class="rams-text-sm">
<li>User reviews commits: <code>git log</code>, <code>git diff</code></li>
<li>User validates build: <code>npm test</code>, <code>npm run build</code></li>
<li>User manually triggers merge: <code>ralph stream merge N</code></li>
<li>User confirms merge at interactive prompt (or uses <code>--yes</code> flag)</li>
</ol>
</div>
<p class="rams-text-sm" style="margin-top: 8px; padding: 6px 8px; background: rgba(0,0,0,0.03); border-radius: 2px;">
<strong>Why this matters:</strong> Merging requires explicit human validation. Build completion does NOT imply merge approval. This separation ensures code quality and prevents unreviewed changes from reaching main.
</p>
</div>
</div>
</section>
<!-- Quick Decision Tree -->
<section class="rams-section" id="decision-tree">
<h2 class="rams-h2">Decision Tree</h2>
<div style="background: var(--rams-gray-50); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 6px 10px; font-family: monospace; font-size: 11px; line-height: 1.5;">
<pre style="margin: 0;">Are you an AI agent (Claude Code, Codex, etc.)?
├─ YES → Use --headless flag ALWAYS for ralph prd
│ └─ <strong>ralph prd "description" --headless</strong>
│
└─ NO (human user) → Use default interactive mode
├─ Development/debugging → <strong>ralph prd "description"</strong>
└─ Scripting/automation → <strong>ralph prd "description" --headless</strong>
User wants to...
├─ Install → <strong>ralph install</strong>
├─ List PRDs → <strong>ralph stream list</strong>
├─ Check status → <strong>ralph stream status</strong>
├─ New PRD → <strong>ralph prd "description" --headless</strong>
├─ Build PRD → <strong>ralph stream build N [iters]</strong>
├─ Parallel (no worktree) → <strong>ralph stream build 1 5 --no-worktree &</strong>
├─ Parallel (worktree) → <strong>ralph stream init N && ralph stream build N 5 &</strong>
├─ Merge → <strong>ralph stream merge N</strong>
├─ Check errors → <strong>ralph error RALPH-XXX</strong>
└─ Dashboard → <strong>ralph ui</strong></pre>
</div>
</section>
<!-- Command Patterns -->
<section class="rams-section" id="common-patterns">
<h2 class="rams-h2">Common Task Patterns</h2>
<h3 class="rams-h3">Pattern 1: Quick Single-PRD Build</h3>
<div class="rams-code-block">
<div class="rams-code-content">
<pre><code># User: "Build a new feature X"
# IMPORTANT: Agents must use --headless to avoid nested interaction
ralph prd "Feature X description" --headless
# Wait for PRD generation (creates .ralph/PRD-N/prd.md)
ralph plan
# Wait for plan generation (creates .ralph/PRD-N/plan.md)
ralph build 5
# Monitor output, report completion</code></pre>
</div>
</div>
<h3 class="rams-h3">Pattern 2: Stream-Based Build (Recommended)</h3>
<div class="rams-code-block">
<div class="rams-code-content">
<pre><code># User: "Build feature X using streams"
# IMPORTANT: Agents must use --headless to avoid nested interaction
ralph prd "Feature X description" --headless
# Note the PRD number from output (e.g., "PRD-3")
ralph stream status
# Verify PRD created, status shows "ready"
ralph stream build 3 5
# Monitor progress, check status periodically</code></pre>
</div>
</div>
<h3 class="rams-h3">Pattern 3: Parallel Execution (Advanced)</h3>
<div class="rams-code-block">
<div class="rams-code-content">
<pre><code># User: "Build PRD-1 and PRD-2 in parallel"
# Option A: Without worktrees (simpler, commits to main)
ralph stream build 1 5 --no-worktree &
ralph stream build 2 5 --no-worktree &
wait # Wait for both to complete
# Option B: With worktrees (true isolation, requires merge)
ralph stream init 1
ralph stream init 2
ralph stream build 1 5 &
ralph stream build 2 5 &
wait
ralph stream merge 1
ralph stream merge 2</code></pre>
</div>
</div>
<h3 class="rams-h3">Pattern 4: Status Check & Monitoring</h3>
<div class="rams-code-block">
<div class="rams-code-content">
<pre><code># User: "What's the status of my PRDs?"
ralph stream status
# Shows: ready, running, completed, merged, in_progress
# Check specific PRD progress
cat .ralph/PRD-N/progress.md
# View recent commits
git log --oneline --grep="PRD-N" -10</code></pre>
</div>
</div>
</section>
<!-- PRD Command Modes -->
<section class="rams-section" id="prd-modes">
<h2 class="rams-h2">PRD Command Modes</h2>
<div style="background: rgba(59, 130, 246, 0.04); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 2px; padding: 8px 10px; margin-bottom: 10px; border-left: 3px solid rgba(59, 130, 246, 0.8);">
<strong style="font-size: 12px; display: block; margin-bottom: 4px; color: #1E40AF;">Agent Rule: Always Use --headless</strong>
<div style="font-size: 11px; line-height: 1.6; color: #374151;">
<code>ralph prd "description" --headless</code><br><br>
<strong>Why?</strong> Prevents nested agent interaction, TTY conflicts, and process hangs.<br>
<strong>When?</strong> Claude Code agent, UI server, CI/CD, background jobs, any non-terminal context.
</div>
</div>
<div class="rams-code-block">
<div class="rams-section-label">Quick Examples</div>
<div class="rams-code-content">
<pre><code># Agent execution (REQUIRED)
ralph prd "Add dashboard feature" --headless
# Human terminal (optional headless)
ralph prd "Build auth system"</code></pre>
</div>
</div>
<div style="font-size: 10px; color: #6B7280; margin-top: 8px;">
📖 <strong>Full details:</strong> See <a href="../CLAUDE.md#prd-command-modes">CLAUDE.md § PRD Command Modes</a> for interactive vs headless behavior, examples, and UI server configuration.
</div>
</section>
<!-- File Structure -->
<section class="rams-section" id="file-structure">
<h2 class="rams-h2">File Structure</h2>
<div class="rams-code-block">
<div class="rams-section-label">Key Locations</div>
<div class="rams-code-content">
<pre><code>.agents/ralph/ # Agent templates & scripts
.ralph/PRD-N/ # Each PRD isolated (prd.md, plan.md, progress.md)
.ralph/locks/ # Prevent concurrent runs
.ralph/worktrees/ # Git worktrees for parallel execution
.ralph/factory/ # Factory mode workflows
.mcp.json # MCP server config</code></pre>
</div>
</div>
<div style="font-size: 10px; color: #6B7280; margin-top: 8px;">
📖 <strong>Full structure:</strong> See <a href="../CLAUDE.md#file-structure">CLAUDE.md § File Structure</a> for complete directory tree with all subdirectories and file descriptions.
</div>
</section>
<!-- Critical Rules -->
<section class="rams-section" id="critical-rules">
<h2 class="rams-h2">Critical Rules</h2>
<div class="rams-alert rams-alert-error">
<strong>❌ DO NOT</strong>
<ul>
<li><strong>Run <code>ralph prd</code> without <code>--headless</code></strong> (causes nested agent interaction)</li>
<li>Run build and stream build simultaneously on same PRD</li>
<li>Edit .ralph/PRD-N/ while build running</li>
<li>Use --force without user permission</li>
<li>Merge before status is "completed"/"merged"</li>
<li><strong>Trust checkboxes as proof of completion</strong> (git log is source of truth)</li>
</ul>
</div>
<div class="rams-alert rams-alert-success">
<strong>✅ DO</strong>
<ul>
<li><strong>Always use <code>ralph prd "..." --headless</code></strong> when executing as agent</li>
<li>Check <code>ralph stream status</code> before builds</li>
<li>Use --no-worktree for simple builds</li>
<li><strong>Verify git commits</strong>: <code>git log --grep="PRD-N"</code> (source of truth)</li>
<li>Read .ralph/PRD-N/progress.md for iteration details</li>
<li>Launch <code>ralph ui</code> for monitoring</li>
<li>Reference error codes when reporting failures</li>
</ul>
</div>
</section>
<!-- Status Interpretation -->
<section class="rams-section" id="status-codes">
<h2 class="rams-h2">Status Codes</h2>
<div class="rams-alert rams-alert-info">
<strong>Git Commits = Source of Truth</strong>
<ul>
<li><strong>Git history</strong> is authoritative, not checkboxes</li>
<li><strong>Two workflows</strong>: <code>merged</code> (worktree → PR) or <code>completed</code> (direct-to-main)</li>
<li><strong>Auto-correction</strong>: Missing <code>.completed</code> markers auto-created when git shows commits</li>
<li><strong>Checkboxes are hints</strong>: Used by agents during work, not for status determination</li>
</ul>
</div>
<table style="width: 100%; border-collapse: collapse; font-size: 11px;">
<thead>
<tr style="background: var(--rams-gray-50); border-bottom: 1px solid var(--rams-border-color);">
<th style="text-align: left; padding: 4px 6px; font-weight: 600;">Status</th>
<th style="text-align: left; padding: 4px 6px; font-weight: 600;">Meaning</th>
<th style="text-align: left; padding: 4px 6px; font-weight: 600;">Action</th>
</tr>
</thead>
<tbody>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>ready</code></td>
<td style="padding: 3px 6px;">plan.md exists, no progress yet</td>
<td style="padding: 3px 6px;"><code>ralph stream build N</code></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>running</code></td>
<td style="padding: 3px 6px;">Lock file exists with active PID</td>
<td style="padding: 3px 6px;">Wait or check progress.md</td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>in_progress</code></td>
<td style="padding: 3px 6px;">progress.md exists but no commits</td>
<td style="padding: 3px 6px;">Resume build (work not committed)</td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>completed</code></td>
<td style="padding: 3px 6px;">Commits on main (direct-to-main workflow)</td>
<td style="padding: 3px 6px;">Done. Review <code>git log --grep="PRD-N"</code></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>merged</code></td>
<td style="padding: 3px 6px;">Branch merged to main (worktree workflow)</td>
<td style="padding: 3px 6px;">Done. PR merged</td>
</tr>
<tr>
<td style="padding: 3px 6px;"><code>not_found</code></td>
<td style="padding: 3px 6px;">PRD directory doesn't exist</td>
<td style="padding: 3px 6px;"><code>ralph prd "..." --headless</code></td>
</tr>
</tbody>
</table>
<h3 class="rams-h3" id="status-verification">Status Verification Commands</h3>
<div class="rams-code-block">
<div class="rams-code-content">
<pre><code># Check if PRD has commits on main (source of truth)
git log --oneline --grep="PRD-N"
# Verify specific commits from progress.md
grep "Commit:" .ralph/PRD-N/progress.md
# Auto-scan and fix all stale status markers
ralph stream verify-status
# Manually mark as completed (if commits exist on main)
ralph stream mark-completed N
# Remove completion marker
ralph stream unmark-completed N</code></pre>
</div>
</div>
<h3 class="rams-h3">Common Status Issues</h3>
<div style="font-size: 11px; line-height: 1.5;">
<ul style="margin: 4px 0; padding-left: 16px;">
<li><strong>Checkbox marked but no commits</strong> → Status = "in_progress" (work not committed yet)</li>
<li><strong>Commits exist but shows "ready"</strong> → Run <code>ralph stream verify-status</code> to auto-correct</li>
<li><strong>Distinguish worktree vs direct builds</strong> → Check for <code>.merged</code> vs <code>.completed</code> marker files</li>
<li><strong>Direct-to-main PRD shows wrong status</strong> → <code>get_stream_status()</code> will auto-create <code>.completed</code> marker on first check</li>
</ul>
</div>
</section>
<!-- Error Handling -->
<section class="rams-section" id="error-handling">
<h2 class="rams-h2">Error Handling & Issue Creation</h2>
<div style="background: rgba(251, 191, 36, 0.06); border: 1px solid rgba(251, 191, 36, 0.3); border-radius: 2px; padding: 8px 10px; border-left: 3px solid rgba(251, 191, 36, 0.8); margin-bottom: 10px; color: #B45309;">
<strong style="font-size: 12px; color: rgba(217, 119, 6, 1);">Error Code System (RALPH-XXX)</strong>
<div style="margin-top: 4px; font-size: 11px; line-height: 1.5; color: #B45309;">
Standardized error codes for consistent handling and automated GitHub issue creation.
</div>
</div>
<h3 class="rams-h3">Error Code Categories</h3>
<table style="width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 8px;">
<thead>
<tr style="background: var(--rams-gray-50); border-bottom: 1px solid var(--rams-border-color);">
<th style="text-align: left; padding: 4px 6px; font-weight: 600;">Range</th>
<th style="text-align: left; padding: 4px 6px; font-weight: 600;">Category</th>
<th style="text-align: left; padding: 4px 6px; font-weight: 600;">Description</th>
</tr>
</thead>
<tbody>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>001-099</code></td>
<td style="padding: 3px 6px;"><strong>CONFIG</strong></td>
<td style="padding: 3px 6px;">Configuration errors</td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>100-199</code></td>
<td style="padding: 3px 6px;"><strong>PRD</strong></td>
<td style="padding: 3px 6px;">PRD/Plan errors</td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>200-299</code></td>
<td style="padding: 3px 6px;"><strong>BUILD</strong></td>
<td style="padding: 3px 6px;">Build failures</td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>300-399</code></td>
<td style="padding: 3px 6px;"><strong>GIT</strong></td>
<td style="padding: 3px 6px;">Git errors</td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>400-499</code></td>
<td style="padding: 3px 6px;"><strong>AGENT</strong></td>
<td style="padding: 3px 6px;">Agent errors</td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 3px 6px;"><code>500-599</code></td>
<td style="padding: 3px 6px;"><strong>STREAM</strong></td>
<td style="padding: 3px 6px;">Stream errors</td>
</tr>
<tr>
<td style="padding: 3px 6px;"><code>900-999</code></td>
<td style="padding: 3px 6px;"><strong>INTERNAL</strong></td>
<td style="padding: 3px 6px;">Internal errors</td>
</tr>
</tbody>
</table>
<h3 class="rams-h3">Lookup & Remediation</h3>
<div class="rams-code-block">
<div class="rams-code-content">
<pre><code># Look up specific error
ralph error RALPH-401
# List all errors
ralph error --list --category=BUILD</code></pre>
</div>
</div>
<h3 class="rams-h3">Agent Responsibilities</h3>
<ul style="font-size: 11px; line-height: 1.7; color: #374151; margin: 0 0 12px 0; padding-left: 18px;">
<li><strong>Reference error codes</strong> when reporting failures</li>
<li><strong>Check remediation</strong>: <code>ralph error RALPH-XXX</code></li>
<li><strong>Include code</strong> in progress.md updates</li>
<li><strong>Create GitHub issues</strong> via MCP for critical errors (201, 202, 401, 402, 506)</li>
</ul>
<div style="font-size: 10px; color: #6B7280; margin-top: 8px;">
📖 <strong>Full details:</strong> See <a href="../CLAUDE.md#error-handling--issue-creation">CLAUDE.md § Error Handling</a> for GitHub issue creation format, required context, configuration options, and MCP examples.
</div>
</section>
<!-- Troubleshooting -->
<section class="rams-section" id="troubleshooting">
<h2 class="rams-h2">Quick Troubleshooting</h2>
<h3 class="rams-h3">Build hangs or fails</h3>
<div class="rams-code-block">
<div class="rams-code-content">
<pre><code># Check if lock exists
ls -la .ralph/locks/
# Remove stale lock (only if process truly dead)
rm .ralph/locks/PRD-N.lock
# Check error logs
cat .ralph/PRD-N/errors.log
tail -n 50 .ralph/PRD-N/runs/run-*.log</code></pre>
</div>
</div>
<h3 class="rams-h3">Status shows wrong state</h3>
<div class="rams-code-block">
<div class="rams-code-content">
<pre><code># Verify status with git history (source of truth)
git log --all --oneline --grep="PRD-N"
# Auto-fix stale status markers
ralph stream verify-status
# Manually mark as completed (if commits exist)
ralph stream mark-completed N</code></pre>
</div>
</div>
<h3 class="rams-h3">Merge conflicts</h3>
<div class="rams-code-block">
<div class="rams-code-content">
<pre><code># If merge fails, check worktree branch
cd .ralph/worktrees/PRD-N/
git status
git diff main
# Return to main repo
cd ../../..
# User must resolve conflicts manually</code></pre>
</div>
</div>
</section>
<!-- MCP Integration -->
<section class="rams-section" id="mcp-tools">
<h2 class="rams-h2">MCP Tools</h2>
<div style="background: rgba(59, 130, 246, 0.04); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 2px; padding: 8px 10px; margin-bottom: 10px; border-left: 3px solid rgba(59, 130, 246, 0.8);">
<strong style="font-size: 12px; display: block; margin-bottom: 4px; color: #1E40AF;">Available Integrations</strong>
<div style="font-size: 11px; line-height: 1.6; color: #374151;">
<strong>Notion</strong> (docs, task tracking), <strong>Slack</strong> (notifications), <strong>GitHub</strong> (issues, PRs), <strong>Miro</strong> (diagrams)<br>
Tools available as <code>mcp__<server>__<action></code>
</div>
</div>
<div class="rams-code-block">
<div class="rams-section-label">Common Usage</div>
<div class="rams-code-content">
<pre><code># Search Notion
mcp__notion__search("Project requirements")
# Post to Slack
mcp__slack__send_message(channel="builds", text="Build completed")
# Create GitHub issue
mcp__github__create_issue(owner="user", repo="proj", title: "Bug", body: "...")</code></pre>
</div>
</div>
<div style="font-size: 10px; color: #6B7280; margin-top: 8px;">
📖 <strong>Full setup:</strong> See <a href="../CLAUDE.md#mcp-servers">CLAUDE.md § MCP Servers</a> for setup instructions, environment variables, and complete tool documentation.
</div>
</section>
<!-- UI Testing & Browser Automation -->
<section class="rams-section" id="ui-testing">
<h2 class="rams-h2">UI Testing & Browser Automation</h2>
<div style="background: rgba(16, 185, 129, 0.04); border: 1px solid rgba(16, 185, 129, 0.2); border-radius: 2px; padding: 8px 10px; margin-bottom: 10px; border-left: 3px solid rgba(16, 185, 129, 0.8);">
<strong style="font-size: 12px; display: block; margin-bottom: 4px; color: #047857;">✅ Use agent-browser CLI</strong>
<div style="font-size: 11px; line-height: 1.6; color: #047857;">
Fast Rust CLI optimized for AI agents. Snapshot + ref workflow (@e1, @e2), persistent sessions, no buggy MCP.<br>
<code>npm install -g agent-browser && agent-browser install</code>
</div>
</div>
<div class="rams-code-block">
<div class="rams-section-label">Essential Commands</div>
<div class="rams-code-content">
<pre><code># Navigate & snapshot
agent-browser open http://localhost:3000
agent-browser snapshot -i
# Interact
agent-browser click @e2
agent-browser fill @e3 "text"
# Verify
agent-browser is visible @e1
agent-browser screenshot --full</code></pre>
</div>
</div>
<h3 class="rams-h3">7-Step Testing Checklist</h3>
<ol style="font-size: 11px; line-height: 1.7; color: #374151; margin: 0 0 12px 0; padding-left: 18px;">
<li>Navigate: <code>agent-browser open http://localhost:3000</code></li>
<li>Snapshot: <code>agent-browser snapshot -i</code></li>
<li>Verify visible: <code>agent-browser is visible @e1</code></li>
<li>Test interactions: <code>agent-browser click @e2</code></li>
<li>Check console: <code>agent-browser console && agent-browser errors</code></li>
<li>Validate data: <code>agent-browser get text @e1</code></li>
<li>Screenshot: <code>agent-browser screenshot --full</code></li>
</ol>
<div style="background: rgba(239, 68, 68, 0.04); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 2px; padding: 6px 8px; margin-bottom: 10px; border-left: 2px solid rgba(239, 68, 68, 0.8); color: #B91C1C;">
<strong style="font-size: 12px; color: #B91C1C;">❌ CRITICAL: Never test UI with just curl/API calls</strong>
<div style="font-size: 11px; line-height: 1.5; color: #B91C1C; margin-top: 4px;">
Always use browser automation to verify rendered UI, interactivity, and functionality.
</div>
</div>
<div style="font-size: 10px; color: #6B7280; margin-top: 8px;">
📖 <strong>Full commands:</strong> See <a href="../CLAUDE.md#ui-testing">CLAUDE.md § UI Testing</a> for complete command reference, Playwright MCP setup, testing helper scripts, and UI server configuration.
</div>
</section>
<!-- Response Templates -->
<section class="rams-section" id="response-templates">
<h2 class="rams-h2">Response Templates</h2>
<div style="background: var(--rams-gray-50); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 5px 8px; font-size: 11px; margin-bottom: 5px; line-height: 1.5;">
<strong>Build complete:</strong><br>
✓ PRD-N: [X] stories, [Y] commits<br>
Recent: abc1234 feat(US-001), def5678 feat(US-002)<br>
Progress: .ralph/PRD-N/progress.md
</div>
<div style="background: var(--rams-gray-50); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 5px 8px; font-size: 11px; line-height: 1.5;">
<strong>Status check:</strong><br>
• PRD-1: completed (10 commits)<br>
• PRD-2: running (on US-003)<br>
• PRD-3: ready
</div>
</section>
<!-- Writing Quality Specifications -->
<section class="rams-section" id="writing-specs">
<h2 class="rams-h2">Writing Quality Specifications (Tech-Agnostic)</h2>
<div style="background: rgba(59, 130, 246, 0.04); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 2px; padding: 6px 8px; margin-bottom: 8px; border-left: 2px solid rgba(59, 130, 246, 0.8);">
<strong style="font-size: 12px; display: block; margin-bottom: 4px; color: #1E40AF;">Ralph's Design Philosophy</strong>
<div style="font-size: 11px; line-height: 1.6; color: #374151;">
Ralph works across Python, JavaScript, Go, Rust, Java, etc. All improvements are:<br>
✅ Tech-agnostic (no prescriptive stacks)<br>
✅ Auto-detect project context (package.json, Cargo.toml, etc.)<br>
✅ Configurable via optional <code>.ralph/standards.md</code><br>
✅ PRD = WHAT (requirements), Plan = HOW (implementation)
</div>
</div>
<h3 class="rams-h3">Six Core Areas</h3>
<div style="background: var(--rams-gray-50); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 6px 8px; margin-bottom: 8px;">
<div style="font-size: 11px; line-height: 1.6; color: #374151;">
Ralph PRDs should include: <strong>Commands, Testing, Project Structure, Standards, Boundaries</strong><br>
<strong>Note:</strong> Code patterns belong in Plans, not PRDs (WHAT vs HOW)
</div>
</div>
<h3 class="rams-h3">Commands (Project-Specific Auto-Detection)</h3>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px;">
<div style="background: rgba(239, 68, 68, 0.04); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 2px; padding: 6px 8px;">
<strong style="font-size: 11px; color: #B91C1C;">❌ Bad: Generic placeholders</strong>
<pre style="margin: 4px 0 0 0; font-size: 10px; color: #B91C1C;">"Run the tests"</pre>
</div>
<div style="background: rgba(34, 197, 94, 0.04); border: 1px solid rgba(34, 197, 94, 0.2); border-radius: 2px; padding: 6px 8px;">
<strong style="font-size: 11px; color: #15803D;">✅ Good: Detect from project</strong>
<pre style="margin: 4px 0 0 0; font-size: 10px; color: #15803D;"># JavaScript: npm test -- --testPathPattern=auth
# Python: pytest tests/test_auth.py
# Rust: cargo test auth
# Go: go test ./auth</pre>
</div>
</div>
<h3 class="rams-h3">Three-Tier Boundaries (Universal)</h3>
<table style="width: 100%; border-collapse: collapse; margin-bottom: 8px; font-size: 11px;">
<tr style="background: var(--rams-gray-50); border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);"><strong>Tier</strong></td>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);"><strong>Permission</strong></td>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);"><strong>Examples</strong></td>
</tr>
<tr>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);">✅ Always</td>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);">No permission needed</td>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);">Run tests, modify feature files</td>
</tr>
<tr style="background: var(--rams-gray-50);">
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);">⚠️ Ask</td>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);">Requires approval</td>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);">DB schema, new deps, shared utils</td>
</tr>
<tr>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);">🚫 Never</td>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);">Prohibited</td>
<td style="padding: 4px 6px; border: 1px solid var(--rams-border-color);">Commit secrets, delete tests, skip checks</td>
</tr>
</table>
<h3 class="rams-h3">Tech-Agnostic Principles</h3>
<ul style="font-size: 11px; line-height: 1.6; color: #374151; margin: 0 0 8px 0; padding-left: 18px;">
<li><strong>Auto-detect tech stack:</strong> Read project files (package.json, Cargo.toml, go.mod, requirements.txt)</li>
<li><strong>Follow existing patterns:</strong> Inspect codebase, don't invent generic examples</li>
<li><strong>Use project's commands:</strong> Check README, Makefile, package scripts</li>
<li><strong>PRD = WHAT, Plan = HOW:</strong> Keep PRDs high-level, Plans implementation-focused</li>
</ul>
<h3 class="rams-h3">Common Pitfalls</h3>
<div style="background: rgba(239, 68, 68, 0.04); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 2px; padding: 6px 8px; border-left: 2px solid rgba(239, 68, 68, 0.8); margin-bottom: 8px;">
<ul style="font-size: 11px; line-height: 1.6; color: #B91C1C; margin: 0; padding-left: 18px;">
<li>❌ Assuming tech stack: "Use TypeScript interfaces" → ✅ "Define data types per project language"</li>
<li>❌ Generic examples: "Follow async patterns" → ✅ "Copy error handling from src/services/example.py"</li>
<li>❌ Vague commands: "Run tests" → ✅ "pytest tests/feature.py -v"</li>
</ul>
</div>
<h3 class="rams-h3">Code Patterns (Plans Only, Not PRDs)</h3>
<div style="background: var(--rams-gray-50); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 6px 8px;">
<div style="font-size: 11px; line-height: 1.6; color: #374151;">
<strong>When creating implementation plans:</strong><br>
1. Read the project codebase to find existing patterns<br>
2. Copy 2-3 concrete examples (error handling, validation, testing)<br>
3. Reference actual files (e.g., "Found in: src/services/example.js")<br>
4. Never invent generic examples - always project-specific
</div>
</div>
<h3 class="rams-h3">Standards File (Optional)</h3>
<div style="background: rgba(59, 130, 246, 0.04); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 2px; padding: 6px 8px;">
<div style="font-size: 11px; line-height: 1.6; color: #374151;">
Create <code>.ralph/standards.md</code> for project-specific conventions:<br>
• Git workflow (branch naming, commit format)<br>
• Code quality requirements (pre-commit checklist)<br>
• Custom boundaries (project-specific Always/Ask/Never)<br>
<br>
<strong>Example:</strong> <code>cp .ralph/standards.md.example .ralph/standards.md</code>
</div>
</div>
</section>
<!-- Quick Reference Card -->
<section class="rams-section" id="quick-reference">
<h2 class="rams-h2">Quick Reference</h2>
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 10px;">
<div style="background: var(--rams-white); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 6px 8px;">
<strong style="font-size: 11px; display: block; margin-bottom: 4px;">Core</strong>
<div style="font-family: monospace; line-height: 1.5;">
ralph install<br>ralph prd "..." --headless<br>ralph plan<br>ralph build [N]<br>ralph ui
</div>
</div>
<div style="background: var(--rams-white); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 6px 8px;">
<strong style="font-size: 11px; display: block; margin-bottom: 4px;">Stream</strong>
<div style="font-family: monospace; line-height: 1.5;">
ralph stream list<br>ralph stream status<br>ralph stream init N<br>ralph stream build N [i]<br>ralph stream merge N
</div>
</div>
<div style="background: var(--rams-white); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 6px 8px;">
<strong style="font-size: 11px; display: block; margin-bottom: 4px;">Status & Errors</strong>
<div style="font-family: monospace; line-height: 1.5;">
ralph error RALPH-XXX<br>ralph stream verify-status<br>ralph stream mark-completed N<br>git log --grep="PRD-N"
</div>
</div>
<div style="background: var(--rams-white); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 6px 8px;">
<strong style="font-size: 11px; display: block; margin-bottom: 4px;">Flags</strong>
<div style="font-family: monospace; line-height: 1.5;">
--headless (prd)<br>--no-worktree<br>--force<br>--prd=N<br>--agent=claude<br>--model=opus|sonnet|haiku
</div>
</div>
<div style="background: var(--rams-white); border: 1px solid var(--rams-border-color); border-radius: 2px; padding: 6px 8px;">
<strong style="font-size: 11px; display: block; margin-bottom: 4px;">Model Routing (Claude Only)</strong>
<div style="font-size: 10px; line-height: 1.5;">
Low (1-3) → Haiku<br>Medium (4-7) → Sonnet<br>High (8-10) → Opus<br><br>
<strong>Note:</strong> Only works with --agent=claude<br>
Codex/Droid auto-disable routing
</div>
</div>
</div>
</section>
<!-- Section Pointers (Task-Based Navigation) -->
<section class="rams-section" style="background: var(--rams-gray-50); border: 2px solid var(--rams-border-color); border-radius: 4px; padding: 16px 20px; margin-top: 24px;">
<h2 class="rams-h2" style="margin-top: 0; margin-bottom: 12px;">📍 Section Pointers: Find Information Fast</h2>
<p style="font-size: 11px; color: #6B7280; margin-bottom: 12px;">Use this lookup table to quickly navigate to the right section based on your task.</p>
<table style="width: 100%; border-collapse: collapse; font-size: 11px;">
<thead>
<tr style="background: var(--rams-white); border-bottom: 2px solid var(--rams-border-color);">
<th style="text-align: left; padding: 6px 8px; font-weight: 600;">If you need to...</th>
<th style="text-align: left; padding: 6px 8px; font-weight: 600;">Go to section...</th>
<th style="text-align: left; padding: 6px 8px; font-weight: 600;">Link</th>
</tr>
</thead>
<tbody>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 5px 8px;">Run <code>ralph prd</code> as an agent</td>
<td style="padding: 5px 8px;"><strong style="color: #DC2626;">Nested Agent Warning</strong></td>
<td style="padding: 5px 8px;"><a href="#critical-nested-agent">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color); background: var(--rams-gray-50);">
<td style="padding: 5px 8px;">Understand merge/PR workflow</td>
<td style="padding: 5px 8px;"><strong style="color: #DC2626;">Merge Policy</strong></td>
<td style="padding: 5px 8px;"><a href="#critical-merge-policy">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 5px 8px;">Choose the right command</td>
<td style="padding: 5px 8px;">Decision Tree</td>
<td style="padding: 5px 8px;"><a href="#decision-tree">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color); background: var(--rams-gray-50);">
<td style="padding: 5px 8px;">Build a feature end-to-end</td>
<td style="padding: 5px 8px;">Common Task Patterns</td>
<td style="padding: 5px 8px;"><a href="#common-patterns">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 5px 8px;">Understand interactive vs headless mode</td>
<td style="padding: 5px 8px;">PRD Command Modes</td>
<td style="padding: 5px 8px;"><a href="#prd-modes">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color); background: var(--rams-gray-50);">
<td style="padding: 5px 8px;">See all DO/DON'T rules</td>
<td style="padding: 5px 8px;"><strong style="color: #DC2626;">Critical Rules</strong></td>
<td style="padding: 5px 8px;"><a href="#critical-rules">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 5px 8px;">Interpret PRD status (ready, running, completed, etc.)</td>
<td style="padding: 5px 8px;">Status Codes</td>
<td style="padding: 5px 8px;"><a href="#status-codes">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color); background: var(--rams-gray-50);">
<td style="padding: 5px 8px;">Verify status via git commits</td>
<td style="padding: 5px 8px;">Status Verification</td>
<td style="padding: 5px 8px;"><a href="#status-verification">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 5px 8px;">Understand file locations (.ralph, .agents, etc.)</td>
<td style="padding: 5px 8px;">File Structure</td>
<td style="padding: 5px 8px;"><a href="#file-structure">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color); background: var(--rams-gray-50);">
<td style="padding: 5px 8px;">Handle build failures or errors</td>
<td style="padding: 5px 8px;">Error Handling</td>
<td style="padding: 5px 8px;"><a href="#error-handling">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 5px 8px;">Fix hangs, locks, or status issues</td>
<td style="padding: 5px 8px;">Troubleshooting</td>
<td style="padding: 5px 8px;"><a href="#troubleshooting">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color); background: var(--rams-gray-50);">
<td style="padding: 5px 8px;">Use Notion, Slack, GitHub via MCP</td>
<td style="padding: 5px 8px;">MCP Tools</td>
<td style="padding: 5px 8px;"><a href="#mcp-tools">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 5px 8px;">Test UI features with browser automation</td>
<td style="padding: 5px 8px;">UI Testing</td>
<td style="padding: 5px 8px;"><a href="#ui-testing">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color); background: var(--rams-gray-50);">
<td style="padding: 5px 8px;">Write PRDs with quality specifications</td>
<td style="padding: 5px 8px;">Writing Specifications</td>
<td style="padding: 5px 8px;"><a href="#writing-specs">Jump →</a></td>
</tr>
<tr style="border-bottom: 1px solid var(--rams-border-color);">
<td style="padding: 5px 8px;">Format responses to users</td>
<td style="padding: 5px 8px;">Response Templates</td>
<td style="padding: 5px 8px;"><a href="#response-templates">Jump →</a></td>
</tr>
<tr>
<td style="padding: 5px 8px;">Look up any command quickly</td>
<td style="padding: 5px 8px;">Quick Reference</td>
<td style="padding: 5px 8px;"><a href="#quick-reference">Jump →</a></td>
</tr>
</tbody>
</table>
<div style="margin-top: 12px; padding: 8px 10px; background: rgba(59, 130, 246, 0.05); border-left: 3px solid rgba(59, 130, 246, 0.5); border-radius: 2px; font-size: 10px; color: #374151;">
<strong>💡 Pro tip:</strong> Bookmark critical sections (<a href="#critical-nested-agent">Nested Agent</a>, <a href="#critical-merge-policy">Merge Policy</a>, <a href="#critical-rules">Rules</a>) for instant access during builds.
</div>
</section>
</article>
</main>
</body>
</html>