Metadata-Version: 2.4
Name: skillsaw-typos
Version: 0.1.0
Summary: Skillsaw plugin that flags misspellings in agentic instruction prose
Author-email: Stephen Benjamin <stephen@bitbin.de>
License-Expression: MIT
Project-URL: Homepage, https://github.com/stbenjam/skillsaw-typos
Project-URL: Repository, https://github.com/stbenjam/skillsaw-typos
Project-URL: Issues, https://github.com/stbenjam/skillsaw-typos/issues
Keywords: skillsaw,linter,typos,spellcheck,codespell
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: skillsaw>=0.14
Requires-Dist: codespell
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black<27,>=26; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"

# skillsaw-typos

A [skillsaw](https://skillsaw.org) plugin that flags misspellings in agentic
instruction prose using the [codespell](https://github.com/codespell-project/codespell)
known-typo dictionary.

## Installation

```bash
pip install skillsaw-typos
```

Once installed alongside skillsaw, the `typo` rule runs automatically — no
configuration required.

## What it checks

The `typo` rule walks every content block in the lint tree (CLAUDE.md, AGENTS.md,
skills, agents, prompts, etc.), reads prose with code fences stripped so
identifiers are never flagged, and checks each word against codespell's 64,000+
known misspellings.

### Fails

```markdown
- All handlers should recieve validated input from the middleware.
- Keep test files and source code in seperate directories.
```

```
⚠ WARNING (typo) [CLAUDE.md:5]: Misspelling: 'recieve' → 'receive'
⚠ WARNING (typo) [CLAUDE.md:6]: Misspelling: 'seperate' → 'separate'
```

### Passes

```markdown
- All handlers should receive validated input from the middleware.
- Keep test files and source code in separate directories.
```

Words inside fenced code blocks are never flagged.

## Autofix

```bash
skillsaw fix --rule typo
```

When codespell's dictionary has exactly one correction, the fix is applied
automatically (`SAFE`). When there are multiple candidates, the fix uses the
first suggestion and is marked `SUGGEST` — applied only with
`skillsaw fix --suggest`.

Fixes preserve the original word's casing (lowercase, Title Case, UPPER CASE).

## Accepting existing typos

To accept all currently-flagged words (e.g. when adopting the plugin on an
existing repo), run:

```bash
skillsaw typos accept
```

This writes the flagged words to `.skillsaw-typos-ignore` in the repo root.
The rule reads this file automatically and skips any listed words. The file
is one word per line and supports `#` comments — commit it to version control.

Running `accept` again is a no-op when no new violations exist.

## Configuration

In `.skillsaw.yaml`:

```yaml
rules:
  typo:
    enabled: true           # true | false | auto
    severity: warning        # error | warning | info
    ignore-words:            # words to accept (e.g. project jargon)
      - frobnicator
      - kubectl
    extra-dictionaries:      # additional dictionary files (codespell format)
      - .skillsaw/extra-typos.txt
```

### `.skillsaw-typos-ignore`

A file in the repo root listing words to skip, one per line. Generated by
`skillsaw typos accept` or maintained manually. Lines starting with `#` are
comments. This is the primary way to suppress false positives.

### `ignore-words`

Additional words to skip, specified inline in `.skillsaw.yaml`. Useful for
small lists that don't warrant a separate file.

### `extra-dictionaries`

Paths to additional dictionary files in codespell format (`word->correction`).
Each file is loaded on top of the built-in dictionary.

## Disabling

Per-rule:

```yaml
rules:
  typo:
    enabled: false
```

Entire plugin:

```yaml
plugins:
  disable:
    - typos
```

Or for a single run:

```bash
skillsaw lint --no-plugins
```
