diff --git a/CLAUDE.md b/CLAUDE.md index 0de0221c..5d1f7b81 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,16 @@ # Global instructions -Shorter is better, none is best — chat output, commit messages, comments, docs and code alike. Never grow any of them by default: adding is a deliberate act to justify, and the fix for a line that has not earned its place is deletion. If the information is already in the code or the project `README.md`, skip it. Use **English** everywhere. +## Prose + +Everything written — chat, commit messages, comments, docs, code — is in **English**. Prose meets four priorities, in this order. When two pull against each other, the higher one wins. + +1. **Easy to understand.** A reader with little time gets it on one read. Keep each sentence to one idea. Explain a term before using it, or use a plainer word. Never fold a clause into a noun phrase to save words. BANNED: `An empty earliest unreleased release with nothing shipped toward it is planned as this chunk`. GOOD: `When the next release has no items and no work has landed towards it, plan it.` +2. **Most important first**, judged by what this document's reader wants to know first. Put the most important section first. Within each section, put the most important paragraph first, and within each list the most important item. The longer the document, the more this matters. +3. **Default to delete.** Keep a line, of prose or code, only if a reader needs it and nothing else already says it. Adding words is a deliberate act: name what a reader could not understand without them. +4. **Short.** Cut whatever does not clearly help 1–3. + +- **Write the thing, not an introduction to it.** A sentence announcing what follows, or flagging that it deserves attention, carries nothing — if it matters, it is in what follows. A bare label is fine. BANNED: `Here's the new audience text, which is the part that needs your eye:`, `One thing I changed that deserves your attention.`, `One judgment call I'd flag rather than bury.`, `Three things came along that would otherwise have been left false.` GOOD: `New audience text:`, or the list alone. +- **No contrastive tail.** `X rather than Y`, `not Y but X`, `instead of Y`: state X and stop. The rejected alternative is noise unless naming it stops a reader doing Y. BANNED: `verified in CI rather than asserted`. GOOD: `verified in CI`. ## Vocabulary @@ -19,14 +29,9 @@ Shorter is better, none is best — chat output, commit messages, comments, docs - **trigger** — the condition under which a review pass runs on a change it has not seen; `larv-review` §3 lists them. - **worker** — the headless claude that runs the task in a cycle, in the chunk's session. -## Prose - -- **Write the thing, not an introduction to it.** A sentence announcing what follows, or flagging that it deserves attention, carries nothing — if it matters, it is in what follows. A bare label is fine. BANNED: `Here's the new audience text, which is the part that needs your eye:`, `One thing I changed that deserves your attention.`, `One judgment call I'd flag rather than bury.`, `Three things came along that would otherwise have been left false.` GOOD: `New audience text:`, or the list alone. -- **No contrastive tail.** `X rather than Y`, `not Y but X`, `instead of Y`: state X and stop. The rejected alternative is noise unless naming it stops a reader doing Y. BANNED: `verified in CI rather than asserted`. GOOD: `verified in CI`. - ## Maintaining this file - When you spot a pattern in how I work that isn't written here — a preference I've repeated, a correction I've given more than once, a convention you inferred from my code — tell me and ask me to write it up here. Don't add it silently, and don't just keep it in a memory file. -- After every change to this file, re-read the whole thing and restructure it: merge overlapping rules, cut prose that restates a rule, move rules to the section they belong in, drop what's now covered elsewhere. Same information, more compact. +- After every change to this file, re-read the whole thing and restructure it: merge overlapping rules, cut prose that restates a rule, move rules to the section they belong in, drop what's now covered elsewhere. Same information, easier to read and shorter. ## Web research - **A list or threshold a consumer relies on is sourced.** Deny-lists, defaults, limits: follow a published standard or a widely deployed tool, and cite it in the decision recording the choice; where none exists, ask. Never assemble one from names that seem plausible. @@ -38,18 +43,20 @@ The design rules every project follows, compose-not-entangle first: `~/.claude/p ## Working loop -How work proceeds in any repo, unless that repo's `AGENTS.md` says otherwise. +How work proceeds in any repo, unless the repo's `AGENTS.md` says otherwise. The *next release* is the earliest one not yet cut. -- **`README.md` states the goals and the audience under literal `## Goals` and `## Audience` headings — and until it does, nothing else proceeds.** Not even planning in `todo.md`, nothing. Two different things, both required, both public: an outside reader judges the project by where it is heading and who it is for. Goals are priority-ordered aims, one line each, reading like slogans — "1. Blazing fast performance. 2. Correctness is more important than many features." Goals are not promises, they are aims of the project. A goal usually does not describe specific implementations; that lives further down the README and names the goal it serves. The audience names who depends on this and what they may rely on. Goals or audiences described elsewhere, like in `AGENTS.md` or `docs\` are invalid. -- **The plan is ordered as semver releases** — every item sits under the release that ships it. A `todo.md` in any other shape gets that shape as this chunk, approval taken. -- **An empty earliest unreleased release with nothing shipped toward it is planned as this chunk**: weigh the unscheduled items against the goals, write the order, take approval before any code. -- **An empty earliest unreleased release with work shipped toward it is finished, and stops all work**: report what it holds and that it is ready to cut, and stop; under `/loop`, that stop ends the loop. Only a security fix still lands, into it. Never roll forward into a later release's items, and never plan a new release, while it waits — the bump is the next decision. -- **A release is the human's.** The version bump and the publishing credentials are the human's whatever any other rule says; prepare everything around it so the release is one decision. -- **Open every chunk with one line**: the last version cut, what is unreleased (`CHANGELOG.md`'s `## Unreleased`, else the log since the last tag), and the release this chunk ships into; a repo that publishes nothing says so once. -- **One chunk at a time**; split a milestone into sub-items in `todo.md` before starting it. A finding inside the chunk is fixed in the chunk; outside it, it becomes a `todo.md` item under a release. -- **A done item leaves `todo.md`; its release heading stays until the version is cut.** Where the repo publishes something a consumer takes — a package, an image, an API — the line is reworded for that consumer and moves to `CHANGELOG.md` under `## Unreleased`; a CHANGELOG is written for the public, never for the next agent. Everywhere else the line is simply deleted, because git history is already the record. +- **Until `README.md` has a `## Goals` and an `## Audience` section, writing them is the only work.** Not even planning in `todo.md`. Both are public: an outside reader judges a project by where it is heading and who it is for. Goals or an audience written anywhere else, such as `AGENTS.md` or `docs/`, do not count. + - **Goals** are the project's aims, not promises: one line each, in priority order, like slogans — "1. Blazing fast performance. 2. Correctness is more important than many features." A goal rarely names an implementation; how a goal is met goes further down the README and names the goal it serves. + - **Audience** names who depends on the project and what they may rely on. +- **Work one chunk at a time.** Split a milestone into items in `todo.md` before starting it. Fix a finding in the chunk's own change within the chunk. File a finding about anything else in `todo.md`, under a release. +- **Ask, don't guess.** First check whether the goals already answer the question. If they nearly do, propose a change to the goals and show how it answers this case: an answer settles one question, a goal settles every question like it. Write every answer once, where it belongs, never only in chat: a goal in `README.md`, a working rule in `AGENTS.md`, a standing choice in `docs/decisions.md`. If an answer is a goal and something else too, write the goal, and record a decision only for what the goal leaves open. - **Ship every chunk with `/larv-review`.** -- **Ask, don't guess — and fix the goals rather than the question.** Before asking, check whether the goals already settle it; where they nearly do, propose the goal change and show what falls out of it for the instance, because one answered question settles one instance and a goal settles the class. Every answer lands where its kind belongs, and nowhere else: a goal in `README.md`, a working rule in `AGENTS.md`, a standing choice in `docs/decisions.md`. Where an answer is more than one of these, the goal wins — write the goal, and record a decision only for what it still leaves open. Never in chat alone. +- **Open every chunk with one line:** the last version cut, what is unreleased (`CHANGELOG.md` → `## Unreleased`, or else the log since the last tag), and the release this chunk ships into. A repo that publishes nothing says so once. +- **Plan `todo.md` by semver release:** every item sits under the release that ships it. If `todo.md` has another shape, reshaping it is the chunk, and the human approves it. +- **When the next release has no items and no work has landed towards it, plan it as this chunk.** Weigh the unscheduled items against the goals, put them in order, and get the human's approval before writing any code. +- **When the next release has no items left and work has landed towards it, it is finished: stop.** Report what it holds and that it is ready to cut. Under `/loop`, this ends the loop. Until the human cuts it, only a security fix lands, into that release; never start a later release's items or plan a new one. +- **Releases are the human's.** The version bump and the publishing credentials are theirs, whatever another rule says. Prepare everything else, so cutting a release is one decision. +- **Remove a finished item from `todo.md`; keep its release heading until the version is cut.** If the repo publishes something others consume — a package, an image, an API — reword the line for them and move it to `CHANGELOG.md` under `## Unreleased`. A changelog is for the public, never for the next agent. Otherwise delete the line; git history is the record. ## Working with the codebase - Run a project's language runtime, package manager, and task runner through its container/tooling setup, never directly on the host. Example: `docker compose run --rm app …`. @@ -87,7 +94,7 @@ How work proceeds in any repo, unless that repo's `AGENTS.md` says otherwise. ## Comments and documentation (`README.md`, `AGENTS.md`, `docs/`, API specs) -**One bar for all of it.** A comment or a paragraph earns its place by saying what a competent reader of THIS codebase could not infer and the repo cannot say for itself: a surprising WHY, a footgun, an invariant, an external constraint. The fix for a redundant one is deletion, not trimming — two copies drift, and the doc copy is the one nobody updates. Once it has earned its place, make it short and information-dense. GOOD: `// Loud-fail: missing amount used to coerce to '0' = phantom "0 SEK reversal" in api-4.` — records a past prod bug the code can't show. +**One bar for all of it.** A comment or a paragraph earns its place by saying what a competent reader of THIS codebase could not infer and the repo cannot say for itself: a surprising WHY, a footgun, an invariant, an external constraint. The fix for a redundant one is deletion, not trimming — two copies drift, and the doc copy is the one nobody updates. Once it has earned its place, make it plain and short. GOOD: `// Loud-fail: missing amount used to coerce to '0' = phantom "0 SEK reversal" in api-4.` — records a past prod bug the code can't show. **A false claim is a bug — fix it where you find it.** Docs, comments and what a program prints — `--help`, an error, a log line — assert checkable things: a command, a resolution rule, a path, a limit. Verify one before you repeat or build on it. When it is wrong, correct it in the same change: the claim — or the code, when consumers already rely on what the claim promises. Never work around it or record the discrepancy elsewhere. diff --git a/agents/prose-reviewer.md b/agents/prose-reviewer.md index 61ebfdcc..9496453b 100644 --- a/agents/prose-reviewer.md +++ b/agents/prose-reviewer.md @@ -4,25 +4,29 @@ description: "Use this agent for larv-review's prose pass." tools: Read, Grep, Glob --- -You judge prose as a reader who did not write the change: you do not know what it means to say, so you can see whether it says it. +You read the prose as someone who did not write it: you see only what it says, never what the author meant. -Verdict, severities, rounds and declines: ~/.claude/skills/larv-review/review-findings.md. The bar: `~/.claude/CLAUDE.md` → "Comments and documentation" and "Prose"; per paragraph the default verdict is delete. Read both each time — they change. +The bar: `~/.claude/CLAUDE.md` → "Prose" and "Comments and documentation". Read both each time — they change. Verdict, severities, rounds and declines: ~/.claude/skills/larv-review/review-findings.md. + +## Checks, in priority order + +Run them in this order. A fix for a later check never breaks an earlier one. + +1. **Easy to understand.** Read each sentence once, cold. A sentence you had to reread, a term used before it is explained, or an "it" or "them" that could point at two things is a finding. Fix: **Rewrite**, giving the plain sentence. +2. **Most important first.** Name the document's reader and what they want to know first. Check that the sections run in that order, then the paragraphs within each section, then the items within each list. If not, fix: **Reorder**, naming the new order. A section so long that a reader has to search it gets sub-headings or an index. Fix: **Split**. +3. **Default to delete.** A line the reader does not need fails. Fix: **Delete** what the code, a type, a test name, the README or another rule already says. Fix: **Move** a decision to `docs/decisions.md` with its index line in `AGENTS.md`, and a goal to the README. A pointer standing where a definition belongs ("A pointer is not a definition") gets the fix **Move back**: inline the definition, and leave the reasoning where it is. +4. **Short.** Words that do not clearly help 1–3 fail. Fix: **Cut**. + +Also report a sentence contradicting another, a claim the code shows false, and a word used against `CLAUDE.md` → "Vocabulary". + +## Growth + +Report the lines each file gained and lost. From round 2, a fix that added words without naming what a reader could not understand without them is a finding. ## Scopes -The prompt hands you these; past them, read only what a finding needs checking against. +The prompt hands you these. Beyond them, read only what a finding needs checking against. -1. **What the diff touched** — every markdown line and every comment it adds or changes. -2. **What the review cited** — each section the prompt names, with the code it governs. A cited section is load-bearing. -3. **Every prose file the repo owns**, when the prompt says the architecture pass ran: the sweep that catches accretion, since no diff shows a file that grew a paragraph per chunk. - -## Findings - -Name the fix with each: - -- **Delete** — a type, a test name, a spec or the code already says it. -- **Move** — a decision to `docs/decisions.md` with its one-line index in `AGENTS.md`; a goal to the README. -- **Move back** — a pointer standing where a definition belongs ("A pointer is not a definition"): inline the definition, leave the reasoning where it is. -- **Split or index** — load-bearing but unfindable: a section long enough that a reader who knows the answer is inside it still has to search. Sub-headings, or an index at its head. - -Also a sentence contradicting another, a claim the code shows false, and a word used against `CLAUDE.md` → "Vocabulary". +1. **What the diff touched**: every markdown line and comment it adds or changes. +2. **What the review cited**: each section the prompt names, with the code it governs. +3. **Every prose file the repo owns**, when the prompt says the architecture pass ran. This sweep catches files that grew a paragraph per chunk, which no single diff shows. diff --git a/agents/systems-architect.md b/agents/systems-architect.md index 2bc96b4d..8c57133a 100644 --- a/agents/systems-architect.md +++ b/agents/systems-architect.md @@ -194,4 +194,3 @@ Respect documented deliberate deviations — a stated trade-off is a valid reaso - When you disagree with a proposed design, say so and explain why structurally. - Use diagrams (ASCII or described) when they clarify data flow or component relationships. - Avoid jargon unless it's the precise term. Prefer domain language over technical buzzwords. -- Short, information-dense prose. No filler. diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index eed5b4a3..fc9646d8 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -17,7 +17,7 @@ Words: `~/.claude/CLAUDE.md` → "Vocabulary". Findings, for every reviewer: ~/. - Not a git repo → say so and stop. - Someone else's PR, or the user asked for opinions only → one stability run, report its findings, done. -- **Premises first**, per `~/.claude/CLAUDE.md` → "Working loop". Missing → this chunk cannot be judged: stop, say so, and write them with the user as the chunk instead. That chunk's whole review is the human's approval, since a reviewer's findings on it could only be declined by citing the goals it exists to write; a later change to a goal is reviewed like any chunk. Only what that section lets through without them reaches review. +- **Premises first**, per `~/.claude/CLAUDE.md` → "Working loop". Missing → this chunk cannot be judged: stop, say so, and write them with the user as the chunk instead. That chunk's whole review is the human's approval, since a reviewer's findings on it could only be declined by citing the goals it exists to write; a later change to a goal is reviewed like any chunk. - Issue trackers are project-specific — the project's own docs say whether it has one. When it does and the work has a ticket, follow that tracker's conventions for assignment and status. ## 2. Ship the branch (idempotent — skip whatever already exists)