Agent skill

Compromise NLP Library

by spencermountain in spencermountain/compromise

Helps write and debug JavaScript or TypeScript that uses the compromise English NLP library for matching, entity extraction, tagging and sentence transforms.

MITAuto-check passedAI & LLM Engineering

Install Compromise NLP Library

skills CLI
$ npx skills add spencermountain/compromise --skill compromise -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install spencermountain/compromise compromise --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/spencermountain/compromise.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/compromise .claude/skills/compromise && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
compromise
GitHub stars
12k
Token cost
~2k tokens
SKILL.md length
909 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Helps write and debug JavaScript or TypeScript that uses the compromise English NLP library for matching, entity extraction, tagging and sentence transforms.

  • Writing JavaScript or TypeScript that uses the compromise library
  • SKILL.md covers Choose the API for the…, Keep the document and…, Write term patterns, not… and Extract, customize, and extend, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Matching text patterns or extracting entities and numbers from English sentences

What it does

Compromise is a rule-based English NLP library that runs locally in Node.js and browsers, and the skill is plain about its limits: tagging and transformations are heuristic, and there is no dependency parse tree, semantic understanding or LLM service. Before choosing APIs, the agent inspects the project's compromise version, imports and registered plugins.

A table of build tiers tells it what each import offers. The full compromise or compromise/three build has tokenization, tagging and named selections and transforms. The compromise/two build has tokenization and tagging without .people(), .verbs() or .numbers(), and compromise/one or compromise/tokenize only tokenizes. When a method is missing, the agent checks tier, version and plugins before inventing a replacement, and specialized transforms belong on specialized selections, such as .verbs().toPastTense().

It points to docs for the API, match syntax, tag definitions, concepts, recipes and tagging differences, and says to read the docs for the installed version rather than the latest. It also stresses that nlp(text) returns a View of the whole document, that selections share that document, and that transforms mutate it.

When your agent uses it

  • Writing JavaScript or TypeScript that uses the compromise library
  • Matching text patterns or extracting entities and numbers from English sentences
  • Debugging a compromise selection or transform that behaves unexpectedly
  • Customizing tags or adding a compromise plugin

Example prompts

  • “Use compromise to pull every person and number out of this meeting transcript.”
  • “Convert the verbs in these sentences to past tense with compromise.”
  • “My compromise match returns the wrong fragment. Figure out why.”
  • “Which compromise import do I need if I only want tokenization?”

Requirements

  • The compromise package, installed in a Node.js or browser project

What it can do on your machine

Read from SKILL.md and the folder at commit 2e7a1b9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Compromise NLP Library loads about 2k tokens when it runs. Until then it costs about 84 tokens; SKILL.md has 909 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~84
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from spencermountain/compromise at commit 2e7a1b9, republished under its MIT licence (© spencermountain). 909 words, ~2,031 tokens.

