# Compromise NLP

Writes and debugs JavaScript code that uses the compromise English NLP library.

- Repository: https://github.com/spencermountain/compromise (12169 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add spencermountain/compromise --skill compromise -g -a claude-code -y`
Codex: `npx skills add spencermountain/compromise --skill compromise -g -a codex -y`
Cursor: `npx skills add spencermountain/compromise --skill compromise -g -a cursor -y`
Gemini CLI: `npx skills add spencermountain/compromise --skill compromise -g -a gemini-cli -y`

## Description

Write and debug JavaScript or TypeScript that uses the compromise English NLP library to match text, extract entities or numbers, customize tagging, and transform sentences. Use when the user requests compromise or the project already uses it, especially for its match syntax, selection semantics, build tiers, and plugins.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Using compromise

Compromise is a rule-based English NLP library that runs locally in Node.js and browsers.
Its tagging and transformations are heuristic; it does not provide a dependency parse tree,
semantic understanding, or an LLM service.

## Choose the API for the installed version

Inspect the project's compromise version, import, and registered plugins before choosing APIs.
Prefer the full `import nlp from 'compromise'` for ordinary use:

| Import | Available features |
| --- | --- |
| `compromise` or `compromise/three` | Tokenization, tagging, named selections and transforms |
| `compromise/two` | Tokenization and tagging; no `.people()`, `.verbs()`, or `.numbers()` |
| `compromise/one` or `compromise/tokenize` | Tokenization; no automatic part-of-speech tagging |

Use the existing module system; CommonJS can use `const nlp = require('compromise')`.
If a method is missing, check the build tier, version, and plugins before inventing a replacement API.
Specialized transforms belong on specialized selections: use `.verbs().toPastTense()`,
not `.match('#Verb').toPastTense()`.

Read only the detailed docs needed for the task. These paths resolve inside this repository
and packages that ship this skill alongside `docs/`:

- [API](../../docs/api.md): method names, arguments, and specialized selection methods.
- [Match syntax](../../docs/match-syntax.md): pattern operators and capture groups.
- [Tag definitions](../../docs/tag-definitions.md): valid tags and their hierarchy.
- [Concepts](../../docs/concepts.md): document, View, Term, and mutation semantics.
- [Recipes](../../docs/recipes.md): task-specific starting points.
- [Tagging differences](../../docs/tagging-differences.md): conventions when comparing other taggers.

The rest: https://github.com/spencermountain/compromise/blob/HEAD/skills/compromise/SKILL.md
