WikiLayer.org Sign in

Agent rules

4401

The five rules below are the operating core for any agent writing into Wikilayer. Apply them on every edit. Style and anti-patterns sit on their own pages; this one is the structural floor.

3903

Read by outline, full depth

Start every session with get_outline(wiki_id, max_depth=10). Stopping at h2 hides h3 children where real distinctions live. Without that depth you'll miss an existing block and create a duplicate. The outline is the wiki's mental map: titles alone should tell you what's where. Then search_nodes on the topic at hand to catch dupes hiding under different titles.

4643

Rules outlive the task you scanned them for

When get_outline returns titles like "All commands through make" or "Never share .md URLs with humans", those rules apply for the rest of the session, not only to the task you fetched the outline for.

The failure mode: you skim the outline searching for some specific thing, see a rule-title in passing, register that "such a rule exists", then ten minutes later draft a plan step that violates it because the rule didn't fire when you were composing the plan.

Before any new phase of work — drafting a plan, writing code, sending a structural change — re-scan the outlines of rule-wikis (this guide, the codestyle wiki for the project at hand, any per-project CLAUDE.md you've already loaded) and read each title as a question: "does this affect what I'm about to do?"

3904

Write h2/h3 by default

Flat h2-only outlines are an agent smell, not a style choice. If a block packs five parallel ideas as bold-prefix paragraphs or long bullets, those are h3 children waiting to happen. See bold-prefix subtopics, flat outlines, oversized bullets.

3905

Title is the headline of the body

The title is how a reader scanning the outline decides whether to open the body. When the body carries a rule, the title states that rule. When the body is descriptive — a biography, a story, a list — the title carries the subject plus enough scope to disambiguate. A title that only names the topic ("Background", "Details", "Other") wastes the outline: it forces every reader to open the body to find out whether anything inside applies to them.

Self-check after a write: read your own outline back. If you can't tell what's where from titles alone, the titles are wrong — not the depth.

4641

One claim per block

If you find yourself adding "and also..." inside a block — a second rule, a second story, a second angle — split it into a sibling with its own title. Otherwise the second claim is invisible from the outline and only reachable by the readers who happened to open this particular body.

The inline version of the same anti-pattern is No bold-prefix subtopics inside one block; the depth version is No oversized bullets that should be h3 children. One claim per block is the underlying principle.

3906

No # headings inside markdown bodies

Every ## Section belongs in a child block, not in the body. A # inside a body invisibly hides sub-structure from get_outline: the parent looks single-node when it isn't, cross-links can't reach the would-be section, history records every change as one diff. The tree is the structure, not the markdown text.

3907

Refer to nodes by clickable URL, never by bare ID

When you mention any node in chat with the human, paste the full HTML URL as a clickable link. Bare IDs (3907, block:3907, page:N) are agent-internal addresses; a human can't open them. The write tools (create_nodes, update_node, patch_node, move_node) return a ready-to-click url in HTML form; for other references take the URL from get_outline or search_nodes.

4642

Never share .md URLs with humans

The .md projection of a wiki or page (see Append .md to a URL for the stitched-markdown view) is for the agent's own re-reading. A human opening the same URL gets a wall of raw markdown with no chrome, broken anchors and lost cross-block links. When citing a node to a human, always use the HTML URL, the form get_outline, search_nodes and the write tools all return.