Skip to main content
skill CX Codex

dart-long-lines — Claude Code skill for Dart line length

dart-long-lines is a Claude Code skill for keeping Dart lines within 80 columns. It applies while writing code or fixing the lines_longer_than_80_chars lint.

Apache-2.0 150 installs ★ 149 updated 2026-10-17

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add kevmoo/dash_skills --skill dart-long-lines -a claude-code
Open on GitHub

What dart-long-lines does

dart-long-lines gives line-wrapping guidance for Dart code, comments, documentation, and string literals. To locate violations, it points to dart analyze with lines_longer_than_80_chars or the regex ^.{81,}$.

Run dart format before manually wrapping code. The skill reserves manual edits for comments and other content the formatter leaves unchanged. It warns against splitting URLs, paths, regular expressions, ASCII art, tables, and preformatted blocks where a break could change meaning or alignment. After edits, run dart format and dart analyze again.

What it helps with

  • find Dart lines that exceed 80 columns
  • wrap long comments and documentation at word boundaries
  • split a long string into adjacent literals
  • avoid changing a regular expression while reformatting

Example prompts for the agent

  • Find Dart lines over 80 columns in this file and suggest edits.
  • Wrap the long comments in this Dart file.
  • Split this long Dart string without changing its content.

How to install dart-long-lines

1Skills CLI (Vercel)

npx skills add kevmoo/dash_skills --skill dart-long-lines -a claude-code

2Manually: put the files in place

~/.claude/skills/dart-long-lines/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/dart-long-lines/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about dart-long-lines

How do I install dart-long-lines in Claude Code?

Run npx skills add kevmoo/dash_skills --skill dart-long-lines -a claude-code. The skill file is installed at ~/.claude/skills/dart-long-lines/SKILL.md.

What does dart-long-lines do?

It guides Dart line wrapping to meet the 80-column limit and address lines_longer_than_80_chars. Its guidance covers comments, documentation, and string literals.

Which lines should dart-long-lines leave unwrapped?

It cautions against breaking URLs, paths, regular expressions, ASCII art, tables, and preformatted text. Run dart format before manually wrapping code.

Source text

SKILL.md · Apache-2.0
---
name: dart-long-lines
description: |-
  Guidelines for handling long lines in Dart code to adhere to the 80-column
  rule. The `lines_longer_than_80_chars` lint.
license: Apache-2.0
key_features:
  - 80-column rule compliance
  - Line length refactoring
  - Linter rule enforcement
---

# Dart Long Lines

## 1. When to use this skill

Use this skill when:

- Writing Dart code that might exceed the 80-column limit.
- Refactoring code to comply with the `lines_longer_than_80_chars` lint.
  Reference: https://dart.dev/tools/linter-rules/lines_longer_than_80_chars

### When NOT to use (Abstention Guardrails)

Do NOT break lines or alter code when:

- **Unbreakable URLs & URIs**: Lines contain long HTTP/HTTPS URLs, import URIs,
  or file paths where breaking them across lines would invalidate the link.
- **Complex Regular Expression Literals**: Long RegExp patterns
  (`RegExp(r'...')`) where inserting whitespace or line breaks changes the
  matching semantics.
- **ASCII Art, Tables, or Preformatted Diagrams**: Preformatted text blocks,
  table rows, or ASCII diagrams inside comments or strings where wrapping lines
  destroys visual alignment.
- **Prior to Automated Formatting**: Do NOT manually break code lines before
  running `dart format`. Let `dart format` handle code wrapping automatically;
  only manually wrap comments, docs, and multi-line strings that the formatter
  does not re-wrap.

## Discovery

To find lines that exceed the limit:

### Automated Analysis

The most reliable way to find long lines is to use the Dart analyzer:

- **Command**: `dart analyze`
- **Lint**: `lines_longer_than_80_chars`

### Manual Search

To search for long lines using regex:

- **Regex**: `^.{81,}$` (Matches any line with 81 or more characters).

## 2. Guidelines

### Format First

