code-formatter
Skill1 starsChanged 56 days agoMITView on GitHub
Visual formatting and reading flow inside function bodies across Dart, Java and Python: braced control-flow exits, blank lines marking phase transitions, comments above the line they describe, doc comments sitting on their declaration, one chain step per line. Use when you say "format this function", "why is this hard to read", "clean up the spacing here", or "break this method chain up". Not for naming, error handling, or whether a comment or doc comment should exist at all, use `coding-standards`.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- NVIDIA/SkillSpectortheir own version, first seen Aug 12, 2026
- benshapyro/cadre-devkit-claudetheir own version, first seen Dec 6, 2025
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- NVIDIA/SkillSpector★ 19ksame name
- benshapyro/cadre-devkit-claude★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- agentic-engineeringSkill
- ai-regression-testingSkill
- angularSkill
- ansibleSkill
- api-designSkill
- architecture-decision-recordsSkill
- ascend-memorySkill
- ascend-web-hunterSkill
- audio-scribeSkill
- automation-inventorySkill
- backend-patternsSkill
- bashSkill
- build-dependency-managementSkill
- code-reviewerSkill
- coding-standardsSkill
- dart-flutter-patternsSkill
- database-migrationsSkill
- deployment-patternsSkill
- design-systemSkill
- docker-patternsSkill
- e2e-runbooksSkill
- e2e-testingSkill
- embedded-c-arduinoSkill
- frontend-designSkill
- g-code-3d-printingSkill
- github-opsSkill
- git-workflowSkill
- golang-patternsSkill
- hexagonal-architectureSkill
- home-assistantSkill
- java-coding-standardsSkill
- jetbrains-ide-opsSkill
- jira-integrationSkill
- keycloak-patternsSkill
- kicadSkill
- markdown-writerSkill
- mongodb-patternsSkill
- nextjs-app-router-patternsSkill
- node-backend-patternsSkill
- observability-and-loggingSkill
- obsidianSkill
- performance-optimizationSkill
- postgres-patternsSkill
- powershellSkill
- project-trackingSkill
- python-patternsSkill
- pytorch-patternsSkill
- react-patternsSkill
- researchSkill
- review-duplicationSkill
- security-reviewSkill
- seoSkill
- soap-webservicesSkill
- springboot-patternsSkill
- tdd-workflowSkill
- unitySkill
- web-accessibilitySkill
The file
Files
Code Formatter
Formatting rules that optimise for one thing: the next reader locating a function's control-flow exits and its async phase transitions in a single scan. They deliberately diverge from what dart format, black and google-java-style produce in specific places, which each rule names.
| Task | Open |
| Applying or reviewing one rule, with wrong and right forms in every language it covers | rules-by-language.md |
When to activate
- Writing a new source file in Dart, Java or Python
- Editing a file already written in this style
- Reviewing a branch or pull request and flagging readability problems
When not to activate
- Naming, SOLID, immutability, error handling and architecture, use
coding-standards - Deciding whether a comment or a doc comment should exist and what it says, use
coding-standards - Language-specific idiom and typing in Java, use
java-coding-standards - Language-specific idiom and typing in Python, use
python-patterns - Language-specific idiom in Go, use
golang-patterns - Auto-formatting an unrelated file the project has not adopted this style for
- Human-facing markdown rather than source code, use
markdown-writer
The rules
Each rule below has its full body, its reasoning, and its wrong-and-right forms per language in rules-by-language.md. Open that file before applying one you are unsure about.
| Rule | What it requires |
| Brace every inline exit | A return or throw never shares a line with its if. Braced, body on its own indented line |
| Empty lines around try, catch and finally | A try is a control-flow landmark, so it gets a blank line before and after, and so does each clause body |
| Empty line above a standalone async call | A hand-off to network or disk is a phase transition and reads as its own beat. Not for an await inside an assignment |
| Empty line above a closing return | A return ending a multi-statement block gets a blank line above it. Not for single-expression bodies |
| Blank line below a return inside a try with clauses | The blank line marks the seam between the happy path and the failure or cleanup clauses |
| Empty line above an operation-terminating call | A call that ends a phase, such as a dismiss, a send, a publish or a navigation, separates from the arithmetic that set it up |
| Comments above the line, never trailing | A trailing comment gets truncated by line length and forces horizontal scrolling |
| Doc comments sit on their declaration | No blank line between the block and what it documents, and no tag hard-wrapped to fit a width. Whether one exists is coding-standards |
| One concept per blank-separated paragraph | Related lines stay together with no blank between them, a topic change gets exactly one. Two blanks means extract a method |
| One chain step per line | Break before each . in a fluent or functional pipeline, so a step can be added, removed or diffed on its own |
| Single-expression bodies stay on one line | The blank-line rules govern blocks. Do not expand an arrow function or a one-line definition to satisfy them |
What the rules look like together
Pass:
public Optional<Receipt> settle(Order order) {
if (order.isEmpty()) {
return Optional.empty();
}
var total = pricing.total(order);
var payload = mapper.toPayload(order, total);
var response = paymentClient.send(payload);
logger.info("settled order {}", order.id());
return Optional.of(Receipt.from(response));
}Fail:
public Optional<Receipt> settle(Order order) {
if (order.isEmpty()) return Optional.empty();
var total = pricing.total(order); // price it
var payload = mapper.toPayload(order, total);
var response = paymentClient.send(payload);
logger.info("settled order {}", order.id());
return Optional.of(Receipt.from(response));
}The failing version is what most default formatters produce and leave alone. Nothing in it is wrong to a compiler. It is harder to read because the exit, the network call and the return all sit at the same visual weight as the local arithmetic around them.
What this skill does not cover
- Naming conventions, member ordering and import ordering, which vary per language. Use the language style guide and
coding-standards - Line length caps, which stay readable by extracting locals rather than wrapping. Each project sets its own budget
- Trailing commas, brace placement and indent width, which the default formatter for each language owns and this skill does not override
Related skills
coding-standardsowns the engineering floor: SOLID, DRY, KISS, YAGNI, naming, error handling, architecturejava-coding-standardsowns Java idiom, Lombok, Optional, streams and Javadoc disciplinepython-patternsowns Python idiom, typing and package layoutgolang-patternsowns Go idiom and error conventionsdart-flutter-patternsowns Dart and Flutter structure above the level of a function bodycode-reviewerowns the review pass where these rules get applied to somebody else's diff
Checklist
- No control-flow exit shares a line with its condition
- Blank lines mark the try, the async hand-off and the terminating call as distinct beats
- Every comment sits above the line it describes
- Every doc comment sits directly on its declaration, with no tag wrapped onto a second line
- No two consecutive blank lines inside a function body
- Fluent chains break before each dot
- Single-expression bodies were left on one line
- The file was already in this style, or the user asked for the conversion
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

