# Dita Line Break

> Remove hard line breaks from AsciiDoc files for DITA compatibility. Use this skill when asked to fix line breaks, remove forced breaks, or prepare files for DITA conversion.

- **Type:** Skill
- **Install:** `agentstack add skill-abhatt-rh-redhat-docs-agent-tools-dita-line-break`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [abhatt-rh](https://agentstack.voostack.com/s/abhatt-rh)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [abhatt-rh](https://github.com/abhatt-rh)
- **Source:** https://github.com/abhatt-rh/redhat-docs-agent-tools/tree/main/plugins/dita-tools/skills/dita-line-break
- **Website:** https://redhat-documentation.github.io/redhat-docs-agent-tools/

## Install

```sh
agentstack add skill-abhatt-rh-redhat-docs-agent-tools-dita-line-break
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Line break removal skill

Remove hard line breaks from AsciiDoc files for DITA compatibility.

## Overview

This skill uses the `line_break.rb` Ruby script to find and remove hard line breaks that are not supported in DITA. Hard line breaks in AsciiDoc can be created using:

1. A space followed by `+` at the end of a line (` +`)
2. The `:hardbreaks-option:` document attribute
3. The `%hardbreaks` option on blocks
4. The `options=hardbreaks` attribute

## What it removes

### Line continuation markers

**Before:**
```asciidoc
This is the first line +
and this continues on a new line.
```

**After:**
```asciidoc
This is the first line and this continues on a new line.
```

### Document-level hardbreaks attribute

**Before:**
```asciidoc
:hardbreaks-option:

This text has
forced line breaks
everywhere.
```

**After:**
```asciidoc
This text has forced line breaks everywhere.
```

### Block-level hardbreaks option

**Before:**
```asciidoc
[%hardbreaks]
First line
Second line
Third line
```

**After:**
```asciidoc
First line
Second line
Third line
```

## Why this matters

Hard line breaks cannot be mapped to DITA output. The AsciiDocDITA Vale rule `LineBreak.yml` warns:

> Hard line breaks are not supported in DITA.

## Usage

When the user asks to fix line breaks:

1. Identify the target folder or file containing AsciiDoc content
2. Find all `.adoc` files in the target location
3. Run the Ruby script against each file:
   ```bash
   ruby ${CLAUDE_SKILL_DIR}/scripts/line_break.rb 
   ```
4. Report the number of line breaks removed

### Dry run mode

To preview changes without modifying files:

```bash
ruby ${CLAUDE_SKILL_DIR}/scripts/line_break.rb  --dry-run
```

### Output to different file

```bash
ruby ${CLAUDE_SKILL_DIR}/scripts/line_break.rb  -o 
```

### Process all files in a directory

```bash
find  -name "*.adoc" -exec ruby ${CLAUDE_SKILL_DIR}/scripts/line_break.rb {} \;
```

## Example invocations

- "Fix line breaks in modules/"
- "Remove hard line breaks from the getting_started folder"
- "Remove all ` +` line continuations"
- "Preview line break changes in modules/ --dry-run"

## Behavior notes

- **Joins lines**: When removing ` +` at end of line, the following line is joined with a space
- **Removes attribute**: The `:hardbreaks-option:` attribute line is removed entirely
- **Removes block option**: The `%hardbreaks` option is removed from block attribute lists
- **Skips code blocks**: Line breaks inside code blocks (---- or ....) are not modified
- **Skips comments**: Line breaks inside comment blocks (////) are not modified

## Output format

```
: Removed N hard line break(s)
```

Or:

```
: No hard line breaks found
```

## Extension location

The Ruby script is located at: `${CLAUDE_SKILL_DIR}/scripts/line_break.rb`

## Related Vale rule

This skill addresses the warning from: `.vale/styles/AsciiDocDITA/LineBreak.yml`

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [abhatt-rh](https://github.com/abhatt-rh)
- **Source:** [abhatt-rh/redhat-docs-agent-tools](https://github.com/abhatt-rh/redhat-docs-agent-tools)
- **License:** Apache-2.0
- **Homepage:** https://redhat-documentation.github.io/redhat-docs-agent-tools/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-abhatt-rh-redhat-docs-agent-tools-dita-line-break
- Seller: https://agentstack.voostack.com/s/abhatt-rh
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
