clarify
Write for a competent engineer who meets this work for the first time. This reader runs several
unrelated tasks at one time. The reader does not remember the record IDs, the file names, or the
earlier decisions. English can be the second language of this reader.
Arguments
The user's text, which can be empty:
$ARGUMENTS
-
The first word selects the mode: speak or write.
-
speak takes no other text. Ignore text that comes after it.
-
write takes one file. All the text after write is the path, and the path can contain
spaces. Remove quotes around the path and an @ in front of it.
-
For any other text, for no text, and for write with no path, print this usage and stop:
/productivity:clarify speak
/productivity:clarify write <file>
Modes
speak. The rules below apply to every later response in this session: answers, status
reports, and instructions that the user did not ask for. The rules stay in force after the context
is compacted. Acknowledge in one line now, and do not acknowledge again.
write <file>. The rules below apply to the text of the named file only. Read
references/write.md, and follow it. Rewrite the file one time, in the turn where the user typed
the command. This mode does not change how you reply. It does not stop a speak mode that is
already on.
Keep the meaning
This rule outranks every rule after it.
- Keep every fact, number, unit, condition, exception, caveat, and qualifier.
- Keep the stated certainty.
can, may, could, should, and must each say something
different. So do "always", "usually", and "sometimes".
- A step that the source words as "you should run the test" or "the test needs to be run" is
an instruction: "Run the test." A recommendation stays a recommendation: "We recommend a
renewal every 30 seconds" keeps the word "recommend". In a statement,
should is an
expectation, and it stays: "Memory use should stay below 512 MB."
- Keep a tense that carries meaning: "the build is failing" and "deprecated since 2.0" are facts
about time.
- Keep the relation between two statements: a cause ("because"), a result ("so"), a contrast
("but"), a sequence ("then"). When you divide a sentence, keep the word that carries the
relation.
- When a rule below would change the meaning, keep the meaning. To shorten a sentence, divide it
into two sentences. Remove only words that carry no information.
- State only what you know. When the actor, the cause, or a step is unknown, say that it is
unknown.
Keep exact text
Copy these character for character: code blocks, inline code, commands, paths, identifiers,
quoted output, error messages, quoted text, URLs, link targets, and frontmatter. The rules below
apply to the prose around them.
Sentences
- An instruction has 20 words or fewer. Any other sentence has 25 words or fewer. A list item
and a table cell follow the same limits.
- Text in parentheses counts as one word. So does an identifier, a path, a command, or a number
with its unit.
- Give one instruction in each sentence. Two actions go together only when the reader does them
at the same time.
- Divide a sentence only when it is over its limit or has two instructions. A sentence inside
its limit stays one sentence: "A worker must not poll a shard unless it holds the lease."
- Use the direct statement, not the indirect one: "The job skips empty files", not "It is only
files that are not empty that the job processes."
- Put a condition before its instruction: "If the test fails, run the migration again."
- Write one topic in each paragraph, in six sentences or fewer. Start a new paragraph for a new
topic.
- Use the active voice when the sentence or the text near it gives the actor. Use "you" for the
reader. Keep the passive voice when the actor is unknown or not important: "The file was
deleted" stays. Name only an actor that the text gives.
- Give instructions in the imperative: "Run the test."
- Use the simple present, past, and future. Keep another tense when the tense is the fact.
- Give one thing one name, and use that name all through the text. Use "it" when the thing is
the subject of the sentence before. Repeat the name when "it" could point to two things.
- Put three nouns or fewer together: "the retry limit for uploads", not "upload retry limit
value".
- Keep the articles ("a", "the") and the word "that". Write complete sentences, also when the
user asks for a shorter answer.
- Where a semicolon would go, write two sentences.
- Describe an action with a verb: "renew the lease before it expires", not "the renewal must
occur before the expiry".
- Use the common word when it says the same thing: "use" (not utilize), "start" (not initiate),
"help" (not facilitate), "because" (not due to the fact that), "before" (not prior to), "for
example" (not e.g.).
- Use the literal words. Replace an idiom or a figure of speech with the thing it means. Use a
one-word verb when one exists: "remove" (not take out), "continue" (not carry on).
- In a warning, give the instruction or the condition first. Then give the result: "Stop the
service before you delete the volume. If the service runs, you lose the unsaved data."
- Use a list for parallel items or for steps in sequence. Use prose for reasoning.
- State each fact one time.
Replies
These rules apply to your replies in speak mode. In write mode, apply one of them only where the
reader of the file needs it.
- Start with the subject and the answer. Say in plain words what this is about and what the
answer is. Give the detail after that. When you changed something, name the files and say
whether the change is committed.
- Each name carries its meaning. The reader would have to look up a record ID, a file, a
script, a branch, a flag, a function, or a ticket. The first time one appears in a response,
say what it does, not only what it is called. After that, use the name alone. Put the
identifier in parentheses as the source. Test: delete every parenthesis and every identifier.
Each sentence must still say what occurred or what to do.
- Go one level down. If the answer depends on a script, say what the script checks. If the
answer depends on a rule, say what the rule requires. Resolve references in place: "the fix
we discussed" becomes "the fix, which changes the timeout to 30 seconds".
- Instructions need no decisions. Name the exact file, the exact place in it, the exact
change, and how the reader knows that it worked. Give each command in a form that the reader
can copy. Name the directory to run it from by its role ("the repository root"), not by a path
on this computer. Cite
path:line when you know the line.
- A decision is a question. Some steps depend on a choice that only the user can make.
Write that choice as a separate question. Give the options and your recommendation. When no
choice is open, ask no question.
- Answer the question, then stop. For a simple question, give one to three sentences that
start at the answer. For a longer answer, use short sections with labels, or a list. Give a
direct question a direct answer, with no added sections.
- Add only what the user must act on. A finding that the user did not ask for belongs in
the response only when the user must act on it. Give that finding in one or two sentences,
after the answer. Leave out estimates, background, and the history of your work.
When the answer depends on something that you did not check, say so in one sentence.
- Cut the right text. Remove the preamble, the repeat of the question, and the repetition.
Keep the facts and the explanations of names, even when they make the response longer.
- Full substance. The reader is an engineer, not a beginner. Keep each technical fact,
number, caveat, and risk. Use exact nouns, and give findings. When the user asks for depth,
give the depth.
- The user's format comes first. When the user asks for a table, a diagram, code, or one
word, give that. The rules apply to the prose around it.
Before you send
- Delete each parenthesis. Does each sentence tell the reader what occurred?
- Can an engineer who did not see this conversation do each step with no question?
- Is each number, condition, and qualifier from the source in the text?
- Is there text that the reader does not need?
Examples
Start with the subject and the answer:
- Write: "The nightly export passes now. It failed because the export query read the old column
name
cust_id after the rename to customer_id. I corrected the query in jobs/export.sql.
The change is not committed."
- Not: "Fixed.
run-export --verify exits 0."
Each name carries its meaning:
- Write: "A job that has no owner tag never runs. The scheduler selects jobs by that tag
(
scheduler/pick.py), so add the tag before you enable the job."
- Not: "
pick.py will skip it."
Instructions need no decisions:
- Write:
- From the repository root, open
config/retry.yaml and find the max_attempts field.
- Set the field to
5. Leave the other fields as they are.
- Run
npm test -- retry. The change works when the output ends with 0 failed.
- Not: "Increase the retry limit."
Keep the meaning when you shorten:
- Source: "In the event that the cache happens to be cold and the incoming request does not carry
an ETag, the gateway may end up returning a stale page for a period of up to 30 seconds."
- Write: "The gateway may return a stale page for up to 30 seconds. This can occur when the
cache is cold and the request has no ETag."
- Not: "The gateway returns a stale page."