# What Is the Line Cap for Humanizer Packages?

> Discover the 5000-line limit for Humanizer skill files. Learn about MAX_LINES constant and validation errors in blader/humanizer to ensure compliance.

- Repository: [Siqi Chen/humanizer](https://github.com/blader/humanizer)
- Tags: faq
- Published: 2026-09-11

---

**Humanizer packages enforce a strict 5,000-line limit on skill files**, defined as the `MAX_LINES` constant in [`scripts/validate-package.py`](https://github.com/blader/humanizer/blob/main/scripts/validate-package.py), which triggers a validation error if [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md) exceeds this threshold.

The Humanizer repository (`blader/humanizer`) manages AI text-rewriting skills through strict package size controls. Understanding the line cap for humanizer packages is essential for contributors who need to ensure their skill definitions meet repository validation standards. The enforcement mechanism specifically targets the primary skill definition file to maintain optimal performance and code readability.

## Where the Line Cap Is Defined

The line limit is hardcoded as a Python constant in the package validation script. In **[`scripts/validate-package.py`](https://github.com/blader/humanizer/blob/main/scripts/validate-package.py)**, line 6 declares the maximum allowable size:

```python

# scripts/validate-package.py

MAX_LINES = 5_000  # Maximum lines allowed in a skill file

```

This constant utilizes Python's underscore notation for readability to define the threshold at **five thousand lines**. The value is referenced by the `validate_skill_file()` function later in the same module to enforce package constraints.

## How the Validation Logic Works

The **`validate_skill_file()`** function (lines 176–181) implements the enforcement mechanism. This function reads the target file, counts the lines, and raises an exception if the cap is exceeded.

```python
def validate_skill_file(skill_path):
    # Read the file and count lines

    with open(skill_path, "r", encoding="utf-8") as f:
        lines = f.readlines()
    if len(lines) > MAX_LINES:
        raise ValueError(f"Skill file exceeds maximum allowed lines ({MAX_LINES})")

```

When invoked, the function:
- Opens the skill file using UTF-8 encoding
- Reads all lines into a list using `readlines()`
- Compares the line count against `MAX_LINES` (5,000)
- Raises a **`ValueError`** with a descriptive message if the limit is breached

## Checking Skill File Size Locally

Developers can verify their skill files before submission using a Python script that mirrors the repository's validation logic. This prevents CI failures by catching oversized files early:

```python
from pathlib import Path

MAX_LINES = 5_000  # As defined in scripts/validate-package.py

def check_skill_size(skill_path: Path) -> None:
    """Validate that a skill file meets Humanizer package requirements."""
    lines = skill_path.read_text(encoding="utf-8").splitlines()
    line_count = len(lines)
    
    if line_count > MAX_LINES:
        raise ValueError(
            f"Skill file exceeds maximum allowed lines ({MAX_LINES}). "
            f"Current count: {line_count}"
        )
    print(f"✓ Skill file valid: {line_count} lines (limit: {MAX_LINES})")

# Usage example

check_skill_size(Path("SKILL.md"))

```

## Summary

- **Hard limit**: Humanizer packages strictly enforce a **5,000-line maximum** on skill definitions as defined in the `MAX_LINES` constant
- **Source location**: The limit resides in **[`scripts/validate-package.py`](https://github.com/blader/humanizer/blob/main/scripts/validate-package.py)** at line 6 and is enforced by the `validate_skill_file()` function
- **Enforcement mechanism**: The function raises a **`ValueError`** when [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md) exceeds 5,000 lines
- **Primary target**: Validation specifically checks **[`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md)**, the master skill definition file for the Humanizer skill

## Frequently Asked Questions

### What is the exact line cap for Humanizer skill files?

The exact line cap is **5,000 lines**. This is defined as the integer `5_000` using Python's underscore notation for readability in the `MAX_LINES` constant within [`scripts/validate-package.py`](https://github.com/blader/humanizer/blob/main/scripts/validate-package.py).

### Which function enforces the line limit in the Humanizer repository?

The **`validate_skill_file()`** function in [`scripts/validate-package.py`](https://github.com/blader/humanizer/blob/main/scripts/validate-package.py) (lines 176–181) performs the validation. It reads the skill file, counts the lines, and raises a `ValueError` if the count exceeds the `MAX_LINES` constant.

### What error occurs if a skill file exceeds the line cap?

The validator raises a **`ValueError`** with the message format: `"Skill file exceeds maximum allowed lines (5000)"`. This error prevents the package from passing validation and must be resolved by reducing the file size before submission.

### Does the line cap apply to README.md or other documentation files?

The validation logic in [`scripts/validate-package.py`](https://github.com/blader/humanizer/blob/main/scripts/validate-package.py) specifically targets **[`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md)** when invoked from the `main()` block. While the `validate_skill_file()` function could theoretically validate any file path, the 5,000-line cap is enforced primarily on the master skill definition file rather than auxiliary documentation.