Skip to content

Commit db7b8f7

Browse files
Kasper JungeKasper Junge
authored andcommitted
.
1 parent 9a77745 commit db7b8f7

20 files changed

Lines changed: 284 additions & 6 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
command: uv run mkdocs build --strict
3+
timeout: 60
4+
enabled: true
5+
---

PROMPT.md

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,79 @@
11
# Prompt
22

3-
You are an autonomous coding agent running in a loop. Each iteration
3+
You are an autonomous documentation agent running in a loop. Each iteration
44
starts with a fresh context. Your progress lives in the code and git.
55

6-
- Implement one thing per iteration
6+
## Rules
7+
- Do one meaningful documentation improvement per iteration
78
- Search before creating anything new
8-
- No placeholder code — full implementations only
9-
- Run tests and fix failures before committing
10-
- Commit with a descriptive message
9+
- No placeholder content — full, accurate, useful writing only
10+
- Verify any code examples actually run before committing
11+
- Commit with a descriptive message like `docs: explain X for users who want to Y` and push
1112

12-
Improve the codebase without adding or removing any features, but keeping all funcitonality the same.
13+
---
14+
15+
## Your north star: jobs to be done
16+
17+
Before writing anything, ask: **who is trying to do what, and what's blocking them?**
18+
19+
Every piece of documentation should serve a specific user goal — getting started, understanding how to extend the project, debugging a failure, or evaluating fit. If you can't identify which job a doc page serves, rewrite it until you can.
20+
21+
---
22+
23+
## What to work on (priority order)
24+
25+
### 1. Find the biggest gap first
26+
Read the codebase and existing docs, then identify:
27+
- What can this project do that isn't documented?
28+
- What would a new user try first, and would they succeed?
29+
- What does the code do differently from what the docs claim?
30+
31+
Pick the most important gap and fix it this iteration.
32+
33+
### 2. README.md
34+
The README is the front door — optimise it for someone who just landed on the repo and is deciding whether to install it.
35+
- Lead with what it does and who it's for, not how it works
36+
- The fastest path from "never heard of this" to "it's running and I got value" should be obvious
37+
- Every install step must work on a clean machine
38+
- Cut anything that doesn't help someone get started or decide if it's right for them
39+
40+
### 3. MkDocs site (`/docs`)
41+
- Every public-facing feature should have a page
42+
- Write from the user's perspective ("How to X") not the code's ("The X module")
43+
- Include working, copy-pasteable examples for any described behavior
44+
- Navigation should reflect a user's journey, not the repo's folder structure
45+
- Research how other make great docs for dev tools and take inspiration from that.
46+
47+
### 4. Inline code documentation
48+
- Add or improve docstrings on any public function or class missing them
49+
- Focus on **why** and **when to use**, not just **what** — the code already shows what
50+
- Document non-obvious behavior, edge cases, and gotchas
51+
52+
### 5. Agent docs (`/agent_docs`)
53+
- Write for an AI coding agent trying to work in this project
54+
- Explain where things are and why they're structured that way
55+
- Call out traps: "if you change X you must also update Y"
56+
- Keep a `CODEBASE_MAP.md` current as a fast orientation guide
57+
58+
---
59+
60+
## Verify before committing
61+
- All code examples must run and produce the documented output
62+
- Run `mkdocs build` — zero warnings is the target
63+
- Confirm any cross-links between pages resolve
64+
- Confirm behavior docs match the actual code
65+
66+
---
67+
68+
## What good looks like
69+
70+
A user who has never seen this project should be able to:
71+
1. Understand what it does and whether it fits their need — in 60 seconds
72+
2. Get it running with their own data — without asking anyone
73+
3. Know where to look when something goes wrong
74+
4. Know how to extend it for their specific use case
75+
76+
If the docs don't achieve all four, there's more to do.
77+
78+
79+
Also the MkDocs should be hosted on Github Pages

ralph_logs/001_20260311-063814.log

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Done. Here's what I did this iteration:
2+
3+
**Gap identified:** The MkDocs site was entirely boilerplate (default template), and the primitives system (checks, contexts, instructions) — the project's most powerful feature — was completely undocumented.
4+
5+
**What I created:**
6+
7+
- **`docs/index.md`** — proper landing page with install, quickstart, and the technique explanation, linking to deeper docs
8+
- **`docs/primitives.md`** — comprehensive guide to checks, contexts, and instructions with creation commands, frontmatter reference tables, placeholder syntax, and examples of how each integrates with the prompt
9+
- **`docs/cli.md`** — reference for all commands (`init`, `run`, `status`, `new`) with options tables
10+
- **`mkdocs.yml`** — proper site config with nav structure
11+
- **`.gitignore`** — added `site/` to ignore MkDocs build output
12+
13+
Build passes clean with `mkdocs build --strict` (zero warnings).

ralph_logs/001_20260311-073449.log

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Done. Added docstrings to all 10 source modules and 5 dataclasses:
2+
3+
- **Module docstrings**: Each module now explains its purpose, what it does, and key behaviors (e.g., `_runner.py` notes that commands run from the project root, `_frontmatter.py` documents HTML comment stripping)
4+
- **Dataclass docstrings**: `Check`, `CheckResult`, `Context`, `ContextResult`, and `Instruction` now document their fields, defaults, and non-obvious behaviors (e.g., exit code -1 for timeouts, empty instructions being silently excluded)
5+
6+
All 197 tests pass, MkDocs builds clean.