Download SKILL.mdSave it as .claude/skills/compromise/SKILL.md (or your agent's skills folder).
name
compromise
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.
metadata.version
0.1

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:

ImportAvailable features
compromise or compromise/threeTokenization, tagging, named selections and transforms
compromise/twoTokenization and tagging; no .people(), .verbs(), or .numbers()
compromise/one or compromise/tokenizeTokenization; 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: method names, arguments, and specialized selection methods.
  • Match syntax: pattern operators and capture groups.
  • Tag definitions: valid tags and their hierarchy.
  • Concepts: document, View, Term, and mutation semantics.
  • Recipes: task-specific starting points.
  • Tagging differences: conventions when comparing other taggers.

If this skill was installed separately, look for these files in the consuming project's node_modules/compromise/docs/ or its resolved package directory. If unavailable, consult the upstream repository at the installed version's tag when available. Do not assume the latest docs describe an older installed version. When docs and behavior disagree, reproduce against that version and inspect its source/types.

Keep the document and selection distinct

nlp(text) returns a View of the whole document. Selections return Views sharing that document. Transforms mutate the shared document; reading .text() from a selection gives only that fragment. Keep the whole-document variable when the requested output is the rewritten input:

js
import nlp from 'compromise'

const original = nlp('She walks home.')
const past = original.clone()
past.verbs().toPastTense()
past.text() // 'She walked home.'
original.text() // 'She walks home.'

Clone before transforming when the original must be preserved. Cloning a selection does not turn it into a whole-document selection. .all() returns a View of the whole underlying document.

  • .match(pattern) extracts matching terms; .has(pattern) returns a boolean.
  • .if(pattern) filters the current phrases, retaining each whole phrase containing a match. Use .sentences().if(pattern) to retain matching sentences.
  • .found is a boolean property, not a method. An empty View is still a truthy JavaScript object.
  • .replace(from, to) finds a pattern and replaces it; .replaceWith(to) replaces the selection.
  • .text() returns a string; .out('array') returns strings per match; .json() returns structured records. These are outputs, not chainable Views.
  • Text outputs can preserve case and punctuation. .text('normal') is not a universal punctuation stripper. Choose and verify normalization for the requested output rather than stripping blindly.

Write term patterns, not character regexes

Patterns operate on tokenized terms within each sentence. Literal words match case-insensitively; use {walk} to include inflections such as walked. Use real tag names: #Person, #Place, #Organization, #Noun, #Verb, #Adjective, #Value, and #Date are useful starting points. Tags form a hierarchy, so #FirstName also matches #Person and #Noun. Unknown tags silently match nothing unless explicitly defined by an extension. Do not invent tags such as #Name, #Location, #Subject, #Object, or #Adj.

PatternMeaning
#Adjective+ #NounOne or more adjective terms followed by a noun
the big? catOptional big term
(cat|dog)Alternatives
the . satExactly one intervening term
the * satZero or more intervening terms
the !#VerbA term that is not a verb after the
^the / sat$Start / end of the current sentence or selection
/^colou?r$/Character regex within a term
[<who>#Person+]Named capture, retrieved with .groups('who')
js
const doc = nlp('John Smith arrived. Mary left.')
doc.match('[<who>#Person+] arrived').groups('who').text() // 'John Smith'
doc.sentences().if('arrived').out('array') // ['John Smith arrived.']
doc.has('#Person') // true

Matches do not cross sentence boundaries. Nested groups are unsupported; express complex logic as separate patterns or successive selections, verifying the scope at each step. Slashes in input split terms; do not assume a slash-joined string is one token. For literal word lists, consider .lookup(words) instead of constructing match syntax from arbitrary user input. For advanced patterns, consult the match reference before guessing.

Show full SKILL.md (275 more words)Show less

Extract, customize, and extend

js
nlp('John Smith arrived.').people().out('array') // ['John Smith']
nlp('It costs twelve dollars.').numbers().get() // [12]
nlp('five hundred').numbers().toNumber().text() // '500' (selected number)
nlp('kermit waved', { kermit: 'FirstName' }).people().out('array') // ['kermit']

Use .people(), .places(), and .organizations() for named entities; .nouns() selects noun phrases and is not a generic entity detector. Domain vocabulary can be supplied at parse time as above. nlp.addWords({...}) and nlp.plugin({...}) customize subsequent parsing globally; register shared configuration once, rather than repeatedly inside request handlers.

Plugins add APIs beyond the full core build. For example, parsing dates into calendar values requires compromise-dates; a #Date match only selects tagged text. Import a required plugin and call nlp.plugin(plugin) before parsing. Consult that plugin's version-matched docs for options such as the reference date and timezone. Do not assume every plugin API is in core.

Check the result, not just that the code runs

Run small examples against the installed build when execution is available. Check exact outputs, including punctuation and whether the result is a fragment or the full document. For matching, include a positive example and a near miss; for transforms, check preservation of surrounding text and, when cloning, the original. Include representative user input rather than only ideal grammar.

When a result is wrong, inspect doc.debug() and doc.json() to see the actual terms and tags. Then check selection scope, sentence boundaries, tag spelling, and method availability. Use nlp.verbose(true) for tagger tracing when needed, and disable it with nlp.verbose(false) after diagnosis. Correct domain tagging with a narrow lexicon or rule rather than treating a failed example as evidence that a guessed pattern is valid.

For entity removal, explicitly select the categories the user needs and verify their coverage; do not assume .redact() includes every category or that heuristic detection guarantees anonymization. If examples cannot be run, distinguish expected behavior from verified output.

© spencermountain, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/compromise of spencermountain/compromise.

Open the folder on GitHubat commit 2e7a1b9

Compare with similar skills

Compromise NLP Library next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Compromise NLP Library compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Compromise NLP Library this skillspencermountain/compromise12k—~2kAutomated safety check: PassMIT
Transformers.jshuggingface/skills11k1 repos~6.2kAutomated safety check: PassApache-2.0
Generate Release Notesteambit/bit18k—~2.2kAutomated safety check: PassCustom licence
ast-grep Codemod Referencewarp-drive-data/warp-drive3.2k—~2.6kAutomated safety check: PassMIT
Coding Standardskurealnum/dotfiles29017 repos~2.9kAutomated safety check: PassNone
Bit CLIteambit/bit18k—~2kAutomated safety check: WarnCustom licence

Similar skills

  • Transformers.js

    huggingface/skills

    Official

    Runs pre-trained Hugging Face models in JavaScript or TypeScript with Transformers.js, in browsers or Node.js, Bun and Deno, for text, vision, audio and multimodal tasks.

    11k GitHub starsUsed in 1 repo~6.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Generate comprehensive release notes for Bit from git commits and pull requests.

    18k GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • ast-grep Codemod Reference

    warp-drive-data/warp-drive

    Reference for writing and debugging TypeScript and JavaScript codemods with @ast-grep/napi: parsing, node queries, meta-variables, rule objects and editing.

    3.2k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Coding Standards

    kurealnum/dotfiles

    Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.

    290 GitHub starsUsed in 17 repos~2.9k tokens
    DevelopmentAuto-check passed
  • Bit CLI

    teambit/bit

    MUST consult before running ANY bit command. An agent skill from teambit/bit.

    18k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check: warnings
  • Bun Runtime and Toolkit

    mweinbach/agent-coworker

    Quick reference for using Bun to run TypeScript and JavaScript, install packages, bundle code, run tests and serve HTTP, with the key files and commands.

    156 GitHub stars~2.2k tokensUpdated yesterday
    DevelopmentAuto-check: notes

More from spencermountain/compromise

  • Compromise NLP for JavaScript

    spencermountain/compromise

    Guide for writing correct code with the compromise rule-based NLP library: tagging, match syntax, in-place transforms and common tasks like tense changes and redaction.

    12k GitHub stars~1.8k tokensUpdated today
    Auto-check passed

Questions about Compromise NLP Library

What does Compromise NLP Library do?

Helps write and debug JavaScript or TypeScript that uses the compromise English NLP library for matching, entity extraction, tagging and sentence transforms. js and browsers, and the skill is plain about its limits: tagging and transformations are heuristic, and there is no dependency parse tree, semantic understanding or LLM service. Before choosing APIs, the agent inspects the project's compromise version, imports and registered plugins.

When should I use Compromise NLP Library?

Compromise NLP Library fits situations like: writing JavaScript or TypeScript that uses the compromise library; matching text patterns or extracting entities and numbers from English sentences; debugging a compromise selection or transform that behaves unexpectedly; customizing tags or adding a compromise plugin.

How do I install Compromise NLP Library in Claude Code?

Run `npx skills add spencermountain/compromise --skill compromise -a claude-code`. Or copy the skill folder (skills/compromise in spencermountain/compromise) into .claude/skills/compromise in your project. Claude Code loads it when a task matches its description.

How do I install Compromise NLP Library in Codex?

Run `npx skills add spencermountain/compromise --skill compromise -a codex`. Or copy the skill folder (skills/compromise in spencermountain/compromise) into .agents/skills/compromise in your project. Codex loads it when a task matches its description.

Can I use Compromise NLP Library in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add spencermountain/compromise --skill compromise -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/compromise, .gemini/skills/compromise, .github/skills/compromise and .opencode/skills/compromise in your project.

What does Compromise NLP Library need to run?

SKILL.md names no scripts, command-line tools or credentials: Compromise NLP Library is instructions for the agent only. Our summary lists: The compromise package, installed in a Node.js or browser project.

Does Compromise NLP Library access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Compromise NLP Library safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Compromise NLP Library use?

Compromise NLP Library is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Compromise NLP Library use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Compromise NLP Library?

Skills that share tags, products or a category with Compromise NLP Library: Transformers.js (huggingface/skills, 11k stars), Generate Release Notes (teambit/bit, 18k stars), ast-grep Codemod Reference (warp-drive-data/warp-drive, 3.2k stars) and Coding Standards (kurealnum/dotfiles, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Compromise NLP Library?

spencermountain (a GitHub user) maintains it in spencermountain/compromise, which has 12,164 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 7, 2026.

Source: spencermountain/compromise on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.