Skip to content

Commit b76be12

Browse files
Kasper JungeKasper Junge
authored andcommitted
.
1 parent 252f5d0 commit b76be12

1 file changed

Lines changed: 125 additions & 0 deletions

File tree

examples/optimize-docs/RALPH.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
agent: claude -p --dangerously-skip-permissions
3+
commands:
4+
- name: docs-build
5+
run: uv run mkdocs build --strict
6+
- name: git-log
7+
run: git log --oneline -20
8+
---
9+
10+
# Optimize Docs
11+
12+
You are an autonomous coding agent running in a loop. Each iteration
13+
starts with a fresh context. Your progress lives in the code and git.
14+
15+
## Docs build output
16+
17+
{{ commands.docs-build }}
18+
19+
If there are warnings or errors above, fix them first — that always
20+
takes priority over everything else.
21+
22+
## Recent commits
23+
24+
{{ commands.git-log }}
25+
26+
## Task
27+
28+
Pick **one** small, concrete improvement per iteration from the
29+
categories below. Rotate between categories — don't do the same
30+
category twice in a row. Check recent commits to see what you already
31+
did in previous iterations.
32+
33+
### Categories
34+
35+
**1. Page quality** — Find a page that is too long, dense, or hard to
36+
scan. Break up walls of text, add examples, improve heading structure,
37+
trim unnecessary content. Target: every page should be fast to consume.
38+
Also:
39+
- Add TL;DR summary boxes (`!!! tldr` admonition) at the top of guides
40+
- Add "Prerequisites" sections before tutorials
41+
- Replace generic headings ("Usage", "Example", "Overview") with
42+
descriptive ones that work in a table of contents and search results
43+
- Use progressive disclosure (`??? note` collapsible blocks) for
44+
advanced or edge-case content
45+
- Max 3 sentences before a code block — lead with the command, not
46+
the explanation
47+
48+
**2. Links and navigation** — Find broken internal or external links,
49+
orphan pages not reachable from the nav, or dead-end pages with no
50+
clear next step. Fix navigation so users always know where to go next.
51+
Also:
52+
- Add "Next steps" links at the bottom of every page (2-3 related pages)
53+
- Link key terms to their reference page on first mention in each page
54+
- Build a mental link graph — fix orphan pages (no incoming links) and
55+
dead-end pages (no outgoing internal links)
56+
- Every page should have at least 3 internal links in the body content
57+
58+
**3. SEO and discoverability** — Do real SEO research for each page you
59+
touch. Think about what developers would actually search to find this
60+
content. Then:
61+
- Rewrite page titles to match "how to X with Y" query patterns that
62+
developers actually type
63+
- Add clear `description` and `keywords` to frontmatter — base these
64+
on actual search intent, not just the page content
65+
- Research what terms competing tools (aider, cursor, claude-code,
66+
copilot) rank for and use relevant ones
67+
- Target long-tail keywords around specific tasks ("run AI agent in
68+
loop", "automate coding agent prompts")
69+
- Add Schema.org `TechArticle` structured data where appropriate
70+
71+
**4. Content freshness** — Cross-reference docs with the current code.
72+
Find docs that describe behavior that has changed or features that have
73+
been added. Update or remove stale content. Also:
74+
- Check that error messages from the source code appear in the
75+
troubleshooting docs — developers google exact error strings
76+
- Verify every RALPH.md example in docs has valid YAML frontmatter
77+
- Ensure terminology is consistent across all pages ("ralph" vs "Ralph"
78+
vs "RALPH" — only the filename should be uppercase)
79+
80+
**5. Cross-surface consistency** — Check that features documented in
81+
one place are also covered where relevant in: `docs/`, `README.md`,
82+
`docs/quick-reference.md`, and `src/ralphify/skills/new-ralph/SKILL.md`.
83+
Fix gaps, not duplications — each surface has its own purpose.
84+
85+
**6. Code example quality** — Find code examples that could be better.
86+
- Ensure every code block has a language annotation (```yaml, ```bash)
87+
- Show command output alongside commands, not just the command itself
88+
- Replace placeholder values (`<your-thing-here>`) with realistic,
89+
copy-pasteable values
90+
- Verify code examples are syntactically correct and actually work
91+
- Add MkDocs Material code annotations for inline explanations
92+
93+
**7. LLM and AI optimization** — Make docs consumable by AI tools.
94+
- Generate or update `llms.txt` at the site root — a structured
95+
markdown summary of the project for LLMs
96+
- Generate or update `llms-full.txt` — all docs concatenated into one
97+
file with clear section headers
98+
- Ensure each page is self-contained: defines its terms and doesn't
99+
assume context from other pages
100+
- Use explicit Q&A format for FAQ-style content (literal questions as
101+
headings like "## How do I pass arguments to a ralph?")
102+
103+
**8. MkDocs config and DX** — Audit and improve the docs site config.
104+
- Verify these MkDocs Material features are enabled: copy buttons
105+
(`content.code.copy`), dark mode toggle, feedback widget, "Edit this
106+
page" link (`edit_uri`), breadcrumbs, keyboard search (Cmd/Ctrl+K)
107+
- Check that navigation hierarchy is max 2 levels deep
108+
- Verify the site works on mobile (check for overly wide tables or
109+
code blocks)
110+
111+
## Principles
112+
113+
- **One thing per iteration.** Don't bundle multiple fixes.
114+
- **Read before writing.** Always read the relevant code and existing
115+
docs before changing anything.
116+
- **Don't gold-plate.** Good enough is good enough. Move on.
117+
- **Jobs-to-be-done framing.** Frame docs around what the user is
118+
trying to accomplish, not feature descriptions.
119+
- Ralphify's tone is direct, casual, and practical.
120+
121+
## Rules
122+
123+
- Run `mkdocs build --strict` and ensure zero warnings before committing
124+
- Commit with a descriptive message and push
125+
- Include which category (1-8) you worked on in the commit message

0 commit comments

Comments
 (0)