ralph_logs/002_20260311-064011.log

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Done. Created `.github/workflows/docs.yml` — a GitHub Actions workflow that:
2+
3+
- **Triggers** on pushes to `main` that change `docs/` or `mkdocs.yml`, plus manual dispatch
4+
- **Builds** the MkDocs site with `--strict` (zero warnings required)
5+
- **Deploys** to GitHub Pages using the modern `actions/deploy-pages@v4` approach with OIDC permissions
6+
7+
**One manual step required:** In the GitHub repo settings, go to **Settings > Pages** and set the source to **"GitHub Actions"** (not "Deploy from a branch"). This is a one-time setting that can't be automated via a workflow file.
8+
9+
After pushing and enabling that setting, the docs will be live at `https://computerlovetech.github.io/ralphify/` and auto-update on every docs change to `main`.

ralph_logs/002_20260311-073828.log

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Done. The README now showcases the three primitives with concrete examples:
2+
3+
- **Checks** — shows the self-healing feedback loop with a visual diagram of how iterations self-correct
4+
- **Contexts** — shows dynamic data injection with a git-log example
5+
- **Instructions** — shows reusable rules with toggle-on/off
6+
7+
This was the biggest gap: someone landing on the repo would previously think ralphify is just a `while True` wrapper. Now the killer feature (self-healing checks) is visible from the front door, answering "why use this instead of a bash loop?"

ralph_logs/003_20260311-064341.log

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Done. Committed `5dbde75` — added a **"Writing Your Prompt" guide** (`docs/prompts.md`) to the MkDocs site.
2+
3+
**What was the gap:** The prompt is the single most important file in a ralphify project, yet the docs only had a few bullet points in the README about customizing it. A new user would install ralphify, see `PROMPT.md`, and have no idea how to write one that actually produces useful work.
4+
5+
**What was added:**
6+
- New `docs/prompts.md` covering: how prompts work in the loop, anatomy of a good prompt (role/task/constraints/process), placeholder system, check feedback loop, three ready-to-use prompt patterns (feature dev, bug fixing, docs), and practical tips
7+
- Linked from the index page's "Next steps" section
8+
- Added to MkDocs nav between Home and Primitives
9+
- `mkdocs build --strict` passes with zero warnings

ralph_logs/003_20260311-074406.log

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Done. Here's what I did this iteration:
2+
3+
**Gap identified:** The how-it-works page explained context resolution, instruction resolution, and check failure injection in separate sections, but never showed a complete assembled prompt. A user trying to debug or understand what their agent actually receives had to mentally combine three separate explanations.
4+
5+
**Changes made:**
6+
7+
1. **`docs/how-it-works.md`** — Added a "Full example: what the agent receives" section showing the complete transformation: raw PROMPT.md with placeholders + context file + instruction file (with HTML comment) + previous check failure → final assembled prompt. This makes the system click at a glance.
8+
9+
2. **`docs/primitives.md`** — Documented two previously undocumented behaviors:
10+
- HTML comments in primitive files are stripped before injection (users can leave internal notes that won't leak to the agent)
11+
- Scripts and commands run with the project root as working directory (not the primitive's directory)
12+
13+
Build passes with zero warnings. Push triggers GitHub Pages deployment.

ralph_logs/004_20260311-064653.log

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Done. Here's what this iteration accomplished:
2+
3+
**Upgraded the MkDocs docs site from the bare default theme to Material for MkDocs.** The docs site now has:
4+
5+
- **Dark/light mode toggle** — respects system preference, user can switch
6+
- **Code copy buttons** — one-click copy on all code blocks
7+
- **Syntax highlighting** — proper highlighting for bash, toml, markdown, etc.
8+
- **Search with suggestions and highlighting** — fast client-side search
9+
- **Navigation improvements** — instant page loads, back-to-top button, footer navigation, sticky TOC
10+
- **GitHub repo link** — visible in the header
11+
- **Admonitions and details** — markdown extensions ready for tip/warning/note boxes in future docs
12+
13+
The build passes with `mkdocs build --strict` (zero warnings), and the GitHub Actions workflow needs no changes since it already runs `uv sync --group dev`.

ralph_logs/004_20260311-075153.log

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
The docs site is live at **https://computerlovetech.github.io/ralphify/**.
2+
3+
Here's what I did this iteration:
4+
5+
1. **Enabled GitHub Pages** — The workflow existed but Pages was never activated in the repo settings. Previous workflow runs were failing with "Not Found" errors. I enabled Pages via the GitHub API with `build_type=workflow`.
6+
7+
2. **Added `--dangerously-skip-permissions` explanation** in `docs/getting-started.md` — New users see this flag in every config example but had no explanation of what it does or why it's safe. Added an info box explaining both `-p` and `--dangerously-skip-permissions`, and why checks serve as the safety guardrail.
8+
9+
3. **Fixed project detection table order** in `docs/how-it-works.md` — The table listed `pyproject.toml` first but the code checks `package.json` first. Fixed the order and added a note about first-match-wins behavior.
10+
11+
4. **Deployed** — Pushed to main, the docs workflow ran successfully, and the site is now live.

0 commit comments

Comments
 (0)