/splitbrain:writing-rulesfrom splitbrain
Rules to adhere to for any technical writing, may it be documentation, inline comments, git commits or PR descriptions
Ships in splitbrain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Keep the language simple! You're not here to win an essay contest. You need to convey important information. Adhere to the KISS-principle: keep it simple stupid.
If the plain-writing skill is available, read it first, then apply what is described here on top.
Never use these. Cut on sight.
Follow these general language guidelines.
When updating existing documentation, change it to include the new facts. Do not simply add the new facts as new sentences or praragraphs. Do not be afraid of rewriting existing documentation when needed.
Do not add "Answered Questions" or "Decisions" sections. Rework the document to incorporate the new facts.
When existing documentation consists of multiple documents, think hard to which document a new fact belongs. Do not repeat yourself across multiple documents!
When planning new features you will often be asked to write a detailed implementation plan first.
Where existing features are changed, the plan should make clear how the feature currently works and how the new implementation will change it and what the goals are. This is the one place where historical contrast is wanted!
Be sure that used time forms always reflect what describes current state (present tense) and planned state (future tense).
Apply the rules on Updates as outlined above, when extending a plan.
While the above general rules always apply, you need to pay additional attention when adding documentation to the source code itself.
The most important rule is: do not repeat what the code already says!
A doc block is whatever the language uses for documented API elements — docblock, docstring, JSDoc, KDoc, rustdoc, XML doc comment. Follow best practices for formatting. Use the full line length - typically 120 chars. Be sure to stay consistent with the existing formatting.
Every class, method, function, constant and field should have a doc block. It contains a summary, an optional body and the parameter and return value descriptions.
Purpose, not procedure. The summary line says what the thing is or does, from the view of its caller, in the words of the domain. It does not list the steps the code takes. Ask "Why would someone call this?" and answer that question. One verb that names the effect ("Label", "Fill", "Check") is better than a chain of steps ("write X, then add Y to Z").
Body paragraphs, if any, explain behaviour that is not obvious. A doc block should rarely have more than three lines beyond its summary.
Do not repeat what the code already describes. Elements, attributes, properties or other parts that are in the body are useless repetition and should be removed.
A doc block must stand on its own: no "see the docs", no pointer to another file or a ticket, no reliance on the comment above it. Spec and RFC names, Ticket IDs or links to additional resources may stay for readers who want to learn more, but they are only additional info. The doc block must be useful without any access to this additional info.
Avoid using markup (like markdown or HTML) in the doc block.
Parameters and return hints should have a short explanation that make it clearer what to pass in. Omit the explanation if the variable name is already 100% clear.
An inline comment is a documentation comment inside a class or method body (typically using //, # or /* */).
Minimal, and only where they structure or explain. Two legitimate jobs:
Rules:
// close session above a call that closes the session is pure noise.TODO and FIXME markers are not descriptive comments. Leave them alone.Inline comments are prone to be outdated. For each comment asserting something about the code, check that it is true. Typical issues:
Where comment and code disagree, work out which one is wrong. If it is the code, report it and change neither.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub splitbrain/agent-skills --plugin splitbrain3 skills in this plugin
/fix-commentsReview the project's inline comments and doc blocks against the comment rules, and fix what violates them. Use when asked to check, clean up or update comments or docblocks, or before committing a finished change./pixel-to-svgRedraws raster graphics (game backgrounds and sprites, icons, logos, comics, diagrams, maps, UI mockups, low resolution illustrations) as clean SVG files that scale without loss. The SVG is built from shapes and shared objects, not from traced pixels. Use when asked to convert, vectorize, trace or redraw a raster image as SVG, or to review and fix such an SVG.