Always run `dart format` before manually breaking long lines. The formatter
often automatically fixes long lines, especially in generated code, and applies
standard Dart styling rules.

### Code Comments

Break long code comments (`//`) cleanly at word boundaries to ensure lines do
not exceed 80 characters. Maintain tight formatting and avoid unnecessary
vertical space.

### Documentation Comments (`///`)

- Apply the same line-breaking rules as for code comments.
- Avoid breaking markdown link blocks like `[name]` or
  `[text](http://example.com)` across lines. Place them on their own line if
  they exceed the limit.
- Start doc comments with a single summary sentence, followed by a blank line
  before the rest of the comment. It is okay to break this first sentence across
  multiple lines to fit the 80-column limit.
- Avoid unresolved references or dangling sentences.

### Long Strings

- Use adjacent string literals (e.g., `'part 1 ' 'part 2'`) to break long
  strings. Break at word boundaries.
- If a single-line string contains newline characters (`\n`) or if there are
  consecutive `print` statements, consider migrating to a multi-line string
  literal (`'''`).

### Format and Analyze After Changes

- Run `dart format` and `dart analyze` after making changes.
- Be aware that splitting strings may trigger new lints (e.g.,
  `prefer_single_quotes` if a double-quoted string is split into parts that no
  longer contain single quotes).

## 3. Examples

### Documentation Comment Link

**Avoid:**

```dart
/// This is a long doc comment that contains a link to [a very long
/// URL](http://example.com/very/long/url/that/exceeds/eighty/chars).
```

**Prefer:**

```dart
/// This is a long doc comment that contains a link to [a very long URL][ref].
///
/// [ref]: http://example.com/very/long/url/that/exceeds/eighty/chars
```

### Adjacent String Literals

**Prefer:**

```dart
final longString = 'This is a very long string that needs to be broken '
    'across multiple lines to stay under the limit.';
```

### Multi-line String Migration

**Avoid:**

```dart
print('This is line 1\nThis is line 2 that is also quite long\nThis is line 3 which makes the whole thing exceed eighty characters');
```

**Prefer:**

```dart
print('''This is line 1
This is line 2 that is also quite long
This is line 3 which makes the whole thing exceed eighty characters''');
```

© kevmoo · Apache-2.0 · kevmoo/dash_skills

Similar skills

All skills for Programming languages →

From the same set9

dart-best-practices dart-best-practices enforces idiomatic Dart code style and formatting during generation and review. Focuses on clean multi-line string literals and strict 80-character line wrapping. CX Codex +1 847installs dart-test-fundamentals dart-test-fundamentals — a skill for Claude Code and Codex that enforces best practices for Dart's package:test. It structures test suites, configures dart_test.yaml, and handles teardowns. CX Codex +1 455installs dart-modern-features dart-modern-features guides coding agents on modern Dart 3.0 to 3.10 features. It helps adopt records, extension types, class modifiers, and null-aware elements during refactoring. CX Codex +1 370installs dart-doc-validation The dart-doc-validation skill for Claude Code validates Dart documentation comments with dart doc and the comment_references lint, catching broken links. CX Codex +1 291installs dart-package-maintenance dart-package-maintenance — a skill for maintaining Dart packages per Dart team standards: manage semantic versioning, keep CHANGELOG in sync, and prepare releases. Essential if you publish packages to pub.dev. CX Codex +1 285installs dart-matcher-best-practices dart-matcher-best-practices is a Claude Code skill for writing Dart tests with expect and package:matcher. It steps in when adding assertions, cleaning up manual checks, or investigating confusing test failures. CX Codex +1 269installs dart-test-coverage Run Dart test coverage, inspect missed lines, and identify code that needs tests. Useful when checking which parts of a package remain untested. CX Codex +1 163installs dart-multiline-strings dart-multiline-strings — a skill for Claude Code, Codex, Cursor and other agents that teaches rewriting consecutive print() calls and string concatenations into triple-quoted literals (''' or """). CX Codex +1 116installs

Project sponsors

Companies that keep this analytics open